]> begriffs open source - libderp/blob - include/hashmap.h
Fix memory leaks
[libderp] / include / hashmap.h
1 #ifndef LIBDERP_HASHMAP_H
2 #define LIBDERP_HASHMAP_H
3
4 #include "common.h"
5
6 #include <stdbool.h>
7 #include <stddef.h>
8 #include <stdint.h>
9
10 typedef struct hashmap hashmap;
11
12 hashmap * hm_new(size_t, hashfn *, comparator *, void *cmp_aux);
13 void      hm_free(hashmap *);
14 void      hm_dtor(hashmap *, dtor *key_dtor, dtor *val_dtor, void *aux);
15 size_t    hm_length(const hashmap *);
16 bool      hm_is_empty(const hashmap *);
17 void *    hm_at(const hashmap *, const void *);
18 bool      hm_insert(hashmap *, void *key, void *val);
19 bool      hm_remove(hashmap *, void *);
20 void      hm_clear(hashmap *);
21
22 #endif