#ifndef __HASH_H__ #define __HASH_H__ /** * hash.h * Declarations of a simple hash table implementation. */ // +-------+---------------------------------------------------------- // | Types | // +-------+ typedef struct hash_table *hash; // +--------------------+--------------------------------------------- // | Exported Functions | // +--------------------+ /** * hash_new () * Create a new hash table. */ hash hash_new (void); /** * hash_put (table, key, value) * Add a new key/value pair to the table. Makes copies of the * key and value. */ int hash_put (hash table, const char *key, const char *value); /** * hash_get (table, key) * Get an element of a hash table. Returns NULL if the key is not * in the table. */ char *hash_get (hash table, const char *key); /** * hash_free (hash table) * Free an element of a hash table. */ void hash_free (hash table); #endif // __HASH_H__