/* hash_table.h */ #ifndef HASH_TABLE_H #define HASH_TABLE_H /* Hash Table Opaque Types */ typedef struct hash_table hash_table_t; typedef int (*hash_table_cmp_fn)(const void *key1, const void *key2); typedef unsigned int (*hash_table_hash_fn)(const void *key); typedef void (*hash_table_dtor)(void *data, int is_key); /* Hash Table Creation and Destruction */ hash_table_t *hash_table_create(int size, hash_table_cmp_fn cmp, hash_table_hash_fn hash, hash_table_dtor dtor); void hash_table_destroy(hash_table_t *table); /* Hash Table Access */ void *hash_table_get(const hash_table_t *table, const void *key); void hash_table_put(hash_table_t *table, void *key, void *value); void hash_table_remove(hash_table_t *table, const void *key); #endif /* HASH_TABLE_H */