diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-12-18 09:04:57 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-12-18 09:04:57 +0200 |
commit | 4e20d4c49f1d623458a7fdc28214e6729c4e32d4 (patch) | |
tree | b1d84a178cef5ad93ab490f41239de2480c41ac1 /lib/rpmte.c | |
parent | ccc69322626ed649d72248e23a2834a9860099fb (diff) | |
download | librpm-tizen-4e20d4c49f1d623458a7fdc28214e6729c4e32d4.tar.gz librpm-tizen-4e20d4c49f1d623458a7fdc28214e6729c4e32d4.tar.bz2 librpm-tizen-4e20d4c49f1d623458a7fdc28214e6729c4e32d4.zip |
Move transaction element iterator into rpmts.c where it logically belongs
- make rpmtsi_s really opaque, move rpmtsi typedef to rpmtypes.h
along with all the other commonly used types
Diffstat (limited to 'lib/rpmte.c')
-rw-r--r-- | lib/rpmte.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c index 8f0f8dff8..9ffe44b57 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -668,55 +668,6 @@ assert (ix < Count); free(refs); } -rpmtsi rpmtsiFree(rpmtsi tsi) -{ - /* XXX watchout: a funky recursion segfaults here iff nrefs is wrong. */ - if (tsi) - tsi->ts = rpmtsFree(tsi->ts); - return _free(tsi); -} - -rpmtsi rpmtsiInit(rpmts ts) -{ - rpmtsi tsi = NULL; - - tsi = xcalloc(1, sizeof(*tsi)); - tsi->ts = rpmtsLink(ts, RPMDBG_M("rpmtsi")); - tsi->oc = 0; - return tsi; -} - -/** - * Return next transaction element. - * @param tsi transaction element iterator - * @return transaction element, NULL on termination - */ -static -rpmte rpmtsiNextElement(rpmtsi tsi) -{ - rpmte te = NULL; - int oc = -1; - - if (tsi == NULL || tsi->ts == NULL || rpmtsNElements(tsi->ts) <= 0) - return te; - - if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++; - if (oc != -1) - te = rpmtsElement(tsi->ts, oc); - return te; -} - -rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type) -{ - rpmte te; - - while ((te = rpmtsiNextElement(tsi)) != NULL) { - if (type == 0 || (te->type & type) != 0) - break; - } - return te; -} - static Header rpmteDBHeader(rpmts ts, unsigned int rec) { Header h = NULL; |