ReactOS 0.4.16-dev-2132-g3885311
dict.h
Go to the documentation of this file.
1#ifndef XML_DICT_H_PRIVATE__
2#define XML_DICT_H_PRIVATE__
3
4#include <libxml/dict.h>
5
6/*
7 * Values are ANDed with 0xFFFFFFFF to support platforms where
8 * unsigned is larger than 32 bits. With 32-bit unsigned values,
9 * modern compilers should optimize the operation away.
10 */
11
12#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
13#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
14
15/*
16 * GoodOAAT: One of a smallest non-multiplicative One-At-a-Time functions
17 * that passes SMHasher.
18 *
19 * Author: Sokolov Yura aka funny-falcon
20 */
21
22#define HASH_INIT(h1, h2, seed) \
23 do { \
24 h1 = seed ^ 0x3b00; \
25 h2 = HASH_ROL(seed, 15); \
26 } while (0)
27
28#define HASH_UPDATE(h1, h2, ch) \
29 do { \
30 h1 += ch; \
31 h1 += h1 << 3; \
32 h2 += h1; \
33 h2 = HASH_ROL(h2, 7); \
34 h2 += h2 << 2; \
35 } while (0)
36
37/* Result is in h2 */
38#define HASH_FINISH(h1, h2) \
39 do { \
40 h1 ^= h2; \
41 h1 += HASH_ROL(h2, 14); \
42 h2 ^= h1; h2 += HASH_ROR(h1, 6); \
43 h1 ^= h2; h1 += HASH_ROL(h2, 5); \
44 h2 ^= h1; h2 += HASH_ROR(h1, 8); \
45 h2 &= 0xFFFFFFFF; \
46 } while (0)
47
48typedef struct {
49 unsigned hashValue;
50 const xmlChar *name;
52
53XML_HIDDEN void
55XML_HIDDEN void
57
58XML_HIDDEN unsigned
59xmlDictComputeHash(const xmlDict *dict, const xmlChar *string);
60XML_HIDDEN unsigned
61xmlDictCombineHash(unsigned v1, unsigned v2);
64
65XML_HIDDEN void
66xmlInitRandom(void);
67XML_HIDDEN void
69XML_HIDDEN unsigned
70xmlRandom(void);
71
72#endif /* XML_DICT_H_PRIVATE__ */
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat v1
Definition: glext.h:6062
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
#define XML_HIDDEN
Definition: libxml.h:52
XML_HIDDEN unsigned xmlDictComputeHash(const xmlDict *dict, const xmlChar *string)
Definition: dict.c:512
XML_HIDDEN void xmlInitDictInternal(void)
Definition: dict.c:99
XML_HIDDEN xmlHashedString xmlDictLookupHashed(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:845
XML_HIDDEN void xmlInitRandom(void)
Definition: dict.c:918
XML_HIDDEN void xmlCleanupDictInternal(void)
Definition: dict.c:121
XML_HIDDEN unsigned xmlDictCombineHash(unsigned v1, unsigned v2)
Definition: dict.c:521
XML_HIDDEN void xmlCleanupRandom(void)
Definition: dict.c:932
XML_HIDDEN unsigned xmlRandom(void)
Definition: dict.c:951
Definition: dict.c:59
Definition: name.c:39
const xmlChar * name
Definition: dict.h:50
unsigned hashValue
Definition: dict.h:49
unsigned char xmlChar
Definition: xmlstring.h:28