Functions | |
void | NJB_Set_Debug (int debug_flags) |
void | NJB_Set_Unicode (int unicode_flag) |
int | NJB_Error_Pending (njb_t *njb) |
void | NJB_Error_Reset_Geterror (njb_t *njb) |
const char * | NJB_Error_Geterror (njb_t *njb) |
void | NJB_Error_Dump (njb_t *njb, FILE *fp) |
|
This function dumps the current libnjb error stack to a file, such as stderr. All errors currently on the stack are dumped. After dumping, the error stack is cleared and errors are not returned again. The function may be called on an empty error stack without effect, but you may just as well check the stack yourself using Typical usage:
njb_t *njb;
if (NJB_Error_Pending(njb)) { NJB_Error_Dump(njb, stderr); }
|
|
This function returns the topmost error on the error stack as a string. The result is statically allocated and MUST NOT be freed by the calling application. This function should be repeatedly called until no errors remain and the function returns NULL. After retrieveing all error strings like this, the error stack is cleared and none of the errors will be returned again.
|
|
This function tells wheter an error message is queued and pending for the current device. If so, the error should be retrieved using
|
|
This function resets the internal error stack, so that old errors do not remain on following calls to retrieve the error.
Retrieve the errors if the function
njb_t *njb; char *errstr;
if (NJB_Error_Pending(njb) { NJB_Error_Reset_Geterror(njb); while ( (errstr = NJB_Error_Geterror(njb)) != NULL ) { printf("%s\n", errstr); } }
|
|
Set the debug print mode for libnjb. The debug flag is created by OR:ing up the different possible flags.
|
|
Defines the encoding used by libnjb. By default, ISO 8859-1 (or rather Windows Codepage 1252) will be used. However, all modern applications should make a call to this function and set the encoding to
|