aboutsummaryrefslogtreecommitdiff
path: root/hashtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'hashtable.h')
-rw-r--r--hashtable.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/hashtable.h b/hashtable.h
new file mode 100644
index 0000000..b85c2e0
--- /dev/null
+++ b/hashtable.h
@@ -0,0 +1,15 @@
+#pragma once
+
+
+struct hashtable;
+
+struct hashtable* ht_alloc();
+void ht_free(struct hashtable *ht);
+
+void ht_insert(struct hashtable *ht, unsigned int key, void *value);
+
+// Returns NULL if key is not present in the table.
+void* ht_find(const struct hashtable *ht, unsigned int key);
+
+// Does nothing if the key is not present in the table.
+void ht_delete(struct hashtable *ht, unsigned int key);