Go to the source code of this file.
|
| int | dict_int_cmp (const void *k1, const void *k2) |
| | Comparison functions for common key types, for use as dict_compare_func.
|
| |
| int | dict_uint_cmp (const void *k1, const void *k2) |
| |
| int | dict_long_cmp (const void *k1, const void *k2) |
| |
| int | dict_ulong_cmp (const void *k1, const void *k2) |
| |
| int | dict_ptr_cmp (const void *k1, const void *k2) |
| |
| int | dict_str_cmp (const void *k1, const void *k2) |
| |
| unsigned | dict_str_hash (const void *k) |
| | FNV-1a hash of a NUL-terminated string, over its bytes in order, so a key hashes to the same value on every platform.
|
| |
| size_t | dict_free (dict *dct, dict_delete_func delete_func) |
| |
| void | dict_itor_free (dict_itor *itor) |
| |
|
| const char *const | kDictVersionString |
| |
| void *(* | dict_malloc_func )(size_t) = malloc |
| | A pointer to a function that libdict will use to allocate memory.
|
| |
| void(* | dict_free_func )(void *) = free |
| | A pointer to a function that libdict will use to deallocate memory.
|
| |
◆ STRINGIFY
Value:
Definition at line 31 of file dict.c.
◆ XSTRINGIFY
Value:
Definition at line 30 of file dict.c.
◆ dict_free()
◆ dict_int_cmp()
| int dict_int_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
Comparison functions for common key types, for use as dict_compare_func.
The keys are pointers to values of the type, except for dict_ptr_cmp, which orders the key pointers themselves (by address, as uintptr_t), and dict_str_cmp, which takes NUL-terminated strings. dict_str_cmp orders bytes as unsigned char, exactly as strcmp() does, so string keys sort the same on every platform.
Definition at line 41 of file dict.c.
◆ dict_itor_free()
◆ dict_long_cmp()
| int dict_long_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
◆ dict_ptr_cmp()
| int dict_ptr_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
◆ dict_str_cmp()
| int dict_str_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
◆ dict_str_hash()
| unsigned dict_str_hash |
( |
const void * | str | ) |
|
FNV-1a hash of a NUL-terminated string, over its bytes in order, so a key hashes to the same value on every platform.
For use as dict_hash_func.
Definition at line 100 of file dict.c.
◆ dict_uint_cmp()
| int dict_uint_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
◆ dict_ulong_cmp()
| int dict_ulong_cmp |
( |
const void * | k1, |
|
|
const void * | k2 ) |
◆ dict_free_func
| void(* dict_free_func) (void *) |
( |
void * | | ) |
= free |
A pointer to a function that libdict will use to deallocate memory.
Definition at line 38 of file dict.c.
◆ dict_malloc_func
| void *(* dict_malloc_func) (size_t) |
( |
size_t | | ) |
= malloc |
A pointer to a function that libdict will use to allocate memory.
Definition at line 37 of file dict.c.
◆ kDictVersionString
| const char* const kDictVersionString |
Initial value:
Definition at line 33 of file dict.c.