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

async.c File 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.


Detailed Description

Async notification helpers.

Author:
Abramo Bagnara <abramo@alsa-project.org>
Date:
2001

Function Documentation

int snd_async_add_handler snd_async_handler_t **    handler,
int    fd,
snd_async_callback_t    callback,
void *    private_data
 

Registers an async handler.

Parameters:
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.
Returns:
Zero if successful, otherwise a negative error code.
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.

See also:
snd_async_add_pcm_handler, snd_async_add_ctl_handler

int snd_async_del_handler snd_async_handler_t   handler
 

Deletes an async handler.

Parameters:
handler  Handle of the async handler to delete.
Returns:
Zero if successful, otherwise a negative error code.

void* snd_async_handler_get_callback_private snd_async_handler_t   handler
 

Returns the private data assigned to an async handler.

Parameters:
handler  Handle to an async handler.
Returns:
The 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.

Parameters:
handler  Handle to an async handler.
Returns:
The file descriptor if successful, otherwise a negative error code.

int snd_async_handler_get_signo snd_async_handler_t   handler
 

Returns the signal number assigned to an async handler.

Parameters:
handler  Handle to an async handler.
Returns:
The signal number if successful, otherwise a negative error code.
The signal number for async handlers usually is SIGIO, but wizards can redefine it to a realtime signal when compiling the ALSA library.


Generated on Thu Apr 1 16:46:00 2004 for ALSA project - the C library reference by doxygen1.2.18