libexpat/expat/xmlparse/hashtable.h

70 lines
2.0 KiB
C
Raw Normal View History

1998-04-05 11:11:29 -04:00
/*
The contents of this file are subject to the Mozilla Public License
1999-05-28 22:19:21 -04:00
Version 1.1 (the "License"); you may not use this file except in
1998-04-05 11:11:29 -04:00
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is expat.
The Initial Developer of the Original Code is James Clark.
1999-05-28 22:19:21 -04:00
Portions created by James Clark are Copyright (C) 1998, 1999
1998-04-05 11:11:29 -04:00
James Clark. All Rights Reserved.
Contributor(s):
1999-05-28 22:19:21 -04:00
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
1998-04-05 11:11:29 -04:00
*/
1997-12-10 02:39:49 -05:00
#include <stddef.h>
1998-05-31 01:32:43 -04:00
#ifdef XML_UNICODE
1999-04-24 23:18:11 -04:00
#ifdef XML_UNICODE_WCHAR_T
1998-05-31 01:32:43 -04:00
typedef const wchar_t *KEY;
1999-04-24 23:18:11 -04:00
#else /* not XML_UNICODE_WCHAR_T */
typedef const unsigned short *KEY;
#endif /* not XML_UNICODE_WCHAR_T */
#else /* not XML_UNICODE */
1998-05-31 01:32:43 -04:00
typedef const char *KEY;
1999-04-24 23:18:11 -04:00
#endif /* not XML_UNICODE */
1998-05-31 01:32:43 -04:00
1997-12-10 02:39:49 -05:00
typedef struct {
1998-05-31 01:32:43 -04:00
KEY name;
1997-12-10 02:39:49 -05:00
} NAMED;
typedef struct {
NAMED **v;
size_t size;
size_t used;
size_t usedLim;
} HASH_TABLE;
1998-05-31 01:32:43 -04:00
NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize);
1997-12-10 02:39:49 -05:00
void hashTableInit(HASH_TABLE *);
void hashTableDestroy(HASH_TABLE *);
1997-12-10 16:57:16 -05:00
typedef struct {
NAMED **p;
NAMED **end;
} HASH_TABLE_ITER;
void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
NAMED *hashTableIterNext(HASH_TABLE_ITER *);