aboutsummaryrefslogtreecommitdiff
path: root/src/hamt.h
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2024-11-16 17:20:23 +0200
committerkartofen <mladenovnasko0@gmail.com>2024-11-16 17:20:23 +0200
commit1945dbf8345a2b59e9057d21e38c78913272bdaa (patch)
tree6f908d5feb358d5deb37e3137684208408a52186 /src/hamt.h
parent0dd38d08551ac2fcff53eb604f6363f37b25aef9 (diff)
cleanup and minor refactoringHEADmaster
Diffstat (limited to 'src/hamt.h')
-rw-r--r--src/hamt.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/hamt.h b/src/hamt.h
deleted file mode 100644
index 6ef27ba..0000000
--- a/src/hamt.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef HAMT_H
-#define HAMT_H
-
-#include <stdint.h>
-
-typedef struct hamt *hamt_t;
-
-// tagged pointer to either
-// hamt_item or hamt_nodelist
-typedef uintptr_t hamtptr_t;
-
-struct hamt_item {
- uint32_t refs;
-
- void *key;
- void *data;
- struct hamt_item *next;
-};
-
-struct hamt_nodelist {
- uint32_t refs;
-
- uint64_t bitmask;
- hamtptr_t *list;
-};
-
-typedef int (*hamt_equal_fn)(void *key1, void *key2);
-typedef uint32_t (*hamt_hash_fn)(void *key);
-
-struct hamt {
- hamt_equal_fn equal_fn;
- hamt_hash_fn hash_fn;
-
- hamtptr_t root;
-};
-
-hamt_t hamt_create(hamt_equal_fn equal_fn, hamt_hash_fn hash_fn);
-void hamt_destroy(hamt_t hamt);
-
-hamt_t hamt_clone(hamt_t src);
-
-int hamt_get(hamt_t hamt, void *key, void **data);
-int hamt_set(hamt_t hamt, void *key, void *data, void **keyptr, void **prevdata);
-
-#endif