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 * getfirstkey(struct genhashtable *ht);
36 void genfreehashtable(struct genhashtable * ht);
37 void genrehash(struct genhashtable * ht);
38 void * getnext(struct genhashtable *,void *);
39 int genputtable(struct genhashtable *, void *, void *);
41 int genputtable_I(struct genhashtable *, void *, void *);
43 void * gengettable(struct genhashtable *, void *);
44 int gencontains(struct genhashtable *, void *);
45 unsigned int genhashfunction(struct genhashtable *,void *);
47 int hashsize(struct genhashtable * ht);
48 void genfreekey(struct genhashtable *ht, void *);
49 struct geniterator * gengetiterator(struct genhashtable *ht);
50 void * gennext(struct geniterator *it);
51 void genfreeiterator(struct geniterator *it);