Data Structures | |
| struct | lh_entry |
| struct | lh_table |
Defines | |
| #define | LH_PRIME 0x9e370001UL |
| #define | LH_EMPTY (void*)-1 |
| #define | LH_FREED (void*)-2 |
| #define | lh_foreach(table, entry) for(entry = table->head; entry; entry = entry->next) |
| #define | lh_foreach_safe(table, entry, tmp) for(entry = table->head; entry && ((tmp = entry->next) || 1); entry = tmp) |
Typedefs | |
| typedef unsigned | long (lh_hash_fn)(void *k) |
| typedef void * | k2 |
Functions | |
| typedef | void (lh_entry_free_fn)(struct lh_en *e) |
| typedef | int (lh_equal_fn)(void *k1 |
| unsigned long | lh_ptr_hash (void *k) |
| int | lh_ptr_equal (void *k1, void *k2) |
| unsigned long | lh_char_hash (void *k) |
| int | lh_char_equal (void *k1, void *k2) |
| 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) |
| lh_table * | lh_kchar_table_new (int size, char *name, lh_entry_free_fn *free_fn) |
| lh_table * | lh_kptr_table_new (int size, char *name, lh_entry_free_fn *free_fn) |
| void | lh_table_free (struct lh_table *t) |
| int | lh_table_insert (struct lh_table *t, void *k, void *v) |
| lh_entry * | lh_table_lookup_entry (struct lh_table *t, void *k) |
| void * | lh_table_lookup (struct lh_table *t, void *k) |
| int | lh_table_delete_entry (struct lh_table *t, struct lh_entry *e) |
| int | lh_table_delete (struct lh_table *t, void *k) |
|
|
sentinel pointer value for empty slots |
|
|
Convenience list iterator. |
|
|
lh_foreach_safe allows calling of deletion routine while iterating. |
|
|
sentinel pointer value for freed slots |
|
|
golden prime used in hash functions |
|
|
|
|
|
callback function prototypes |
|
|
callback function prototypes |
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
Convenience function to create a new linkhash table with char keys.
|
|
||||||||||||||||
|
Convenience function to create a new linkhash table with ptr keys.
|
|
||||||||||||
|
|
|
|
Pre-defined hash and equality functions |
|
||||||||||||
|
Delete a record from the table. If a callback free function is provided then it is called for the for the item being deleted.
|
|
||||||||||||
|
Delete a record from the table. If a callback free function is provided then it is called for the for the item being deleted.
|
|
|
Free a linkhash table. If a callback free function is provided then it is called for all entries in the table.
|
|
||||||||||||||||
|
Insert a record into the table.
|
|
||||||||||||
|
Lookup a record into the table
|
|
||||||||||||
|
Lookup a record into the table.
|
|
||||||||||||||||||||||||
|
Create a new linkhash table.
|
|
|
callback function prototypes |
1.2.15