2 * Summary: chained hash tables
3 * description: this module implement the hash table support used in
4 * various place in the library.
6 * Copy: See Copyright for the status of this software.
8 * Author: Bjorn Reese <bjorn.reese@systematic.dk>
9 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
20 #include <stdapis/libxml2/libxml2_xmlstring.h>
29 typedef struct _xmlHashTable xmlHashTable;
30 typedef xmlHashTable* xmlHashTablePtr;
44 * @param payload the data in the hash
45 * @param name the name associated
47 * Callback to free data from a hash.
49 typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
52 * @param payload the data in the hash
53 * @param name the name associated
55 * Callback to copy data from a hash.
57 * Returns a copy of the data or NULL in case of error.
59 typedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
62 * @param payload the data in the hash
63 * @param data extra scannner data
64 * @param name the name associated
66 * Callback when scanning data in a hash with the simple scanner.
68 typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
71 * @param payload the data in the hash
72 * @param data extra scannner data
73 * @param name the name associated
74 * @param name2 the second name associated
75 * @param name3 the third name associated
77 * Callback when scanning data in a hash with the full scanner.
79 typedef void (*xmlHashScannerFull)(void *payload, void *data,
80 const xmlChar *name, const xmlChar *name2,
81 const xmlChar *name3);
84 * Constructor and destructor.
86 XMLPUBFUN xmlHashTablePtr XMLCALL
87 xmlHashCreate (int size);
88 XMLPUBFUN void XMLCALL
89 xmlHashFree (xmlHashTablePtr table,
90 xmlHashDeallocator f);
94 * Add a new entry to the hash table.
97 xmlHashAddEntry (xmlHashTablePtr table,
100 XMLPUBFUN int XMLCALL
101 xmlHashUpdateEntry(xmlHashTablePtr table,
104 xmlHashDeallocator f);
105 XMLPUBFUN int XMLCALL
106 xmlHashAddEntry2(xmlHashTablePtr table,
108 const xmlChar *name2,
110 XMLPUBFUN int XMLCALL
111 xmlHashUpdateEntry2(xmlHashTablePtr table,
113 const xmlChar *name2,
115 xmlHashDeallocator f);
116 XMLPUBFUN int XMLCALL
117 xmlHashAddEntry3(xmlHashTablePtr table,
119 const xmlChar *name2,
120 const xmlChar *name3,
122 XMLPUBFUN int XMLCALL
123 xmlHashUpdateEntry3(xmlHashTablePtr table,
125 const xmlChar *name2,
126 const xmlChar *name3,
128 xmlHashDeallocator f);
131 * Remove an entry from the hash table.
133 XMLPUBFUN int XMLCALL
134 xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
135 xmlHashDeallocator f);
136 XMLPUBFUN int XMLCALL
137 xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
138 const xmlChar *name2, xmlHashDeallocator f);
139 XMLPUBFUN int XMLCALL
140 xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
141 const xmlChar *name2, const xmlChar *name3,
142 xmlHashDeallocator f);
145 * Retrieve the userdata.
147 XMLPUBFUN void * XMLCALL
148 xmlHashLookup (xmlHashTablePtr table,
149 const xmlChar *name);
150 XMLPUBFUN void * XMLCALL
151 xmlHashLookup2 (xmlHashTablePtr table,
153 const xmlChar *name2);
154 XMLPUBFUN void * XMLCALL
155 xmlHashLookup3 (xmlHashTablePtr table,
157 const xmlChar *name2,
158 const xmlChar *name3);
160 #ifndef XMLENGINE_EXCLUDE_UNUSED
161 XMLPUBFUN void * XMLCALL
162 xmlHashQLookup (xmlHashTablePtr table,
164 const xmlChar *prefix);
165 #endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
167 XMLPUBFUN void * XMLCALL
168 xmlHashQLookup2 (xmlHashTablePtr table,
170 const xmlChar *prefix,
171 const xmlChar *name2,
172 const xmlChar *prefix2);
173 XMLPUBFUN void * XMLCALL
174 xmlHashQLookup3 (xmlHashTablePtr table,
176 const xmlChar *prefix,
177 const xmlChar *name2,
178 const xmlChar *prefix2,
179 const xmlChar *name3,
180 const xmlChar *prefix3);
185 XMLPUBFUN xmlHashTablePtr XMLCALL
186 xmlHashCopy (xmlHashTablePtr table,
189 #ifndef XMLENGINE_EXCLUDE_UNUSED
190 XMLPUBFUN int XMLCALL
191 xmlHashSize (xmlHashTablePtr table);
192 #endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
194 XMLPUBFUN void XMLCALL
195 xmlHashScan (xmlHashTablePtr table,
198 XMLPUBFUN void XMLCALL
199 xmlHashScan3 (xmlHashTablePtr table,
201 const xmlChar *name2,
202 const xmlChar *name3,
205 XMLPUBFUN void XMLCALL
206 xmlHashScanFull (xmlHashTablePtr table,
207 xmlHashScannerFull f,
209 XMLPUBFUN void XMLCALL
210 xmlHashScanFull3(xmlHashTablePtr table,
212 const xmlChar *name2,
213 const xmlChar *name3,
214 xmlHashScannerFull f,
219 #endif /* XML_HASH_H */