14 struct hashmap *hashmap_new(
size_t elsize,
size_t cap,
15 uint64_t seed0, uint64_t seed1,
16 uint64_t (*hash)(
const void *item,
17 uint64_t seed0, uint64_t seed1),
18 int (*compare)(
const void *a,
const void *b,
20 void (*elfree)(
void *item),
22 struct hashmap *hashmap_new_with_allocator(
23 void *(*malloc)(
size_t),
24 void *(*realloc)(
void *,
size_t),
26 size_t elsize,
size_t cap,
27 uint64_t seed0, uint64_t seed1,
28 uint64_t (*hash)(
const void *item,
29 uint64_t seed0, uint64_t seed1),
30 int (*compare)(
const void *a,
const void *b,
32 void (*elfree)(
void *item),
34 void hashmap_free(
struct hashmap *map);
35 void hashmap_clear(
struct hashmap *map,
bool update_cap);
36 size_t hashmap_count(
struct hashmap *map);
37 bool hashmap_oom(
struct hashmap *map);
38 void *hashmap_get(
struct hashmap *map,
const void *item);
39 void *hashmap_set(
struct hashmap *map,
const void *item);
40 void *hashmap_delete(
struct hashmap *map,
void *item);
41 void *hashmap_probe(
struct hashmap *map, uint64_t position);
42 bool hashmap_scan(
struct hashmap *map,
43 bool (*iter)(
const void *item,
void *udata),
void *udata);
44 bool hashmap_iter(
struct hashmap *map,
size_t *i,
void **item);
46 uint64_t hashmap_sip(
const void *data,
size_t len,
47 uint64_t seed0, uint64_t seed1);
48 uint64_t hashmap_murmur(
const void *data,
size_t len,
49 uint64_t seed0, uint64_t seed1);
53 void hashmap_set_allocator(
void *(*malloc)(
size_t),
void (*free)(
void*));