#include <search.h> ENTRY *hsearch(ENTRY item, ACTION action);
First the table must be created with the function hcreate(). nel is an estimation of the table size which will suffice the needs. For better algorithms this value can be corrected upwards.
The corresponding function hdestroy() frees the memory occupied by the hash table for that a new table can be constructed.
hsearch() is the function for searching and inserting. Which action is done is controlled by the parameter action. It is of the type ACTION (also defined in <search.h>) and can have the values ENTER or FIND. ENTER means to insert the given item and FIND means to only search. Unsuccesful actions result in a return value NULL.
hsearch() return NULL if either action is ENTER and the hash table is full or action is FIND and the item cannot be find in the hash table.