<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>async.c File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.18 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindex" href="examples.html">Examples</a> </center> <hr><h1>async.c File Reference</h1>Async notification helpers. <a href="#_details">More...</a> <p> <table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="async_8c.html#a3">snd_async_add_handler</a> (<a class="el" href="group___global.html#a0">snd_async_handler_t</a> **handler, int fd, <a class="el" href="group___global.html#a1">snd_async_callback_t</a> callback, void *private_data)</td></tr> <tr><td> </td><td><font size=-1><em>Registers an async handler.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="async_8c.html#a4">snd_async_del_handler</a> (<a class="el" href="group___global.html#a0">snd_async_handler_t</a> *handler)</td></tr> <tr><td> </td><td><font size=-1><em>Deletes an async handler.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="async_8c.html#a5">snd_async_handler_get_signo</a> (<a class="el" href="group___global.html#a0">snd_async_handler_t</a> *handler)</td></tr> <tr><td> </td><td><font size=-1><em>Returns the signal number assigned to an async handler.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="async_8c.html#a6">snd_async_handler_get_fd</a> (<a class="el" href="group___global.html#a0">snd_async_handler_t</a> *handler)</td></tr> <tr><td> </td><td><font size=-1><em>Returns the file descriptor assigned to an async handler.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="async_8c.html#a7">snd_async_handler_get_callback_private</a> (<a class="el" href="group___global.html#a0">snd_async_handler_t</a> *handler)</td></tr> <tr><td> </td><td><font size=-1><em>Returns the private data assigned to an async handler.</em> <a href="#a7"></a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Async notification helpers. <p> <p> <dl compact><dt><b>Author: </b></dt><dd> Abramo Bagnara <<a href="mailto:abramo@alsa-project.org">abramo@alsa-project.org</a>> </dl><dl compact><dt><b>Date: </b></dt><dd> 2001</dl><hr><h2>Function Documentation</h2> <a name="a3" doxytag="async.c::snd_async_add_handler"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_async_add_handler </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___global.html#a0">snd_async_handler_t</a> ** </td> <td class="mdname" nowrap> <em>handler</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>fd</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="group___global.html#a1">snd_async_callback_t</a> </td> <td class="mdname" nowrap> <em>callback</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>void * </td> <td class="mdname" nowrap> <em>private_data</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Registers an async handler. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handler</em> </td><td> The function puts the pointer to the new async handler object at the address specified by <code>handler</code>. </td></tr> <tr><td valign=top><em>fd</em> </td><td> The file descriptor to be associated with the callback. </td></tr> <tr><td valign=top><em>callback</em> </td><td> The async callback function. </td></tr> <tr><td valign=top><em>private_data</em> </td><td> Private data for the async callback function. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code.</dl>This function associates the callback function with the given file, and saves this association in a <code><a class="el" href="group___global.html#a0">snd_async_handler_t</a></code> object. <p> Whenever the <code>SIGIO</code> signal is raised for the file <code>fd</code>, the callback function will be called with its parameter pointing to the async handler object returned by this function. <p> The ALSA <code>sigaction</code> handler for the <code>SIGIO</code> signal automatically multiplexes the notifications to the registered async callbacks. However, the application is responsible for instructing the device driver to generate the <code>SIGIO</code> signal. <p> The <code>SIGIO</code> signal may have been replaced with another signal, see <a class="el" href="async_8c.html#a5">snd_async_handler_get_signo</a>. <p> When the async handler isn't needed anymore, you must delete it with <a class="el" href="async_8c.html#a4">snd_async_del_handler</a>. <p> <dl compact><dt><b>See also: </b></dt><dd> <a class="el" href="pcm_8c.html#a51">snd_async_add_pcm_handler</a>, <a class="el" href="control_8c.html#a27">snd_async_add_ctl_handler</a> </dl> </td> </tr> </table> <a name="a4" doxytag="async.c::snd_async_del_handler"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_async_del_handler </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___global.html#a0">snd_async_handler_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>handler</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Deletes an async handler. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handler</em> </td><td> Handle of the async handler to delete. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code. </dl> </td> </tr> </table> <a name="a7" doxytag="async.c::snd_async_handler_get_callback_private"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void* snd_async_handler_get_callback_private </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___global.html#a0">snd_async_handler_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>handler</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the private data assigned to an async handler. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handler</em> </td><td> Handle to an async handler. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The <code>private_data</code> value registered with the async handler. </dl> </td> </tr> </table> <a name="a6" doxytag="async.c::snd_async_handler_get_fd"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_async_handler_get_fd </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___global.html#a0">snd_async_handler_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>handler</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the file descriptor assigned to an async handler. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handler</em> </td><td> Handle to an async handler. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The file descriptor if successful, otherwise a negative error code. </dl> </td> </tr> </table> <a name="a5" doxytag="async.c::snd_async_handler_get_signo"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_async_handler_get_signo </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___global.html#a0">snd_async_handler_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>handler</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the signal number assigned to an async handler. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handler</em> </td><td> Handle to an async handler. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The signal number if successful, otherwise a negative error code.</dl>The signal number for async handlers usually is <code>SIGIO</code>, but wizards can redefine it to a realtime signal when compiling the ALSA library. </td> </tr> </table> <hr><address style="align: right;"><small>Generated on Wed Apr 2 16:06:33 2003 for ALSA project - the C library reference by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address> </body> </html>