diff options
Diffstat (limited to 'runtime/docs/html/group__maps.html')
-rw-r--r-- | runtime/docs/html/group__maps.html | 1265 |
1 files changed, 1265 insertions, 0 deletions
diff --git a/runtime/docs/html/group__maps.html b/runtime/docs/html/group__maps.html new file mode 100644 index 00000000..1da96a51 --- /dev/null +++ b/runtime/docs/html/group__maps.html @@ -0,0 +1,1265 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>SystemTap: Maps</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.1 --> +<div class="qindex"><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="dirs.html">Directories</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></div> +<h1>Maps</h1>Implements maps (associative arrays) and lists. +<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structstat.html">stat</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Statistics are stored in this struct. <a href="structstat.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">union </td><td class="memItemRight" valign="bottom"><a class="el" href="unionkey__data.html">key_data</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Keys are either longs or char *. <a href="unionkey__data.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node.html">map_node</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">basic map element <a href="structmap__node.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__int64.html">map_node_int64</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing int64 <a href="structmap__node__int64.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__str.html">map_node_str</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing string <a href="structmap__node__str.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__node__stat.html">map_node_stat</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">map element containing stats <a href="structmap__node__stat.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmap__root.html">map_root</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This structure contains all information about a map. <a href="structmap__root.html#_details">More...</a><br></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="maps::key1str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga24">key1str</a>(ptr) (ptr->n.key1.str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key1 union. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="maps::key2str"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga25">key2str</a>(ptr) (ptr->n.key2.str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts string from key2 union. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="maps::key1int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga26">key1int</a>(ptr) (ptr->n.key1.val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key1 union. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="maps::key2int"></a> +#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga27">key2int</a>(ptr) (ptr->n.key2.val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts int from key2 union. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga28">_stp_map_key2</a>(map, key1, key2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key functions based on the types of the arguments. <a href="#ga28"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga29">_stp_map_key</a>(map, key)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_key function based on the type of the argument. <a href="#ga29"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga30">_stp_map_set</a>(map, val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Macro to call the proper _stp_map_set function based on the type of the argument. <a href="#ga30"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga31">foreach</a>(map, ptr)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Loop through all elements of a map or list. <a href="#ga31"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="maps::MAP"></a> +typedef <a class="el" href="structmap__root.html">map_root</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga1">MAP</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All maps are of this type. <br></td></tr> +<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga32">keytype</a> { <b>NONE</b>, +<b>LONG</b>, +<b>STR</b> + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga33">valtype</a> { <b>INT64</b>, +<b>STAT</b>, +<b>STRING</b>, +<b>END</b> + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">values can be either int64, stats or strings <br></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__root.html">MAP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga2">_stp_map_new</a> (unsigned max_entries, enum <a class="el" href="group__maps.html#ga33">valtype</a> type)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new map. <a href="#ga2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga4">_stp_map_key_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes the current element. <a href="#ga4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga5">_stp_map_start</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the first element in a map. <a href="#ga5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structmap__node.html">map_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga6">_stp_map_iter</a> (<a class="el" href="structmap__root.html">MAP</a> map, struct <a class="el" href="structmap__node.html">map_node</a> *m)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next element in a map. <a href="#ga6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga7">_stp_map_del</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a map. <a href="#ga7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga8">_stp_map_key_long_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, long key2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two longs. <a href="#ga8"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga9">_stp_map_key_str_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, char *key2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to two strings. <a href="#ga9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga10">_stp_map_key_str_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key1, long key2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string and a long. <a href="#ga10"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga11">_stp_map_key_long_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key1, char *key2)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long and a string. <a href="#ga11"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga12">_stp_map_key_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *key)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a string. <a href="#ga12"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga13">_stp_map_key_long</a> (<a class="el" href="structmap__root.html">MAP</a> map, long key)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the map's key to a long. <a href="#ga13"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to an int64. <a href="#ga16"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an int64 to the current element's value. <a href="#ga17"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga18">_stp_map_get_int64</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga18"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga19">_stp_map_set_str</a> (<a class="el" href="structmap__root.html">MAP</a> map, char *val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a string. <a href="#ga19"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga20">_stp_map_get_str</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga20"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga21">_stp_map_set_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map, <a class="el" href="structstat.html">stat</a> *stats)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current element's value to a stat. <a href="#ga21"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstat.html">stat</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga22">_stp_map_get_stat</a> (<a class="el" href="structmap__root.html">MAP</a> map)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the current element's value. <a href="#ga22"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a> (<a class="el" href="structmap__root.html">MAP</a> map, int64_t val)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add to the current element's statistics. <a href="#ga23"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Variables</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="maps::packed"></a> +enum <a class="el" href="group__maps.html#ga32">keytype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__maps.html#ga0">packed</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">keys can be longs or strings <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Implements maps (associative arrays) and lists. +<p> +<hr><h2>Define Documentation</h2> +<a class="anchor" name="ga29" doxytag="map.h::_stp_map_key"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define _stp_map_key </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">map, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>key </td> + <td class="mdname1" valign="top" nowrap> </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> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga12">_stp_map_key_str</a> (map, (<span class="keywordtype">char</span> *)(key)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga13">_stp_map_key_long</a> (map, (<span class="keywordtype">long</span>)(key)); \ + }) +</pre></div>Macro to call the proper _stp_map_key function based on the type of the argument. +<p> +<dl compact><dt><b>Note:</b></dt><dd>May cause compiler warning on some GCCs </dd></dl> + +<p> +Definition at line <a class="el" href="map_8h-source.html#l00141">141</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> + </tr> +</table> +<a class="anchor" name="ga28" doxytag="map.h::_stp_map_key2"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define _stp_map_key2 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">map, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>key1, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>key2 </td> + <td class="mdname1" valign="top" nowrap> </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> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key1), <span class="keywordtype">char</span>[])) \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga9">_stp_map_key_str_str</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">char</span> *)(key2)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga10">_stp_map_key_str_long</a> (map, (<span class="keywordtype">char</span> *)(key1), (<span class="keywordtype">long</span>)(key2)); \ + <span class="keywordflow">else</span> \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (key2), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga11">_stp_map_key_long_str</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">char</span> *)(key2)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga8">_stp_map_key_long_long</a> (map, (<span class="keywordtype">long</span>)(key1), (<span class="keywordtype">long</span>)(key2)); \ + }) +</pre></div>Macro to call the proper _stp_map_key functions based on the types of the arguments. +<p> +<dl compact><dt><b>Note:</b></dt><dd>May cause compiler warning on some GCCs </dd></dl> + +<p> +Definition at line <a class="el" href="map_8h-source.html#l00123">123</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> + </tr> +</table> +<a class="anchor" name="ga30" doxytag="map.h::_stp_map_set"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define _stp_map_set </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">map, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>val </td> + <td class="mdname1" valign="top" nowrap> </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> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (__builtin_types_compatible_p (typeof (val), <span class="keywordtype">char</span>[])) \ + <a class="code" href="group__maps.html#ga19">_stp_map_set_str</a> (map, (<span class="keywordtype">char</span> *)(val)); \ + <span class="keywordflow">else</span> \ + <a class="code" href="group__maps.html#ga16">_stp_map_set_int64</a> (map, (int64_t)(val)); \ + }) +</pre></div>Macro to call the proper _stp_map_set function based on the type of the argument. +<p> +<dl compact><dt><b>Note:</b></dt><dd>May cause compiler warning on some GCCs </dd></dl> + +<p> +Definition at line <a class="el" href="map_8h-source.html#l00153">153</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> + </tr> +</table> +<a class="anchor" name="ga31" doxytag="map.h::foreach"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">#define foreach </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">map, <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>ptr </td> + <td class="mdname1" valign="top" nowrap> </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> +<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">for</span> (ptr = (typeof(ptr))<a class="code" href="group__maps.html#ga5">_stp_map_start</a>(map); ptr; \ + ptr = (typeof(ptr))_stp_map_iter (map, (<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)ptr)) +</pre></div>Loop through all elements of a map or list. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>ptr</em> </td><td>pointer to a <a class="el" href="structmap__node__stat.html">map_node_stat</a>, <a class="el" href="structmap__node__int64.html">map_node_int64</a> or <a class="el" href="structmap__node__str.html">map_node_str</a></td></tr> + </table> +</dl> +<b>Example:</b> <div class="fragment"><pre class="fragment"><span class="comment">/* example showing how to print all the stats in a map using foreach() */</span> + +<span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> *ptr; + +<a class="code" href="group__maps.html#ga31">foreach</a> (map, ptr) + printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), + key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, + ptr->stats.max); + +</pre></div> +<p> +Definition at line <a class="el" href="map_8h-source.html#l00169">169</a> of file <a class="el" href="map_8h-source.html">map.h</a>. </td> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="ga17" doxytag="map.c::_stp_map_add_int64"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_add_int64 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</em></td> + </tr> + <tr> + <td class="md"></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> +Adds an int64 to the current element's value. +<p> +This adds an int64 to the current element's value. The map must have been created to hold int64s using <a class="el" href="group__maps.html#ga2">_stp_map_new()</a><p> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>value </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga16">_stp_map_set_int64</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00558">558</a> of file <a class="el" href="map_8c-source.html">map.c</a>. </td> + </tr> +</table> +<a class="anchor" name="ga7" doxytag="map.c::_stp_map_del"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_del </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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 a map. +<p> +Deletes a map, freeing all memory in all elements. Normally done only when the module exits. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00205">205</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="alloc_8c-source.html#l00086">_stp_vfree()</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, and <a class="el" href="map_8h-source.html#l00104">map_root::membuf</a>. </td> + </tr> +</table> +<a class="anchor" name="ga18" doxytag="map.c::_stp_map_get_int64"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">int64_t _stp_map_get_int64 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>The value. If the current element is not set or doesn't exist, returns 0. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00568">568</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00049">map_node_int64::val</a>. </td> + </tr> +</table> +<a class="anchor" name="ga22" doxytag="map.c::_stp_map_get_stat"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"><a class="el" href="structstat.html">stat</a>* _stp_map_get_stat </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>A pointer to the stats struct. If the current element is not set or doesn't exist, returns NULL. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00732">732</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>. </td> + </tr> +</table> +<a class="anchor" name="ga20" doxytag="map.c::_stp_map_get_str"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">char* _stp_map_get_str </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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> +Gets the current element's value. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>A string pointer. If the current element is not set or doesn't exist, returns NULL. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00649">649</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_str::str</a>. </td> + </tr> +</table> +<a class="anchor" name="ga6" doxytag="map.c::_stp_map_iter"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">struct <a class="el" href="structmap__node.html">map_node</a>* _stp_map_iter </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>struct <a class="el" href="structmap__node.html">map_node</a> * </td> + <td class="mdname" nowrap> <em>m</em></td> + </tr> + <tr> + <td class="md"></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> +Get the next element in a map. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td>a pointer to the current element, returned from <a class="el" href="group__maps.html#ga5">_stp_map_start()</a> or <a class="el" href="group__maps.html#ga6">_stp_map_iter()</a>. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the next element. This is typically used with <a class="el" href="group__maps.html#ga5">_stp_map_start()</a>. See the <a class="el" href="group__maps.html#ga31">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">foreach</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00186">186</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, and <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>. </td> + </tr> +</table> +<a class="anchor" name="ga4" doxytag="map.c::_stp_map_key_del"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_del </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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 the current element. +<p> +If no current element (key) for this map is set, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00118">118</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, and <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00588">_stp_map_set_str()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga13" doxytag="map.c::_stp_map_key_long"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_long </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>key</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to a long. +<p> +This sets the current element based on a long key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00430">430</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8c-source.html#l00233">_stp_map_key_long_long()</a>, and <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64()</a>, and <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga8" doxytag="map.c::_stp_map_key_long_long"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_long_long </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>key2</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to two longs. +<p> +This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00233">233</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00430">_stp_map_key_long()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga11" doxytag="map.c::_stp_map_key_long_str"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_long_str </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key2</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to a long and a string. +<p> +This sets the current element based on a key of a long and a string. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00373">373</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00025">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. </td> + </tr> +</table> +<a class="anchor" name="ga12" doxytag="map.c::_stp_map_key_str"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_str </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to a string. +<p> +This sets the current element based on a string key. If the key is not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td></td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00414">414</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8c-source.html#l00276">_stp_map_key_str_str()</a>, and <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>. </td> + </tr> +</table> +<a class="anchor" name="ga10" doxytag="map.c::_stp_map_key_str_long"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_str_long </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>key2</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to a string and a long. +<p> +This sets the current element based on a key of a string and a long. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00325">325</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, <a class="el" href="map_8h-source.html#l00025">key_data::str</a>, and <a class="el" href="map_8h-source.html#l00024">key_data::val</a>. </td> + </tr> +</table> +<a class="anchor" name="ga9" doxytag="map.c::_stp_map_key_str_str"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_key_str_str </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>key2</em></td> + </tr> + <tr> + <td class="md"></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> +Set the map's key to two strings. +<p> +This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a <em>_stp_map_set_xxx</em> call. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>key1</em> </td><td>first key </td></tr> + <tr><td valign="top"></td><td valign="top"><em>key2</em> </td><td>second key </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00276">276</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00097">map_root::c_key1</a>, <a class="el" href="map_8h-source.html#l00094">map_root::c_key1type</a>, <a class="el" href="map_8h-source.html#l00098">map_root::c_key2</a>, <a class="el" href="map_8h-source.html#l00095">map_root::c_key2type</a>, <a class="el" href="map_8h-source.html#l00096">map_root::c_keyhead</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00101">map_root::hashes</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00040">map_node::key1</a>, <a class="el" href="map_8h-source.html#l00041">map_node::key2</a>, and <a class="el" href="map_8h-source.html#l00025">key_data::str</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00414">_stp_map_key_str()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga2" doxytag="map.c::_stp_map_new"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> _stp_map_new </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">unsigned </td> + <td class="mdname" nowrap> <em>max_entries</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>enum <a class="el" href="group__maps.html#ga33">valtype</a> </td> + <td class="mdname" nowrap> <em>type</em></td> + </tr> + <tr> + <td class="md"></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> +Create a new map. +<p> +Maps must be created at module initialization time. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>max_entries</em> </td><td>The maximum number of entries allowed. Currently that number will be preallocated. If more entries are required, the oldest ones will be deleted. This makes it effectively a circular buffer. If max_entries is 0, there will be no maximum and entries will be allocated dynamically. </td></tr> + <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Type of values stored in this map. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>A MAP on success or NULL on failure. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00057">57</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="alloc_8c-source.html#l00062">_stp_valloc()</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00104">map_root::membuf</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00069">map_root::type</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00801">_stp_list_new()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga16" doxytag="map.c::_stp_map_set_int64"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_set_int64 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</em></td> + </tr> + <tr> + <td class="md"></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> +Set the current element's value to an int64. +<p> +This sets the current element's value to an int64. The map must have been created to hold int64s using <a class="el" href="group__maps.html#ga2">_stp_map_new()</a><p> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>new value </td></tr> + </table> +</dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga17">_stp_map_add_int64</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00541">541</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00864">_stp_list_add_int64()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga21" doxytag="map.c::_stp_map_set_stat"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_set_stat </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap><a class="el" href="structstat.html">stat</a> * </td> + <td class="mdname" nowrap> <em>stats</em></td> + </tr> + <tr> + <td class="md"></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> +Set the current element's value to a stat. +<p> +This sets the current element's value to an stat struct. The map must have been created to hold stats using <em>_stp_map_new(xxx, STAT)</em>. This function would only be used if we wanted to set stats to something other than the normal initial values (count = 0, sum = 0, etc). It may be deleted if it doesn't turn out to be useful. <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga23">_stp_map_stat_add</a></dd></dl> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>stats</em> </td><td>pointer to stats struct. </td></tr> + </table> +</dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000006">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00673">673</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00060">map_node_stat::n</a>, <a class="el" href="map_8h-source.html#l00078">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00753">_stp_map_stat_add()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga19" doxytag="map.c::_stp_map_set_str"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_set_str </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>char * </td> + <td class="mdname" nowrap> <em>val</em></td> + </tr> + <tr> + <td class="md"></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> +Set the current element's value to a string. +<p> +This sets the current element's value to an string. The map must have been created to hold int64s using <em>_stp_map_new(xxx, STRING)</em><p> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>new string </td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00588">588</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="alloc_8c-source.html#l00031">_stp_alloc()</a>, <a class="el" href="alloc_8c-source.html#l00047">_stp_calloc()</a>, <a class="el" href="alloc_8c-source.html#l00076">_stp_free()</a>, <a class="el" href="map_8c-source.html#l00118">_stp_map_key_del()</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00081">map_root::head</a>, <a class="el" href="map_8h-source.html#l00039">map_node::hnode</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00037">map_node::lnode</a>, <a class="el" href="map_8h-source.html#l00072">map_root::maxnum</a>, <a class="el" href="map_8h-source.html#l00054">map_node_str::n</a>, <a class="el" href="map_8h-source.html#l00078">map_root::no_wrap</a>, <a class="el" href="map_8h-source.html#l00085">map_root::pool</a>, and <a class="el" href="map_8h-source.html#l00055">map_node_str::str</a>. +<p> +Referenced by <a class="el" href="map_8c-source.html#l00853">_stp_list_add_str()</a>. </td> + </tr> +</table> +<a class="anchor" name="ga5" doxytag="map.c::_stp_map_start"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">struct <a class="el" href="structmap__node.html">map_node</a>* _stp_map_start </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname1" valign="top" nowrap> <em>map</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> +Get the first element in a map. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the first element. This is typically used with <a class="el" href="group__maps.html#ga6">_stp_map_iter()</a>. See the <a class="el" href="group__maps.html#ga31">foreach()</a> macro for typical usage. It probably does what you want anyway. </dd></dl> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__maps.html#ga31">foreach</a> </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00163">163</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8h-source.html#l00081">map_root::head</a>. </td> + </tr> +</table> +<a class="anchor" name="ga23" doxytag="map.c::_stp_map_stat_add"></a><p> +<table class="mdTable" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top">void _stp_map_stat_add </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="structmap__root.html">MAP</a> </td> + <td class="mdname" nowrap> <em>map</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td class="md"></td> + <td class="md" nowrap>int64_t </td> + <td class="mdname" nowrap> <em>val</em></td> + </tr> + <tr> + <td class="md"></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> +Add to the current element's statistics. +<p> +Increments the statistics counter by one and the sum by <em>val</em>. Adjusts minimum, maximum, and histogram.<p> +If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>map</em> </td><td></td></tr> + <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>value to add to the statistics </td></tr> + </table> +</dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000007">Todo:</a></b></dt><dd>Histograms don't work yet. </dd></dl> + +<p> +Definition at line <a class="el" href="map_8c-source.html#l00753">753</a> of file <a class="el" href="map_8c-source.html">map.c</a>. +<p> +References <a class="el" href="map_8c-source.html#l00673">_stp_map_set_stat()</a>, <a class="el" href="map_8h-source.html#l00016">stat::count</a>, <a class="el" href="map_8h-source.html#l00093">map_root::create</a>, <a class="el" href="map_8h-source.html#l00088">map_root::key</a>, <a class="el" href="map_8h-source.html#l00018">stat::max</a>, <a class="el" href="map_8h-source.html#l00018">stat::min</a>, <a class="el" href="map_8h-source.html#l00061">map_node_stat::stats</a>, and <a class="el" href="map_8h-source.html#l00017">stat::sum</a>. </td> + </tr> +</table> +</body></html> |