13 #if defined(__cplusplus)
19 struct hashmap *hashmap_new(
size_t elsize,
size_t cap, uint64_t seed0,
21 uint64_t (*hash)(
const void *item, uint64_t seed0, uint64_t seed1),
22 int (*compare)(
const void *a,
const void *b,
void *udata),
23 void (*elfree)(
void *item),
26 struct hashmap *hashmap_new_with_allocator(
void *(*malloc)(
size_t),
27 void *(*realloc)(
void *,
size_t),
void (*free)(
void*),
size_t elsize,
28 size_t cap, uint64_t seed0, uint64_t seed1,
29 uint64_t (*hash)(
const void *item, uint64_t seed0, uint64_t seed1),
30 int (*compare)(
const void *a,
const void *b,
void *udata),
31 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 const void *hashmap_get(
struct hashmap *map,
const void *item);
39 const void *hashmap_set(
struct hashmap *map,
const void *item);
40 const void *hashmap_delete(
struct hashmap *map,
const void *item);
41 const void *hashmap_probe(
struct hashmap *map, uint64_t position);
42 bool hashmap_scan(
struct hashmap *map,
bool (*iter)(
const void *item,
void *udata),
void *udata);
43 bool hashmap_iter(
struct hashmap *map,
size_t *i,
void **item);
45 uint64_t hashmap_sip(
const void *data,
size_t len, uint64_t seed0, uint64_t seed1);
46 uint64_t hashmap_murmur(
const void *data,
size_t len, uint64_t seed0, uint64_t seed1);
47 uint64_t hashmap_xxhash3(
const void *data,
size_t len, uint64_t seed0, uint64_t seed1);
49 const void *hashmap_get_with_hash(
struct hashmap *map,
const void *key, uint64_t hash);
50 const void *hashmap_delete_with_hash(
struct hashmap *map,
const void *key, uint64_t hash);
51 const void *hashmap_set_with_hash(
struct hashmap *map,
const void *item, uint64_t hash);
52 void hashmap_set_grow_by_power(
struct hashmap *map,
size_t power);
53 void hashmap_set_load_factor(
struct hashmap *map,
double load_factor);
57 void hashmap_set_allocator(
void *(*malloc)(
size_t),
void (*free)(
void*));
59 #if defined(__cplusplus)