hash.h revision b3732cac9d37eba37a0bba5669a190b4055c9b3f
#ifndef __HASH_H
#define __HASH_H
/* Returns hash code. */
typedef unsigned int (*HashFunc) (const void *p);
/* Returns 0 if the pointers are equal. */
/* Create a new hash table. If initial_size is 0, the default value is used.
is used.
for smaller allocations and can also be alloconly pool. The pools must not
be free'd before hash_destroy() is called. */
/* Remove all nodes from hash table. If free_collisions is TRUE, the
memory allocated from node_pool is freed, or discarded with
alloconly pools. */
replaces the key in table to given one, while hash_update() doesnt. */
/* Calls the given function for each node in hash table. You may safely
call hash_*() functions inside your function, but if you add any
new nodes, they may or may not be called for in this foreach loop. */
/* Stop the active hash_foreach() loop */
void hash_foreach_stop(void);
/* Hash table isn't resized, and removed nodes aren't removed from
the list while hash table is freezed. Supports nesting. */
/* hash function for strings */
unsigned int str_hash(const void *p);
unsigned int strcase_hash(const void *p);
#endif