hash.h revision b53af186aa40192111856e5e76a9769dde87c824
#ifndef HASH_H
#define HASH_H
/* Returns hash code. */
typedef unsigned int hash_callback_t(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.
for smaller allocations and can also be alloconly pool. The pools must not
be free'd before hash_table_destroy() is called. */
struct hash_table *
/* Remove all nodes from hash table. If free_collisions is TRUE, the
memory allocated from node_pool is freed, or discarded with
alloconly pools. */
const void *lookup_key,
replaces the key in table to given one, while hash_table_update() doesnt. */
/* Iterates through all nodes in hash table. You may safely call hash_table_*()
functions while iterating, but if you add any new nodes, they may or may
not be called for in this iteration. */
/* Hash table isn't resized, and removed nodes aren't removed from
the list while hash table is freezed. Supports nesting. */
/* Copy all nodes from one hash table to another */
/* hash function for strings */
unsigned int strcase_hash(const void *p) ATTR_PURE;
/* a generic hash for a given memory block */
#endif