From 63f11aaec8d21844a07fd27003a992c102a3a297 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 27 Dec 2024 20:05:06 -0800 Subject: make directory structure for client --- server/hash_table.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 server/hash_table.c (limited to 'server/hash_table.c') diff --git a/server/hash_table.c b/server/hash_table.c new file mode 100644 index 0000000..cced194 --- /dev/null +++ b/server/hash_table.c @@ -0,0 +1,11 @@ +#include +#include +#include + +ht_t *init_ht(size_t size) { + ht_t *ht = safe_calloc(1, sizeof(size)); + size_t realsize = size == 0 ? DEFAULT_HT_SIZE : size; + ht->buckets = safe_calloc(realsize, sizeof(sll_t *)); + ht->size = realsize; + return ht; +} -- cgit