8 #define LOADFACTOR 0.75
11 typedef struct mhashlistnode {
13 void *val; //this can be cast to another type or used to point to a larger structure
14 struct mhashlistnode *next;
17 typedef struct mhashtable {
18 mhashlistnode_t *table; // points to beginning of hash table
20 unsigned int numelements;
22 pthread_mutex_t locktable;
25 unsigned int mhashCreate(unsigned int size, float loadfactor);
26 unsigned int mhashFunction(unsigned int key);
27 unsigned mhashInsert(unsigned int key, void *val);
28 void *mhashSearch(unsigned int key); //returns val, NULL if not found
29 unsigned int mhashRemove(unsigned int key); //returns -1 if not found
30 unsigned int mhashResize(unsigned int newsize);
31 unsigned int *mhashGetKeys(unsigned int *numKeys);