summaryrefslogtreecommitdiff
path: root/lib/rpmds.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-26 16:54:16 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-26 17:11:12 +0200
commitb88d5d3aaf4e5174a4683cef4d5d3ba0de28f3b1 (patch)
treebab30b9e9e11562110c1674224d82e3ad561c846 /lib/rpmds.c
parent971348fd46037ed7bf2cb20fc29fefe0d86143cc (diff)
downloadlibrpm-tizen-b88d5d3aaf4e5174a4683cef4d5d3ba0de28f3b1.tar.gz
librpm-tizen-b88d5d3aaf4e5174a4683cef4d5d3ba0de28f3b1.tar.bz2
librpm-tizen-b88d5d3aaf4e5174a4683cef4d5d3ba0de28f3b1.zip
Add public rpmdsCurrent() function for creating a single ds from iteration
- Permits extracting single dependencies from a set with instance number inherited without exposing rpmdsSetInstance() kind of thing - Also faster than calling rpmdsSingle(rpmdsTagN(ds), rpmdsN(ds)....) where each call re-re-re-re-validates the indexes
Diffstat (limited to 'lib/rpmds.c')
-rw-r--r--lib/rpmds.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index b3dd0f684..faf0ba585 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -252,6 +252,16 @@ rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, rpmsenseFlags F
return singleDS(tagN, N, EVR, Flags, 0);
}
+rpmds rpmdsCurrent(rpmds ds)
+{
+ rpmds cds = NULL;
+ if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
+ cds = singleDS(ds->tagN, ds->N[ds->i], ds->EVR[ds->i],
+ ds->Flags[ds->i], ds->instance);
+ }
+ return cds;
+}
+
int rpmdsCount(const rpmds ds)
{
return (ds != NULL ? ds->Count : 0);