/*
* this is an open table keyed by strings
*/
-int
+void
hash_table_init(const char *name, hash_table_t *hash, int len)
{
if (hash->entries != NULL) {
fprintf(stderr, "ERROR: %s called on a non empty hash table\n",
__FUNCTION__);
- return -1;
+ return;
}
memset(hash, 0, sizeof(hash_table_t));
hash->name = name;
hash->n_buckets = len;
hash->entries = xcalloc(hash->n_buckets, sizeof(hash_entry_t));
-
- return 0;
}
void
unsigned int n_hits, n_misses;
};
-int hash_table_init(const char *name, hash_table_t *hash, int len);
+void hash_table_init(const char *name, hash_table_t *hash, int len);
void hash_table_deinit(hash_table_t *hash);
void hash_print_stats(hash_table_t *hash);
void *hash_table_get(hash_table_t *hash, const char *key);