# lib/formats.c File Reference

`#include "system.h"`
`#include <rpmlib.h>`
`#include <rpmmacro.h>`
`#include "rpmpgp.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)
static char * | permsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element)
static char * | fflagsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element)
static char * | armorFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element)
static char * | base64Format (int_32 type, const void *data, char *formatPrefix, int padding, int element)
static char * | depflagsFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element)
static int | fsnamesTag (Header h, int_32 *type, void **data, int_32 *count, int *freeData)
static int | instprefixTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | fssizesTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | triggercondsTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | triggertypeTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | filenamesTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | i18nTag (Header h, int_32 tag, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | summaryTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | descriptionTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)
static int | groupTag (Header h, rpmTagType *type, const void **data, int_32 *count, int *freeData)

## Variables

int | _nl_msg_cat_cntr
static const char * | language = "LANGUAGE"
static const char * | _macro_i18ndomains
struct headerSprintfExtension_s | rpmHeaderFormats []
| Table of query format extensions.

## Detailed Description

Definition in file formats.c.

## Function Documentation

static char* armorFormat | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix |
  | padding |
  | element | (unused)

Returns:
  formatted string

Definition at line 118 of file formats.c.

static char* base64Format | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix |
  | padding |
  | element | (unused)

Returns:
  formatted string

Definition at line 204 of file formats.c.

static char* depflagsFormat | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix |
  | padding |
  | element | (unused)

Returns:
  formatted string

Definition at line 272 of file formats.c.

static int descriptionTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 692 of file formats.c.

static char* fflagsFormat | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix |
  | padding |
  | element | (unused)

Returns:
  formatted string

Definition at line 75 of file formats.c.

static int filenamesTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 551 of file formats.c.

static int fsnamesTag | ( | Header | h,
|  | int_32 * | type,
|  | void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 310 of file formats.c.

static int fssizesTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 372 of file formats.c.

static int groupTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 709 of file formats.c.

static int i18nTag | ( | Header | h,
|  | int_32 | tag,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header
  | tag | tag

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 588 of file formats.c.

static int instprefixTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 339 of file formats.c.

static char* permsFormat | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix |
  | padding |
  | element | (unused)

Returns:
  formatted string

Definition at line 45 of file formats.c.

static int summaryTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 675 of file formats.c.

static int triggercondsTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 426 of file formats.c.

static char* triggertypeFormat | ( | int_32 | type,
|  | const void * | data,
|  | char * | formatPrefix,
|  | int | padding,
|  | int | element |
| ) |  |  | `[static]`

Parameters:

  | type | tag type
  | data | tag value
  | formatPrefix | (unused)
  | padding | (unused)
  | element | (unused)

Returns:
  formatted string

Definition at line 21 of file formats.c.

static int triggertypeTag | ( | Header | h,
|  | rpmTagType * | type,
|  | const void ** | data,
|  | int_32 * | count,
|  | int * | freeData |
| ) |  |  | `[static]`

Parameters:

  | h | header

Return values:

  | type | address of tag type
  | data | address of tag value pointer
  | count | address of no. of data items
  | freedata | address of data-was-malloc'ed indicator

Returns:
  0 on success

Definition at line 498 of file formats.c.

## Variable Documentation

const char* _macro_i18ndomains `[static]`

Initial value:

                    "%{?_i18ndomains:%{_i18ndomains}}"

Definition at line 576 of file formats.c.

int _nl_msg_cat_cntr

Definition at line 570 of file formats.c.

const char* language = "LANGUAGE"`[static]`

Definition at line 573 of file formats.c.

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_FILENAMES", { filenamesTag } },
        { HEADER_EXT_TAG, "RPMTAG_FSSIZES", { fssizesTag } },
        { HEADER_EXT_TAG, "RPMTAG_FSNAMES", { fsnamesTag } },
        { HEADER_EXT_TAG, "RPMTAG_INSTALLPREFIX", { instprefixTag } },
        { 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, "depflags", { depflagsFormat } },
        { HEADER_EXT_FORMAT, "fflags", { fflagsFormat } },
        { HEADER_EXT_FORMAT, "perms", { permsFormat } },
        { HEADER_EXT_FORMAT, "permissions", { permsFormat } },
        { HEADER_EXT_FORMAT, "triggertype", { triggertypeFormat } },
        { HEADER_EXT_MORE, NULL, { (void *) headerDefaultFormats } }
    }

Table of query format extensions.

Note:
  Chains to headerDefaultFormats[].

Definition at line 719 of file formats.c.