libhpdftbl 1.5.0
Table construction library for Haru PDF library
|
Utility module to translate HPDF error codes to human readable strings. More...
Data Structures | |
struct | hpdftbl_errcode_entry |
An entry in the error string table. More... | |
Macros | |
#define | ERR_UNKNOWN 11 |
Error code for unknown error. | |
Functions | |
const char * | hpdftbl_hpdf_get_errstr (const HPDF_STATUS err_code) |
Function to return a human readable error string for an error code from Core HPDF library. More... | |
const char * | hpdftbl_get_errstr (int err) |
Translate a table error code to a human readable string. More... | |
void | hpdftbl_default_table_error_handler (hpdftbl_t t, int r, int c, int err) |
A basic default table error handler. More... | |
int | hpdftbl_get_last_errcode (const char **errstr, int *row, int *col) |
Return last error code. More... | |
void | hpdftbl_get_last_err_file (int *lineno, char **file, char **extrainfo) |
Get the filename and line number where the last error occurred. More... | |
hpdftbl_error_handler_t | hpdftbl_set_errhandler (hpdftbl_error_handler_t err_handler) |
Specify errhandler for the table routines. More... | |
Variables | |
int | hpdftbl_err_code = 0 |
Stores the last generated error code. More... | |
int | hpdftbl_err_row = -1 |
The row where the last error was generated. More... | |
int | hpdftbl_err_col = -1 |
The column where the last error was generated. More... | |
int | hpdftbl_err_lineno = 0 |
Hold the line number of the last error occurred. More... | |
char * | hpdftbl_err_file = NULL |
Hold the file name where the last error occurred. More... | |
char | hpdftbl_err_extrainfo [1024] = {0} |
Extra info that may be specified at the point of error. More... | |
Utility module to translate HPDF error codes to human readable strings.
void hpdftbl_default_table_error_handler | ( | hpdftbl_t | t, |
int | r, | ||
int | c, | ||
int | err | ||
) |
A basic default table error handler.
This error handler is used as a callback that outputs the error to stderr in human readable format and quits the process.
t | Table where the error happened (can be NULL) |
r | Cell row |
c | Cell column |
err | The error code |
const char * hpdftbl_get_errstr | ( | int | err | ) |
Translate a table error code to a human readable string.
The function returns a pointer to a static string that cannot be modified. It will translate both internal table error messages as well as generic HPDF library error codes.
err | The error code to be translated |
Referenced by hpdftbl_default_table_error_handler(), and hpdftbl_get_last_errcode().
void hpdftbl_get_last_err_file | ( | int * | lineno, |
char ** | file, | ||
char ** | extrainfo | ||
) |
Get the filename and line number where the last error occurred.
lineno | Set to the line number where the error occurred |
file | Set to the file where the error occurred |
extrainfo | Extra info string that may be set at the point of error |
int hpdftbl_get_last_errcode | ( | const char ** | errstr, |
int * | row, | ||
int * | col | ||
) |
Return last error code.
Return last error code. if errstr is not NULL a human readable string describing the error will be copied to the string. The error code will be reset after call.
errstr | A string buffer where the error string is written to |
row | The row where the error was found |
col | The col where the error was found |
const char * hpdftbl_hpdf_get_errstr | ( | const HPDF_STATUS | err_code | ) |
Function to return a human readable error string for an error code from Core HPDF library.
The various error codes given by the HPDF library can be translated back to a string by the usage of this function. The function will return a pointer to a static string that can not be manipulated.
err_code | The error code |
Referenced by hpdftbl_get_errstr().
hpdftbl_error_handler_t hpdftbl_set_errhandler | ( | hpdftbl_error_handler_t | err_handler | ) |
Specify errhandler for the table routines.
Note: The library provides a basic default error handler that can be used,
err_handler |
int hpdftbl_err_code = 0 |
Stores the last generated error code.
Internal variable to record last error
Referenced by hpdftbl_get_errstr(), and hpdftbl_get_last_errcode().
int hpdftbl_err_col = -1 |
The column where the last error was generated.
Internal variable to record last error
Referenced by hpdftbl_get_last_errcode().
char hpdftbl_err_extrainfo[1024] = {0} |
Extra info that may be specified at the point of error.
Internal variable to record last error
Referenced by hpdftbl_get_last_err_file().
char* hpdftbl_err_file = NULL |
Hold the file name where the last error occurred.
Internal variable to record last error
Referenced by hpdftbl_get_last_err_file().
int hpdftbl_err_lineno = 0 |
Hold the line number of the last error occurred.
Internal variable to record last error
Referenced by hpdftbl_get_last_err_file().
int hpdftbl_err_row = -1 |
The row where the last error was generated.
Internal variable to record last error
Referenced by hpdftbl_get_last_errcode().