1 // implements a generic hash table
5 #define geninitialnumbins 10
9 unsigned int (*hash_function)(void *);
10 int (*comp_function)(void *,void *);
11 struct genpointerlist ** bins;
14 struct genpointerlist *list;
15 struct genpointerlist *last;
19 struct genpointerlist {
22 struct genpointerlist * next;
24 struct genpointerlist * inext;
25 struct genpointerlist * iprev;
30 struct genpointerlist * ptr;
34 struct genhashtable * genallocatehashtable(unsigned int (*hash_function)(void *),int (*comp_function)(void *,void *));
35 void genfreehashtable(struct genhashtable * ht);
37 void * getnext(struct genhashtable *,void *);
38 int genputtable(struct genhashtable *, void *, void *);
39 void * gengettable(struct genhashtable *, void *);
40 int gencontains(struct genhashtable *, void *);
41 unsigned int genhashfunction(struct genhashtable *,void *);
43 int hashsize(struct genhashtable * ht);
44 void genfreekey(struct genhashtable *ht, void *);
45 struct geniterator * gengetiterator(struct genhashtable *ht);
46 void * gennext(struct geniterator *it);
47 void genfreeiterator(struct geniterator *it);