1 // implements a generic hash table
5 #define geninitialnumbins 10
8 unsigned int (*hash_function)(void *);
9 int (*comp_function)(void *,void *);
10 struct genpointerlist ** bins;
13 struct genpointerlist *list;
14 struct genpointerlist *last;
18 struct genpointerlist {
21 struct genpointerlist * next;
23 struct genpointerlist * inext;
24 struct genpointerlist * iprev;
29 struct genpointerlist * ptr;
33 struct genhashtable * genallocatehashtable(unsigned int (*hash_function)(void *),int (*comp_function)(void *,void *));
34 void genfreehashtable(struct genhashtable * ht);
36 void * getnext(struct genhashtable *,void *);
37 int genputtable(struct genhashtable *, void *, void *);
38 void * gengettable(struct genhashtable *, void *);
39 int gencontains(struct genhashtable *, void *);
40 unsigned int genhashfunction(struct genhashtable *,void *);
42 int hashsize(struct genhashtable * ht);
43 void genfreekey(struct genhashtable *ht, void *);
44 struct geniterator * gengetiterator(struct genhashtable *ht);
45 void * gennext(struct geniterator *it);
46 void genfreeiterator(struct geniterator *it);