To use QBIC's error handling routines, call QbInitializeErrorStructure(), which is declared in quError.h, at the beginning of your program or before any QBIC calls.
When an error is detected (as indicated by a nonzero return code from a class method or when False is returned after invoking the IsOK() method), you can retrieve the error severity state by calling GetErrorMSGSeverity().
If the severity state is QERR_FATAL, the system is in a fatal error state and should exit gracefully. To determine the problem, call QbPrintErrorMessage(FILE *stream) to print the error message to the specified IO stream.
Because most errors happen during memory allocation, the QBIC API provides the following set of routines specifically designed for memory allocation. Use these methods if you want to write your own feature extraction routines.
The following methods are described in this chapter:
This method returns error severity information.
QERR_SeverityType GetErrorMSGSeverity(void);
A enumerated value of either QERR_NON_FATAL or QERR_FATAL.
This method is similar to QbNew, except that it creates memory for a specified number of objects as (nobj * size).
void *QbCNew(size_t nobj, size_t size, const char *err_msg, QERR_SeverityType Sev = QERR_FATAL)
This method frees memory allocated by the QbNew and QbCNew methods.
void QbDelete(void *p)
p-Pointer to the memory block to be freed
This method initializes the error handling routine.
QbInitializeErrorStructure();
This method allocates a block of memory. If it fails, it returns a NULL and fills the QBIC error message buffer with the message (pointed to by the string err_msg).
void *QbNew(size_t size, const char *err_msg , QERR_SeverityType Sev = QERR_FATAL)
This method prints the error message to the specified file descriptor.
void QbPrintErrorMessage(FILE *stream)