diff --git a/hash.c b/hash.c index 6a0ff932..a4801cbe 100644 --- a/hash.c +++ b/hash.c @@ -5,11 +5,13 @@ #include #include -#include "hash.h" - #define GOLDEN_RAT (0.6180339887498949) /* (sqrt(5) - 1) / 2 */ #define IS_POW2(x) (((x) & ((x) - 1)) == 0) +struct hash_table { + size_t m; + int *a; +}; /* ---------------------------------------------------------------------- */ static size_t @@ -120,7 +122,20 @@ hash_table_expand(size_t m, struct hash_table *t) /* ---------------------------------------------------------------------- */ -struct hash_table * +static void +hash_table_deallocate(struct hash_table *t) +/* ---------------------------------------------------------------------- */ +{ + if (t != NULL) { + free(t->a); + } + + free(t); +} + + +/* ---------------------------------------------------------------------- */ +static struct hash_table * hash_table_allocate(int m) /* ---------------------------------------------------------------------- */ { @@ -147,20 +162,7 @@ hash_table_allocate(int m) /* ---------------------------------------------------------------------- */ -void -hash_table_deallocate(struct hash_table *t) -/* ---------------------------------------------------------------------- */ -{ - if (t != NULL) { - free(t->a); - } - - free(t); -} - - -/* ---------------------------------------------------------------------- */ -int +static int hash_table_insert(int k, struct hash_table *t) /* ---------------------------------------------------------------------- */ { diff --git a/hash.h b/hash.h deleted file mode 100644 index d1970284..00000000 --- a/hash.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef HASH_H_INCLUDED -#define HASH_H_INCLUDED - -#include - -struct hash_table { - size_t m; - int *a; -}; - -struct hash_table * -hash_table_allocate(int m); - -void -hash_table_deallocate(struct hash_table *t); - -int -hash_table_insert(int k, struct hash_table *t); - -#endif /* HASH_H_INCLUDED */