source: protocols/jabber/hashtable.h @ 755ae5b

Last change on this file since 755ae5b was b7d3cc34, checked in by Wilmer van der Gaast <wilmer@…>, at 2005-11-06T18:23:18Z

Initial repository (0.99 release tree)

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