alSetErrorHandler man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



alSetErrorHandler(3dm)					alSetErrorHandler(3dm)

NAME
     alSetErrorHandler - establish an alternate audio error handling routine

SYNOPSIS
     #include <dmedia/audio.h>

     ALerrfunc alSetErrorHandler(ALerrfunc efunc)

PARAMETER
     efunc	 expects a pointer to an error handling routine declared as
		 void errorfunc(int, const char*, ...)

DESCRIPTION
     By default, the Audio Library handles errors silently, returning a
     failure code to the caller. alSetErrorHandler(3dm) allows you to install
     an error handling routine which is called in the event of an error in an
     Audio Library call. This error handler can be a function in the
     application or a default error handler provided by the AL.

     Two special values are accepted for efunc. If efunc is 0, errors are
     handled silently and no error handler is called. This is the default
     behavior. If efunc is AL_PRINT_ERRORS, the AL installs a simple internal
     error handler which prints a message to stderr.  This was the default
     behavior in older versions of the AL. If efunc is neither of these
     values, it is assumed to be a pointer to a function provided by the
     caller.

     The arguments that are passed to the error handling routine are an error
     code and a printf-like string perhaps followed with printf-like
     arguments.

     The returned value is a pointer to the previous value of efunc.

EXAMPLE
	  #include <dmedia/audio.h>

	  static void
	  myerror(int code, const char* fmt, ...)
	  {
	      /* do something with code */
	  }

	  void example()
	  {
	      ALerrfunc originalErrorHandler;
	      ...

	      /* set up myerror as the error handler */
	      originalErrorHandler = alSetErrorHandler(myerror);

	      /* do some audio stuff here */

									Page 1

alSetErrorHandler(3dm)					alSetErrorHandler(3dm)

	      alSetErrorHandler(originalErrorHandler);
	      /* back to normal behavior: errors are ignored */

	      ...
	  }

SEE ALSO
     stdarg(5)

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net