ReactOS  0.4.13-dev-479-gec9c8fd
hash.h
Go to the documentation of this file.
1 /*
2  * Summary: Chained hash tables
3  * Description: This module implements the hash table support used in
4  * various places in the library.
5  *
6  * Copy: See Copyright for the status of this software.
7  *
8  * Author: Bjorn Reese <bjorn.reese@systematic.dk>
9  */
10 
11 #ifndef __XML_HASH_H__
12 #define __XML_HASH_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /*
19  * The hash table.
20  */
21 typedef struct _xmlHashTable xmlHashTable;
23 
24 #ifdef __cplusplus
25 }
26 #endif
27 
28 #include <libxml/xmlversion.h>
29 #include <libxml/parser.h>
30 #include <libxml/dict.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Recent version of gcc produce a warning when a function pointer is assigned
38  * to an object pointer, or vice versa. The following macro is a dirty hack
39  * to allow suppression of the warning. If your architecture has function
40  * pointers which are a different size than a void pointer, there may be some
41  * serious trouble within the library.
42  */
56 #define XML_CAST_FPTR(fptr) fptr
57 
58 
59 /*
60  * function types:
61  */
69 typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name);
79 typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
88 typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
99 typedef void (*xmlHashScannerFull)(void *payload, void *data,
100  const xmlChar *name, const xmlChar *name2,
101  const xmlChar *name3);
102 
103 /*
104  * Constructor and destructor.
105  */
107  xmlHashCreate (int size);
110  xmlDictPtr dict);
111 XMLPUBFUN void XMLCALL
114 XMLPUBFUN void XMLCALL
116  const xmlChar *name);
117 
118 /*
119  * Add a new entry to the hash table.
120  */
121 XMLPUBFUN int XMLCALL
123  const xmlChar *name,
124  void *userdata);
125 XMLPUBFUN int XMLCALL
127  const xmlChar *name,
128  void *userdata,
130 XMLPUBFUN int XMLCALL
132  const xmlChar *name,
133  const xmlChar *name2,
134  void *userdata);
135 XMLPUBFUN int XMLCALL
137  const xmlChar *name,
138  const xmlChar *name2,
139  void *userdata,
141 XMLPUBFUN int XMLCALL
143  const xmlChar *name,
144  const xmlChar *name2,
145  const xmlChar *name3,
146  void *userdata);
147 XMLPUBFUN int XMLCALL
149  const xmlChar *name,
150  const xmlChar *name2,
151  const xmlChar *name3,
152  void *userdata,
154 
155 /*
156  * Remove an entry from the hash table.
157  */
158 XMLPUBFUN int XMLCALL
161 XMLPUBFUN int XMLCALL
164 XMLPUBFUN int XMLCALL
166  const xmlChar *name2, const xmlChar *name3,
168 
169 /*
170  * Retrieve the userdata.
171  */
172 XMLPUBFUN void * XMLCALL
174  const xmlChar *name);
175 XMLPUBFUN void * XMLCALL
177  const xmlChar *name,
178  const xmlChar *name2);
179 XMLPUBFUN void * XMLCALL
181  const xmlChar *name,
182  const xmlChar *name2,
183  const xmlChar *name3);
184 XMLPUBFUN void * XMLCALL
186  const xmlChar *name,
187  const xmlChar *prefix);
188 XMLPUBFUN void * XMLCALL
190  const xmlChar *name,
191  const xmlChar *prefix,
192  const xmlChar *name2,
193  const xmlChar *prefix2);
194 XMLPUBFUN void * XMLCALL
196  const xmlChar *name,
197  const xmlChar *prefix,
198  const xmlChar *name2,
199  const xmlChar *prefix2,
200  const xmlChar *name3,
201  const xmlChar *prefix3);
202 
203 /*
204  * Helpers.
205  */
208  xmlHashCopier f);
209 XMLPUBFUN int XMLCALL
211 XMLPUBFUN void XMLCALL
214  void *data);
215 XMLPUBFUN void XMLCALL
217  const xmlChar *name,
218  const xmlChar *name2,
219  const xmlChar *name3,
221  void *data);
222 XMLPUBFUN void XMLCALL
225  void *data);
226 XMLPUBFUN void XMLCALL
228  const xmlChar *name,
229  const xmlChar *name2,
230  const xmlChar *name3,
232  void *data);
233 #ifdef __cplusplus
234 }
235 #endif
236 #endif /* ! __XML_HASH_H__ */
XMLPUBFUN int XMLCALL xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:529
XMLPUBFUN int XMLCALL xmlHashSize(xmlHashTablePtr table)
Definition: hash.c:1032
XMLPUBFUN int XMLCALL xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, xmlHashDeallocator f)
Definition: hash.c:1050
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f)
Definition: hash.c:990
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
XMLPUBFUN void XMLCALL xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data)
Definition: hash.c:857
XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
Definition: hash.c:404
void(* xmlHashDeallocator)(void *payload, const xmlChar *name)
Definition: hash.h:69
void(* xmlHashScannerFull)(void *payload, void *data, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.h:99
XMLPUBFUN void *XMLCALL xmlHashQLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2, const xmlChar *name3, const xmlChar *prefix3)
Definition: hash.c:811
XMLPUBFUN int XMLCALL xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata)
Definition: hash.c:387
#define XMLPUBFUN
Definition: xmlexports.h:30
XMLPUBFUN void *XMLCALL xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2)
Definition: hash.c:474
XMLPUBFUN void XMLCALL xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
Definition: hash.c:320
XMLPUBFUN void XMLCALL xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data)
Definition: hash.c:924
xmlHashTable * xmlHashTablePtr
Definition: hash.h:22
void *(* xmlHashCopier)(void *payload, const xmlChar *name)
Definition: hash.h:79
XMLPUBFUN int XMLCALL xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f)
Definition: hash.c:1089
XMLPUBFUN void *XMLCALL xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:767
GLfloat f
Definition: glext.h:7540
GLsizeiptr size
Definition: glext.h:5919
XMLPUBFUN void *XMLCALL xmlHashQLookup2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2)
Definition: hash.c:508
XMLPUBFUN void *XMLCALL xmlHashQLookup(xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix)
Definition: hash.c:490
xmlDictPtr dict
Definition: hash.c:71
XMLPUBFUN int XMLCALL xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f)
Definition: hash.c:1069
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate(int size)
Definition: hash.c:174
XMLPUBFUN int XMLCALL xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
Definition: hash.c:645
XMLPUBFUN void XMLCALL xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data)
Definition: hash.c:873
uint32_t entry
Definition: isohybrid.c:63
unsigned char xmlChar
Definition: xmlstring.h:28
void(* xmlHashScanner)(void *payload, void *data, const xmlChar *name)
Definition: hash.h:88
XMLPUBFUN int XMLCALL xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f)
Definition: hash.c:423
XMLPUBFUN int XMLCALL xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator f)
Definition: hash.c:443
__XML_EXTERNC typedef xmlDict * xmlDictPtr
Definition: dict.h:24
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreateDict(int size, xmlDictPtr dict)
Definition: hash.c:208
#define XMLCALL
static const WCHAR name3[]
Definition: db.c:2958
Definition: name.c:36
XMLPUBFUN void XMLCALL xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data)
Definition: hash.c:948
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN void *XMLCALL xmlHashLookup(xmlHashTablePtr table, const xmlChar *name)
Definition: hash.c:459
XMLPUBFUN void XMLCALL xmlHashDefaultDeallocator(void *entry, const xmlChar *name)
GLuint const GLchar * name
Definition: glext.h:6031