summaryrefslogtreecommitdiff
path: root/lib/rpmgi.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-13 19:32:37 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-13 19:32:37 +0200
commit7e56c6355bea552d89e8d5d0a317763a8cee4a4f (patch)
treec18ddebb9e8e6da144d00909c61fdcecdf718057 /lib/rpmgi.c
parentcbd7a684a4cd88bfa3383658790be3c37230707a (diff)
downloadrpm-7e56c6355bea552d89e8d5d0a317763a8cee4a4f.tar.gz
rpm-7e56c6355bea552d89e8d5d0a317763a8cee4a4f.tar.bz2
rpm-7e56c6355bea552d89e8d5d0a317763a8cee4a4f.zip
Use rpm_tag_t everywhere for rpm (header) tag type
- typedef'ed as int32_t for now, negative values used in some places for error cases - easy to grep, easy to change... - add RPMTAG_NOT_FOUND define, used in place of -1 "magic",
Diffstat (limited to 'lib/rpmgi.c')
-rw-r--r--lib/rpmgi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rpmgi.c b/lib/rpmgi.c
index 0cc5fd7eb..f9e7fa9a1 100644
--- a/lib/rpmgi.c
+++ b/lib/rpmgi.c
@@ -26,7 +26,7 @@ rpmgiFlags giFlags = RPMGI_NONE;
*/
struct rpmgi_s {
rpmts ts; /*!< Iterator transaction set. */
- int tag; /*!< Iterator type. */
+ rpm_tag_t tag; /*!< Iterator type. */
const void * keyp; /*!< Iterator key. */
size_t keylen; /*!< Iterator key length. */
@@ -339,7 +339,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi);
if (gi->argv != NULL)
for (av = (const char **) gi->argv; *av != NULL; av++) {
- int tag = RPMTAG_NAME;
+ rpm_tag_t tag = RPMTAG_NAME;
const char * pat;
char * a, * ae;
@@ -350,7 +350,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi);
if ((ae = strchr(a, '=')) != NULL) {
*ae++ = '\0';
tag = rpmTagGetValue(a);
- if (tag < 0) {
+ if (tag == RPMTAG_NOT_FOUND) {
rpmlog(RPMLOG_NOTICE, _("unknown tag: \"%s\"\n"), a);
res = 1;
}
@@ -432,7 +432,7 @@ rpmgi rpmgiFree(rpmgi gi)
return NULL;
}
-rpmgi rpmgiNew(rpmts ts, int tag, const void * keyp, size_t keylen)
+rpmgi rpmgiNew(rpmts ts, rpm_tag_t tag, const void * keyp, size_t keylen)
{
rpmgi gi = xcalloc(1, sizeof(*gi));