00001 #ifndef H_RPMHASH
00002 #define H_RPMHASH
00003 
00011 typedef  struct hashTable_s * hashTable;
00012 
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016 
00019 typedef unsigned int (*hashFunctionType) (const void * string)
00020         ;
00021 
00024 typedef int (*hashEqualityType) (const void * key1, const void * key2)
00025         ;
00026 
00032 unsigned int hashFunctionString(const void * string)
00033         ;
00034 
00041 int hashEqualityString(const void * key1, const void * key2)
00042         ;
00043 
00055 hashTable htCreate(int numBuckets, int keySize, int freeData,
00056                 hashFunctionType fn, hashEqualityType eq)
00057         ; 
00058 
00064 
00065 hashTable htFree(  hashTable ht)
00066         ;
00067 
00074 void htAddEntry(hashTable ht,  const void * key,
00075                  const void * data)
00076         ;
00077 
00087 int htGetEntry(hashTable ht, const void * key,
00088                   const void *** data,
00089                   int * dataCount,
00090                   const void ** tableKey)
00091         ;
00092 
00099 
00100 int htHasEntry(hashTable ht, const void * key)
00101         ;
00102 
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106 
00107 #endif