aboutsummaryrefslogtreecommitdiff
path: root/src/hashtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hashtable.h')
-rw-r--r--src/hashtable.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hashtable.h b/src/hashtable.h
index f593432..8f73066 100644
--- a/src/hashtable.h
+++ b/src/hashtable.h
@@ -33,7 +33,9 @@ void *table_reset(struct table *table, int *count);
#include <stdlib.h>
#include <string.h>
-static struct bucket *
+#define internal static
+
+internal struct bucket *
table_new_bucket(void *key, void *value)
{
struct bucket *bucket = malloc(sizeof(struct bucket));
@@ -43,7 +45,7 @@ table_new_bucket(void *key, void *value)
return bucket;
}
-static struct bucket **
+internal struct bucket **
table_get_bucket(struct table *table, void *key)
{
struct bucket **bucket = table->buckets + (table->hash(key) % table->capacity);
@@ -56,6 +58,8 @@ table_get_bucket(struct table *table, void *key)
return bucket;
}
+#undef internal
+
void table_init(struct table *table, int capacity, table_hash_func hash, table_compare_func compare)
{
table->count = 0;