From efac7f7747b6919c979fbc5ce09a00a9ea1600a6 Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 31 Jan 2025 18:10:01 -0500 Subject: [PATCH] Added hashtable header. --- src/include/htab.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/include/htab.h diff --git a/src/include/htab.h b/src/include/htab.h new file mode 100644 index 0000000..6891731 --- /dev/null +++ b/src/include/htab.h @@ -0,0 +1,26 @@ +#ifndef HTAB_H +#define HTAB_H + +#include +#define HTAB_SPACE 128 + +// Hash Table. +typedef struct {} HTab; + +// Create a new hash table. +HTab* htab_init(); +// Destroy a hash table. +void htab_destroy(HTab* htab); + +// Get element at `hash`. Return its contents, or NULL if nothing found. +void* htab_get(HTab* htab, int hash); + +// Insert `data` at index `hash`. +void htab_ins(HTab* htab, int key, void* data); + +// Gets the length of the hash table. +size_t htab_ln(HTab* htab); + + + +#endif