Add HEADERGET_RAW flag to disable i18n lookups

This commit is contained in:
Panu Matilainen 2008-05-17 09:50:39 +03:00
parent 89b8f53621
commit 7fedc20570
2 changed files with 14 additions and 9 deletions

View File

@ -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 */

View File

@ -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