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 replace(GString *key, void *val);
34 void replace(GString *key, int val);
35 void *lookup(GString *key);
36 int lookupInt(GString *key);
37 void *lookup(char *key);
38 int lookupInt(char *key);
39 void *remove(GString *key);
40 int removeInt(GString *key);
41 void *remove(char *key);
42 int removeInt(char *key);
43 int getLength() { return len; }
44 void startIter(GHashIter **iter);
45 GBool getNext(GHashIter **iter, GString **key, void **val);
46 GBool getNext(GHashIter **iter, GString **key, int *val);
47 void killIter(GHashIter **iter);
52 GHashBucket *find(GString *key, int *h);
53 GHashBucket *find(char *key, int *h);
54 int hash(GString *key);
57 GBool deleteKeys; // set if key strings should be deleted
58 int size; // number of buckets
59 int len; // number of entries
63 #define deleteGHash(hash, T) \
65 GHash *_hash = (hash); \
70 _hash->startIter(&_iter); \
71 while (_hash->getNext(&_iter, &_key, &_p)) { \