]> pd.if.org Git - nbds/blobdiff - include/struct.h
generalize list into an updatable list-based map
[nbds] / include / struct.h
index 3bb724bc6dae5870ee1fcddadae3aee5a14caedd..359c4cf5901f377cea6af6fe77adbc4ec554a6dc 100644 (file)
@@ -9,16 +9,14 @@
 
 typedef struct ht hashtable_t;
 hashtable_t *ht_alloc (void);
-void ht_free (hashtable_t *ht);
-
 uint64_t ht_compare_and_set (hashtable_t *ht, const char *key, uint32_t key_len, uint64_t expected_val, uint64_t val);
 uint64_t ht_get    (hashtable_t *ht, const char *key, uint32_t len);
 uint64_t ht_remove (hashtable_t *ht, const char *key, uint32_t len);
 uint64_t ht_count  (hashtable_t *ht);
+void     ht_free   (hashtable_t *ht);
 
 typedef struct ll list_t;
-list_t * ll_alloc (void);
-
+list_t * ll_alloc  (void);
 uint64_t ll_lookup (list_t *ll, const void *key_data, uint32_t key_len);
 uint64_t ll_cas    (list_t *ll, const void *key_data, uint32_t key_len, uint64_t expected_val, uint64_t new_val);
 uint64_t ll_remove (list_t *ll, const void *key_data, uint32_t key_len);
@@ -26,7 +24,6 @@ void     ll_print  (list_t *ll);
 
 typedef struct sl skiplist_t;
 skiplist_t * sl_alloc (void);
-
 uint64_t sl_lookup (skiplist_t *sl, const void *key_data, uint32_t key_len);
 uint64_t sl_add    (skiplist_t *sl, const void *key_data, uint32_t key_len, uint64_t value);
 uint64_t sl_remove (skiplist_t *sl, const void *key_data, uint32_t key_len);