]> pd.if.org Git - nbds/blob - include/list.h
in txn, use a "naked" value without an update record whenever possible
[nbds] / include / list.h
1 #ifndef LIST_H
2 #define LIST_H
3
4 #include "map.h"
5
6 typedef struct ll list_t;
7
8 list_t * ll_alloc  (const datatype_t *key_type);
9 uint64_t ll_cas    (list_t *ll, void *key, uint64_t expected_val, uint64_t new_val);
10 uint64_t ll_lookup (list_t *ll, void *key);
11 uint64_t ll_remove (list_t *ll, void *key);
12 uint64_t ll_count  (list_t *ll);
13 void     ll_print  (list_t *ll);
14 void     ll_free   (list_t *ll);
15
16 static const map_impl_t ll_map_impl = { 
17     (map_alloc_t)ll_alloc, (map_cas_t)ll_cas, (map_get_t)ll_lookup, (map_remove_t)ll_remove, 
18     (map_count_t)ll_count, (map_print_t)ll_print, (map_free_t)ll_free
19 };
20
21 #endif//LIST_H