summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-12-16 09:28:34 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-12-16 09:30:09 +0200
commit3296c651b90b1caed216a3c65f024ea741ea13f9 (patch)
treec3505e858999ccfb3e155036b3a296d0e659f489 /lib
parent69187d6bb04d36934a7f9f276d90164e842ef54c (diff)
downloadlibrpm-tizen-3296c651b90b1caed216a3c65f024ea741ea13f9.tar.gz
librpm-tizen-3296c651b90b1caed216a3c65f024ea741ea13f9.tar.bz2
librpm-tizen-3296c651b90b1caed216a3c65f024ea741ea13f9.zip
Support GetEntry() for hashes without datatype too
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmhash.C12
-rw-r--r--lib/rpmhash.H5
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/rpmhash.C b/lib/rpmhash.C
index 016afb225..628f2dd2c 100644
--- a/lib/rpmhash.C
+++ b/lib/rpmhash.C
@@ -205,27 +205,27 @@ int HASHPREFIX(HasEntry)(HASHTYPE ht, HTKEYTYPE key)
if (!(b = HASHPREFIX(findEntry)(ht, key))) return 0; else return 1;
}
+int HASHPREFIX(GetEntry)(HASHTYPE ht, HTKEYTYPE key,
#ifdef HTDATATYPE
-
-int HASHPREFIX(GetEntry)(HASHTYPE ht, HTKEYTYPE key, HTDATATYPE** data,
- int * dataCount, HTKEYTYPE* tableKey)
+ HTDATATYPE** data, int * dataCount,
+#endif
+ HTKEYTYPE* tableKey)
{
Bucket b;
int rc = ((b = HASHPREFIX(findEntry)(ht, key)) != NULL);
+#ifdef HTDATATYPE
if (data)
*data = rc ? b->data : NULL;
if (dataCount)
*dataCount = rc ? b->dataCount : 0;
+#endif
if (tableKey && rc)
*tableKey = b->key;
return rc;
}
-#endif
-
-
unsigned int HASHPREFIX(NumBuckets)(HASHTYPE ht) {
return ht->numBuckets;
}
diff --git a/lib/rpmhash.H b/lib/rpmhash.H
index 44b45ca48..e9db2ea2f 100644
--- a/lib/rpmhash.H
+++ b/lib/rpmhash.H
@@ -75,8 +75,6 @@ void HASHPREFIX(AddEntry)(HASHTYPE ht, HTKEYTYPE key
#endif
);
-#ifdef HTDATATYPE
-
/**
* Retrieve item from hash table.
* @param ht pointer to hash table
@@ -88,10 +86,11 @@ void HASHPREFIX(AddEntry)(HASHTYPE ht, HTKEYTYPE key
*/
RPM_GNUC_INTERNAL
int HASHPREFIX(GetEntry)(HASHTYPE ht, HTKEYTYPE key,
+#ifdef HTDATATYPE
HTDATATYPE** data,
int * dataCount,
- HTKEYTYPE* tableKey);
#endif
+ HTKEYTYPE* tableKey);
/**
* Check for key in hash table.