Go to the documentation of this file.00001 #ifndef H_RPMHASH
00002 #define H_RPMHASH
00003
00009 #include <rpmiotypes.h>
00010
00013 typedef struct hashTable_s * hashTable;
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00025 typedef int (*hashEqualityType) (const void * key1, const void * key2)
00026 ;
00027
00034 int hashEqualityString(const void * key1, const void * key2)
00035 ;
00036
00044 typedef rpmuint32_t (*hashFunctionType) (rpmuint32_t h, const void * data,
00045 size_t size)
00046 ;
00047
00055 rpmuint32_t hashFunctionString(rpmuint32_t h, const void * data, size_t size)
00056 ;
00057
00064 void htAddEntry(hashTable ht, const void * key,
00065 const void * data)
00066 ;
00067
00077 int htGetEntry(hashTable ht, const void * key,
00078 const void * data,
00079 int * dataCount,
00080 const void * tableKey)
00081 ;
00082
00088 const void ** htGetKeys(hashTable ht)
00089 ;
00090
00097
00098 int htHasEntry(hashTable ht, const void * key)
00099 ;
00100
00106
00107 hashTable htUnlink ( hashTable ht)
00108 ;
00109 #define htUnlink(_ht) \
00110 ((hashTable)rpmioUnlinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
00111
00117
00118 hashTable htLink ( hashTable ht)
00119 ;
00120 #define htLink(_ht) \
00121 ((hashTable)rpmioLinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
00122
00128
00129 hashTable htFree( hashTable ht)
00130 ;
00131 #define htFree(_ht) \
00132 ((hashTable)rpmioFreePoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
00133
00145
00146 hashTable htCreate(int numBuckets, size_t keySize, int freeData,
00147 hashFunctionType fn, hashEqualityType eq)
00148
00149 ;
00150
00151 #ifdef __cplusplus
00152 }
00153 #endif
00154
00155 #endif