35 unsigned int (*hash_function)(
void*),
36 int (*hash_key_compare)(
void*,
void*));
44 #define icl_hash_foreach(ht, tmpint, tmpent, kp, dp) \
45 for (tmpint=0;tmpint<ht->nbuckets; tmpint++) \
46 for (tmpent=ht->buckets[tmpint]; \
47 tmpent!=NULL&&((kp=tmpent->key)!=NULL)&&((dp=tmpent->data)!=NULL); \
int icl_hash_destroy(icl_hash_t *ht, void(*free_key)(void *), void(*free_data)(void *))
Free hash table structures. Key and data are freed using functions.
int icl_hash_dump(FILE *stream, icl_hash_t *ht)
Dump the hash table's contents to the given file pointer.
struct icl_entry_s icl_entry_t
struct icl_entry_s * next
icl_entry_t * icl_hash_insert(icl_hash_t *ht, void *key, void *data)
Insert an item into the hash table.
int(* hash_key_compare)(void *, void *)
icl_entry_t * icl_hash_update_insert(icl_hash_t *ht, void *key, void *data, void **olddata)
Replace entry in hash table with the given entry.
void * icl_hash_find(icl_hash_t *ht, void *key)
Search for an entry in a hash table.
unsigned int(* hash_function)(void *)
icl_hash_t * icl_hash_create(int nbuckets, unsigned int(*hash_function)(void *), int(*hash_key_compare)(void *, void *))
Create a new hash table.
int icl_hash_delete(icl_hash_t *ht, void *key, void(*free_key)(void *), void(*free_data)(void *))
Free one hash table entry located by key. Key and data are freed using functions. ...
struct icl_hash_s icl_hash_t