18 #define LH_PRIME 0x9e370001UL 23 #define LH_EMPTY (void*)-1 28 #define LH_FREED (void*)-2 145 #define lh_foreach(table, entry) \ 146 for(entry = table->head; entry; entry = entry->next) 151 #define lh_foreach_safe(table, entry, tmp) \ 152 for(entry = table->head; entry && ((tmp = entry->next) || 1); entry = tmp) int( lh_equal_fn)(void *k1, void *k2)
lh_entry_free_fn * free_fn
struct lh_entry * lh_table_lookup_entry(struct lh_table *t, void *k)
int lh_ptr_equal(void *k1, void *k2)
void * lh_table_lookup(struct lh_table *t, void *k)
unsigned long( lh_hash_fn)(void *k)
unsigned long lh_ptr_hash(void *k)
int lh_char_equal(void *k1, void *k2)
unsigned long lh_char_hash(void *k)
int lh_table_delete(struct lh_table *t, void *k)
void lh_table_free(struct lh_table *t)
void( lh_entry_free_fn)(struct lh_entry *e)
struct lh_table * lh_kchar_table_new(int size, char *name, lh_entry_free_fn *free_fn)
struct lh_table * lh_table_new(int size, char *name, lh_entry_free_fn *free_fn, lh_hash_fn *hash_fn, lh_equal_fn *equal_fn)
int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e)
struct lh_table * lh_kptr_table_new(int size, char *name, lh_entry_free_fn *free_fn)
int lh_table_insert(struct lh_table *t, void *k, void *v)