4 typedef struct hashTable_s * hashTable;
10 typedef unsigned int (*hashFunctionType)(const void * string);
11 typedef int (*hashEqualityType)(const void * key1, const void * key2);
13 unsigned int hashFunctionString(const void * string);
14 int hashEqualityString(const void * key1, const void * key2);
16 /* if keySize > 0, the key is duplicated within the table (which costs
17 memory, but may be usefull anyway */
18 hashTable htCreate(int numBuckets, int keySize, hashFunctionType fn,
20 void htAddEntry(hashTable ht, const void * key, const void * data);
21 void htFree(hashTable ht);
22 /* returns 0 on success, 1 if the item is not found. tableKey may be NULL */
23 int htGetEntry(hashTable ht, const void * key, const void *** data, int * dataCount,
24 const void ** tableKey);
25 /* returns 1 if the item is present, 0 otherwise */
26 int htHasEntry(hashTable ht, const void * key);