#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <oski/common.h>
#include <oski/config.h>
Defines | |
#define | g_errlogfile stderr |
Where default error handler's output messages go. | |
#define | oski_LockErrorHandler() ; |
Lock access to global error-handler variable. | |
#define | oski_UnlockErrorHandler() ; |
Release global error-handler variable. | |
Functions | |
const char * | oski_GetErrorName (int code) |
Get generic information about an error code. | |
void | oski_HandleErrorDefault (int error_code, const char *message, const char *source_filename, unsigned long line_number, const char *format_string,...) |
The default error handler, called when one of the BeBOP routines detects an error condition and the handler has not been overriden. | |
void | oski_HandleErrorNull (int error_code, const char *message, const char *source_filename, unsigned long line_number, const char *format_string,...) |
Null error handler. | |
oski_errhandler_t | oski_GetErrorHandler (void) |
Returns a pointer to the current error handling routine for a given matrix object, or the current global handler if a valid matrix object is not specified. | |
oski_errhandler_t | oski_SetErrorHandler (oski_errhandler_t new_handler) |
Changes the current error handler for a given matrix, or changes the default error handler if no valid matrix object is specified. | |
Variables | |
static oski_errhandler_t | gfuncp_oski_HandleError = oski_HandleErrorDefault |
This variable points to the current error handler. |
If the library is built with pthreads support, then oski_GetErrorHandler and oski_SetErrorHandler routines execute atomically using pthreads locking.
#define g_errlogfile stderr |
Where default error handler's output messages go.
Referenced by oski_HandleErrorDefault().
void oski_HandleErrorNull | ( | int | error_code, | |
const char * | message, | |||
const char * | source_filename, | |||
unsigned long | line_number, | |||
const char * | format_string, | |||
... | ||||
) |
Null error handler.
This routine has the signature of an error handler, but contains no statements (i.e., is a no-op.)
Referenced by oski_SetErrorHandler().
oski_errhandler_t gfuncp_oski_HandleError = oski_HandleErrorDefault [static] |
This variable points to the current error handler.
When an error occurs in the library, the error handler is called through this pointer.
Important note: This variable should never be equal to NULL! Instead, error handling should be disabled by setting this variable to be equal to oski_HandleErrorNull, the 'null' error handler.
Referenced by oski_GetErrorHandler(), and oski_SetErrorHandler().