/** * hashtable.h * The hash table type and the useful functions on that table. */ struct hashtable { int size; int elements; struct element **contents; }; /** * PROCEDURE: * assign * Parameters: * table, a hash table * key, a string * value, a string * Purpose: * table[key] = value * Produces: * success, a boolean (integer) */ int assign (struct hashtable *table, char *key, char *value); /** * Procedure: * get * Parameters: * table, a hash table * key, a string * Purpose: * Get the value associated with key * Produces: * value, a string * Problems: * If the key is not in the table, return NULL. */ char *get (struct hashtable *table, char *key); /** * Procedure: * new_hashtable * Parameters: * size, a positive int * Purpose: * Create a new hash table of the specified size. */ struct hashtable *new_hashtable (int size);