rpmdb/rpmhash.h - Hash table implemenation.
typedef hashTable_s * hashTable
typedef unsigned int(* hashFunctionType )(const void *string)
typedef int(* hashEqualityType )(const void *key1, const void *key2)
unsigned int hashFunctionString (const void *string)
Return hash value of a string.
int hashEqualityString (const void *key1, const void *key2)
Compare two hash table entries for equality.
hashTable htCreate (int numBuckets, int keySize, int freeData, hashFunctionType fn, hashEqualityType eq)
Create hash table.
void htFree (hashTable ht)
Destroy hash table.
void htAddEntry (hashTable ht, const void *key, const void *data)
Add item to hash table.
int htGetEntry (hashTable ht, const void *key, const void ***data, int *dataCount, const void **tableKey)
Retrieve item from hash table.
int htHasEntry (hashTable ht, const void *key)
Check for key in hash table.
Hash table implemenation.
Definition at line 24 of file rpmhash.h.
Definition at line 19 of file rpmhash.h.
Definition at line 11 of file rpmhash.h.
Compare two hash table entries for equality.
Parameters:
Returns: 0 if entries are equal
Definition at line 59 of file rpmhash.c.
Return hash value of a string.
Parameters:
Returns: hash value
Definition at line 66 of file rpmhash.c.
Add item to hash table.
Parameters:
Definition at line 101 of file rpmhash.c.
References hashBucket_s::data, hashBucket_s::dataCount, hashBucket_s::key, hashBucket_s::next, xmalloc(), and xrealloc().
Referenced by doLookup(), and rpmRunTransactions().
Create hash table.
If keySize > 0, the key is duplicated within the table (which costs memory, but may be useful anyway.
Parameters:
Returns: pointer to initialized hash table
Definition at line 83 of file rpmhash.c.
References hashEqualityType, hashFunctionType, xcalloc(), and xmalloc().
Referenced by fpCacheCreate(), and rpmRunTransactions().
Destroy hash table.
Parameters:
Definition at line 133 of file rpmhash.c.
References _free(), hashBucket_s::data, hashBucket_s::key, and hashBucket_s::next.
Referenced by fpCacheFree(), and rpmRunTransactions().
Retrieve item from hash table.
Parameters:
Return values:
Returns: 0 on success, 1 if the item is not found.
Definition at line 169 of file rpmhash.c.
References hashBucket_s::data, hashBucket_s::dataCount, findEntry(), and hashBucket_s::key.
Referenced by cacheContainsDirectory(), and handleOverlappedFiles().
Check for key in hash table.
Parameters:
Returns: 1 if the key is present, 0 otherwise
Definition at line 162 of file rpmhash.c.
Generated automatically by Doxygen for rpm from the source code.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |