]> granicus.if.org Git - json-c/blob - doc/html/linkhash_8h.html
Add doxygen-generated docs for the 0.12.1 release.
[json-c] / doc / html / linkhash_8h.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.9.1"/>
7 <title>json-c: linkhash.h File Reference</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 </head>
13 <body>
14 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
15 <div id="titlearea">
16 <table cellspacing="0" cellpadding="0">
17  <tbody>
18  <tr style="height: 56px;">
19   <td style="padding-left: 0.5em;">
20    <div id="projectname">json-c
21    &#160;<span id="projectnumber">0.12.1</span>
22    </div>
23   </td>
24  </tr>
25  </tbody>
26 </table>
27 </div>
28 <!-- end header part -->
29 <!-- Generated by Doxygen 1.8.9.1 -->
30   <div id="navrow1" class="tabs">
31     <ul class="tablist">
32       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
33       <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
34       <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
35       <li class="current"><a href="files.html"><span>Files</span></a></li>
36     </ul>
37   </div>
38   <div id="navrow2" class="tabs2">
39     <ul class="tablist">
40       <li><a href="files.html"><span>File&#160;List</span></a></li>
41       <li><a href="globals.html"><span>Globals</span></a></li>
42     </ul>
43   </div>
44 </div><!-- top -->
45 <div class="header">
46   <div class="summary">
47 <a href="#nested-classes">Data Structures</a> &#124;
48 <a href="#define-members">Macros</a> &#124;
49 <a href="#typedef-members">Typedefs</a> &#124;
50 <a href="#func-members">Functions</a>  </div>
51   <div class="headertitle">
52 <div class="title">linkhash.h File Reference</div>  </div>
53 </div><!--header-->
54 <div class="contents">
55 <table class="memberdecls">
56 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
57 Data Structures</h2></td></tr>
58 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlh__entry.html">lh_entry</a></td></tr>
59 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
60 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlh__table.html">lh_table</a></td></tr>
61 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
62 </table><table class="memberdecls">
63 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
64 Macros</h2></td></tr>
65 <tr class="memitem:a032f1bd115df254dda325437203ce5fb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a032f1bd115df254dda325437203ce5fb">LH_PRIME</a>&#160;&#160;&#160;0x9e370001UL</td></tr>
66 <tr class="separator:a032f1bd115df254dda325437203ce5fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
67 <tr class="memitem:a66b61772c29d85eb52b697e0b0dc0aaf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a66b61772c29d85eb52b697e0b0dc0aaf">LH_LOAD_FACTOR</a>&#160;&#160;&#160;0.66</td></tr>
68 <tr class="separator:a66b61772c29d85eb52b697e0b0dc0aaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
69 <tr class="memitem:a93fad7f8ae44575dc89c9567859972d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a93fad7f8ae44575dc89c9567859972d2">LH_EMPTY</a>&#160;&#160;&#160;(void*)-1</td></tr>
70 <tr class="separator:a93fad7f8ae44575dc89c9567859972d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
71 <tr class="memitem:ac69428f2de0a6fb080b6fb373d506aa7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ac69428f2de0a6fb080b6fb373d506aa7">LH_FREED</a>&#160;&#160;&#160;(void*)-2</td></tr>
72 <tr class="separator:ac69428f2de0a6fb080b6fb373d506aa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
73 <tr class="memitem:ad7dd67da915065dce2c6f44cb03e2d82"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ad7dd67da915065dce2c6f44cb03e2d82">lh_foreach</a>(table,  entry)&#160;&#160;&#160;for(entry = table-&gt;head; entry; entry = entry-&gt;next)</td></tr>
74 <tr class="separator:ad7dd67da915065dce2c6f44cb03e2d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
75 <tr class="memitem:abcbb0df08b4976d0649b826b6bacfca1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#abcbb0df08b4976d0649b826b6bacfca1">lh_foreach_safe</a>(table,  entry,  tmp)&#160;&#160;&#160;for(entry = table-&gt;head; entry &amp;&amp; ((tmp = entry-&gt;next) || 1); entry = tmp)</td></tr>
76 <tr class="separator:abcbb0df08b4976d0649b826b6bacfca1"><td class="memSeparator" colspan="2">&#160;</td></tr>
77 </table><table class="memberdecls">
78 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
79 Typedefs</h2></td></tr>
80 <tr class="memitem:a0c6811f660b93857aafdbfdf80d9696b"><td class="memItemLeft" align="right" valign="top">typedef void(&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a>) (struct <a class="el" href="structlh__entry.html">lh_entry</a> *e)</td></tr>
81 <tr class="separator:a0c6811f660b93857aafdbfdf80d9696b"><td class="memSeparator" colspan="2">&#160;</td></tr>
82 <tr class="memitem:a1780449146b716ad5e6ed0a0207d0417"><td class="memItemLeft" align="right" valign="top">typedef unsigned long(&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a1780449146b716ad5e6ed0a0207d0417">lh_hash_fn</a>) (const void *k)</td></tr>
83 <tr class="separator:a1780449146b716ad5e6ed0a0207d0417"><td class="memSeparator" colspan="2">&#160;</td></tr>
84 <tr class="memitem:abcbf0e4849fb0c6279827ac3b66d15c3"><td class="memItemLeft" align="right" valign="top">typedef int(&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#abcbf0e4849fb0c6279827ac3b66d15c3">lh_equal_fn</a>) (const void *k1, const void *k2)</td></tr>
85 <tr class="separator:abcbf0e4849fb0c6279827ac3b66d15c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
86 </table><table class="memberdecls">
87 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
88 Functions</h2></td></tr>
89 <tr class="memitem:a2e560f0d3e5a20f6b0bfa4049737db23"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a2e560f0d3e5a20f6b0bfa4049737db23">lh_ptr_hash</a> (const void *k)</td></tr>
90 <tr class="separator:a2e560f0d3e5a20f6b0bfa4049737db23"><td class="memSeparator" colspan="2">&#160;</td></tr>
91 <tr class="memitem:a6ce3cb97560072c40f5caeaba85f756a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a6ce3cb97560072c40f5caeaba85f756a">lh_ptr_equal</a> (const void *k1, const void *k2)</td></tr>
92 <tr class="separator:a6ce3cb97560072c40f5caeaba85f756a"><td class="memSeparator" colspan="2">&#160;</td></tr>
93 <tr class="memitem:a1fcf495b9c4ce169630cb31f638b8435"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a1fcf495b9c4ce169630cb31f638b8435">lh_char_hash</a> (const void *k)</td></tr>
94 <tr class="separator:a1fcf495b9c4ce169630cb31f638b8435"><td class="memSeparator" colspan="2">&#160;</td></tr>
95 <tr class="memitem:ae4e9f21fb1a556c7a50c6b7ea61f2079"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ae4e9f21fb1a556c7a50c6b7ea61f2079">lh_char_equal</a> (const void *k1, const void *k2)</td></tr>
96 <tr class="separator:ae4e9f21fb1a556c7a50c6b7ea61f2079"><td class="memSeparator" colspan="2">&#160;</td></tr>
97 <tr class="memitem:ac3ba464ac43c083397b1f1d34f2ddf55"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ac3ba464ac43c083397b1f1d34f2ddf55">lh_table_new</a> (int size, const char *name, <a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *free_fn, <a class="el" href="linkhash_8h.html#a1780449146b716ad5e6ed0a0207d0417">lh_hash_fn</a> *hash_fn, <a class="el" href="linkhash_8h.html#abcbf0e4849fb0c6279827ac3b66d15c3">lh_equal_fn</a> *equal_fn)</td></tr>
98 <tr class="separator:ac3ba464ac43c083397b1f1d34f2ddf55"><td class="memSeparator" colspan="2">&#160;</td></tr>
99 <tr class="memitem:a0aaf11e11ee5b0925279a52eab04bc38"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a0aaf11e11ee5b0925279a52eab04bc38">lh_kchar_table_new</a> (int size, const char *name, <a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *free_fn)</td></tr>
100 <tr class="separator:a0aaf11e11ee5b0925279a52eab04bc38"><td class="memSeparator" colspan="2">&#160;</td></tr>
101 <tr class="memitem:a705513954267a16cc1d40a284a7c441e"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a705513954267a16cc1d40a284a7c441e">lh_kptr_table_new</a> (int size, const char *name, <a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *free_fn)</td></tr>
102 <tr class="separator:a705513954267a16cc1d40a284a7c441e"><td class="memSeparator" colspan="2">&#160;</td></tr>
103 <tr class="memitem:a81653acf740cf8c9fe672e6cd16df0cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a81653acf740cf8c9fe672e6cd16df0cf">lh_table_free</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t)</td></tr>
104 <tr class="separator:a81653acf740cf8c9fe672e6cd16df0cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
105 <tr class="memitem:a22b897763cc34a98c21c7fe82d151004"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a22b897763cc34a98c21c7fe82d151004">lh_table_insert</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, void *k, const void *v)</td></tr>
106 <tr class="separator:a22b897763cc34a98c21c7fe82d151004"><td class="memSeparator" colspan="2">&#160;</td></tr>
107 <tr class="memitem:ad3b6ca2d967a6c3021ee6c39e014a918"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlh__entry.html">lh_entry</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ad3b6ca2d967a6c3021ee6c39e014a918">lh_table_lookup_entry</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, const void *k)</td></tr>
108 <tr class="separator:ad3b6ca2d967a6c3021ee6c39e014a918"><td class="memSeparator" colspan="2">&#160;</td></tr>
109 <tr class="memitem:a849aa0ce9fe550c16ce81a215b1765ad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a849aa0ce9fe550c16ce81a215b1765ad">THIS_FUNCTION_IS_DEPRECATED</a> (extern const void *lh_table_lookup(struct <a class="el" href="structlh__table.html">lh_table</a> *t, const void *k))</td></tr>
110 <tr class="separator:a849aa0ce9fe550c16ce81a215b1765ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
111 <tr class="memitem:a81c270bb0dd9d5c8a3e7ae20bc4d67f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="json__object_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a81c270bb0dd9d5c8a3e7ae20bc4d67f3">lh_table_lookup_ex</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, const void *k, void **v)</td></tr>
112 <tr class="separator:a81c270bb0dd9d5c8a3e7ae20bc4d67f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
113 <tr class="memitem:ae5885a71c3457190fb1dc2d6e20dde3b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ae5885a71c3457190fb1dc2d6e20dde3b">lh_table_delete_entry</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, struct <a class="el" href="structlh__entry.html">lh_entry</a> *e)</td></tr>
114 <tr class="separator:ae5885a71c3457190fb1dc2d6e20dde3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
115 <tr class="memitem:a2fed2c78f70d229edb2d00775ffe593c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a2fed2c78f70d229edb2d00775ffe593c">lh_table_delete</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, const void *k)</td></tr>
116 <tr class="separator:a2fed2c78f70d229edb2d00775ffe593c"><td class="memSeparator" colspan="2">&#160;</td></tr>
117 <tr class="memitem:ac9ba631c91fe80fb905f04c7cd526f2b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#ac9ba631c91fe80fb905f04c7cd526f2b">lh_table_length</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t)</td></tr>
118 <tr class="separator:ac9ba631c91fe80fb905f04c7cd526f2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
119 <tr class="memitem:a1294160fa0e80cee04cd745a401f43a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a1294160fa0e80cee04cd745a401f43a4">lh_abort</a> (const char *msg,...)</td></tr>
120 <tr class="separator:a1294160fa0e80cee04cd745a401f43a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
121 <tr class="memitem:a5322eccf3394af7dc1ebb22af8f8c562"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linkhash_8h.html#a5322eccf3394af7dc1ebb22af8f8c562">lh_table_resize</a> (struct <a class="el" href="structlh__table.html">lh_table</a> *t, int new_size)</td></tr>
122 <tr class="separator:a5322eccf3394af7dc1ebb22af8f8c562"><td class="memSeparator" colspan="2">&#160;</td></tr>
123 </table>
124 <h2 class="groupheader">Macro Definition Documentation</h2>
125 <a class="anchor" id="a93fad7f8ae44575dc89c9567859972d2"></a>
126 <div class="memitem">
127 <div class="memproto">
128       <table class="memname">
129         <tr>
130           <td class="memname">#define LH_EMPTY&#160;&#160;&#160;(void*)-1</td>
131         </tr>
132       </table>
133 </div><div class="memdoc">
134 <p>sentinel pointer value for empty slots </p>
135
136 </div>
137 </div>
138 <a class="anchor" id="ad7dd67da915065dce2c6f44cb03e2d82"></a>
139 <div class="memitem">
140 <div class="memproto">
141       <table class="memname">
142         <tr>
143           <td class="memname">#define lh_foreach</td>
144           <td>(</td>
145           <td class="paramtype">&#160;</td>
146           <td class="paramname">table, </td>
147         </tr>
148         <tr>
149           <td class="paramkey"></td>
150           <td></td>
151           <td class="paramtype">&#160;</td>
152           <td class="paramname">entry&#160;</td>
153         </tr>
154         <tr>
155           <td></td>
156           <td>)</td>
157           <td></td><td>&#160;&#160;&#160;for(entry = table-&gt;head; entry; entry = entry-&gt;next)</td>
158         </tr>
159       </table>
160 </div><div class="memdoc">
161 <p>Convenience list iterator. </p>
162
163 </div>
164 </div>
165 <a class="anchor" id="abcbb0df08b4976d0649b826b6bacfca1"></a>
166 <div class="memitem">
167 <div class="memproto">
168       <table class="memname">
169         <tr>
170           <td class="memname">#define lh_foreach_safe</td>
171           <td>(</td>
172           <td class="paramtype">&#160;</td>
173           <td class="paramname">table, </td>
174         </tr>
175         <tr>
176           <td class="paramkey"></td>
177           <td></td>
178           <td class="paramtype">&#160;</td>
179           <td class="paramname">entry, </td>
180         </tr>
181         <tr>
182           <td class="paramkey"></td>
183           <td></td>
184           <td class="paramtype">&#160;</td>
185           <td class="paramname">tmp&#160;</td>
186         </tr>
187         <tr>
188           <td></td>
189           <td>)</td>
190           <td></td><td>&#160;&#160;&#160;for(entry = table-&gt;head; entry &amp;&amp; ((tmp = entry-&gt;next) || 1); entry = tmp)</td>
191         </tr>
192       </table>
193 </div><div class="memdoc">
194 <p>lh_foreach_safe allows calling of deletion routine while iterating. </p>
195
196 </div>
197 </div>
198 <a class="anchor" id="ac69428f2de0a6fb080b6fb373d506aa7"></a>
199 <div class="memitem">
200 <div class="memproto">
201       <table class="memname">
202         <tr>
203           <td class="memname">#define LH_FREED&#160;&#160;&#160;(void*)-2</td>
204         </tr>
205       </table>
206 </div><div class="memdoc">
207 <p>sentinel pointer value for freed slots </p>
208
209 </div>
210 </div>
211 <a class="anchor" id="a66b61772c29d85eb52b697e0b0dc0aaf"></a>
212 <div class="memitem">
213 <div class="memproto">
214       <table class="memname">
215         <tr>
216           <td class="memname">#define LH_LOAD_FACTOR&#160;&#160;&#160;0.66</td>
217         </tr>
218       </table>
219 </div><div class="memdoc">
220 <p>The fraction of filled hash buckets until an insert will cause the table to be resized. This can range from just above 0 up to 1.0. </p>
221
222 </div>
223 </div>
224 <a class="anchor" id="a032f1bd115df254dda325437203ce5fb"></a>
225 <div class="memitem">
226 <div class="memproto">
227       <table class="memname">
228         <tr>
229           <td class="memname">#define LH_PRIME&#160;&#160;&#160;0x9e370001UL</td>
230         </tr>
231       </table>
232 </div><div class="memdoc">
233 <p>golden prime used in hash functions </p>
234
235 </div>
236 </div>
237 <h2 class="groupheader">Typedef Documentation</h2>
238 <a class="anchor" id="a0c6811f660b93857aafdbfdf80d9696b"></a>
239 <div class="memitem">
240 <div class="memproto">
241       <table class="memname">
242         <tr>
243           <td class="memname">typedef void( lh_entry_free_fn) (struct <a class="el" href="structlh__entry.html">lh_entry</a> *e)</td>
244         </tr>
245       </table>
246 </div><div class="memdoc">
247 <p>callback function prototypes </p>
248
249 </div>
250 </div>
251 <a class="anchor" id="abcbf0e4849fb0c6279827ac3b66d15c3"></a>
252 <div class="memitem">
253 <div class="memproto">
254       <table class="memname">
255         <tr>
256           <td class="memname">typedef int( lh_equal_fn) (const void *k1, const void *k2)</td>
257         </tr>
258       </table>
259 </div><div class="memdoc">
260 <p>callback function prototypes </p>
261
262 </div>
263 </div>
264 <a class="anchor" id="a1780449146b716ad5e6ed0a0207d0417"></a>
265 <div class="memitem">
266 <div class="memproto">
267       <table class="memname">
268         <tr>
269           <td class="memname">typedef unsigned long( lh_hash_fn) (const void *k)</td>
270         </tr>
271       </table>
272 </div><div class="memdoc">
273 <p>callback function prototypes </p>
274
275 </div>
276 </div>
277 <h2 class="groupheader">Function Documentation</h2>
278 <a class="anchor" id="a1294160fa0e80cee04cd745a401f43a4"></a>
279 <div class="memitem">
280 <div class="memproto">
281       <table class="memname">
282         <tr>
283           <td class="memname">void lh_abort </td>
284           <td>(</td>
285           <td class="paramtype">const char *&#160;</td>
286           <td class="paramname"><em>msg</em>, </td>
287         </tr>
288         <tr>
289           <td class="paramkey"></td>
290           <td></td>
291           <td class="paramtype">&#160;</td>
292           <td class="paramname"><em>...</em>&#160;</td>
293         </tr>
294         <tr>
295           <td></td>
296           <td>)</td>
297           <td></td><td></td>
298         </tr>
299       </table>
300 </div><div class="memdoc">
301
302 </div>
303 </div>
304 <a class="anchor" id="ae4e9f21fb1a556c7a50c6b7ea61f2079"></a>
305 <div class="memitem">
306 <div class="memproto">
307       <table class="memname">
308         <tr>
309           <td class="memname">int lh_char_equal </td>
310           <td>(</td>
311           <td class="paramtype">const void *&#160;</td>
312           <td class="paramname"><em>k1</em>, </td>
313         </tr>
314         <tr>
315           <td class="paramkey"></td>
316           <td></td>
317           <td class="paramtype">const void *&#160;</td>
318           <td class="paramname"><em>k2</em>&#160;</td>
319         </tr>
320         <tr>
321           <td></td>
322           <td>)</td>
323           <td></td><td></td>
324         </tr>
325       </table>
326 </div><div class="memdoc">
327
328 </div>
329 </div>
330 <a class="anchor" id="a1fcf495b9c4ce169630cb31f638b8435"></a>
331 <div class="memitem">
332 <div class="memproto">
333       <table class="memname">
334         <tr>
335           <td class="memname">unsigned long lh_char_hash </td>
336           <td>(</td>
337           <td class="paramtype">const void *&#160;</td>
338           <td class="paramname"><em>k</em></td><td>)</td>
339           <td></td>
340         </tr>
341       </table>
342 </div><div class="memdoc">
343
344 </div>
345 </div>
346 <a class="anchor" id="a0aaf11e11ee5b0925279a52eab04bc38"></a>
347 <div class="memitem">
348 <div class="memproto">
349       <table class="memname">
350         <tr>
351           <td class="memname">struct <a class="el" href="structlh__table.html">lh_table</a>* lh_kchar_table_new </td>
352           <td>(</td>
353           <td class="paramtype">int&#160;</td>
354           <td class="paramname"><em>size</em>, </td>
355         </tr>
356         <tr>
357           <td class="paramkey"></td>
358           <td></td>
359           <td class="paramtype">const char *&#160;</td>
360           <td class="paramname"><em>name</em>, </td>
361         </tr>
362         <tr>
363           <td class="paramkey"></td>
364           <td></td>
365           <td class="paramtype"><a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *&#160;</td>
366           <td class="paramname"><em>free_fn</em>&#160;</td>
367         </tr>
368         <tr>
369           <td></td>
370           <td>)</td>
371           <td></td><td></td>
372         </tr>
373       </table>
374 </div><div class="memdoc">
375 <p>Convenience function to create a new linkhash table with char keys. </p><dl class="params"><dt>Parameters</dt><dd>
376   <table class="params">
377     <tr><td class="paramname">size</td><td>initial table size. </td></tr>
378     <tr><td class="paramname">name</td><td>table name. </td></tr>
379     <tr><td class="paramname">free_fn</td><td>callback function used to free memory for entries. </td></tr>
380   </table>
381   </dd>
382 </dl>
383 <dl class="section return"><dt>Returns</dt><dd>a pointer onto the linkhash table. </dd></dl>
384
385 </div>
386 </div>
387 <a class="anchor" id="a705513954267a16cc1d40a284a7c441e"></a>
388 <div class="memitem">
389 <div class="memproto">
390       <table class="memname">
391         <tr>
392           <td class="memname">struct <a class="el" href="structlh__table.html">lh_table</a>* lh_kptr_table_new </td>
393           <td>(</td>
394           <td class="paramtype">int&#160;</td>
395           <td class="paramname"><em>size</em>, </td>
396         </tr>
397         <tr>
398           <td class="paramkey"></td>
399           <td></td>
400           <td class="paramtype">const char *&#160;</td>
401           <td class="paramname"><em>name</em>, </td>
402         </tr>
403         <tr>
404           <td class="paramkey"></td>
405           <td></td>
406           <td class="paramtype"><a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *&#160;</td>
407           <td class="paramname"><em>free_fn</em>&#160;</td>
408         </tr>
409         <tr>
410           <td></td>
411           <td>)</td>
412           <td></td><td></td>
413         </tr>
414       </table>
415 </div><div class="memdoc">
416 <p>Convenience function to create a new linkhash table with ptr keys. </p><dl class="params"><dt>Parameters</dt><dd>
417   <table class="params">
418     <tr><td class="paramname">size</td><td>initial table size. </td></tr>
419     <tr><td class="paramname">name</td><td>table name. </td></tr>
420     <tr><td class="paramname">free_fn</td><td>callback function used to free memory for entries. </td></tr>
421   </table>
422   </dd>
423 </dl>
424 <dl class="section return"><dt>Returns</dt><dd>a pointer onto the linkhash table. </dd></dl>
425
426 </div>
427 </div>
428 <a class="anchor" id="a6ce3cb97560072c40f5caeaba85f756a"></a>
429 <div class="memitem">
430 <div class="memproto">
431       <table class="memname">
432         <tr>
433           <td class="memname">int lh_ptr_equal </td>
434           <td>(</td>
435           <td class="paramtype">const void *&#160;</td>
436           <td class="paramname"><em>k1</em>, </td>
437         </tr>
438         <tr>
439           <td class="paramkey"></td>
440           <td></td>
441           <td class="paramtype">const void *&#160;</td>
442           <td class="paramname"><em>k2</em>&#160;</td>
443         </tr>
444         <tr>
445           <td></td>
446           <td>)</td>
447           <td></td><td></td>
448         </tr>
449       </table>
450 </div><div class="memdoc">
451
452 </div>
453 </div>
454 <a class="anchor" id="a2e560f0d3e5a20f6b0bfa4049737db23"></a>
455 <div class="memitem">
456 <div class="memproto">
457       <table class="memname">
458         <tr>
459           <td class="memname">unsigned long lh_ptr_hash </td>
460           <td>(</td>
461           <td class="paramtype">const void *&#160;</td>
462           <td class="paramname"><em>k</em></td><td>)</td>
463           <td></td>
464         </tr>
465       </table>
466 </div><div class="memdoc">
467 <p>Pre-defined hash and equality functions </p>
468
469 </div>
470 </div>
471 <a class="anchor" id="a2fed2c78f70d229edb2d00775ffe593c"></a>
472 <div class="memitem">
473 <div class="memproto">
474       <table class="memname">
475         <tr>
476           <td class="memname">int lh_table_delete </td>
477           <td>(</td>
478           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
479           <td class="paramname"><em>t</em>, </td>
480         </tr>
481         <tr>
482           <td class="paramkey"></td>
483           <td></td>
484           <td class="paramtype">const void *&#160;</td>
485           <td class="paramname"><em>k</em>&#160;</td>
486         </tr>
487         <tr>
488           <td></td>
489           <td>)</td>
490           <td></td><td></td>
491         </tr>
492       </table>
493 </div><div class="memdoc">
494 <p>Delete a record from the table. If a callback free function is provided then it is called for the for the item being deleted. </p><dl class="params"><dt>Parameters</dt><dd>
495   <table class="params">
496     <tr><td class="paramname">t</td><td>the table to delete from. </td></tr>
497     <tr><td class="paramname">k</td><td>a pointer to the key to delete. </td></tr>
498   </table>
499   </dd>
500 </dl>
501 <dl class="section return"><dt>Returns</dt><dd>0 if the item was deleted. </dd>
502 <dd>
503 -1 if it was not found. </dd></dl>
504
505 </div>
506 </div>
507 <a class="anchor" id="ae5885a71c3457190fb1dc2d6e20dde3b"></a>
508 <div class="memitem">
509 <div class="memproto">
510       <table class="memname">
511         <tr>
512           <td class="memname">int lh_table_delete_entry </td>
513           <td>(</td>
514           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
515           <td class="paramname"><em>t</em>, </td>
516         </tr>
517         <tr>
518           <td class="paramkey"></td>
519           <td></td>
520           <td class="paramtype">struct <a class="el" href="structlh__entry.html">lh_entry</a> *&#160;</td>
521           <td class="paramname"><em>e</em>&#160;</td>
522         </tr>
523         <tr>
524           <td></td>
525           <td>)</td>
526           <td></td><td></td>
527         </tr>
528       </table>
529 </div><div class="memdoc">
530 <p>Delete a record from the table. If a callback free function is provided then it is called for the for the item being deleted. </p><dl class="params"><dt>Parameters</dt><dd>
531   <table class="params">
532     <tr><td class="paramname">t</td><td>the table to delete from. </td></tr>
533     <tr><td class="paramname">e</td><td>a pointer to the entry to delete. </td></tr>
534   </table>
535   </dd>
536 </dl>
537 <dl class="section return"><dt>Returns</dt><dd>0 if the item was deleted. </dd>
538 <dd>
539 -1 if it was not found. </dd></dl>
540
541 </div>
542 </div>
543 <a class="anchor" id="a81653acf740cf8c9fe672e6cd16df0cf"></a>
544 <div class="memitem">
545 <div class="memproto">
546       <table class="memname">
547         <tr>
548           <td class="memname">void lh_table_free </td>
549           <td>(</td>
550           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
551           <td class="paramname"><em>t</em></td><td>)</td>
552           <td></td>
553         </tr>
554       </table>
555 </div><div class="memdoc">
556 <p>Free a linkhash table. If a callback free function is provided then it is called for all entries in the table. </p><dl class="params"><dt>Parameters</dt><dd>
557   <table class="params">
558     <tr><td class="paramname">t</td><td>table to free. </td></tr>
559   </table>
560   </dd>
561 </dl>
562
563 </div>
564 </div>
565 <a class="anchor" id="a22b897763cc34a98c21c7fe82d151004"></a>
566 <div class="memitem">
567 <div class="memproto">
568       <table class="memname">
569         <tr>
570           <td class="memname">int lh_table_insert </td>
571           <td>(</td>
572           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
573           <td class="paramname"><em>t</em>, </td>
574         </tr>
575         <tr>
576           <td class="paramkey"></td>
577           <td></td>
578           <td class="paramtype">void *&#160;</td>
579           <td class="paramname"><em>k</em>, </td>
580         </tr>
581         <tr>
582           <td class="paramkey"></td>
583           <td></td>
584           <td class="paramtype">const void *&#160;</td>
585           <td class="paramname"><em>v</em>&#160;</td>
586         </tr>
587         <tr>
588           <td></td>
589           <td>)</td>
590           <td></td><td></td>
591         </tr>
592       </table>
593 </div><div class="memdoc">
594 <p>Insert a record into the table. </p><dl class="params"><dt>Parameters</dt><dd>
595   <table class="params">
596     <tr><td class="paramname">t</td><td>the table to insert into. </td></tr>
597     <tr><td class="paramname">k</td><td>a pointer to the key to insert. </td></tr>
598     <tr><td class="paramname">v</td><td>a pointer to the value to insert. </td></tr>
599   </table>
600   </dd>
601 </dl>
602
603 </div>
604 </div>
605 <a class="anchor" id="ac9ba631c91fe80fb905f04c7cd526f2b"></a>
606 <div class="memitem">
607 <div class="memproto">
608       <table class="memname">
609         <tr>
610           <td class="memname">int lh_table_length </td>
611           <td>(</td>
612           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
613           <td class="paramname"><em>t</em></td><td>)</td>
614           <td></td>
615         </tr>
616       </table>
617 </div><div class="memdoc">
618
619 </div>
620 </div>
621 <a class="anchor" id="ad3b6ca2d967a6c3021ee6c39e014a918"></a>
622 <div class="memitem">
623 <div class="memproto">
624       <table class="memname">
625         <tr>
626           <td class="memname">struct <a class="el" href="structlh__entry.html">lh_entry</a>* lh_table_lookup_entry </td>
627           <td>(</td>
628           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
629           <td class="paramname"><em>t</em>, </td>
630         </tr>
631         <tr>
632           <td class="paramkey"></td>
633           <td></td>
634           <td class="paramtype">const void *&#160;</td>
635           <td class="paramname"><em>k</em>&#160;</td>
636         </tr>
637         <tr>
638           <td></td>
639           <td>)</td>
640           <td></td><td></td>
641         </tr>
642       </table>
643 </div><div class="memdoc">
644 <p>Lookup a record into the table. </p><dl class="params"><dt>Parameters</dt><dd>
645   <table class="params">
646     <tr><td class="paramname">t</td><td>the table to lookup </td></tr>
647     <tr><td class="paramname">k</td><td>a pointer to the key to lookup </td></tr>
648   </table>
649   </dd>
650 </dl>
651 <dl class="section return"><dt>Returns</dt><dd>a pointer to the record structure of the value or NULL if it does not exist. </dd></dl>
652
653 </div>
654 </div>
655 <a class="anchor" id="a81c270bb0dd9d5c8a3e7ae20bc4d67f3"></a>
656 <div class="memitem">
657 <div class="memproto">
658       <table class="memname">
659         <tr>
660           <td class="memname"><a class="el" href="json__object_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> lh_table_lookup_ex </td>
661           <td>(</td>
662           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
663           <td class="paramname"><em>t</em>, </td>
664         </tr>
665         <tr>
666           <td class="paramkey"></td>
667           <td></td>
668           <td class="paramtype">const void *&#160;</td>
669           <td class="paramname"><em>k</em>, </td>
670         </tr>
671         <tr>
672           <td class="paramkey"></td>
673           <td></td>
674           <td class="paramtype">void **&#160;</td>
675           <td class="paramname"><em>v</em>&#160;</td>
676         </tr>
677         <tr>
678           <td></td>
679           <td>)</td>
680           <td></td><td></td>
681         </tr>
682       </table>
683 </div><div class="memdoc">
684 <p>Lookup a record in the table </p><dl class="params"><dt>Parameters</dt><dd>
685   <table class="params">
686     <tr><td class="paramname">t</td><td>the table to lookup </td></tr>
687     <tr><td class="paramname">k</td><td>a pointer to the key to lookup </td></tr>
688     <tr><td class="paramname">v</td><td>a pointer to a where to store the found value (set to NULL if it doesn't exist). </td></tr>
689   </table>
690   </dd>
691 </dl>
692 <dl class="section return"><dt>Returns</dt><dd>whether or not the key was found </dd></dl>
693
694 </div>
695 </div>
696 <a class="anchor" id="ac3ba464ac43c083397b1f1d34f2ddf55"></a>
697 <div class="memitem">
698 <div class="memproto">
699       <table class="memname">
700         <tr>
701           <td class="memname">struct <a class="el" href="structlh__table.html">lh_table</a>* lh_table_new </td>
702           <td>(</td>
703           <td class="paramtype">int&#160;</td>
704           <td class="paramname"><em>size</em>, </td>
705         </tr>
706         <tr>
707           <td class="paramkey"></td>
708           <td></td>
709           <td class="paramtype">const char *&#160;</td>
710           <td class="paramname"><em>name</em>, </td>
711         </tr>
712         <tr>
713           <td class="paramkey"></td>
714           <td></td>
715           <td class="paramtype"><a class="el" href="linkhash_8h.html#a0c6811f660b93857aafdbfdf80d9696b">lh_entry_free_fn</a> *&#160;</td>
716           <td class="paramname"><em>free_fn</em>, </td>
717         </tr>
718         <tr>
719           <td class="paramkey"></td>
720           <td></td>
721           <td class="paramtype"><a class="el" href="linkhash_8h.html#a1780449146b716ad5e6ed0a0207d0417">lh_hash_fn</a> *&#160;</td>
722           <td class="paramname"><em>hash_fn</em>, </td>
723         </tr>
724         <tr>
725           <td class="paramkey"></td>
726           <td></td>
727           <td class="paramtype"><a class="el" href="linkhash_8h.html#abcbf0e4849fb0c6279827ac3b66d15c3">lh_equal_fn</a> *&#160;</td>
728           <td class="paramname"><em>equal_fn</em>&#160;</td>
729         </tr>
730         <tr>
731           <td></td>
732           <td>)</td>
733           <td></td><td></td>
734         </tr>
735       </table>
736 </div><div class="memdoc">
737 <p>Create a new linkhash table. </p><dl class="params"><dt>Parameters</dt><dd>
738   <table class="params">
739     <tr><td class="paramname">size</td><td>initial table size. The table is automatically resized although this incurs a performance penalty. </td></tr>
740     <tr><td class="paramname">name</td><td>the table name. </td></tr>
741     <tr><td class="paramname">free_fn</td><td>callback function used to free memory for entries when lh_table_free or lh_table_delete is called. If NULL is provided, then memory for keys and values must be freed by the caller. </td></tr>
742     <tr><td class="paramname">hash_fn</td><td>function used to hash keys. 2 standard ones are defined: lh_ptr_hash and lh_char_hash for hashing pointer values and C strings respectively. </td></tr>
743     <tr><td class="paramname">equal_fn</td><td>comparison function to compare keys. 2 standard ones defined: lh_ptr_hash and lh_char_hash for comparing pointer values and C strings respectively. </td></tr>
744   </table>
745   </dd>
746 </dl>
747 <dl class="section return"><dt>Returns</dt><dd>a pointer onto the linkhash table. </dd></dl>
748
749 </div>
750 </div>
751 <a class="anchor" id="a5322eccf3394af7dc1ebb22af8f8c562"></a>
752 <div class="memitem">
753 <div class="memproto">
754       <table class="memname">
755         <tr>
756           <td class="memname">void lh_table_resize </td>
757           <td>(</td>
758           <td class="paramtype">struct <a class="el" href="structlh__table.html">lh_table</a> *&#160;</td>
759           <td class="paramname"><em>t</em>, </td>
760         </tr>
761         <tr>
762           <td class="paramkey"></td>
763           <td></td>
764           <td class="paramtype">int&#160;</td>
765           <td class="paramname"><em>new_size</em>&#160;</td>
766         </tr>
767         <tr>
768           <td></td>
769           <td>)</td>
770           <td></td><td></td>
771         </tr>
772       </table>
773 </div><div class="memdoc">
774
775 </div>
776 </div>
777 <a class="anchor" id="a849aa0ce9fe550c16ce81a215b1765ad"></a>
778 <div class="memitem">
779 <div class="memproto">
780       <table class="memname">
781         <tr>
782           <td class="memname">THIS_FUNCTION_IS_DEPRECATED </td>
783           <td>(</td>
784           <td class="paramtype">extern const void *&#160;</td>
785           <td class="paramname"><em>lh_table_lookup</em>struct lh_table *t, const void *k</td><td>)</td>
786           <td></td>
787         </tr>
788       </table>
789 </div><div class="memdoc">
790 <p>Lookup a record into the table </p><dl class="params"><dt>Parameters</dt><dd>
791   <table class="params">
792     <tr><td class="paramname">t</td><td>the table to lookup </td></tr>
793     <tr><td class="paramname">k</td><td>a pointer to the key to lookup </td></tr>
794   </table>
795   </dd>
796 </dl>
797 <dl class="section return"><dt>Returns</dt><dd>a pointer to the found value or NULL if it does not exist. </dd></dl>
798 <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Use lh_table_lookup_ex instead. </dd></dl>
799
800 </div>
801 </div>
802 </div><!-- contents -->
803 <!-- start footer part -->
804 <hr class="footer"/><address class="footer"><small>
805 Generated on Tue Jun 7 2016 17:51:50 for json-c by &#160;<a href="http://www.doxygen.org/index.html">
806 <img class="footer" src="doxygen.png" alt="doxygen"/>
807 </a> 1.8.9.1
808 </small></address>
809 </body>
810 </html>