clSetErrorHandler(3dm) clSetErrorHandler(3dm)
clSetErrorHandler - Select an alternate error handling routine
#include <dmedia/cl.h>
CLerrFunc clSetErrorHandler(CLerrFunc efunc) [Toc] [Back]
efunc A pointer to an error handling routine declared as
void ErrorFunc(CLhandle handle, int code, const char *format, ...)
clSetErrorHandler allows overriding of the Compression Library's default
error handling routine, which prints a message to stderr.
The arguments that are passed to the error handling routine are a handle
to the processing object, an error code, and a printf-like string
optionally followed with printf-like arguments.
The error codes are listed in <dmedia/cl.h>.
clSetErrorHandler returns a pointer to the previous error handling
routine.
#include <dmedia/cl.h>
CLerrFunc originalErrorHandler;
...
void silentCLError(CLhandle handle, int code, const char* format, ...)
{
/* ignore all CL errors */
}
...
originalErrorHandler = clSetErrorHandler(silentCLError);
/* CL errors here will go unnoticed */
...
clSetErrorHandler(originalErrorHandler);
/* back to normal reporting of CL errors */
...
CLintro(3dm), clError(3dm), stdarg(5)
PPPPaaaaggggeeee 1111 [ Back ]
|