1 //========================================================================
5 // Copyright 2001-2002 Glyph & Cog, LLC
7 //========================================================================
22 //------------------------------------------------------------------------
27 GHash(GBool deleteKeysA = gFalse);
29 void add(GString *key, void *val);
30 void *lookup(GString *key);
31 void *lookup(char *key);
32 void *remove(GString *key);
33 void *remove(char *key);
34 int getLength() { return len; }
35 void startIter(GHashIter **iter);
36 GBool getNext(GHashIter **iter, GString **key, void **val);
37 void killIter(GHashIter **iter);
41 GHashBucket *find(GString *key, int *h);
42 GHashBucket *find(char *key, int *h);
43 int hash(GString *key);
46 GBool deleteKeys; // set if key strings should be deleted
47 int size; // number of buckets
48 int len; // number of entries
52 #define deleteGHash(hash, T) \
54 GHash *_hash = (hash); \
59 _hash->startIter(&_iter); \
60 while (_hash->getNext(&_iter, &_key, &_p)) { \