2 * Written by Josh Dybnis and released to the public domain, as explained at
3 * http://creativecommons.org/licenses/publicdomain
10 #define HT_EXPECT_NOT_EXISTS ( 0)
11 #define HT_EXPECT_EXISTS (-1)
12 #define HT_EXPECT_WHATEVER (-2)
14 typedef struct hash_table_i *hash_table_t;
16 hash_table_t *ht_alloc (void);
17 void ht_free (hash_table_t *ht);
18 uint64_t ht_get (hash_table_t *ht, const char *key, uint32_t len);
19 uint64_t ht_compare_and_set (hash_table_t *ht, const char *key, uint32_t key_len, uint64_t expected_val, uint64_t val);
20 uint64_t ht_remove (hash_table_t *ht, const char *key, uint32_t len);
21 uint64_t ht_count (hash_table_t *ht);