diff --git a/src/hashtable.c b/src/hashtable.c index 443283b42e132f3fa9d3654dd806d86c4df3e71f..293a05a5e03a4ce309f7a6c71da1baab380f3c8c 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -57,7 +57,7 @@ static void rehash_list_backwards(struct hash_table *h, /* * create a new, empty hashable */ -struct hash_table *create_hash_table(void) +static struct hash_table *create_hash_table(void) { struct hash_table *new; new=calloc(1, sizeof(struct hash_table)+ @@ -70,7 +70,7 @@ struct hash_table *create_hash_table(void) /* * rehash - ugh */ -struct hash_table *hash_rehash(struct hash_table *h,int size) +static struct hash_table *hash_rehash(struct hash_table *h,int size) { struct hash_table *new; int e; @@ -139,20 +139,6 @@ struct hash_table *hash_unlink(struct hash_table *h, struct hash_entry *s) return h; } -void map_hashtable(struct hash_table *h, void (*fun)(struct hash_entry *)) -{ - INT32 e; - struct hash_entry *i, *n; - for(e=0;e<=h->mask;e++) - { - for(i=h->htable[e];i;i=n) - { - n=i->next; - fun(i); - } - } -} - void free_hashtable(struct hash_table *h, void (*free_entry)(struct hash_entry *)) { diff --git a/src/hashtable.h b/src/hashtable.h index ff9caa9036040f20a1e3d77f5f68a84d4333aa30..70fa10be4b96db60bd632083ce292553d704c3a9 100644 --- a/src/hashtable.h +++ b/src/hashtable.h @@ -36,18 +36,14 @@ struct hash_table * NB: hash_insert is known to clash with mariadb-connector-c 2.2. */ #define hash_lookup pike_hash_lookup -#define hash_rehash pike_hash_rehash #define hash_insert pike_hash_insert #define hash_unlink pike_hash_unlink /* Prototypes begin here */ struct hash_entry *hash_lookup(const struct hash_table *h, const struct pike_string *s); -struct hash_table *create_hash_table(void); -struct hash_table *hash_rehash(struct hash_table *h,int size); struct hash_table *hash_insert(struct hash_table *h, struct hash_entry *s); struct hash_table *hash_unlink(struct hash_table *h, struct hash_entry *s); -void map_hashtable(struct hash_table *h, void (*fun)(struct hash_entry *)); void free_hashtable(struct hash_table *h, void (*free_entry)(struct hash_entry *)); /* Prototypes end here */