#include "system.h"
#include "rpmio_internal.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include <rpmfi.h>
#include "legacy.h"
#include "manifest.h"
#include "misc.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
static char * | triggertypeFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Identify type of trigger. | |
static char * | permsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Format file permissions for display. | |
static char * | fflagsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Format file flags for display. | |
static char * | armorFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Wrap a pubkey in ascii armor for display. | |
static char * | base64Format (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Encode binary data in base64 for display. | |
static size_t | xmlstrlen (const char *s) |
static char * | xmlstrcpy (char *t, const char *s) |
static char * | xmlFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Wrap tag data in simple header xml markup. | |
static char * | pgpsigFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Display signature fingerprint and time. | |
static char * | depflagsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
Format dependency flags for display. | |
static int | fsnamesTag (Header h, int_32 *type, void **data, int_32 *count, int *freeData) |
Retrieve mounted file system paths. | |
static int | instprefixTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve install prefixes. | |
static int | fssizesTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve mounted file system space. | |
static int | triggercondsTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve trigger info. | |
static int | triggertypeTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve trigger type info. | |
static int | filenamesTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file paths. | |
static int | fileclassTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file classes. | |
static int | filecontextsTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file contexts from header. | |
static int | fscontextsTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file contexts from file system. | |
static int | recontextsTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file contexts from policy RE's. | |
static int | fileprovideTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file provides. | |
static int | filerequireTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve file requires. | |
static int | i18nTag (Header h, int_32 tag, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve i18n text. | |
static int | summaryTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve summary text. | |
static int | descriptionTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve description text. | |
static int | groupTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData) |
Retrieve group text. | |
Variables | |
static const char * | language = "LANGUAGE" |
static const char * | _macro_i18ndomains = "%{?_i18ndomains}" |
headerSprintfExtension_s | rpmHeaderFormats [] |
Table of query format extensions. |
Definition in file formats.c.
static char* armorFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Wrap a pubkey in ascii armor for display.
type | tag type | |
data | tag value | |
formatPrefix | (unused) | |
padding | (unused) | |
element | no. bytes of binary data |
Definition at line 150 of file formats.c.
References _, PGPARMOR_PUBKEY, PGPARMOR_SIGNATURE, pgpArmorWrap(), RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_NULL_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, and xstrdup().
static char* base64Format | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Encode binary data in base64 for display.
type | tag type | |
data | tag value | |
formatPrefix | (unused) | |
padding | ||
element |
Definition at line 199 of file formats.c.
References _, _free(), RPM_BIN_TYPE, stpcpy(), xmalloc(), and xstrdup().
Referenced by xmlFormat().
static char* depflagsFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Format dependency flags for display.
type | tag type | |
data | tag value | |
formatPrefix | ||
padding | ||
element | (unused) |
Definition at line 510 of file formats.c.
References _, RPM_INT32_TYPE, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, xmalloc(), and xstrdup().
Referenced by triggercondsTag().
static int descriptionTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve description text.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 1122 of file formats.c.
References i18nTag(), and RPMTAG_DESCRIPTION.
static char* fflagsFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Format file flags for display.
type | tag type | |
data | tag value | |
formatPrefix | ||
padding | ||
element | (unused) |
Definition at line 96 of file formats.c.
References _, RPM_INT32_TYPE, RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_GHOST, RPMFILE_LICENSE, RPMFILE_MISSINGOK, RPMFILE_NOREPLACE, RPMFILE_README, RPMFILE_SPECFILE, xmalloc(), and xstrdup().
static int fileclassTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file classes.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 846 of file formats.c.
References RPM_STRING_ARRAY_TYPE, and rpmfiBuildFClasses().
static int filecontextsTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file contexts from header.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 870 of file formats.c.
References RPM_STRING_ARRAY_TYPE, and rpmfiBuildFContexts().
static int filenamesTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file paths.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 824 of file formats.c.
References RPM_STRING_ARRAY_TYPE, rpmfiBuildFNames(), and RPMTAG_BASENAMES.
static int fileprovideTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file provides.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 942 of file formats.c.
References RPM_STRING_ARRAY_TYPE, rpmfiBuildFDeps(), and RPMTAG_PROVIDENAME.
static int filerequireTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file requires.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 966 of file formats.c.
References RPM_STRING_ARRAY_TYPE, rpmfiBuildFDeps(), and RPMTAG_REQUIRENAME.
static int fscontextsTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file contexts from file system.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 894 of file formats.c.
References RPM_STRING_ARRAY_TYPE, and rpmfiBuildFSContexts().
static int fsnamesTag | ( | Header | h, | |
int_32 * | type, | |||
void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve mounted file system paths.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 555 of file formats.c.
References RPM_STRING_ARRAY_TYPE, and rpmGetFilesystemList().
static int fssizesTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve mounted file system space.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 625 of file formats.c.
References _free(), headerGetEntryMinMemory(), RPM_INT32_TYPE, rpmfiBuildFNames(), rpmGetFilesystemList(), rpmGetFilesystemUsage(), RPMTAG_BASENAMES, RPMTAG_FILESIZES, and xcalloc().
static int groupTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve group text.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 1142 of file formats.c.
References i18nTag(), and RPMTAG_GROUP.
static int i18nTag | ( | Header | h, | |
int_32 | tag, | |||
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve i18n text.
h | header | |
tag | tag |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 1005 of file formats.c.
References _free(), _macro_i18ndomains, alloca(), dgettext, getenv(), headerGetEntryMinMemory(), headerNVR(), language, RPM_STRING_TYPE, rpmExpand(), setenv(), tagName(), unsetenv(), and xstrdup().
Referenced by descriptionTag(), groupTag(), and summaryTag().
static int instprefixTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve install prefixes.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 587 of file formats.c.
References headerFreeData(), headerGetEntryMinMemory(), RPM_STRING_TYPE, RPMTAG_INSTALLPREFIX, RPMTAG_INSTPREFIXES, and xstrdup().
static char* permsFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Format file permissions for display.
type | tag type | |
data | tag value | |
formatPrefix | ||
padding | ||
element | (unused) |
Definition at line 62 of file formats.c.
References _, _free(), RPM_INT32_TYPE, rpmPermsString(), xmalloc(), and xstrdup().
static char* pgpsigFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Display signature fingerprint and time.
type | tag type | |
data | tag value | |
formatPrefix | (unused) | |
padding | ||
element | (unused) |
Definition at line 397 of file formats.c.
References _, pgpDigParams_s::hash_algo, pgpFreeDig(), pgpGrab(), PGPHASHALGO_MD5, PGPHASHALGO_SHA1, pgpHexStr(), pgpLen(), pgpNewDig(), pgpPrtPkts(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, PGPTAG_SIGNATURE, pgpDigParams_s::pubkey_algo, RPM_BIN_TYPE, pgpDig_s::signature, pgpDigParams_s::signid, snprintf(), stpcpy(), pgpDigParams_s::time, xrealloc(), and xstrdup().
static int recontextsTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve file contexts from policy RE's.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 918 of file formats.c.
References RPM_STRING_ARRAY_TYPE, and rpmfiBuildREContexts().
static int summaryTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve summary text.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 1102 of file formats.c.
References i18nTag(), and RPMTAG_SUMMARY.
static int triggercondsTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve trigger info.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 685 of file formats.c.
References _free(), depflagsFormat(), headerFreeData(), headerGetEntryMinMemory(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMSENSE_SENSEMASK, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERSCRIPTS, RPMTAG_TRIGGERVERSION, xmalloc(), xrealloc(), and xstrdup().
static char* triggertypeFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Identify type of trigger.
type | tag type | |
data | tag value | |
formatPrefix | (unused) | |
padding | (unused) | |
element | (unused) |
Definition at line 30 of file formats.c.
References _, RPM_INT32_TYPE, RPMSENSE_TRIGGERIN, RPMSENSE_TRIGGERPOSTUN, RPMSENSE_TRIGGERPREIN, RPMSENSE_TRIGGERUN, and xstrdup().
static int triggertypeTag | ( | Header | h, | |
rpmTagType * | type, | |||
const void ** | data, | |||
int_32 * | count, | |||
int * | freeData | |||
) | [static] |
Retrieve trigger type info.
h | header |
*type | tag type | |
*data | tag value | |
*count | no. of data items | |
*freeData | data-was-malloc'ed indicator |
Definition at line 762 of file formats.c.
References headerFreeData(), headerGetEntryMinMemory(), RPM_STRING_ARRAY_TYPE, RPMSENSE_TRIGGERIN, RPMSENSE_TRIGGERPOSTUN, RPMSENSE_TRIGGERPREIN, RPMSENSE_TRIGGERUN, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERSCRIPTS, xmalloc(), and xstrdup().
static char* xmlFormat | ( | int_32 | type, | |
const void * | data, | |||
char * | formatPrefix, | |||
int | padding, | |||
int | element | |||
) | [static] |
Wrap tag data in simple header xml markup.
type | tag type | |
data | tag value | |
formatPrefix | ||
padding | ||
element | (unused) |
Definition at line 292 of file formats.c.
References _, _free(), alloca(), base64Format(), RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_NULL_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, snprintf(), stpcpy(), xmalloc(), xmlstrcpy(), xmlstrlen(), and xstrdup().
static char* xmlstrcpy | ( | char * | t, | |
const char * | s | |||
) | [static] |
static size_t xmlstrlen | ( | const char * | s | ) | [static] |
const char* _macro_i18ndomains = "%{?_i18ndomains}" [static] |
const char* language = "LANGUAGE" [static] |
struct headerSprintfExtension_s rpmHeaderFormats[] |
Initial value:
{ { HEADER_EXT_TAG, "RPMTAG_GROUP", { groupTag } }, { HEADER_EXT_TAG, "RPMTAG_DESCRIPTION", { descriptionTag } }, { HEADER_EXT_TAG, "RPMTAG_SUMMARY", { summaryTag } }, { HEADER_EXT_TAG, "RPMTAG_FILECLASS", { fileclassTag } }, { HEADER_EXT_TAG, "RPMTAG_FILECONTEXTS", { filecontextsTag } }, { HEADER_EXT_TAG, "RPMTAG_FILENAMES", { filenamesTag } }, { HEADER_EXT_TAG, "RPMTAG_FILEPROVIDE", { fileprovideTag } }, { HEADER_EXT_TAG, "RPMTAG_FILEREQUIRE", { filerequireTag } }, { HEADER_EXT_TAG, "RPMTAG_FSCONTEXTS", { fscontextsTag } }, { HEADER_EXT_TAG, "RPMTAG_FSNAMES", { fsnamesTag } }, { HEADER_EXT_TAG, "RPMTAG_FSSIZES", { fssizesTag } }, { HEADER_EXT_TAG, "RPMTAG_INSTALLPREFIX", { instprefixTag } }, { HEADER_EXT_TAG, "RPMTAG_RECONTEXTS", { recontextsTag } }, { HEADER_EXT_TAG, "RPMTAG_TRIGGERCONDS", { triggercondsTag } }, { HEADER_EXT_TAG, "RPMTAG_TRIGGERTYPE", { triggertypeTag } }, { HEADER_EXT_FORMAT, "armor", { armorFormat } }, { HEADER_EXT_FORMAT, "base64", { base64Format } }, { HEADER_EXT_FORMAT, "pgpsig", { pgpsigFormat } }, { HEADER_EXT_FORMAT, "depflags", { depflagsFormat } }, { HEADER_EXT_FORMAT, "fflags", { fflagsFormat } }, { HEADER_EXT_FORMAT, "perms", { permsFormat } }, { HEADER_EXT_FORMAT, "permissions", { permsFormat } }, { HEADER_EXT_FORMAT, "triggertype", { triggertypeFormat } }, { HEADER_EXT_FORMAT, "xml", { xmlFormat } }, { HEADER_EXT_MORE, NULL, { (void *) headerDefaultFormats } } }
Definition at line 1154 of file formats.c.
Referenced by hdr_subscript(), hdrSprintf(), init_rpm(), main(), packageBinaries(), printNewSpecfile(), queryHeader(), rpmcliImportPubkey(), rpmDisplayQueryTags(), rpmHeaderGetEntry(), rpmpsmStage(), rpmShowProgress(), rpmtsSolve(), runScript(), and spewHeader().