11 typedef struct _hashvector {
13 unsigned int fill; // number of added elements
14 unsigned int holes; // number of deleted
15 int (*keyhashcode)(void *key);
16 void *(*itemkey)(void *item);
17 int (*haskey)(void *item,void *key);
23 #define HV_HOLE ((void*) 1)
25 // Find the keyed element, and assign the x pointer, or assign 0.
26 // Returns 1 if element is found and 0 otherwise.
27 int hashvector_find(hashvector *hv,void *key,void **x);
29 // Add the given element.
30 void hashvector_add(hashvector *hv,void *p);
32 // Return the next element starting at i, or 0 if there are no more.
33 // Also increment the index to be of the element + 1, or -1 if there
34 // are no more elements.
35 //unsigned char *htnext(htable *table,int *i);
37 // Delete the given element.
38 void hashvector_delete(hashvector *hv,void *p);
40 // Copy content items into pvector, which must be empty.
41 int hashvector_pack(hashvector *hv,pvector *pv);