Add hash table methodn for (pre)calculating base hash of a key
This commit is contained in:
parent
f974c457e3
commit
b323c27d88
|
@ -102,6 +102,11 @@ static void HASHPREFIX(Resize)(HASHTYPE ht, int numBuckets) {
|
|||
ht->numBuckets = numBuckets;
|
||||
}
|
||||
|
||||
unsigned int HASHPREFIX(KeyHash)(HASHTYPE ht, HTKEYTYPE key)
|
||||
{
|
||||
return ht->fn(key);
|
||||
}
|
||||
|
||||
void HASHPREFIX(AddEntry)(HASHTYPE ht, HTKEYTYPE key
|
||||
#ifdef HTDATATYPE
|
||||
, HTDATATYPE data
|
||||
|
|
|
@ -62,6 +62,14 @@ HASHTYPE HASHPREFIX(Free)( HASHTYPE ht);
|
|||
RPM_GNUC_INTERNAL
|
||||
void HASHPREFIX(Empty)(HASHTYPE ht);
|
||||
|
||||
/**
|
||||
* Calculate hash for key.
|
||||
* @param @ht pointer to hash table
|
||||
* @param @key key
|
||||
*/
|
||||
RPM_GNUC_INTERNAL
|
||||
unsigned int HASHPREFIX(KeyHash)(HASHTYPE ht, HTKEYTYPE key);
|
||||
|
||||
/**
|
||||
* Add item to hash table.
|
||||
* @param ht pointer to hash table
|
||||
|
|
Loading…
Reference in New Issue