diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-10-22 11:27:01 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-10-22 11:27:01 +0300 |
commit | 73c079735a2af231ff63e7150fdee3b33bacbae6 (patch) | |
tree | 3426386cdbed3b4f99130beff13d61ee116366e3 | |
parent | a68f648cf1a1821924e08b8f99c14af9da216b10 (diff) | |
download | librpm-tizen-73c079735a2af231ff63e7150fdee3b33bacbae6.tar.gz librpm-tizen-73c079735a2af231ff63e7150fdee3b33bacbae6.tar.bz2 librpm-tizen-73c079735a2af231ff63e7150fdee3b33bacbae6.zip |
Switch rpmds API and internals to use rpmTagVal instead of rpmTag
- None of these require passing "true enum", the value is what counts.
In general, enums as function argument types are just a royal PITA
from C++, avoid when not strictly necessary.
-rw-r--r-- | lib/rpmds.c | 26 | ||||
-rw-r--r-- | lib/rpmds.h | 8 |
2 files changed, 17 insertions, 17 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c index adc52ecb9..e1a3df77a 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -25,7 +25,7 @@ struct rpmds_s { const char ** EVR; /*!< Epoch-Version-Release. */ rpmsenseFlags * Flags; /*!< Bit(s) identifying context/comparison. */ rpm_color_t * Color; /*!< Bit(s) calculated from file color(s). */ - rpmTag tagN; /*!< Header tag. */ + rpmTagVal tagN; /*!< Header tag. */ int32_t Count; /*!< No. of elements */ unsigned int instance; /*!< From rpmdb instance? */ int i; /*!< Element index. */ @@ -37,13 +37,13 @@ struct rpmds_s { static const char ** rpmdsDupArgv(const char ** argv, int argc); -static int dsType(rpmTag tag, - const char ** Type, rpmTag * tagEVR, rpmTag * tagF) +static int dsType(rpmTagVal tag, + const char ** Type, rpmTagVal * tagEVR, rpmTagVal * tagF) { int rc = 0; const char *t = NULL; - rpmTag evr = RPMTAG_NOT_FOUND; - rpmTag f = RPMTAG_NOT_FOUND; + rpmTagVal evr = RPMTAG_NOT_FOUND; + rpmTagVal f = RPMTAG_NOT_FOUND; if (tag == RPMTAG_PROVIDENAME) { t = "Provides"; @@ -90,7 +90,7 @@ rpmds rpmdsLink(rpmds ds) rpmds rpmdsFree(rpmds ds) { - rpmTag tagEVR, tagF; + rpmTagVal tagEVR, tagF; if (ds == NULL) return NULL; @@ -116,9 +116,9 @@ rpmds rpmdsFree(rpmds ds) return NULL; } -rpmds rpmdsNew(Header h, rpmTag tagN, int flags) +rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags) { - rpmTag tagEVR, tagF; + rpmTagVal tagEVR, tagF; rpmds ds = NULL; const char * Type; struct rpmtd_s names; @@ -204,7 +204,7 @@ char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds) return tbuf; } -static rpmds singleDS(rpmTag tagN, const char * N, const char * EVR, +static rpmds singleDS(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags, unsigned int instance) { rpmds ds = NULL; @@ -231,7 +231,7 @@ exit: return rpmdsLink(ds); } -rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags) +rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags) { char *evr = headerGetAsString(h, RPMTAG_EVR); rpmds ds = singleDS(tagN, headerGetString(h, RPMTAG_NAME), @@ -240,7 +240,7 @@ rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags) return ds; } -rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, rpmsenseFlags Flags) +rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags) { return singleDS(tagN, N, EVR, Flags, 0); } @@ -324,9 +324,9 @@ rpmsenseFlags rpmdsFlags(const rpmds ds) return Flags; } -rpmTag rpmdsTagN(const rpmds ds) +rpmTagVal rpmdsTagN(const rpmds ds) { - rpmTag tagN = RPMTAG_NOT_FOUND; + rpmTagVal tagN = RPMTAG_NOT_FOUND; if (ds != NULL) tagN = ds->tagN; diff --git a/lib/rpmds.h b/lib/rpmds.h index 7d5a95115..5a91ba167 100644 --- a/lib/rpmds.h +++ b/lib/rpmds.h @@ -102,7 +102,7 @@ rpmds rpmdsFree(rpmds ds); * @param flags unused * @return new dependency set */ -rpmds rpmdsNew(Header h, rpmTag tagN, int flags); +rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags); /** \ingroup rpmds * Return new formatted dependency string. @@ -119,7 +119,7 @@ char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds); * @param Flags comparison flags * @return new dependency set */ -rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags); +rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags); /** \ingroup rpmds * Create, load and initialize a dependency set of size 1. @@ -129,7 +129,7 @@ rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags); * @param Flags comparison flags * @return new dependency set */ -rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, rpmsenseFlags Flags); +rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags); /** \ingroup rpmds * Return a new dependency set of size 1 from the current iteration index @@ -193,7 +193,7 @@ rpmsenseFlags rpmdsFlags(const rpmds ds); * @param ds dependency set * @return current dependency type, 0 on invalid */ -rpmTag rpmdsTagN(const rpmds ds); +rpmTagVal rpmdsTagN(const rpmds ds); /** \ingroup rpmds * Return dependency header instance, ie whether the dependency comes from |