<!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>Global defines and functions</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>Global defines and functions</h1><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Defines</h2></td></tr> <tr><td nowrap align=right valign=top><a name="a10" doxytag="Global::__SND_DLSYM_VERSION"></a> #define </td><td valign=bottom><a class="el" href="group___global.html#a10">__SND_DLSYM_VERSION</a>(name, version)</td></tr> <tr><td> </td><td><font size=-1><em>Helper macro for <a class="el" href="group___global.html#a11">SND_DLSYM_BUILD_VERSION</a>.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a11" doxytag="Global::SND_DLSYM_BUILD_VERSION"></a> #define </td><td valign=bottom><a class="el" href="group___global.html#a11">SND_DLSYM_BUILD_VERSION</a>(name, version)</td></tr> <tr><td> </td><td><font size=-1><em>Appends the build version to the name of a versioned dynamic symbol.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a12" doxytag="Global::SND_DLSYM_VERSION"></a> #define </td><td valign=bottom><a class="el" href="group___global.html#a12">SND_DLSYM_VERSION</a>(version) __STRING(version)</td></tr> <tr><td> </td><td><font size=-1><em>Returns the version of a dynamic symbol as a string.</em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Typedefs</h2></td></tr> <tr><td nowrap align=right valign=top>typedef _snd_async_handler </td><td valign=bottom><a class="el" href="group___global.html#a0">snd_async_handler_t</a></td></tr> <tr><td> </td><td><font size=-1><em>Internal structure for an async notification client handler.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>typedef void(* </td><td valign=bottom><a class="el" href="group___global.html#a1">snd_async_callback_t</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>Async notification callback.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="group___global.html#a2">snd_dlopen</a> (const char *file, int mode)</td></tr> <tr><td> </td><td><font size=-1><em>Opens a dynamic library - ALSA wrapper for <code>dlopen</code>.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="group___global.html#a3">snd_dlsym</a> (void *handle, const char *name, const char *version)</td></tr> <tr><td> </td><td><font size=-1><em>Resolves a symbol from a dynamic library - ALSA wrapper for <code>dlsym</code>.</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="group___global.html#a4">snd_dlclose</a> (void *handle)</td></tr> <tr><td> </td><td><font size=-1><em>Closes a dynamic library - ALSA wrapper for <code>dlclose</code>.</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="group___global.html#a5">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="#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="group___global.html#a6">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="#a6"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="group___global.html#a7">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="#a7"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="group___global.html#a8">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="#a8"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="group___global.html#a9">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="#a9"></a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Global defines and functions. <p> The ALSA library implementation uses these macros and functions. Most applications probably do not need them. <hr><h2>Typedef Documentation</h2> <a name="a1" doxytag="global.h::snd_async_callback_t"></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"> typedef void(* snd_async_callback_t)(<a class="el" href="group___global.html#a0">snd_async_handler_t</a> *handler) </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Async notification callback. <p> See the <a class="el" href="group___global.html#a5">snd_async_add_handler</a> function for details. </td> </tr> </table> <a name="a0" doxytag="global.h::snd_async_handler_t"></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"> typedef struct _snd_async_handler snd_async_handler_t </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Internal structure for an async notification client handler. <p> The ALSA library uses a pointer to this structure as a handle to an async notification object. Applications don't access its contents directly. </td> </tr> </table> <hr><h2>Function Documentation</h2> <a name="a5" doxytag="global.h::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="group___global.html#a8">snd_async_handler_get_signo</a>. <p> When the async handler isn't needed anymore, you must delete it with <a class="el" href="group___global.html#a6">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="a6" doxytag="global.h::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="a9" doxytag="global.h::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><dl compact><dt><b>Examples: </b></dt><dd> <a class="el" href="_2test_2pcm_8c-example.html#a28">/test/pcm.c</a>.</dl> </td> </tr> </table> <a name="a7" doxytag="global.h::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="a8" doxytag="global.h::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> <a name="a4" doxytag="global.h::snd_dlclose"></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_dlclose </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname1" valign="top" nowrap> <em>handle</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> Closes a dynamic library - ALSA wrapper for <code>dlclose</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handle</em> </td><td> Library handle, similar to <code>dlclose</code>. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise an error code.</dl>This function can emulate dynamic linking for the static build of the alsa-lib library. </td> </tr> </table> <a name="a2" doxytag="global.h::snd_dlopen"></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_dlopen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>mode</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> Opens a dynamic library - ALSA wrapper for <code>dlopen</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>name</em> </td><td> name of the library, similar to <code>dlopen</code>. </td></tr> <tr><td valign=top><em>mode</em> </td><td> mode flags, similar to <code>dlopen</code>. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Library handle if successful, otherwise <code>NULL</code>.</dl>This function can emulate dynamic linking for the static build of the alsa-lib library. In that case, <code>name</code> is set to <code>NULL</code>. </td> </tr> </table> <a name="a3" doxytag="global.h::snd_dlsym"></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_dlsym </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> <em>handle</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>version</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> Resolves a symbol from a dynamic library - ALSA wrapper for <code>dlsym</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>handle</em> </td><td> Library handle, similar to <code>dlsym</code>. </td></tr> <tr><td valign=top><em>name</em> </td><td> Symbol name. </td></tr> <tr><td valign=top><em>version</em> </td><td> Version of the symbol.</td></tr> </table> </dl>This function can emulate dynamic linking for the static build of the alsa-lib library. <p> This special version of the <code>dlsym</code> function checks also the version of the symbol. A versioned symbol should be defined using the <a class="el" href="group___global.html#a11">SND_DLSYM_BUILD_VERSION</a> macro. </td> </tr> </table> <hr><address style="align: right;"><small>Generated on Wed Apr 2 16:06:36 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>