From: Panu Matilainen Date: Sat, 17 May 2008 06:50:39 +0000 (+0300) Subject: Add HEADERGET_RAW flag to disable i18n lookups X-Git-Tag: rpm-4.6.0-rc1~543 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fedc2057030e46e1421fa5d14278c2d7bc49a87;p=platform%2Fupstream%2Frpm.git Add HEADERGET_RAW flag to disable i18n lookups --- diff --git a/lib/header.c b/lib/header.c index 973466e..1c16436 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1359,16 +1359,20 @@ static int intGetTdEntry(Header h, rpmTag tag, rpmtd td, headerGetFlags flags) return 0; } - switch (entry->info.type) { - case RPM_I18NSTRING_TYPE: - rc = 1; - td->type = RPM_STRING_TYPE; - td->count = 1; - td->data = headerFindI18NString(h, entry); - break; - default: + if (flags & HEADERGET_RAW) { rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM)); - break; + } else { + switch (entry->info.type) { + case RPM_I18NSTRING_TYPE: + rc = 1; + td->type = RPM_STRING_TYPE; + td->count = 1; + td->data = headerFindI18NString(h, entry); + break; + default: + rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM)); + break; + } } /* XXX 1 on success */ diff --git a/lib/header.h b/lib/header.h index cba3157..14e0d0f 100644 --- a/lib/header.h +++ b/lib/header.h @@ -183,6 +183,7 @@ typedef enum headerGetFlags_e { HEADERGET_DEFAULT = 0, HEADERGET_MINMEM = (1 << 0), /* string pointers refer to header memory */ HEADERGET_EXT = (1 << 1), /* lookup extension types too */ + HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */ } headerGetFlags; /** \ingroup header