Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 48aebc76604d00e261fd2a64f42d7eb8 > files > 12

liblomoco-devel-1.0-9mdv2010.0.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!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" lang="en" xml:lang="en">
<head>
  <title>lomoco: iniparser/src/dictionary.h File Reference</title>

<style type="text/css">
  .cp-doNotDisplay { display: none; }
  @media aural, braille, handheld, tty { .cp-doNotDisplay { display: inline; speak: normal; }}
  .cp-edit { text-align: right; }
  @media print, embossed { .cp-edit { display: none; }}
</style>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />
  <link rel="stylesheet" type="text/css" href="doxygen.css" />
  <link rel="stylesheet" media="screen" type="text/css" href="csync.css" />
  <link rel="stylesheet" media="print, embossed" type="text/css" href="print.css" />
</head>

<body>

<ul class="cp-doNotDisplay">
  <li><a href="#cp-content" accesskey="2">Skip to content</a></li>
  <li><a href="#cp-menu" accesskey="5">Skip to link menu</a></li>
</ul>

<div id="container">
<div id="header">
  <div id="header_top"><div><div style="padding: 10px 30px;">
  <!-- <img alt ="" src="top-kde.jpg"/> -->
    csync API Reference  </div></div></div>
  <div id="header_bottom">
    <div id="location">
      <ul>
        <li><a href="index.html">csync</a></li>
      </ul>
    </div>

    <div id="menu">
<ul><li><a href="http://www.csync.org/">Sitemap</a></li>
<li><a href="http://www.csync.org/">Contact Us</a></li>
</ul>
    </div>
  </div>
</div>
<!-- End page header -->
    <div id="body_wrapper">
      <div id="body">
        <!-- begin main content -->
        <div id="right">
          <div class="content">
          <div id="main">
            <div class="clearer">&nbsp;</div>
    <!-- <h2><a name="content"></a>lomoco</h2> -->

<!-- BC -->
<!-- Generated by Doxygen 1.5.9 -->
  <div class="navpath"><a class="el" href="dir_83899319ec122a03d431d68c45b0dd06.html">iniparser</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_78cebf553df91c53d1da58b5e3c2bd5d.html">src</a>
  </div>
<div class="contents">
<h1>dictionary.h File Reference</h1>Implements a dictionary for string variables.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;stdio.h&gt;</code><br>
<code>#include &lt;stdlib.h&gt;</code><br>
<code>#include &lt;string.h&gt;</code><br>
<code>#include &lt;unistd.h&gt;</code><br>

<p>
<div class="dynheader">
Include dependency graph for dictionary.h:</div>
<div class="dynsection">
<p><center><img src="dictionary_8h__incl.png" border="0" usemap="#iniparser/src/dictionary.h_map" alt=""></center>
</div>

<p>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dynsection">
<p><center><img src="dictionary_8h__dep__incl.png" border="0" usemap="#iniparser/src/dictionary.hdep_map" alt=""></center>
<map name="iniparser/src/dictionary.hdep_map">
<area shape="rect" id="node3" href="iniparser_8h.html" title="Parser for ini files." alt="" coords="9,80,281,107"></map>
</div>

<p>
<a href="dictionary_8h_source.html">Go to the source code of this file.</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 &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dictionary__.html">_dictionary_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dictionary object.  <a href="struct__dictionary__.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <a class="el" href="struct__dictionary__.html">_dictionary_</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#5bd3b2ce42b776c76755ec65642f43af">dictionary</a></td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#9d792f2544cf674a371663e2f32128fa">dictionary_del</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *vd)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#6e29ecf9c79331b1c6c26cd662cba042">dictionary_dump</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, FILE *out)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#c9d0e02363aa4220eef57a72949e1693">dictionary_get</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, char *def)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#2db28d75446968beb2b3f7332a01addf">dictionary_getchar</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, char def)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#7e9beef3b2d71e071246ab0483376240">dictionary_getdouble</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, double def)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#025d09dfaf59bec27c5477040bb0d8bc">dictionary_getint</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, int def)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#9ad99578040354d12ba4cc518c1c18d8">dictionary_hash</a> (char *key)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#9f584d70e3559fe6fe5f62a112bc7b17">dictionary_new</a> (int size)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#00cabef11d2e6c50767c878567e96c1b">dictionary_set</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *vd, char *key, char *val)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#e284ec91570369462870627492dfbc28">dictionary_setdouble</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, double val)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#3f4376e98032e94d25a1e970b11443e6">dictionary_setint</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key, int val)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="dictionary_8h.html#108b89bce8d154d4a9f489cbc89f8b9e">dictionary_unset</a> (<a class="el" href="struct__dictionary__.html">dictionary</a> *d, char *key)</td></tr>

</table>
<hr><h2>Detailed Description</h2>
Implements a dictionary for string variables. 
<p>
<dl class="author" compact><dt><b>Author:</b></dt><dd>N. Devillard </dd></dl>
<dl class="date" compact><dt><b>Date:</b></dt><dd>Aug 2000 </dd></dl>
<dl class="version" compact><dt><b>Version:</b></dt><dd></dd></dl>
<dl class="rcs" compact><dt><b>Revision</b></dt><dd>1.11 </dd></dl>
This module implements a simple dictionary object, i.e. a list of string/string associations. This object is useful to store e.g. informations retrieved from a configuration file (ini files). 
<p>Definition in file <a class="el" href="dictionary_8h_source.html">dictionary.h</a>.</p>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="5bd3b2ce42b776c76755ec65642f43af"></a><!-- doxytag: member="dictionary.h::dictionary" ref="5bd3b2ce42b776c76755ec65642f43af" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="struct__dictionary__.html">_dictionary_</a>  <a class="el" href="struct__dictionary__.html">dictionary</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Dictionary object. 
<p>
This object contains a list of string/string associations. Each association is identified by a unique string key. Looking up values in the dictionary is speeded up by the use of a (hopefully collision-free) hash function. 
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="9d792f2544cf674a371663e2f32128fa"></a><!-- doxytag: member="dictionary.h::dictionary_del" ref="9d792f2544cf674a371663e2f32128fa" args="(dictionary *vd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_del           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>vd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete a dictionary object. 
<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>d</em>&nbsp;</td><td>dictionary object to deallocate. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Deallocate a dictionary object and all memory associated to it. 
</div>
</div><p>
<a class="anchor" name="6e29ecf9c79331b1c6c26cd662cba042"></a><!-- doxytag: member="dictionary.h::dictionary_dump" ref="6e29ecf9c79331b1c6c26cd662cba042" args="(dictionary *d, FILE *out)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_dump           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>out</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Dump a dictionary to an opened file pointer. 
<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>d</em>&nbsp;</td><td>Dictionary to dump </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>f</em>&nbsp;</td><td>Opened file pointer. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Dumps a dictionary onto an opened file pointer. Key pairs are printed out as <code></code>[Key]=[Value], one per line. It is Ok to provide stdout or stderr as output file pointers. 
</div>
</div><p>
<a class="anchor" name="c9d0e02363aa4220eef57a72949e1693"></a><!-- doxytag: member="dictionary.h::dictionary_get" ref="c9d0e02363aa4220eef57a72949e1693" args="(dictionary *d, char *key, char *def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* dictionary_get           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>def</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a value from a dictionary. 
<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>d</em>&nbsp;</td><td>dictionary object to search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to look for in the dictionary. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Default value to return if key not found. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>1 pointer to internally allocated character string.</dd></dl>
This function locates a key in a dictionary and returns a pointer to its value, or the passed 'def' pointer if no such key can be found in dictionary. The returned character pointer points to data internal to the dictionary object, you should not try to free it or modify it. 
</div>
</div><p>
<a class="anchor" name="2db28d75446968beb2b3f7332a01addf"></a><!-- doxytag: member="dictionary.h::dictionary_getchar" ref="2db28d75446968beb2b3f7332a01addf" args="(dictionary *d, char *key, char def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char dictionary_getchar           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>def</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a value from a dictionary, as a char. 
<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>d</em>&nbsp;</td><td>dictionary object to search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to look for in the dictionary. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Default value for the key if not found. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>char</dd></dl>
This function locates a key in a dictionary using dictionary_get, and returns the first char of the found string. 
</div>
</div><p>
<a class="anchor" name="7e9beef3b2d71e071246ab0483376240"></a><!-- doxytag: member="dictionary.h::dictionary_getdouble" ref="7e9beef3b2d71e071246ab0483376240" args="(dictionary *d, char *key, double def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double dictionary_getdouble           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>def</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a value from a dictionary, as a double. 
<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>d</em>&nbsp;</td><td>dictionary object to search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to look for in the dictionary. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Default value for the key if not found. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>double</dd></dl>
This function locates a key in a dictionary using dictionary_get, and applies atof on it to return a double. If the value cannot be found in the dictionary, the default is returned. 
</div>
</div><p>
<a class="anchor" name="025d09dfaf59bec27c5477040bb0d8bc"></a><!-- doxytag: member="dictionary.h::dictionary_getint" ref="025d09dfaf59bec27c5477040bb0d8bc" args="(dictionary *d, char *key, int def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dictionary_getint           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>def</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a value from a dictionary, as an int. 
<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>d</em>&nbsp;</td><td>dictionary object to search. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to look for in the dictionary. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Default value for the key if not found. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>int</dd></dl>
This function locates a key in a dictionary using dictionary_get, and applies atoi on it to return an int. If the value cannot be found in the dictionary, the default is returned. 
</div>
</div><p>
<a class="anchor" name="9ad99578040354d12ba4cc518c1c18d8"></a><!-- doxytag: member="dictionary.h::dictionary_hash" ref="9ad99578040354d12ba4cc518c1c18d8" args="(char *key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned dictionary_hash           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compute the hash key for a string. 
<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>key</em>&nbsp;</td><td>Character string to use for key. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>1 unsigned int on at least 32 bits.</dd></dl>
This hash function has been taken from an Article in Dr Dobbs Journal. This is normally a collision-free function, distributing keys evenly. The key is stored anyway in the struct so that collision can be avoided by comparing the key itself in last resort. 
</div>
</div><p>
<a class="anchor" name="9f584d70e3559fe6fe5f62a112bc7b17"></a><!-- doxytag: member="dictionary.h::dictionary_new" ref="9f584d70e3559fe6fe5f62a112bc7b17" args="(int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct__dictionary__.html">dictionary</a>* dictionary_new           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new dictionary object. 
<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>size</em>&nbsp;</td><td>Optional initial size of the dictionary. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>1 newly allocated dictionary objet.</dd></dl>
This function allocates a new dictionary object of given size and returns it. If you do not know in advance (roughly) the number of entries in the dictionary, give size=0. 
</div>
</div><p>
<a class="anchor" name="00cabef11d2e6c50767c878567e96c1b"></a><!-- doxytag: member="dictionary.h::dictionary_set" ref="00cabef11d2e6c50767c878567e96c1b" args="(dictionary *vd, char *key, char *val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_set           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>vd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>val</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a value in a dictionary. 
<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>d</em>&nbsp;</td><td>dictionary object to modify. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to modify or add. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>val</em>&nbsp;</td><td>Value to add. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
If the given key is found in the dictionary, the associated value is replaced by the provided one. If the key cannot be found in the dictionary, it is added to it.<p>
It is Ok to provide a NULL value for val, but NULL values for the dictionary or the key are considered as errors: the function will return immediately in such a case.<p>
Notice that if you dictionary_set a variable to NULL, a call to dictionary_get will return a NULL value: the variable will be found, and its value (NULL) is returned. In other words, setting the variable content to NULL is equivalent to deleting the variable from the dictionary. It is not possible (in this implementation) to have a key in the dictionary without value. 
</div>
</div><p>
<a class="anchor" name="e284ec91570369462870627492dfbc28"></a><!-- doxytag: member="dictionary.h::dictionary_setdouble" ref="e284ec91570369462870627492dfbc28" args="(dictionary *d, char *key, double val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_setdouble           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>val</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a key in a dictionary, providing a double. 
<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>d</em>&nbsp;</td><td>Dictionary to update. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to modify or add </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>val</em>&nbsp;</td><td>Double value to store (will be stored as a string). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
This helper function calls <a class="el" href="dictionary_8h.html#00cabef11d2e6c50767c878567e96c1b" title="Set a value in a dictionary.">dictionary_set()</a> with the provided double converted to a string using g. 
</div>
</div><p>
<a class="anchor" name="3f4376e98032e94d25a1e970b11443e6"></a><!-- doxytag: member="dictionary.h::dictionary_setint" ref="3f4376e98032e94d25a1e970b11443e6" args="(dictionary *d, char *key, int val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_setint           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>val</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a key in a dictionary, providing an int. 
<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>d</em>&nbsp;</td><td>Dictionary to update. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to modify or add </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>val</em>&nbsp;</td><td>Integer value to store (will be stored as a string). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
This helper function calls <a class="el" href="dictionary_8h.html#00cabef11d2e6c50767c878567e96c1b" title="Set a value in a dictionary.">dictionary_set()</a> with the provided integer converted to a string using d. 
</div>
</div><p>
<a class="anchor" name="108b89bce8d154d4a9f489cbc89f8b9e"></a><!-- doxytag: member="dictionary.h::dictionary_unset" ref="108b89bce8d154d4a9f489cbc89f8b9e" args="(dictionary *d, char *key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dictionary_unset           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__dictionary__.html">dictionary</a> *&nbsp;</td>
          <td class="paramname"> <em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>key</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete a key in a dictionary. 
<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>d</em>&nbsp;</td><td>dictionary object to modify. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>Key to remove. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
This function deletes a key in a dictionary. Nothing is done if the key cannot be found. 
</div>
</div><p>
</div>
            </div>
          </div>
        </div>
        <div id="left">
          <div class="menu_box">
<a name="cp-menu" /><div class="menutitle"><div>
<h2 id="cp-menu-project">lomoco</h2>
<a href="#cp-skip-project" class="cp-doNotDisplay">Skip menu "lomoco"</a>
</div></div>
<!-- menu -->

<div class="menu_box">
<a name="cp-menu" /><div class="menutitle"><div>
<h2 id="cp-menu-project">API Documentation</h2>
<a href="#cp-skip-project" class="cp-doNotDisplay">Skip menu "@topname@"</a>
</div></div>
<div class="nav_list">
<ul>
<!-- gmenu -->
</ul></div></div>

          </div>
        </div>
        <div class="clearer"></div>
      </div>
      <div class="clearer"></div>
    </div>


    <div id="end_body"></div>

    <div id="footer"><div id="footer_text">
    Generated with <a href="http://www.stack.nl/~dimitri/doxygen/" target="_blank">Doxygen</a>
    </div></div>
  </div>

</body>
</html>