]> pd.if.org Git - nbds/blob - include/struct.h
move files around
[nbds] / include / struct.h
1 #ifndef STRUCT_H
2 #define STRUCT_H
3
4 #define DOES_NOT_EXIST 0
5
6 #define HT_EXPECT_NOT_EXISTS ( 0)
7 #define HT_EXPECT_EXISTS     (-1)
8 #define HT_EXPECT_WHATEVER   (-2)
9
10 typedef struct hash_table_i *hash_table_t;
11
12 hash_table_t *ht_alloc (void);
13 void ht_free (hash_table_t *ht);
14 uint64_t ht_get (hash_table_t *ht, const char *key, uint32_t len);
15 uint64_t ht_compare_and_set (hash_table_t *ht, const char *key, uint32_t key_len, uint64_t expected_val, uint64_t val);
16 uint64_t ht_remove (hash_table_t *ht, const char *key, uint32_t len);
17 uint64_t ht_count (hash_table_t *ht);
18
19 #endif//STRUCT_H