Previous: Error Values, Up: Error Handling


5.17.2 Error Functions

shishi_strerror

— Function: const char * shishi_strerror (int err)

err: shishi error code.

Convert return code to human readable string.

Return value: Returns a pointer to a statically allocated string containing a description of the error with the error value err. This string can be used to output a diagnostic message to the user.

shishi_error

— Function: const char * shishi_error (Shishi * handle)

handle: shishi handle as allocated by shishi_init().

Extract detailed error information string. Note that the memory is managed by the Shishi library, so you must not deallocate the string.

Return value: Returns pointer to error information string, that must not be deallocate by caller.

shishi_error_clear

— Function: void shishi_error_clear (Shishi * handle)

handle: shishi handle as allocated by shishi_init().

Clear the detailed error information string. See shishi_error() for how to access the error string, and shishi_error_set() and shishi_error_printf() for how to set the error string. This function is mostly for Shishi internal use, but if you develop an extension of Shishi, it may be useful to use the same error handling infrastructure.

shishi_error_set

— Function: void shishi_error_set (Shishi * handle, const char * errstr)

handle: shishi handle as allocated by shishi_init().

errstr: Zero terminated character array containing error description, or NULL to clear the error description string.

Set the detailed error information string to specified string. The string is copied into the Shishi internal structure, so you can deallocate the string passed to this function after the call. This function is mostly for Shishi internal use, but if you develop an extension of Shishi, it may be useful to use the same error handling infrastructure.

shishi_error_printf

— Function: void shishi_error_printf (Shishi * handle, const char * format, ...)

handle: shishi handle as allocated by shishi_init().

format: printf style format string. ...: print style arguments.

Set the detailed error information string to a printf formatted string. This function is mostly for Shishi internal use, but if you develop an extension of Shishi, it may be useful to use the same error handling infrastructure.

shishi_error_outputtype

— Function: int shishi_error_outputtype (Shishi * handle)

handle: shishi handle as allocated by shishi_init().

Get the current output type for logging messages.

Return value: Return output type (NULL, stderr or syslog) for informational and warning messages.

shishi_error_set_outputtype

— Function: void shishi_error_set_outputtype (Shishi * handle, int type)

handle: shishi handle as allocated by shishi_init().

type: output type.

Set output type (NULL, stderr or syslog) for informational and warning messages.

shishi_info

— Function: void shishi_info (Shishi * handle, const char * format, ...)

handle: shishi handle as allocated by shishi_init().

format: printf style format string. ...: print style arguments.

Print informational message to output as defined in handle.

shishi_warn

— Function: void shishi_warn (Shishi * handle, const char * format, ...)

handle: shishi handle as allocated by shishi_init().

format: printf style format string. ...: print style arguments.

Print a warning to output as defined in handle.

shishi_verbose

— Function: void shishi_verbose (Shishi * handle, const char * format, ...)

handle: shishi handle as allocated by shishi_init().

format: printf style format string. ...: print style arguments.

Print a diagnostic message to output as defined in handle.