Error codes and error handling.
[Public Interface]


Error codes.

If adding a new error code here, also modify the list of generic messages in oski_GetErrorName() (error.c).

#define ERR_OUT_OF_MEMORY   -1
 Out of memory.
#define ERR_INIT_LIB   -2
 Error initializing the library.
#define ERR_INIT_SHAREDLIB   -3
 Could not initialized shared library module.
#define ERR_BAD_ID   -4
 Invalid id number specified.
#define ERR_LOAD_MOD   -5
 Could not load shared library module.
#define ERR_UNLOAD_MOD   -6
 Could not unload shared library module.
#define ERR_LOAD_MATTYPE   -7
 Could not load matrix type module.
#define ERR_UNLOAD_MATTYPE   -8
 Could not unload matrix type module.
#define ERR_NOT_IMPLEMENTED   -9
 Feature not implemented.
#define ERR_BAD_ARG   -10
 Bad input argument.
#define ERR_INMATPROP_CONFLICT   -11
 Conflicting input matrix properties specified.
#define ERR_DIM_MISMATCH   -12
 Matrix multiply operand dimensions don't match.
#define ERR_FALSE_INMATPROP   -13
 Asserted input matrix property is false.
#define ERR_BAD_LEADDIM   -14
 Invalid leading dimension specified.
#define ERR_BAD_MAT   -15
 Invalid matrix object.
#define ERR_BAD_VECVIEW   -16
 Invalid vector view object.
#define ERR_WRONG_ANS   -17
 Wrong answer computed!
#define ERR_BAD_HINT_ARG   -18
 Invalid argument psased to a hint-setting routine.
#define ERR_CANT_CONVERT   -19
 Cannot convert data structure.
#define ERR_FILE_READ   -20
 Can't open an input file.
#define ERR_BAD_SYNTAX   -21
 BeBOP-Lua transformation program has invalid syntax.
#define ERR_OLUA_NORET   -22
 BeBOP-Lua transformation program did not return a new matrix.
#define ERR_OLUA_STARTUP   -23
 Can't start BeBOP-Lua interpreter.
#define ERR_OLUA_TYPE_MISMATCH   -24
 BeBOP-Lua types differ.
#define ERR_BAD_PERM   -25
 An error detected in permutation.
#define ERR_BAD_ENTRY   -26
 An invalid (out-of-range) entry was specified.
#define ERR_ZERO_ENTRY   -27
 Attempt to change a logically zero entry.

Defines

#define oski_HandleError   (oski_GetErrorHandler())
 Call error handler.
#define IS_VAL_IN_RANGE(x, a, b)
 Checks if a value lies in a specified closed interval.

Typedefs

typedef void(* oski_errhandler_t )(int, const char *, const char *, unsigned long, const char *,...)
 Pointer to a user-defined error handler.

Functions

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.
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.
const char * oski_GetErrorName (int error_code)
 Get generic information about an error code.


Define Documentation

#define IS_VAL_IN_RANGE x,
a,
 ) 
 

Value:

((((a) <= (b)) && ((x) >= (a)) && ((x) <= (b))) \
    || (((a) > (b)) && ((x) >= (b)) && ((x) <= (a))))
Checks if a value lies in a specified closed interval.

Parameters:
[in] x Value to check.
[in] a Interval end-point.
[in] b Interval end-point.
Returns:
1 if and only if x lies between a and b.
Note:
This macro works whether a < b or b < a, and is fully parenthesized.


Typedef Documentation

typedef void(* oski_errhandler_t)(int, const char *, const char *, unsigned long, const char *,...)
 

Pointer to a user-defined error handler.

An error handler has the following signature:

void handler( int error_code, const char* message, const char* source_filename, unsigned long line_number, const char* format_string, ... );

whose parameters are defined as follows:

  • error_code: An integer error code less than 0.
  • message: A short but descriptive error message for display to the user.
  • source_filename: Name of the source file in which the error was detected.
  • line_number: Approximate line number at which the error occurred.
  • format_string: A printf-style string which, when used with the remaining arguments, is suitable for passing to a printf/fprintf/sprintf-type function to display additional diagonstic information.


Generated on Wed Sep 19 16:41:23 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6