libxml-hash.html revision 2fdbd32d514c8b9d166a80564aca3426ec9cfdb2
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>hash</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
2        .synopsis, .classsynopsis {
3            background: #eeeeee;
4            border: solid 1px #aaaaaa;
5            padding: 0.5em;
6        }
7        .programlisting {
8            background: #eeeeff;
9            border: solid 1px #aaaaff;
10            padding: 0.5em;
11        }
12        .variablelist {
13            padding: 4px;
14            margin-left: 3em;
15        }
16        .navigation {
17            background: #ffeeee;
18            border: solid 1px #ffaaaa;
19            margin-top: 0.5em;
20            margin-bottom: 0.5em;
21        }
22        .navigation a {
23            color: #770000;
24        }
25        .navigation a:visited {
26            color: #550000;
27        }
28        .navigation .title {
29            font-size: 200%;
30        }
31      </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-encoding.html" title="encoding"><link rel="next" href="libxml-debugXML.html" title="debugXML"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-encoding.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-debugXML.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-hash"></a><div class="titlepage"></div><div class="refnamediv"><h2>hash</h2><p>hash &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
33
34
35struct      <a href="libxml-hash.html#xmlHashTable">xmlHashTable</a>;
36typedef     <a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>;
37void        (<a href="libxml-hash.html#xmlHashDeallocator">*xmlHashDeallocator</a>)           (void *payload,
38                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
39void*       (<a href="libxml-hash.html#xmlHashCopier">*xmlHashCopier</a>)                (void *payload,
40                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
41void        (<a href="libxml-hash.html#xmlHashScanner">*xmlHashScanner</a>)               (void *payload,
42                                             void *data,
43                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
44void        (<a href="libxml-hash.html#xmlHashScannerFull">*xmlHashScannerFull</a>)           (void *payload,
45                                             void *data,
46                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
47                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
48                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3);
49<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> <a href="libxml-hash.html#xmlHashCreate">xmlHashCreate</a>               (int size);
50void        <a href="libxml-hash.html#xmlHashFree">xmlHashFree</a>                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
51                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
52int         <a href="libxml-hash.html#xmlHashAddEntry">xmlHashAddEntry</a>                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
53                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
54                                             void *userdata);
55int         <a href="libxml-hash.html#xmlHashUpdateEntry">xmlHashUpdateEntry</a>              (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
56                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
57                                             void *userdata,
58                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
59int         <a href="libxml-hash.html#xmlHashAddEntry2">xmlHashAddEntry2</a>                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
60                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
61                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
62                                             void *userdata);
63int         <a href="libxml-hash.html#xmlHashUpdateEntry2">xmlHashUpdateEntry2</a>             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
64                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
65                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
66                                             void *userdata,
67                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
68int         <a href="libxml-hash.html#xmlHashAddEntry3">xmlHashAddEntry3</a>                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
69                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
70                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
71                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
72                                             void *userdata);
73int         <a href="libxml-hash.html#xmlHashUpdateEntry3">xmlHashUpdateEntry3</a>             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
74                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
75                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
76                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
77                                             void *userdata,
78                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
79int         <a href="libxml-hash.html#xmlHashRemoveEntry">xmlHashRemoveEntry</a>              (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
80                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
81                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
82int         <a href="libxml-hash.html#xmlHashRemoveEntry2">xmlHashRemoveEntry2</a>             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
83                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
84                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
85                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
86int         <a href="libxml-hash.html#xmlHashRemoveEntry3">xmlHashRemoveEntry3</a>             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
87                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
88                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
89                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
90                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);
91void*       <a href="libxml-hash.html#xmlHashLookup">xmlHashLookup</a>                   (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
92                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
93void*       <a href="libxml-hash.html#xmlHashLookup2">xmlHashLookup2</a>                  (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
94                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
95                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2);
96void*       <a href="libxml-hash.html#xmlHashLookup3">xmlHashLookup3</a>                  (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
97                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
98                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
99                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3);
100<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> <a href="libxml-hash.html#xmlHashCopy">xmlHashCopy</a>                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
101                                             <a href="libxml-hash.html#xmlHashCopier">xmlHashCopier</a> f);
102int         <a href="libxml-hash.html#xmlHashSize">xmlHashSize</a>                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table);
103void        <a href="libxml-hash.html#xmlHashScan">xmlHashScan</a>                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
104                                             <a href="libxml-hash.html#xmlHashScanner">xmlHashScanner</a> f,
105                                             void *data);
106void        <a href="libxml-hash.html#xmlHashScan3">xmlHashScan3</a>                    (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
107                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
108                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
109                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
110                                             <a href="libxml-hash.html#xmlHashScanner">xmlHashScanner</a> f,
111                                             void *data);
112void        <a href="libxml-hash.html#xmlHashScanFull">xmlHashScanFull</a>                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
113                                             <a href="libxml-hash.html#xmlHashScannerFull">xmlHashScannerFull</a> f,
114                                             void *data);
115void        <a href="libxml-hash.html#xmlHashScanFull3">xmlHashScanFull3</a>                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
116                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
117                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
118                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
119                                             <a href="libxml-hash.html#xmlHashScannerFull">xmlHashScannerFull</a> f,
120                                             void *data);
121</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
122
123</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlHashTable"></a>struct xmlHashTable</h3><pre class="programlisting">struct xmlHashTable;</pre><p>
124
125</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashTablePtr"></a>xmlHashTablePtr</h3><pre class="programlisting">typedef xmlHashTable *xmlHashTablePtr;
126</pre><p>
127
128</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashDeallocator"></a>xmlHashDeallocator ()</h3><pre class="programlisting">void        (*xmlHashDeallocator)           (void *payload,
129                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
130Callback to free data from a hash.</p><p>
131
132</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>payload</tt></i>�:</span></td><td>  the data in the hash
133</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td>  the name associated
134</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashCopier"></a>xmlHashCopier ()</h3><pre class="programlisting">void*       (*xmlHashCopier)                (void *payload,
135                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
136Callback to copy data from a hash.</p><p>
137
138</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>payload</tt></i>�:</span></td><td>  the data in the hash
139</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td>  the name associated
140</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScanner"></a>xmlHashScanner ()</h3><pre class="programlisting">void        (*xmlHashScanner)               (void *payload,
141                                             void *data,
142                                             <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
143Callback when scanning data in a hash with the simple scanner.</p><p>
144
145</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>payload</tt></i>�:</span></td><td>  the data in the hash
146</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra scannner data
147</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td>  the name associated
148</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScannerFull"></a>xmlHashScannerFull ()</h3><pre class="programlisting">void        (*xmlHashScannerFull)           (void *payload,
149                                             void *data,
150                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
151                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
152                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3);</pre><p>
153Callback when scanning data in a hash with the full scanner.</p><p>
154
155</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>payload</tt></i>�:</span></td><td>  the data in the hash
156</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra scannner data
157</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td>  the name associated
158</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td>  the second name associated
159</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td>  the third name associated
160</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashCreate"></a>xmlHashCreate ()</h3><pre class="programlisting"><a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> xmlHashCreate               (int size);</pre><p>
161Create a new xmlHashTablePtr.</p><p>
162
163</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i>�:</span></td><td> the size of the hash table
164</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the newly created object, or NULL if an error occured.
165</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashFree"></a>xmlHashFree ()</h3><pre class="programlisting">void        xmlHashFree                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
166                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
167Free the hash <i><tt>table</tt></i> and its contents. The userdata is
168deallocated with <i><tt>f</tt></i> if provided.</p><p>
169
170</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
171</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the deallocator function for items in the hash
172</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashAddEntry"></a>xmlHashAddEntry ()</h3><pre class="programlisting">int         xmlHashAddEntry                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
173                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
174                                             void *userdata);</pre><p>
175Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
176by using the <i><tt>name</tt></i>. Duplicate names generate errors.</p><p>
177
178</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
179</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
180</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
181</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
182</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashUpdateEntry"></a>xmlHashUpdateEntry ()</h3><pre class="programlisting">int         xmlHashUpdateEntry              (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
183                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
184                                             void *userdata,
185                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
186Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
187by using the <i><tt>name</tt></i>. Existing entry for this <i><tt>name</tt></i> will be removed
188and freed with <i><tt>f</tt></i> if found.</p><p>
189
190</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
191</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
192</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
193</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for replaced item (if any)
194</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
195</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashAddEntry2"></a>xmlHashAddEntry2 ()</h3><pre class="programlisting">int         xmlHashAddEntry2                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
196                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
197                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
198                                             void *userdata);</pre><p>
199Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
200by using the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>) tuple. Duplicate tuples generate errors.</p><p>
201
202</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
203</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
204</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
205</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
206</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
207</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashUpdateEntry2"></a>xmlHashUpdateEntry2 ()</h3><pre class="programlisting">int         xmlHashUpdateEntry2             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
208                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
209                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
210                                             void *userdata,
211                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
212Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
213by using the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>) tuple. Existing entry for this tuple will
214be removed and freed with <i><tt>f</tt></i> if found.</p><p>
215
216</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
217</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
218</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
219</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
220</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for replaced item (if any)
221</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
222</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashAddEntry3"></a>xmlHashAddEntry3 ()</h3><pre class="programlisting">int         xmlHashAddEntry3                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
223                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
224                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
225                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
226                                             void *userdata);</pre><p>
227Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
228by using the tuple (<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>). Duplicate entries generate
229errors.</p><p>
230
231</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
232</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
233</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
234</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata
235</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
236</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
237</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashUpdateEntry3"></a>xmlHashUpdateEntry3 ()</h3><pre class="programlisting">int         xmlHashUpdateEntry3             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
238                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
239                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
240                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
241                                             void *userdata,
242                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
243Add the <i><tt>userdata</tt></i> to the hash <i><tt>table</tt></i>. This can later be retrieved
244by using the tuple (<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>). Existing entry for this tuple
245will be removed and freed with <i><tt>f</tt></i> if found.</p><p>
246
247</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
248</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
249</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
250</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata
251</td></tr><tr><td><span class="term"><i><tt>userdata</tt></i>�:</span></td><td> a pointer to the userdata
252</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for replaced item (if any)
253</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 the addition succeeded and -1 in case of error.
254</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashRemoveEntry"></a>xmlHashRemoveEntry ()</h3><pre class="programlisting">int         xmlHashRemoveEntry              (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
255                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
256                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
257Find the userdata specified by the <i><tt>name</tt></i> and remove
258it from the hash <i><tt>table</tt></i>. Existing userdata for this tuple will be removed
259and freed with <i><tt>f</tt></i>.</p><p>
260
261</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
262</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
263</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for removed item (if any)
264</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the removal succeeded and -1 in case of error or not found.
265</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashRemoveEntry2"></a>xmlHashRemoveEntry2 ()</h3><pre class="programlisting">int         xmlHashRemoveEntry2             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
266                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
267                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
268                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
269Find the userdata specified by the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>) tuple and remove
270it from the hash <i><tt>table</tt></i>. Existing userdata for this tuple will be removed
271and freed with <i><tt>f</tt></i>.</p><p>
272
273</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
274</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
275</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
276</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for removed item (if any)
277</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the removal succeeded and -1 in case of error or not found.
278</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashRemoveEntry3"></a>xmlHashRemoveEntry3 ()</h3><pre class="programlisting">int         xmlHashRemoveEntry3             (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
279                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
280                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
281                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
282                                             <a href="libxml-hash.html#xmlHashDeallocator">xmlHashDeallocator</a> f);</pre><p>
283Find the userdata specified by the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>) tuple and remove
284it from the hash <i><tt>table</tt></i>. Existing userdata for this tuple will be removed
285and freed with <i><tt>f</tt></i>.</p><p>
286
287</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
288</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
289</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
290</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata
291</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td> the deallocator function for removed item (if any)
292</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the removal succeeded and -1 in case of error or not found.
293</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashLookup"></a>xmlHashLookup ()</h3><pre class="programlisting">void*       xmlHashLookup                   (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
294                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
295Find the userdata specified by the <i><tt>name</tt></i>.</p><p>
296
297</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
298</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
299</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashLookup2"></a>xmlHashLookup2 ()</h3><pre class="programlisting">void*       xmlHashLookup2                  (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
300                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
301                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2);</pre><p>
302Find the userdata specified by the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>) tuple.</p><p>
303
304</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
305</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
306</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
307</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashLookup3"></a>xmlHashLookup3 ()</h3><pre class="programlisting">void*       xmlHashLookup3                  (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
308                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
309                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
310                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3);</pre><p>
311Find the userdata specified by the (<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>) tuple.</p><p>
312
313</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
314</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata
315</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata
316</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata
317</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashCopy"></a>xmlHashCopy ()</h3><pre class="programlisting"><a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> xmlHashCopy                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
318                                             <a href="libxml-hash.html#xmlHashCopier">xmlHashCopier</a> f);</pre><p>
319Scan the hash <i><tt>table</tt></i> and applied <i><tt>f</tt></i> to each value.</p><p>
320
321</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
322</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the copier function for items in the hash
323</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new table or NULL in case of error.
324</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashSize"></a>xmlHashSize ()</h3><pre class="programlisting">int         xmlHashSize                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table);</pre><p>
325Query the number of elements installed in the hash <i><tt>table</tt></i>.</p><p>
326
327</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
328</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of elements in the hash table or
329-1 in case of error
330</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScan"></a>xmlHashScan ()</h3><pre class="programlisting">void        xmlHashScan                     (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
331                                             <a href="libxml-hash.html#xmlHashScanner">xmlHashScanner</a> f,
332                                             void *data);</pre><p>
333Scan the hash <i><tt>table</tt></i> and applied <i><tt>f</tt></i> to each value.</p><p>
334
335</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
336</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the scanner function for items in the hash
337</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra data passed to f
338</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScan3"></a>xmlHashScan3 ()</h3><pre class="programlisting">void        xmlHashScan3                    (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
339                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
340                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
341                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
342                                             <a href="libxml-hash.html#xmlHashScanner">xmlHashScanner</a> f,
343                                             void *data);</pre><p>
344Scan the hash <i><tt>table</tt></i> and applied <i><tt>f</tt></i> to each value matching
345(<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>) tuple. If one of the names is null,
346the comparison is considered to match.</p><p>
347
348</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
349</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata or NULL
350</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata or NULL
351</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata or NULL
352</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the scanner function for items in the hash
353</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra data passed to f
354</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScanFull"></a>xmlHashScanFull ()</h3><pre class="programlisting">void        xmlHashScanFull                 (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
355                                             <a href="libxml-hash.html#xmlHashScannerFull">xmlHashScannerFull</a> f,
356                                             void *data);</pre><p>
357Scan the hash <i><tt>table</tt></i> and applied <i><tt>f</tt></i> to each value.</p><p>
358
359</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
360</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the scanner function for items in the hash
361</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra data passed to f
362</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlHashScanFull3"></a>xmlHashScanFull3 ()</h3><pre class="programlisting">void        xmlHashScanFull3                (<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> table,
363                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
364                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name2,
365                                             const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name3,
366                                             <a href="libxml-hash.html#xmlHashScannerFull">xmlHashScannerFull</a> f,
367                                             void *data);</pre><p>
368Scan the hash <i><tt>table</tt></i> and applied <i><tt>f</tt></i> to each value matching
369(<i><tt>name</tt></i>, <i><tt>name2</tt></i>, <i><tt>name3</tt></i>) tuple. If one of the names is null,
370the comparison is considered to match.</p><p>
371
372</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>table</tt></i>�:</span></td><td> the hash table
373</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the name of the userdata or NULL
374</td></tr><tr><td><span class="term"><i><tt>name2</tt></i>�:</span></td><td> a second name of the userdata or NULL
375</td></tr><tr><td><span class="term"><i><tt>name3</tt></i>�:</span></td><td> a third name of the userdata or NULL
376</td></tr><tr><td><span class="term"><i><tt>f</tt></i>�:</span></td><td>  the scanner function for items in the hash
377</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td>  extra data passed to f
378</td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-encoding.html"><b>&lt;&lt;�encoding</b></a></td><td align="right"><a accesskey="n" href="libxml-debugXML.html"><b>debugXML�&gt;&gt;</b></a></td></tr></table></body></html>
379