summaryrefslogtreecommitdiff
path: root/src/ht.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ht.h')
-rw-r--r--src/ht.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ht.h b/src/ht.h
new file mode 100644
index 0000000..54c0497
--- /dev/null
+++ b/src/ht.h
@@ -0,0 +1,23 @@
+#ifndef HT_H
+#define HT_H
+#include "util.h"
+
+enum { HT_INIT_CAP = 257 };
+
+typedef struct ht_s ht;
+
+ht *new_ht(UNUM size);
+
+void destroy_ht(ht * restrict htp, int flag);
+
+BOOL ht_insert(ht *htp, NUM key, void *value);
+
+/* This is just for the completeness. In theory I do not need to
+ delete keys.
+
+ If FLAG is non-zero, also free the value pointer. */
+BOOL ht_delete(ht * const restrict htp, NUM key, int flag);
+
+void *ht_find(ht * const restrict htp, NUM key);
+
+#endif