]> begriffs open source - libderp/blob - include/hashmap.h
Hore hashmap tests
[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 *,
13                  comparator *, void *,
14                  void (*key_dtor)(void *),
15                  void (*val_dtor)(void *));
16 void      hm_free(hashmap *);
17 size_t    hm_length(const hashmap *);
18 bool      hm_is_empty(const hashmap *);
19 void *    hm_at(const hashmap *, const void *);
20 bool      hm_insert(hashmap *, void *key, void *val);
21 bool      hm_remove(hashmap *, void *);
22 void      hm_clear(hashmap *);
23
24 #endif