]> pd.if.org Git - nbds/blob - include/struct.h
change the names of some variables and types for consistency across API's
[nbds] / include / struct.h
1 #ifndef STRUCT_H
2 #define STRUCT_H
3
4 #define DOES_NOT_EXIST 0
5
6 #define EXPECT_DOES_NOT_EXIST ( 0)
7 #define EXPECT_EXISTS         (-1)
8 #define EXPECT_WHATEVER       (-2)
9
10 typedef struct hti *hashtable_t;
11
12 hashtable_t *ht_alloc (void);
13 void ht_free (hashtable_t *ht);
14 uint64_t ht_get (hashtable_t *ht, const char *key, uint32_t len);
15 uint64_t ht_compare_and_set (hashtable_t *ht, const char *key, uint32_t key_len, uint64_t expected_val, uint64_t val);
16 uint64_t ht_remove (hashtable_t *ht, const char *key, uint32_t len);
17 uint64_t ht_count (hashtable_t *ht);
18
19 #endif//STRUCT_H