40 #if defined(__LCLINT__)
69 while (b && b->
key && ht->
eq(b->
key, key))
78 const char *k1 = (
const char *)key1;
79 const char *k2 = (
const char *)key2;
85 const char *
key = (
const char *) data;
126 for (; size >= 8; size -= 8) {
143 case 1: h = ((h << 5) + h) + (
rpmuint32_t)*key++;
break;
158 while (b && b->
key && ht->
eq(b->
key, key))
185 if (!(b =
findEntry(ht, key)))
return 0;
else return 1;
189 int * dataCount,
const void * tableKey)
197 *(
const void ***)data = (
const void **) b->
data;
201 *(
const void **)tableKey = b->
key;
208 const void **
keys = (
const void **)
210 const void ** keypointer =
keys;
224 }
while ((b = n) !=
NULL);
253 }
while ((b = n) !=
NULL);
269 if (_htPool ==
NULL) {
int htHasEntry(hashTable ht, const void *key)
Check for key in hash table.
int(* hashEqualityType)(const void *key1, const void *key2)
Compare two hash table entries for equality.
const void ** htGetKeys(hashTable ht)
Retrieve keys from hash table.
Hash table implemenation.
int htGetEntry(hashTable ht, const void *key, const void *data, int *dataCount, const void *tableKey)
Retrieve item from hash table.
struct hashBucket_s * hashBucket
static hashTable htGetPool(rpmioPool pool)
void * xcalloc(size_t nmemb, size_t size)
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
static hashBucket findEntry(hashTable ht, const void *key)
Find entry in hash table.
static void htFini(void *_ht)
int hashEqualityString(const void *key1, const void *key2)
Compare two hash table entries for equality.
return strcmp(ame->name, bme->name)
void htAddEntry(hashTable ht, const void *key, const void *data)
Add item to hash table.
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
struct hashTable_s * hashTable
rpmuint32_t hashFunctionString(rpmuint32_t h, const void *data, size_t size)
Return hash value of a string.
hashTable htCreate(int numBuckets, size_t keySize, int freeData, hashFunctionType fn, hashEqualityType eq)
Create hash table.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
rpmuint32_t(* hashFunctionType)(rpmuint32_t h, const void *data, size_t size)
Return hash value.
hashTable htLink(hashTable ht)
Reference a hash table instance.