Go to the source code of this file.
Macros | |
| #define | hash_isfull(H) |
| #define | hash_isempty(H) |
| #define | hash_count(H) |
| #define | hash_size(H) |
| #define | hnode_get(N) |
| #define | hnode_getkey(N) |
| #define | hnode_put(N, V) |
Functions | |
| hash_t * | hash_create (hashcount_t, hash_comp_t, hash_fun_t) |
| Create a dynamic hash table. | |
| void | hash_set_allocator (hash_t *, hnode_alloc_t, hnode_free_t, void *) |
| void | hash_destroy (hash_t *) |
| void | hash_free_nodes (hash_t *) |
| void | hash_free (hash_t *) |
| hash_t * | hash_init (hash_t *, hashcount_t, hash_comp_t, hash_fun_t, hnode_t **, hashcount_t) |
| void | hash_insert (hash_t *, hnode_t *, const void *) |
| Insert a node into the hash table. | |
| hnode_t * | hash_lookup (hash_t *, const void *) |
| Find a node in the hash table and return a pointer to it. | |
| hnode_t * | hash_delete (hash_t *, hnode_t *) |
| Delete the given node from the hash table. Since the chains are singly linked, we must locate the start of the node's chain and traverse. | |
| int | hash_alloc_insert (hash_t *, const void *, void *) |
| void | hash_delete_free (hash_t *, hnode_t *) |
| void | hnode_put (hnode_t *, void *) |
| void * | hnode_get (hnode_t *) |
| const void * | hnode_getkey (hnode_t *) |
| hashcount_t | hash_count (hash_t *) |
| hashcount_t | hash_size (hash_t *) |
| int | hash_isfull (hash_t *) |
| int | hash_isempty (hash_t *) |
| void | hash_scan_begin (hscan_t *, hash_t *) |
| Initialize a hash scanner. | |
| hnode_t * | hash_scan_next (hscan_t *) |
| Retrieve the next node from the hash table, and update the pointer for the next invocation of hash_scan_next(). | |
| hnode_t * | hash_scan_delete (hash_t *, hnode_t *) |
| void | hash_scan_delfree (hash_t *, hnode_t *) |
| int | hash_verify (hash_t *) |
| Verify whether the given object is a valid hash table. | |
| hnode_t * | hnode_create (void *) |
| hnode_t * | hnode_init (hnode_t *, void *) |
| void | hnode_destroy (hnode_t *) |
| #define hash_count | ( | H | ) |
| #define hash_isempty | ( | H | ) |
| #define hash_isfull | ( | H | ) |
| #define hash_size | ( | H | ) |
| #define hnode_get | ( | N | ) |
| #define hnode_getkey | ( | N | ) |
| #define hnode_put | ( | N, | |
| V ) |
|
extern |
|
extern |
|
extern |
Create a dynamic hash table.
Both the hash table structure and the table itself are dynamically allocated. Furthermore, the table is extendible in that it will automatically grow as its load factor increases beyond a certain threshold.
Delete the given node from the hash table. Since the chains are singly linked, we must locate the start of the node's chain and traverse.
|
extern |
Free a dynamic hash table structure.
|
extern |
|
extern |
Free every node in the hash using the hash->freenode() function pointer, and cause the hash to become empty.
|
extern |
Insert a node into the hash table.
|
extern |
|
extern |
Find a node in the hash table and return a pointer to it.
Initialize a hash scanner.
Reset the hash scanner so that the next element retrieved by hash_scan_next() shall be the first element on the first non-empty chain.
Exactly like hash_delete, except does not trigger table shrinkage. This is to be used from within a hash table scan operation. See notes for hash_delete.
Like hash_delete_free but based on hash_scan_delete.
Retrieve the next node from the hash table, and update the pointer for the next invocation of hash_scan_next().
|
extern |
Select a different set of node allocator routines.
|
extern |
|
extern |
Verify whether the given object is a valid hash table.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |