From d5e58616a2c729c9851c83fa24b3db419db25c48 Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Wed, 25 Oct 2017 20:30:00 +0200 Subject: [PATCH] add init function --- hashtable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hashtable.c b/hashtable.c index 193f6bd..ceab16d 100644 --- a/hashtable.c +++ b/hashtable.c @@ -23,6 +23,10 @@ entry_hash_t key_hash(entry_key_t key) { return strhash_str(key) + 1; // make hash always nonzero } +void hashtable_init(struct hashtable * table) { + memset(table, 0, sizeof(table)); +} + hashtable_iterator_t hashtable_end(struct hashtable * table) { return table->data + table->len; }