aboutsummaryrefslogtreecommitdiff
path: root/src/hashtable.h
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2019-03-02 10:33:53 +0100
committerkoekeishiya <aasvi93@hotmail.com>2019-03-02 10:33:53 +0100
commite23811d884b9dae356c84e4515ef52184aa3432c (patch)
treec958c07378b6b613536cceff79912382daff32ba /src/hashtable.h
parentb55ce42591ac45a82d2339844631f7a50cedef90 (diff)
downloadskhd-e23811d884b9dae356c84e4515ef52184aa3432c.tar.gz
skhd-e23811d884b9dae356c84e4515ef52184aa3432c.zip
statics..
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;