File: //usr/share/doc/alsa-lib-devel-1.1.8/doxygen/html/conffunc.html
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>ALSA project - the C library reference: Runtime functions in configuration files</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ALSA project - the C library reference
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<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">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.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)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</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>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Runtime functions in configuration files </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><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"><div class="line">func.remove_first_char {</div>
<div class="line"> lib <span class="stringliteral">"/usr/lib/libasoundextend.so"</span></div>
<div class="line"> func <span class="stringliteral">"extend_remove_first_char"</span></div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="conffunc_ref"></a>
Function reference</h1>
<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></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>