annotate plugins/jabber/hashtable.h @ 1692:a312d64a995d

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