ASetErrorHandler(3X)
NAME
ASetErrorHandler − replace default error handler with specified handler
SYNOPSIS
AErrorHandler
ASetErrorHandler (
AErrorHandler handler);
DESCRIPTION
ASetErrorHandler() replaces the default error handler with the handler specified in handler, and returns a pointer to the handler that was previously in effect. The new error handler should return AENoError, if the error should be ignored. If the error should not be ignored and the handler cannot correct it, the handler should return the error code.
handler is the pointer to an application-supplied handler function.
RETURN VALUE
Upon successful completion, ASetErrorHandler() returns a pointer to the handler that was previously in effect.
ERRORS
ASetErrorHandler() does not return an error status.
EXAMPLE
The following example replaces the default error handler with a handler named myhandler.
long myhandler(
Audio ∗ audio,
AErrorEvent ∗ err_event
)
{
char errorbuff[132];
printf ("Error is %s\n", errorbuff);
return (err_event->error_code);
}
.
.
.
AErrorHandler prev_handler; /∗ ptr to previous handler ∗/
AErrorHandler myhandler; /∗ this data type is a function∗/
.
.
.
/∗ replace default error handler ∗/
prev_handler = ASetErrorHandler(myhandler);
DEPENDENCIES
This function belongs to the Audio Library of functions that manage connections to an audio server. The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to the hardware manual that accompanies your system.
AUTHOR
ASetErrorHandler() was developed by HP.
SEE ALSO
Using the Audio Application Program Interface.
Hewlett-Packard Company — HP-UX Release 8.07: November 1991