aboutsummaryrefslogtreecommitdiff
path: root/include/bh/internal/hashmap.h
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2024-04-13 14:52:29 +0300
committerMikhail Romanko <me@blankhex.com>2024-04-13 14:52:29 +0300
commitac5df0ebe9a6ac67b9be4cc319f5cd0625b50178 (patch)
tree5532f9fd219691476fb3be127f228f3a07325e4b /include/bh/internal/hashmap.h
downloadbhlib-old-ac5df0ebe9a6ac67b9be4cc319f5cd0625b50178.tar.gz
Initial commit
Diffstat (limited to 'include/bh/internal/hashmap.h')
-rw-r--r--include/bh/internal/hashmap.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/bh/internal/hashmap.h b/include/bh/internal/hashmap.h
new file mode 100644
index 0000000..8d62c16
--- /dev/null
+++ b/include/bh/internal/hashmap.h
@@ -0,0 +1,30 @@
+#ifndef BHLIB_INTERNAL_HASHMAP_H
+#define BHLIB_INTERNAL_HASHMAP_H
+
+#include <bh/hashmap.h>
+
+typedef struct bh_hashmap_node_s
+{
+ void *key;
+ void *value;
+} bh_hashmap_node_t;
+
+struct bh_hashmap_s
+{
+ bh_hashmap_node_t *data;
+ size_t *psls;
+ size_t size;
+ size_t capacity;
+ size_t threshold;
+ bh_equal_cb_t equal;
+ bh_hash_cb_t hash;
+ float factor;
+};
+
+void bh_hashmap_init(bh_hashmap_t *hashmap,
+ bh_equal_cb_t equal,
+ bh_hash_cb_t hash);
+
+void bh_hashmap_destroy(bh_hashmap_t *hashmap);
+
+#endif /* BHLIB_INTERNAL_HASHMAP_H */