]> pd.if.org Git - nbds/blob - include/hashtable.h
more header file refactoring
[nbds] / include / hashtable.h
1 #ifndef HASHTABLE_H
2 #define HASHTABLE_H
3
4 #include "map.h"
5
6 typedef struct ht hashtable_t;
7
8 hashtable_t *ht_alloc (const datatype_t *key_type);
9 uint64_t ht_cas    (hashtable_t *ht, void *key, uint64_t expected_val, uint64_t val);
10 uint64_t ht_get    (hashtable_t *ht, void *key);
11 uint64_t ht_remove (hashtable_t *ht, void *key);
12 uint64_t ht_count  (hashtable_t *ht);
13 void     ht_print  (hashtable_t *ht);
14 void     ht_free   (hashtable_t *ht);
15
16 static const map_impl_t ht_map_impl = { 
17     (map_alloc_t)ht_alloc, (map_cas_t)ht_cas, (map_get_t)ht_get, (map_remove_t)ht_remove, 
18     (map_count_t)ht_count, (map_print_t)ht_print, (map_free_t)ht_free
19 };
20
21 #endif//HASHTABLE_H