]> pd.if.org Git - nbds/blobdiff - include/ht.h
lock-free skiplist
[nbds] / include / ht.h
index b396ce86170b619656d32957c185d301badc8e56..49198bb3efc1d829081fd908e9cdcb9eb0818bc3 100644 (file)
@@ -5,9 +5,7 @@
 #ifndef HT_H
 #define HT_H
 
-#include "common.h"
-
-#define DOES_NOT_EXIST 0
+#include "struct.h"
 
 #define HT_EXPECT_NOT_EXISTS ( 0)
 #define HT_EXPECT_EXISTS     (-1)
@@ -17,9 +15,9 @@ typedef struct hash_table_i *hash_table_t;
 
 hash_table_t *ht_alloc (void);
 void ht_free (hash_table_t *ht);
-int64_t ht_get (hash_table_t *ht, const char *key, uint32_t len);
-int64_t ht_compare_and_set (hash_table_t *ht, const char *key, uint32_t key_len, int64_t expected_val, int64_t val);
-int64_t ht_remove (hash_table_t *ht, const char *key, uint32_t len);
+uint64_t ht_get (hash_table_t *ht, const char *key, uint32_t len);
+uint64_t ht_compare_and_set (hash_table_t *ht, const char *key, uint32_t key_len, uint64_t expected_val, uint64_t val);
+uint64_t ht_remove (hash_table_t *ht, const char *key, uint32_t len);
 uint64_t ht_count (hash_table_t *ht);
 
 #endif//HT_H