|
ALSA project - the C library reference
|
Macros | |
| #define | SND_ERROR_BEGIN 500000 |
| #define | SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0) |
| #define | SND_LOG_ERROR 1 |
| #define | SND_LOG_WARN 2 |
| #define | SND_LOG_INFO 3 |
| #define | SND_LOG_DEBUG 4 |
| #define | SND_LOG_TRACE 5 |
| #define | SND_LOG_LAST SND_LOG_TRACE |
| #define | SND_ILOG_CORE 1 |
| #define | SND_ILOG_CONFIG 2 |
| #define | SND_ILOG_CONTROL 3 |
| #define | SND_ILOG_HWDEP 4 |
| #define | SND_ILOG_TIMER 5 |
| #define | SND_ILOG_RAWMIDI 6 |
| #define | SND_ILOG_PCM 7 |
| #define | SND_ILOG_MIXER 8 |
| #define | SND_ILOG_SEQUENCER 9 |
| #define | SND_ILOG_UCM 10 |
| #define | SND_ILOG_TOPOLOGY 11 |
| #define | SND_ILOG_ASERVER 12 |
| #define | SND_ILOG_LAST SND_ILOG_ASERVER |
| #define | snd_error(interface, args...) snd_lib_log(SND_LOG_ERROR, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_errornum(interface, args...) snd_lib_log(SND_LOG_ERROR, SND_ILOG_##interface, __FILE__, __LINE__, __func__, errno, ##args) |
| #define | snd_warn(interface, args...) snd_lib_log(SND_LOG_WARN, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_info(interface, args...) snd_lib_log(SND_LOG_INFO, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_debug(interface, args...) snd_lib_log(SND_LOG_DEBUG, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_trace(interface, args...) snd_lib_log(SND_LOG_TRACE, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_check(interface, args...) snd_lib_check(SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | snd_checknum(interface, args...) snd_lib_check(SND_ILOG_##interface, __FILE__, __LINE__, __func__, errno, ##args) |
| #define | SNDERR(args...) snd_lib_log(SND_LOG_ERROR, 0, __FILE__, __LINE__, __func__, 0, ##args) |
| #define | SYSERR(args...) snd_lib_log(SND_LOG_ERROR, 0, __FILE__, __LINE__, __func__, errno, ##args) |
Typedefs | |
| typedef void(* | snd_lib_log_handler_t) (int prio, int interface, const char *file, int line, const char *function, int errcode, const char *fmt, va_list arg) |
| Log handler callback. More... | |
| typedef void(* | snd_lib_error_handler_t) (const char *file, int line, const char *function, int errcode, const char *fmt,...) |
| Error handler callback. More... | |
| typedef void(* | snd_local_error_handler_t) (const char *file, int line, const char *func, int errcode, const char *fmt, va_list arg) |
Functions | |
| const char * | snd_strerror (int errnum) |
| Returns the message for an error code. More... | |
| int | snd_lib_log_filter (int prio, int interface, const char *configstr) |
| Check if a log message should be shown based on LIBASOUND_DEBUG. More... | |
| void | snd_lib_log (int prio, int interface, const char *file, int line, const char *function, int errcode, const char *fmt,...) |
| Root log handler function. More... | |
| void | snd_lib_check (int interface, const char *file, int line, const char *function, int errcode, const char *fmt,...) |
| The check point function. More... | |
| snd_lib_log_handler_t | snd_lib_log_set_handler (snd_lib_log_handler_t handler) |
| Sets the log handler. More... | |
| snd_lib_log_handler_t | snd_lib_log_set_local (snd_lib_log_handler_t handler) |
| Install local log handler. More... | |
| const char * | snd_lib_log_priority (int prio) |
| Function to convert log priority level to text. More... | |
| const char * | snd_lib_log_interface (int interface) |
| Function to convert interface code to text. More... | |
| int | snd_lib_error_set_handler (snd_lib_error_handler_t handler) |
| Sets the error handler. More... | |
| snd_local_error_handler_t | snd_lib_error_set_local (snd_local_error_handler_t func) |
| Install local error handler. More... | |
Variables | |
| snd_lib_log_handler_t | snd_lib_vlog |
| snd_lib_error_handler_t | snd_lib_error |
| snd_lib_log_handler_t | snd_lib_vlog = snd_lib_vlog_default |
| snd_lib_error_handler_t | snd_lib_error = snd_lib_error_default |
Error handling macros and functions.
| #define snd_check | ( | interface, | |
| args... | |||
| ) | snd_lib_check(SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an check log message.
| #define snd_checknum | ( | interface, | |
| args... | |||
| ) | snd_lib_check(SND_ILOG_##interface, __FILE__, __LINE__, __func__, errno, ##args) |
Shows an check log message (related to errno).
| #define snd_debug | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_DEBUG, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an error log message.
| #define snd_error | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_ERROR, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an error log message.
| #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_errornum | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_ERROR, SND_ILOG_##interface, __FILE__, __LINE__, __func__, errno, ##args) |
Shows a system error log message (related to errno).
| #define SND_ILOG_ASERVER 12 |
aserver
| #define SND_ILOG_CONFIG 2 |
configuration parsing and operations
| #define SND_ILOG_CONTROL 3 |
control API
| #define SND_ILOG_CORE 1 |
core library code
| #define SND_ILOG_HWDEP 4 |
hwdep API
| #define SND_ILOG_LAST SND_ILOG_ASERVER |
last known value for interface
| #define SND_ILOG_MIXER 8 |
mixer API
| #define SND_ILOG_PCM 7 |
PCM API
| #define SND_ILOG_RAWMIDI 6 |
RawMidi API
| #define SND_ILOG_SEQUENCER 9 |
sequencer API
| #define SND_ILOG_TIMER 5 |
timer API
| #define SND_ILOG_TOPOLOGY 11 |
topology API
| #define SND_ILOG_UCM 10 |
UCM API
| #define snd_info | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_INFO, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an error log message.
| #define SND_LOG_DEBUG 4 |
debug priority level
| #define SND_LOG_ERROR 1 |
error priority level
| #define SND_LOG_INFO 3 |
info priority level
| #define SND_LOG_LAST SND_LOG_TRACE |
last known value for priority level
| #define SND_LOG_TRACE 5 |
trace priority level
| #define SND_LOG_WARN 2 |
warning priority level
| #define snd_trace | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_TRACE, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an trace log message.
| #define snd_warn | ( | interface, | |
| args... | |||
| ) | snd_lib_log(SND_LOG_WARN, SND_ILOG_##interface, __FILE__, __LINE__, __func__, 0, ##args) |
Shows an error log message.
| #define SNDERR | ( | args... | ) | snd_lib_log(SND_LOG_ERROR, 0, __FILE__, __LINE__, __func__, 0, ##args) |
Shows a sound error message.
| #define SYSERR | ( | args... | ) | snd_lib_log(SND_LOG_ERROR, 0, __FILE__, __LINE__, __func__, errno, ##args) |
Shows a system error message (related to errno).
| typedef void(* snd_lib_error_handler_t) (const char *file, int line, const char *function, int errcode, const char *fmt,...) |
Error handler callback.
| file | Source file name. |
| line | Line number. |
| function | Function name. |
| errcode | 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.
| typedef void(* snd_lib_log_handler_t) (int prio, int interface, const char *file, int line, const char *function, int errcode, const char *fmt, va_list arg) |
Log handler callback.
| prio | Priority (SND_LOG_* defines). |
| interface | Interface (SND_ILOG_* defines). |
| file | Source file name. |
| line | Line number. |
| function | Function name. |
| errcode | 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.
| typedef void(* snd_local_error_handler_t) (const char *file, int line, const char *func, int errcode, const char *fmt, va_list arg) |
Local error handler function type
| void snd_lib_check | ( | int | interface, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | errcode, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
The check point function.
| interface | Interface (SND_ILOG_*). |
| file | The filename where the error was hit. |
| line | The line number. |
| function | The function name. |
| errcode | The error code. |
| fmt | The message (including the format characters). |
| ... | Optional arguments. |
The error message is passed with error priority level to snd_lib_vlog handler.
| int snd_lib_error_set_handler | ( | snd_lib_error_handler_t | handler | ) |
Sets the error handler.
| 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.
| snd_local_error_handler_t snd_lib_error_set_local | ( | snd_local_error_handler_t | func | ) |
Install local error handler.
| func | The local error handler function |
| Previous | local error handler function |
| void snd_lib_log | ( | int | prio, |
| int | interface, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | errcode, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Root log handler function.
| prio | Priority value (SND_LOG_*). |
| interface | Interface (SND_ILOG_*). |
| file | The filename where the error was hit. |
| line | The line number. |
| function | The function name. |
| errcode | The error code. |
| fmt | The message (including the format characters). |
| ... | Optional arguments. |
| int snd_lib_log_filter | ( | int | prio, |
| int | interface, | ||
| const char * | configstr | ||
| ) |
Check if a log message should be shown based on LIBASOUND_DEBUG.
| prio | Priority value (SND_LOG_*). |
| interface | Interface (SND_ILOG_*). |
| configstr | Configuration string (usually LIBASOUND_DEBUG environment variable) |
| const char* snd_lib_log_interface | ( | int | interface | ) |
Function to convert interface code to text.
| interface | Interface (SND_ILOG_*). |
| const char* snd_lib_log_priority | ( | int | prio | ) |
Function to convert log priority level to text.
| prio | Priority value (SND_LOG_*). |
| snd_lib_log_handler_t snd_lib_log_set_handler | ( | snd_lib_log_handler_t | handler | ) |
Sets the log handler.
| handler | The pointer to the new log handler function. |
| Previous | log handler function |
This function sets a new log handler, or (if handler is NULL) the default one which prints the error messages to stderr.
| snd_lib_log_handler_t snd_lib_log_set_local | ( | snd_lib_log_handler_t | func | ) |
Install local log handler.
| func | The local log handler function |
| Previous | local log handler function |
| const char* snd_strerror | ( | int | errnum | ) |
Returns the message for an error code.
| errnum | The error code number, which must be a system error code or an ALSA error code. |
|
extern |
| snd_lib_error_handler_t snd_lib_error = snd_lib_error_default |
|
extern |
Pointer to the error handler function. For internal use only.
| snd_lib_log_handler_t snd_lib_vlog = snd_lib_vlog_default |
Pointer to the error handler function. For internal use only.