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
00063 void htFree( hashTable ht)
00064 ;
00065
00072 void htAddEntry(hashTable ht, const void * key,
00073 const void * data)
00074 ;
00075
00085 int htGetEntry(hashTable ht, const void * key,
00086 const void *** data,
00087 int * dataCount,
00088 const void ** tableKey)
00089 ;
00090
00097
00098 int htHasEntry(hashTable ht, const void * key)
00099 ;
00100
00101 #ifdef __cplusplus
00102 }
00103 #endif
00104
00105 #endif