diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-10-22 09:48:24 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-10-22 09:59:56 +0300 |
commit | 757d0b443b486b8745aabc61fb6809ae1ecf14be (patch) | |
tree | 346cb461b5505dfc024c0d82ca856dba55b07a75 /lib/header.c | |
parent | 935d0654a612c28494d104f168f00e18f411d247 (diff) | |
download | librpm-tizen-757d0b443b486b8745aabc61fb6809ae1ecf14be.tar.gz librpm-tizen-757d0b443b486b8745aabc61fb6809ae1ecf14be.tar.bz2 librpm-tizen-757d0b443b486b8745aabc61fb6809ae1ecf14be.zip |
Switch header APIs to use rpmTagVal instead of rpmTag
- The header getters are used for both signature header and the "normal"
header, and even beyond that there's no requirement for a tag in
the header to be part of rpmTag enum. The headerPutFoo() variants
technically do require the tag to be found in the tag table (ie be
an rpmTag) but they still operate on the integer value, they dont
require it to be a "true" enum.
- Inside tagexts.c there are a few "true" enum uses in the
internal helper functions, leave them be.
- While this technically changes some the most commonly used API's,
this wont affect callers really: if the callers were using an enum
before, enum can always be cast naturally to an integer. The other
way around was the problematic part (ie the braindamage we're fixing
here now...)
Diffstat (limited to 'lib/header.c')
-rw-r--r-- | lib/header.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/header.c b/lib/header.c index 55b2d17d2..bf1642cf5 100644 --- a/lib/header.c +++ b/lib/header.c @@ -719,7 +719,7 @@ void * headerUnload(Header h) * @return header entry */ static -indexEntry findEntry(Header h, rpmTag tag, rpmTagType type) +indexEntry findEntry(Header h, rpmTagVal tag, rpmTagType type) { indexEntry entry; struct indexEntry_s key; @@ -746,7 +746,7 @@ indexEntry findEntry(Header h, rpmTag tag, rpmTagType type) return NULL; } -int headerDel(Header h, rpmTag tag) +int headerDel(Header h, rpmTagVal tag) { indexEntry last = h->index + h->indexUsed; indexEntry entry, first; @@ -915,7 +915,7 @@ errxit: return h; } -Header headerReload(Header h, rpmTag tag) +Header headerReload(Header h, rpmTagVal tag) { Header nh; size_t length; @@ -1044,7 +1044,7 @@ exit: return (nb == length ? 0 : 1); } -int headerIsEntry(Header h, rpmTag tag) +int headerIsEntry(Header h, rpmTagVal tag) { /* FIX: h modified by sort. */ return (findEntry(h, tag, RPM_NULL_TYPE) ? 1 : 0); @@ -1339,7 +1339,7 @@ static int intGetTdEntry(Header h, rpmtd td, headerGetFlags flags) return ((rc == 1) ? 1 : 0); } -int headerGet(Header h, rpmTag tag, rpmtd td, headerGetFlags flags) +int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags) { int rc; headerTagTagFunction tagfunc = intGetTdEntry; @@ -1505,7 +1505,7 @@ int headerPut(Header h, rpmtd td, headerPutFlags flags) return rc; } -int headerAddI18NString(Header h, rpmTag tag, const char * string, +int headerAddI18NString(Header h, rpmTagVal tag, const char * string, const char * lang) { indexEntry table, entry; @@ -1728,7 +1728,7 @@ static indexEntry nextIndex(HeaderIterator hi) return entry; } -rpmTag headerNextTag(HeaderIterator hi) +rpmTagVal headerNextTag(HeaderIterator hi) { indexEntry entry = nextIndex(hi); return entry ? entry->info.tag : RPMTAG_NOT_FOUND; |