1 | /* |
---|
2 | The contents of this file are subject to the Mozilla Public License |
---|
3 | Version 1.1 (the "License"); you may not use this file except in |
---|
4 | compliance with the License. You may obtain a copy of the License at |
---|
5 | http://www.mozilla.org/MPL/ |
---|
6 | |
---|
7 | Software distributed under the License is distributed on an "AS IS" |
---|
8 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
---|
9 | License for the specific language governing rights and limitations |
---|
10 | under the License. |
---|
11 | |
---|
12 | The Original Code is expat. |
---|
13 | |
---|
14 | The Initial Developer of the Original Code is James Clark. |
---|
15 | Portions created by James Clark are Copyright (C) 1998, 1999 |
---|
16 | James Clark. All Rights Reserved. |
---|
17 | |
---|
18 | Contributor(s): |
---|
19 | |
---|
20 | Alternatively, the contents of this file may be used under the terms |
---|
21 | of the GNU General Public License (the "GPL"), in which case the |
---|
22 | provisions of the GPL are applicable instead of those above. If you |
---|
23 | wish to allow use of your version of this file only under the terms of |
---|
24 | the GPL and not to allow others to use your version of this file under |
---|
25 | the MPL, indicate your decision by deleting the provisions above and |
---|
26 | replace them with the notice and other provisions required by the |
---|
27 | GPL. If you do not delete the provisions above, a recipient may use |
---|
28 | your version of this file under either the MPL or the GPL. |
---|
29 | */ |
---|
30 | |
---|
31 | |
---|
32 | #include <stddef.h> |
---|
33 | |
---|
34 | #ifdef XML_UNICODE |
---|
35 | |
---|
36 | #ifdef XML_UNICODE_WCHAR_T |
---|
37 | typedef const wchar_t *KEY; |
---|
38 | #else /* not XML_UNICODE_WCHAR_T */ |
---|
39 | typedef const unsigned short *KEY; |
---|
40 | #endif /* not XML_UNICODE_WCHAR_T */ |
---|
41 | |
---|
42 | #else /* not XML_UNICODE */ |
---|
43 | |
---|
44 | typedef const char *KEY; |
---|
45 | |
---|
46 | #endif /* not XML_UNICODE */ |
---|
47 | |
---|
48 | typedef struct { |
---|
49 | KEY name; |
---|
50 | } NAMED; |
---|
51 | |
---|
52 | typedef struct { |
---|
53 | NAMED **v; |
---|
54 | size_t size; |
---|
55 | size_t used; |
---|
56 | size_t usedLim; |
---|
57 | } HASH_TABLE; |
---|
58 | |
---|
59 | NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); |
---|
60 | void hashTableInit(HASH_TABLE *); |
---|
61 | void hashTableDestroy(HASH_TABLE *); |
---|
62 | |
---|
63 | typedef struct { |
---|
64 | NAMED **p; |
---|
65 | NAMED **end; |
---|
66 | } HASH_TABLE_ITER; |
---|
67 | |
---|
68 | void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); |
---|
69 | NAMED *hashTableIterNext(HASH_TABLE_ITER *); |
---|