<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ALSA project - the C library reference: Runtime functions in configuration files</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.3 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> </div> <div class="contents"> <h1><a class="anchor" id="conffunc">Runtime functions in configuration files </a></h1><p>The ALSA library can modify the configuration at runtime. Several built-in functions are available.</p> <p>A function is defined with the id <code>@func</code> and the function name. All other values in the current compound are used as configuration for the function. If the compound func.<function_name> is defined in the root node, then the library and function from this compound configuration are used, otherwise 'snd_func_' is prefixed to the string and code from the ALSA library is used. The definition of a function looks like:</p> <div class="fragment"><pre class="fragment">func.remove_first_char { lib <span class="stringliteral">"/usr/lib/libasoundextend.so"</span> func <span class="stringliteral">"extend_remove_first_char"</span> } </pre></div><h2><a class="anchor" id="conffunc_ref"> Function reference</a></h2> <ul> <li> The getenv function - <a class="el" href="confmisc_8c.html#a033eab97ee6619aeb8c5eca585acf6c0" title="Returns an environment value.">snd_func_getenv()</a> - obtains an environment value. The result is a string. </li> <li> The igetenv function - <a class="el" href="confmisc_8c.html#a121864fba02478b9f605be44c97f5dc8" title="Returns an integer environment value.">snd_func_igetenv()</a> - obtains an environment value. The result is an integer. </li> <li> The concat function - <a class="el" href="confmisc_8c.html#a43a3685d5e397fdc0e46af6d7b121616" title="Merges the given strings.">snd_func_concat()</a> - merges all specified strings. The result is a string. </li> <li> The iadd function - <a class="el" href="confmisc_8c.html#a4e7acbc261ca8b6bf4602753ea5c17fe" title="Sum the given integers.">snd_func_iadd()</a> - sum all specified integers. The result is an integer. </li> <li> The imul function - <a class="el" href="confmisc_8c.html#a12f4b8b67e0976a260859edb929f4d36" title="Multiply the given integers.">snd_func_imul()</a> - multiply all specified integers. The result is an integer. </li> <li> The datadir function - <a class="el" href="confmisc_8c.html#aa24c85e86b4c1f6c4d2d440e4782d098" title="Returns the ALSA data directory.">snd_func_datadir()</a> - returns the ALSA data directory. The result is a string. </li> <li> The refer function - <a class="el" href="confmisc_8c.html#a8d91af8387a708c526bac3ee2c7ea10e" title="Copies the specified configuration node.">snd_func_refer()</a> - copies the referred configuration. The result has the same type as the referred node. </li> <li> The card_inum function - <a class="el" href="confmisc_8c.html#a023f9fd40df7c2c428a457b6ec7f8004" title="Returns the card number as integer.">snd_func_card_inum()</a> - returns a card number (integers). </li> <li> The card_driver function - <a class="el" href="confmisc_8c.html#a2d147e387821449a8927d60ef4f8ff16" title="Returns the driver identification for a card.">snd_func_card_driver()</a> - returns a driver identification. The result is a string. </li> <li> The card_id function - <a class="el" href="confmisc_8c.html#a9ccfc361f1bc1d81837335de02707ee8" title="Returns the identification of a card.">snd_func_card_id()</a> - returns a card identification. The result is a string. </li> <li> The card_name function - <a class="el" href="confmisc_8c.html#aba1ae0185e2d3e9b50291b40e7048181" title="Returns the name of a card.">snd_func_card_name()</a> - returns a card's name. The result is a string. </li> <li> The pcm_id function - snd_func_pcm_id() - returns a pcm identification. The result is a string. </li> <li> The private_string function - <a class="el" href="confmisc_8c.html#af14b528e2502f2037294301473389948" title="Returns the string from private_data.">snd_func_private_string()</a> - returns the string from the private_data node. </li> <li> The private_card_driver function - <a class="el" href="confmisc_8c.html#a7bc4fec8cb3499997934a00210d34fe7" title="Returns the driver identification from private_data.">snd_func_private_card_driver()</a> - returns the driver identification from the private_data node. The result is a string. </li> <li> The private_pcm_subdevice function - snd_func_private_pcm_subdevice() - returns the PCM subdevice number from the private_data node. The result is a string. </li> </ul> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Nov 20 07:42:24 2010 for ALSA project - the C library reference by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>