1 //========================================================================
5 // Copyright 2001-2003 Glyph & Cog, LLC
7 //========================================================================
14 #ifdef USE_GCC_PRAGMAS
24 //------------------------------------------------------------------------
29 GHash(GBool deleteKeysA = gFalse);
31 void add(GString *key, void *val);
32 void add(GString *key, int val);
33 void *lookup(GString *key);
34 int lookupInt(GString *key);
35 void *lookup(char *key);
36 int lookupInt(char *key);
37 void *remove(GString *key);
38 int removeInt(GString *key);
39 void *remove(char *key);
40 int removeInt(char *key);
41 int getLength() { return len; }
42 void startIter(GHashIter **iter);
43 GBool getNext(GHashIter **iter, GString **key, void **val);
44 GBool getNext(GHashIter **iter, GString **key, int *val);
45 void killIter(GHashIter **iter);
50 GHashBucket *find(GString *key, int *h);
51 GHashBucket *find(char *key, int *h);
52 int hash(GString *key);
55 GBool deleteKeys; // set if key strings should be deleted
56 int size; // number of buckets
57 int len; // number of entries
61 #define deleteGHash(hash, T) \
63 GHash *_hash = (hash); \
68 _hash->startIter(&_iter); \
69 while (_hash->getNext(&_iter, &_key, &_p)) { \