summaryrefslogtreecommitdiff
path: root/lib/fprint.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2020-02-20 14:43:54 +0100
committerPanu Matilainen <pmatilai@redhat.com>2020-02-24 11:54:22 +0200
commite2f0fbcc29b4b8610009ca5b5937716a592ee0f5 (patch)
treee7462035918e13329b5186cfe94f80c56b2c8414 /lib/fprint.c
parent5d4489f34477994122412e788887ee642b808ad9 (diff)
downloadrpm-e2f0fbcc29b4b8610009ca5b5937716a592ee0f5.tar.gz
Add fingerprint lookup/compare variants that take ids
This will be used to get rid of unneeded id->str->id roundtrips.
Diffstat (limited to 'lib/fprint.c')
-rw-r--r--lib/fprint.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/fprint.c b/lib/fprint.c
index 5744566ca..1b4073618 100644
--- a/lib/fprint.c
+++ b/lib/fprint.c
@@ -248,6 +248,15 @@ int fpLookup(fingerPrintCache cache,
return doLookup(cache, dirName, baseName, *fp);
}
+int fpLookupId(fingerPrintCache cache,
+ rpmsid dirNameId, rpmsid baseNameId,
+ fingerPrint **fp)
+{
+ if (*fp == NULL)
+ *fp = xcalloc(1, sizeof(**fp));
+ return doLookupId(cache, dirNameId, baseNameId, *fp);
+}
+
/**
* Return hash value for a finger print.
* Hash based on dev and inode only!
@@ -302,6 +311,14 @@ int fpLookupEquals(fingerPrintCache cache, fingerPrint *fp,
return FP_EQUAL(*fp, ofp);
}
+int fpLookupEqualsId(fingerPrintCache cache, fingerPrint *fp,
+ rpmsid dirNameId, rpmsid baseNameId)
+{
+ struct fingerPrint_s ofp;
+ doLookupId(cache, dirNameId, baseNameId, &ofp);
+ return FP_EQUAL(*fp, ofp);
+}
+
fingerPrint * fpLookupList(fingerPrintCache cache, rpmstrPool pool,
rpmsid * dirNames, rpmsid * baseNames,
const uint32_t * dirIndexes,