ReactOS 0.4.16-dev-2132-g3885311
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#include <libxml/xmlversion.h>
15#include <libxml/dict.h>
16#include <libxml/xmlstring.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*
23 * The hash table.
24 */
27
28/*
29 * Recent version of gcc produce a warning when a function pointer is assigned
30 * to an object pointer, or vice versa. The following macro is a dirty hack
31 * to allow suppression of the warning. If your architecture has function
32 * pointers which are a different size than a void pointer, there may be some
33 * serious trouble within the library.
34 */
48#define XML_CAST_FPTR(fptr) fptr
49
50/*
51 * function types:
52 */
60typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name);
70typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
79typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
90typedef void (*xmlHashScannerFull)(void *payload, void *data,
91 const xmlChar *name, const xmlChar *name2,
92 const xmlChar *name3);
93
94/*
95 * Constructor and destructor.
96 */
98 xmlHashCreate (int size);
102XMLPUBFUN void
105XMLPUBFUN void
107 const xmlChar *name);
108
109/*
110 * Add a new entry to the hash table.
111 */
112XMLPUBFUN int
114 const xmlChar *name,
115 void *userdata);
116XMLPUBFUN int
118 const xmlChar *name,
119 void *userdata,
121XMLPUBFUN int
123 const xmlChar *name,
124 const xmlChar *name2,
125 void *userdata);
126XMLPUBFUN int
128 const xmlChar *name,
129 const xmlChar *name2,
130 void *userdata,
132XMLPUBFUN int
134 const xmlChar *name,
135 const xmlChar *name2,
136 const xmlChar *name3,
137 void *userdata);
138XMLPUBFUN int
140 const xmlChar *name,
141 const xmlChar *name2,
142 const xmlChar *name3,
143 void *userdata,
145
146/*
147 * Remove an entry from the hash table.
148 */
149XMLPUBFUN int
151 const xmlChar *name,
153XMLPUBFUN int
155 const xmlChar *name,
156 const xmlChar *name2,
158XMLPUBFUN int
160 const xmlChar *name,
161 const xmlChar *name2,
162 const xmlChar *name3,
164
165/*
166 * Retrieve the payload.
167 */
168XMLPUBFUN void *
170 const xmlChar *name);
171XMLPUBFUN void *
173 const xmlChar *name,
174 const xmlChar *name2);
175XMLPUBFUN void *
177 const xmlChar *name,
178 const xmlChar *name2,
179 const xmlChar *name3);
180XMLPUBFUN void *
182 const xmlChar *prefix,
183 const xmlChar *name);
184XMLPUBFUN void *
186 const xmlChar *prefix,
187 const xmlChar *name,
188 const xmlChar *prefix2,
189 const xmlChar *name2);
190XMLPUBFUN void *
192 const xmlChar *prefix,
193 const xmlChar *name,
194 const xmlChar *prefix2,
195 const xmlChar *name2,
196 const xmlChar *prefix3,
197 const xmlChar *name3);
198
199/*
200 * Helpers.
201 */
205XMLPUBFUN int
207XMLPUBFUN void
209 xmlHashScanner scan,
210 void *data);
211XMLPUBFUN void
213 const xmlChar *name,
214 const xmlChar *name2,
215 const xmlChar *name3,
216 xmlHashScanner scan,
217 void *data);
218XMLPUBFUN void
221 void *data);
222XMLPUBFUN void
224 const xmlChar *name,
225 const xmlChar *name2,
226 const xmlChar *name3,
228 void *data);
229#ifdef __cplusplus
230}
231#endif
232#endif /* ! __XML_HASH_H__ */
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
static const WCHAR name3[]
Definition: db.c:2839
void dealloc(int i, int no_throw)
Definition: ehthrow.cxx:33
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
uint32_t entry
Definition: isohybrid.c:63
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN xmlHashTablePtr xmlHashCopy(xmlHashTablePtr hash, xmlHashCopier copy)
Definition: hash.c:1050
xmlHashTable * xmlHashTablePtr
Definition: hash.h:26
void(* xmlHashDeallocator)(void *payload, const xmlChar *name)
Definition: hash.h:60
XMLPUBFUN void xmlHashScan3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner scan, void *data)
Definition: hash.c:969
XMLPUBFUN int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *name, void *userdata)
Definition: hash.c:621
XMLPUBFUN void * xmlHashQLookup3(xmlHashTablePtr hash, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
Definition: hash.c:837
XMLPUBFUN int xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *name, void *userdata, xmlHashDeallocator dealloc)
Definition: hash.c:678
XMLPUBFUN int xmlHashUpdateEntry3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator dealloc)
Definition: hash.c:722
void *(* xmlHashCopier)(void *payload, const xmlChar *name)
Definition: hash.h:70
XMLPUBFUN void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
Definition: hash.c:898
void(* xmlHashScanner)(void *payload, void *data, const xmlChar *name)
Definition: hash.h:79
XMLPUBFUN void xmlHashDefaultDeallocator(void *entry, const xmlChar *name)
XMLPUBFUN void * xmlHashQLookup(xmlHashTablePtr hash, const xmlChar *prefix, const xmlChar *name)
Definition: hash.c:770
XMLPUBFUN int xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, void *userdata)
Definition: hash.c:639
XMLPUBFUN void * xmlHashLookup3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:806
XMLPUBFUN xmlHashTablePtr xmlHashCreateDict(int size, xmlDictPtr dict)
Definition: hash.c:209
XMLPUBFUN void xmlHashScanFull3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull scan, void *data)
Definition: hash.c:992
XMLPUBFUN int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *name, xmlHashDeallocator dealloc)
Definition: hash.c:1102
XMLPUBFUN int xmlHashRemoveEntry2(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator dealloc)
Definition: hash.c:1121
XMLPUBFUN xmlHashTablePtr xmlHashCreate(int size)
Definition: hash.c:160
XMLPUBFUN void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
Definition: hash.c:229
void(* xmlHashScannerFull)(void *payload, void *data, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.h:90
XMLPUBFUN int xmlHashRemoveEntry3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator dealloc)
Definition: hash.c:1142
XMLPUBFUN void * xmlHashLookup2(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2)
Definition: hash.c:754
XMLPUBFUN int xmlHashSize(xmlHashTablePtr hash)
Definition: hash.c:1085
XMLPUBFUN void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *name)
Definition: hash.c:739
XMLPUBFUN int xmlHashAddEntry3(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:659
XMLPUBFUN int xmlHashUpdateEntry2(xmlHashTablePtr hash, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator dealloc)
Definition: hash.c:699
XMLPUBFUN void * xmlHashQLookup2(xmlHashTablePtr hash, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2)
Definition: hash.c:788
XMLPUBFUN void xmlHashScanFull(xmlHashTablePtr hash, xmlHashScannerFull scan, void *data)
Definition: hash.c:914
Definition: dict.c:59
xmlDictPtr dict
Definition: hash.c:52
Definition: _hash_fun.h:40
Definition: name.c:39
Character const *const prefix
Definition: tempnam.cpp:195
#define XMLPUBFUN
Definition: xmlexports.h:30
unsigned char xmlChar
Definition: xmlstring.h:28