#include #include "hash.h" /* a simple driver program */ int main() { struct listElement theElement; struct listElement * result; struct hash_table * theTable; theTable = init_table(); theElement.key = "mistery"; theElement.tv = 4; add_to_table(theTable, &theElement, theElement.key); /* theElement.key = "|Tex|"; add_to_table(theTable, &theElement, theElement.key); */ theElement.key = "LOL"; theElement.tv = 5; add_to_table(theTable, &theElement, theElement.key); theElement.key = "|xeT|"; theElement.tv = 9; add_to_table(theTable, &theElement, theElement.key); delete_from_table(theTable, "|Tex|"); delete_from_table(theTable, "|xeT|"); theElement.key = "|Tex|"; theElement.tv = 1; add_to_table(theTable, &theElement, theElement.key); theElement.key = "|xeT|"; theElement.tv = 3; add_to_table(theTable, &theElement, theElement.key); result = get_from_table(theTable, "|Tex|"); printf("Got %s (tv: %d)\n", result->key, result->tv); delete_from_table(theTable, "|xeT|"); return 0; }