]> pd.if.org Git - nbds/blob - include/skiplist.h
more header file refactoring
[nbds] / include / skiplist.h
1 #ifndef SKIPLIST_H
2 #define SKIPLIST_H
3
4 #include "map.h"
5
6 typedef struct sl skiplist_t;
7
8 skiplist_t *sl_alloc (const datatype_t *key_type);
9 uint64_t sl_cas    (skiplist_t *sl, void *key, uint64_t expected_val, uint64_t new_val);
10 uint64_t sl_lookup (skiplist_t *sl, void *key);
11 uint64_t sl_remove (skiplist_t *sl, void *key);
12 uint64_t sl_count  (skiplist_t *sl);
13 void     sl_print  (skiplist_t *sl);
14 void     sl_free   (skiplist_t *sl);
15
16 static const map_impl_t sl_map_impl = { 
17     (map_alloc_t)sl_alloc, (map_cas_t)sl_cas, (map_get_t)sl_lookup, (map_remove_t)sl_remove, 
18     (map_count_t)sl_count, (map_print_t)sl_print, (map_free_t)sl_free
19 };
20
21 #endif//SKIPLIST_H