ALSA project - the C library reference
|
Async notification helpers. More...
Functions | |
int | snd_async_add_handler (snd_async_handler_t **handler, int fd, snd_async_callback_t callback, void *private_data) |
Registers an async handler. | |
int | snd_async_del_handler (snd_async_handler_t *handler) |
Deletes an async handler. | |
int | snd_async_handler_get_signo (snd_async_handler_t *handler) |
Returns the signal number assigned to an async handler. | |
int | snd_async_handler_get_fd (snd_async_handler_t *handler) |
Returns the file descriptor assigned to an async handler. | |
void * | snd_async_handler_get_callback_private (snd_async_handler_t *handler) |
Returns the private data assigned to an async handler. | |
Async notification helpers.
int snd_async_add_handler | ( | snd_async_handler_t ** | handler, |
int | fd, | ||
snd_async_callback_t | callback, | ||
void * | private_data ) |
Registers an async handler.
handler | The function puts the pointer to the new async handler object at the address specified by handler . |
fd | The file descriptor to be associated with the callback. |
callback | The async callback function. |
private_data | Private data for the async callback function. |
This function associates the callback function with the given file, and saves this association in a snd_async_handler_t
object.
Whenever the SIGIO
signal is raised for the file fd
, the callback function will be called with its parameter pointing to the async handler object returned by this function.
The ALSA sigaction
handler for the SIGIO
signal automatically multiplexes the notifications to the registered async callbacks. However, the application is responsible for instructing the device driver to generate the SIGIO
signal.
The SIGIO
signal may have been replaced with another signal, see snd_async_handler_get_signo.
When the async handler isn't needed anymore, you must delete it with snd_async_del_handler.
int snd_async_del_handler | ( | snd_async_handler_t * | handler | ) |
Deletes an async handler.
handler | Handle of the async handler to delete. |
void * snd_async_handler_get_callback_private | ( | snd_async_handler_t * | handler | ) |
Returns the private data assigned to an async handler.
handler | Handle to an async handler. |
private_data
value registered with the async handler. int snd_async_handler_get_fd | ( | snd_async_handler_t * | handler | ) |
Returns the file descriptor assigned to an async handler.
handler | Handle to an async handler. |
int snd_async_handler_get_signo | ( | snd_async_handler_t * | handler | ) |
Returns the signal number assigned to an async handler.
handler | Handle to an async handler. |
The signal number for async handlers usually is SIGIO
, but wizards can redefine it to a realtime signal when compiling the ALSA library.