|
| #define | HASH_CLASSIC 128 |
| | Murmur hash using hash key string, hash key numeric value, index table with lists of elements.
|
| |
| #define | HASH_DOUBLE 2 |
| | value of double type inside the hash node
|
| |
| #define | HASH_INT 1 |
| | compatibility with existing rot func
|
| |
| #define | HASH_INT_TYPE int64_t |
| | type of a HASH_INT in 64 bits
|
| |
| #define | HASH_PTR 8 |
| | value of pointer type inside the hash node
|
| |
| #define | HASH_STRING 4 |
| | value of char * type inside the hash node
|
| |
| #define | HASH_TRIE 256 |
| | TRIE tree using hash key string.
|
| |
| #define | HASH_UNKNOWN 16 |
| | value of unknow type inside the hash node
|
| |
| #define | hash_val(node, type) ((node && node->ptr) ? ((type*)(((HASH_NODE*)node->ptr)->data.ptr)) : NULL) |
| | Cast a HASH_NODE element.
|
| |
| #define | HASH_VAL(node, type) ((node && node->data.ptr) ? ((type*)node->data.ptr) : NULL) |
| | Cast a HASH_NODE element.
|
| |
| #define | ht_foreach(__ITEM_, __HASH_) |
| | ForEach macro helper (classic / old)
|
| |
| #define | HT_FOREACH(__ITEM_, __HASH_, ...) |
| | ForEach macro helper.
|
| |
| #define | HT_FOREACH_R(__ITEM_, __HASH_, __ITERATOR, ...) |
| | ForEach macro helper.
|
| |
| #define | ht_foreach_r(__ITEM_, __HASH_, __ITERATOR_) |
| | ForEach macro helper, reentrant (classic / old)
|
| |
| #define | MurmurHash(__key, __len, __seed, __out) MurmurHash3_x64_128(__key, __len, __seed, __out) |
| | Murmur hash macro helper 64 bits.
|
| |
|
| int | destroy_ht (HASH_TABLE **table) |
| | empty a table and destroy it
|
| |
| int | empty_ht (HASH_TABLE *table) |
| | empty a table
|
| |
| LIST * | ht_get_completion_list (HASH_TABLE *table, const char *keybud, size_t max_results) |
| | get next matching keys in table tree
|
| |
| int | ht_get_double (HASH_TABLE *table, const char *key, double *val) |
| | get double at 'key' from 'table'
|
| |
| int | ht_get_int (HASH_TABLE *table, const char *key, int64_t *val) |
| | get node at 'key' from 'table'
|
| |
| HASH_NODE * | ht_get_node (HASH_TABLE *table, const char *key) |
| | get node at 'key' from 'table'
|
| |
| HASH_NODE * | ht_get_node_ex (HASH_TABLE *table, HASH_VALUE hash_value) |
| | return the associated key's node inside the hash_table (HASH_CLASSIC only)
|
| |
| size_t | ht_get_optimal_size (HASH_TABLE *table) |
| | get optimal array size based on nb=(number_of_key*1.3) && if( !isprime(nb) )nb=nextprime(nb) (HASH_CLASSIC mode only)
|
| |
| int | ht_get_ptr (HASH_TABLE *table, const char *key, void **val) |
| | get pointer at 'key' from 'table'
|
| |
| int | ht_get_ptr_ex (HASH_TABLE *table, HASH_VALUE hash_value, void **val) |
| | Retrieve a pointer value in the hash table, at the given key.
|
| |
| int | ht_get_string (HASH_TABLE *table, const char *key, char **val) |
| | get string at 'key' from 'table'
|
| |
| int | ht_get_table_collision_percentage (HASH_TABLE *table) |
| | get table collision percentage (HASH_CLASSIC mode only)
|
| |
| char * | ht_node_type (HASH_NODE *node) |
| | get the type of a node , text version
|
| |
| int | ht_optimize (HASH_TABLE **table) |
| | try an automatic optimization of the table
|
| |
| void | ht_print (HASH_TABLE *table) |
| | print contents of table
|
| |
| int | ht_put_double (HASH_TABLE *table, const char *key, double value) |
| | put a double value with given key in the targeted hash table
|
| |
| int | ht_put_int (HASH_TABLE *table, const char *key, int64_t value) |
| | put an integral value with given key in the targeted hash table
|
| |
| int | ht_put_ptr (HASH_TABLE *table, const char *key, void *ptr, void(*destructor)(void *ptr)) |
| | put a pointer to the string value with given key in the targeted hash table
|
| |
| int | ht_put_ptr_ex (HASH_TABLE *table, HASH_VALUE hash_value, void *val, void(*destructor)(void *ptr)) |
| | put a pointer value with given key in the targeted hash table (HASH_CLASSIC only)
|
| |
| int | ht_put_string (HASH_TABLE *table, const char *key, char *string) |
| | put a string value (copy/dup) with given key in the targeted hash table
|
| |
| int | ht_put_string_ptr (HASH_TABLE *table, const char *key, char *string) |
| | put a string value (pointer) with given key in the targeted hash table
|
| |
| int | ht_remove (HASH_TABLE *table, const char *key) |
| | remove and delete node at key in table
|
| |
| int | ht_remove_ex (HASH_TABLE *table, HASH_VALUE hash_value) |
| | Remove a key from a hash table (HASH_CLASSIC only)
|
| |
| int | ht_resize (HASH_TABLE **table, size_t size) |
| | rehash table according to size (HASH_CLASSIC mode only)
|
| |
| LIST * | ht_search (HASH_TABLE *table, int(*node_is_matching)(HASH_NODE *node)) |
| | seach table for matching nodes
|
| |
| int | is_prime (size_t nb) |
| | test if number is a prime number or not
|
| |
| void | MurmurHash3_x64_128 (const void *key, const size_t len, const uint64_t seed, void *out) |
| | MurmurHash3 was written by Austin Appleby, and is placed in the public domain.
|
| |
| void | MurmurHash3_x86_128 (const void *key, const size_t len, const uint32_t seed, void *out) |
| | MurmurHash3 was written by Austin Appleby, and is placed in the public domain.
|
| |
| void | MurmurHash3_x86_32 (const void *key, const size_t len, const uint32_t seed, void *out) |
| | MurmurHash3 was written by Austin Appleby, and is placed in the public domain.
|
| |
| HASH_TABLE * | new_ht (size_t size) |
| | Create a hash table with the given size.
|
| |
| HASH_TABLE * | new_ht_trie (size_t alphabet_size, size_t alphabet_offset) |
| | create a TRIE hash table with the alphabet_size, each key value beeing decreased by alphabet_offset
|
| |
| size_t | next_prime (size_t nb) |
| | compute next prime number after nb
|
| |
Hash functions and table.
- Author
- Castagnier Mickael
- Version
- 2.0
- Date
- 16/03/2015
Definition in file n_hash.h.