30#define XSTRINGIFY(x) STRINGIFY(x)
31#define STRINGIFY(x) #x
37void* (*dict_malloc_func)(size_t) = malloc;
43 const int a = *(
const int*)k1;
44 const int b = *(
const int*)k2;
45 return (a > b) - (a < b);
51 const unsigned int a = *(
const unsigned int*)k1;
52 const unsigned int b = *(
const unsigned int*)k2;
53 return (a > b) - (a < b);
59 const long a = *(
const long*)k1;
60 const long b = *(
const long*)k2;
61 return (a > b) - (a < b);
67 const unsigned long a = *(
const unsigned long*)k1;
68 const unsigned long b = *(
const unsigned long*)k2;
69 return (a > b) - (a < b);
77 const uintptr_t a = (uintptr_t) k1;
78 const uintptr_t b = (uintptr_t) k2;
79 return (a > b) - (a < b);
89 const unsigned char* a = k1;
90 const unsigned char* b = k2;
93 unsigned char p = *a++, q = *b++;
95 return (p > q) - (p < q);
103 unsigned hash = 2166136261U;
104 for (
const uint8_t* ptr = k; *ptr;) {
105 hash = (hash ^ *ptr++) * 16777619U;
int dict_ptr_cmp(const void *k1, const void *k2)
int dict_ulong_cmp(const void *k1, const void *k2)
size_t dict_free(dict *dct, dict_delete_func delete_func)
int dict_uint_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...
void dict_itor_free(dict_itor *itor)
int dict_long_cmp(const void *k1, const void *k2)
const char *const kDictVersionString
void(* dict_free_func)(void *)
A pointer to a function that libdict will use to deallocate memory.
int dict_int_cmp(const void *k1, const void *k2)
Comparison functions for common key types, for use as dict_compare_func.
#define DICT_VERSION_MINOR
void(* dict_delete_func)(void *, void *)
A pointer to a function that is called when a key-value pair gets removed from a dictionary.
#define DICT_VERSION_PATCH
#define DICT_VERSION_MAJOR
const itor_vtable * _vtable
const dict_vtable * _vtable