13 #define HASH_LEN table->key_num
14 #define HASH(x,y) hash_table_do_hash(x,y,HASH_LEN)
46 #define hash_table_element_s sizeof(hash_table_element_t)
92 #define hash_table_s sizeof(hash_table_t)
143 #define HT_ADD(table, key, value) hash_table_add(table, (void *) key, sizeof(*key), (void *) value, sizeof(*value))
165 #define HT_REMOVE(table, key) hash_table_remove(table, key, sizeof(*key))
184 #define HT_LOOKUP(table, key) hash_table_lookup(table, key, sizeof(*key))
204 #define HT_HAS_KEY(table, key) hash_table_has_key(table, key, sizeof(*key))
250 void *value,
void *key,
size_t key_len),
void *user);
uint16_t hash_table_do_hash(void *key, size_t key_len, uint16_t max_key)
Definition: hashtable.c:432
int hash_table_iterate(hash_table_t *table, int(*fct)(void *user, void *value, void *key, size_t key_len), void *user)
Definition: hashtable.c:505
int hash_table_add(hash_table_t *, void *, size_t, void *, size_t)
Definition: hashtable.c:104
Definition: hashtable.h:55
void * hash_table_lookup(hash_table_t *, void *, size_t)
Definition: hashtable.c:276
struct hash_table hash_table_t
hash_table_element_t ** store_house
Definition: hashtable.h:69
size_t hash_table_get_elements(hash_table_t *, hash_table_element_t ***)
Definition: hashtable.c:390
Definition: hashtable.h:53
hash_table_mode
Definition: hashtable.h:51
int hash_table_resize(hash_table_t *, size_t)
Definition: hashtable.c:460
size_t hash_table_get_keys(hash_table_t *, void ***)
Definition: hashtable.c:352
size_t key_count
Definition: hashtable.h:79
size_t key_len
Definition: hashtable.h:28
Definition: hashtable.h:57
int hash_table_remove(hash_table_t *, void *, size_t)
Definition: hashtable.c:219
void * value
Definition: hashtable.h:40
void * key
Definition: hashtable.h:36
hash_table_t * hash_table_new(hash_table_mode_t)
Definition: hashtable.c:51
hash_table_mode_t mode
Definition: hashtable.h:74
size_t value_len
Definition: hashtable.h:32
size_t key_ratio
Definition: hashtable.h:89
hash_table_element_t * hash_table_element_new()
Definition: hashtable.c:18
stores an hash table element for use in the hash table
Definition: hashtable.h:23
void hash_table_delete(hash_table_t *)
Definition: hashtable.c:77
enum hash_table_mode hash_table_mode_t
uint16_t key_num
Definition: hashtable.h:84
identifies the hashtable for which operations are to be performed
Definition: hashtable.h:64
hash_table_element_t * next
Definition: hashtable.h:44
int hash_table_has_key(hash_table_t *, void *, size_t)
Definition: hashtable.c:316
void hash_table_element_delete(hash_table_t *, hash_table_element_t *)
Definition: hashtable.c:29