1999-02-27 01:31:49 +00:00
|
|
|
/*
|
2001-09-29 00:10:42 +00:00
|
|
|
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
|
|
|
|
Portions Copyright (c) 1999 Netscape Communications Corporation.
|
|
|
|
See the file COPYING for copying permission.
|
1999-02-27 01:31:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
#ifdef XML_UNICODE
|
1999-07-02 02:32:56 +00:00
|
|
|
|
1999-04-24 08:33:34 +00:00
|
|
|
#ifdef XML_UNICODE_WCHAR_T
|
1999-02-27 01:31:49 +00:00
|
|
|
typedef const wchar_t *KEY;
|
1999-07-02 02:32:56 +00:00
|
|
|
#else /* not XML_UNICODE_WCHAR_T */
|
1999-04-24 08:33:34 +00:00
|
|
|
typedef const unsigned short *KEY;
|
1999-07-02 02:32:56 +00:00
|
|
|
#endif /* not XML_UNICODE_WCHAR_T */
|
|
|
|
|
|
|
|
#else /* not XML_UNICODE */
|
|
|
|
|
1999-02-27 01:31:49 +00:00
|
|
|
typedef const char *KEY;
|
1999-07-02 02:32:56 +00:00
|
|
|
|
|
|
|
#endif /* not XML_UNICODE */
|
1999-02-27 01:31:49 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
KEY name;
|
|
|
|
} NAMED;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NAMED **v;
|
|
|
|
size_t size;
|
|
|
|
size_t used;
|
|
|
|
size_t usedLim;
|
|
|
|
} HASH_TABLE;
|
|
|
|
|
|
|
|
NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize);
|
|
|
|
void hashTableInit(HASH_TABLE *);
|
|
|
|
void hashTableDestroy(HASH_TABLE *);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NAMED **p;
|
|
|
|
NAMED **end;
|
|
|
|
} HASH_TABLE_ITER;
|
|
|
|
|
|
|
|
void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
|
|
|
|
NAMED *hashTableIterNext(HASH_TABLE_ITER *);
|