Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

Error handling


Defines

#define SND_ERROR_BEGIN   500000 /**< Lower boundary of sound error codes. */
#define SND_ERROR_INCOMPATIBLE_VERSION   (SND_ERROR_BEGIN+0) /**< Kernel/library protocols are not compatible. */
#define SND_ERROR_ALISP_NIL   (SND_ERROR_BEGIN+1) /**< Lisp encountered an error during acall. */
#define SNDERR(args...)   snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< Shows a sound error message. */
#define SYSERR(args...)   snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< Shows a system error message (related to \c errno). */

Typedefs

typedef void(* snd_lib_error_handler_t )(const char *file, int line, const char *function, int err, const char *fmt,...)
 Error handler callback.


Functions

const char * snd_strerror (int errnum)
 Returns the message for an error code.

int snd_lib_error_set_handler (snd_lib_error_handler_t handler)
 Sets the error handler.


Variables

snd_lib_error_handler_t snd_lib_error
snd_lib_error_handler_t snd_lib_error = snd_lib_error_default

Detailed Description

Error handling macros and functions.

Define Documentation

#define SND_ERROR_ALISP_NIL   (SND_ERROR_BEGIN+1) /**< Lisp encountered an error during acall. */
 

Lisp encountered an error during acall.

#define SND_ERROR_BEGIN   500000 /**< Lower boundary of sound error codes. */
 

Lower boundary of sound error codes.

#define SND_ERROR_INCOMPATIBLE_VERSION   (SND_ERROR_BEGIN+0) /**< Kernel/library protocols are not compatible. */
 

Kernel/library protocols are not compatible.

#define SNDERR args...   )     snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< Shows a sound error message. */
 

Shows a sound error message.

#define SYSERR args...   )     snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< Shows a system error message (related to \c errno). */
 

Shows a system error message (related to errno).


Typedef Documentation

typedef void(* snd_lib_error_handler_t)(const char *file, int line, const char *function, int err, const char *fmt, ...)
 

Error handler callback.

Parameters:
file Source file name.
line Line number.
function Function name.
err Value of errno, or 0 if not relevant.
fmt printf(3) format.
... printf(3) arguments.
A function of this type is called by the ALSA library when an error occurs. This function usually shows the message on the screen, and/or logs it.


Function Documentation

int snd_lib_error_set_handler snd_lib_error_handler_t  handler  ) 
 

Sets the error handler.

Parameters:
handler The pointer to the new error handler function.
This function sets a new error handler, or (if handler is NULL) the default one which prints the error messages to stderr.

const char* snd_strerror int  errnum  ) 
 

Returns the message for an error code.

Parameters:
errnum The error code number, which must be a system error code or an ALSA error code.
Returns:
The ASCII description of the given numeric error code.
Examples:
/test/latency.c, /test/pcm.c, and /test/timer.c.


Variable Documentation

snd_lib_error_handler_t snd_lib_error = snd_lib_error_default
 

Pointer to the error handler function. For internal use only.

snd_lib_error_handler_t snd_lib_error
 

Pointer to the error handler function. For internal use only.


Generated on Mon May 3 16:15:22 2004 for ALSA project - the C library reference by doxygen 1.3.6