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