formats.c File Reference
HEADER.
`#include "system.h"`
`#include <rpmio.h>`
`#include <rpmiotypes.h>`
`#include <rpmmacro.h>`
`#include <rpmtag.h>`
`#include <rpmtypes.h>`
`#include <rpmds.h>`
`#include <rpmfi.h>`
`#include "legacy.h"`
`#include "manifest.h"`
`#include "argv.h"`
`#include "fs.h"`
`#include "debug.h"`
Include dependency graph for formats.c:

Go to the source code of this file.

## Macros

#define | _RPMTAG_INTERNAL
#define | _RPMEVR_INTERNAL

## Functions

static int | fsnamesTag (Header h, HE_t he)
| Retrieve mounted file system paths. More...
static int | fssizesTag (Header h, HE_t he)
| Retrieve mounted file system space. More...
static int | fileclassTag (Header h, HE_t he)
| Retrieve file classes. More...
static int | filecontextsTag (Header h, HE_t he)
| Retrieve file contexts from header. More...
static int | fscontextsTag (Header h, HE_t he)
| Retrieve file contexts from file system. More...
static int | recontextsTag (Header h, HE_t he)
| Retrieve file contexts from policy RE's. More...
static int | fileprovideTag (Header h, HE_t he)
| Retrieve file provides. More...
static int | filerequireTag (Header h, HE_t he)
| Retrieve file requires. More...
static int | missingokTag (Header h, HE_t he)
| Retrieve Requires(missingok): array for Suggests: or Enhances:. More...

## Variables

static struct headerSprintfExtension_s | _rpmHeaderFormats []
headerSprintfExtension | rpmHeaderFormats = &_rpmHeaderFormats[0]
| Table of query format extensions. More...

## Macro Definition Documentation

#define _RPMEVR_INTERNAL

Definition at line 15 of file formats.c.

#define _RPMTAG_INTERNAL

Definition at line 11 of file formats.c.

## Function Documentation

static int fileclassTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file classes.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 113 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildFClasses(), and _HE_s::t.

static int filecontextsTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file contexts from header.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 130 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildFContexts(), and _HE_s::t.

static int fileprovideTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file provides.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 181 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildFDeps(), RPMTAG_PROVIDENAME, and _HE_s::t.

static int filerequireTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file requires.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 198 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildFDeps(), RPMTAG_REQUIRENAME, and _HE_s::t.

static int fscontextsTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file contexts from file system.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 147 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildFSContexts(), and _HE_s::t.

static int fsnamesTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve mounted file system paths.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 34 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmGetFilesystemList(), and _HE_s::t.

static int fssizesTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve mounted file system space.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 56 of file formats.c.

References _free(), rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, headerGet(), _HE_s::p, rpmDataType_u::ptr, RPM_UINT64_TYPE, rpmGetFilesystemList(), rpmGetFilesystemUsage(), RPMTAG_FILEPATHS, RPMTAG_FILESIZES, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, rpmDataType_u::ui64p, and xcalloc().

static int missingokTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve Requires(missingok): array for Suggests: or Enhances:.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 215 of file formats.c.

References rpmDataType_u::argv, argvAdd(), argvFree(), _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmdsDNEVR(), rpmdsFlags(), rpmdsFree(), rpmdsInit(), rpmdsNew(), rpmdsNext(), RPMTAG_REQUIRENAME, stpcpy(), _HE_s::t, and xcalloc().

static int recontextsTag | ( | Header | h,
|  | HE_t | he
| ) |  |

static

Retrieve file contexts from policy RE's.

Parameters

  h | header

Return values

  *he | tag container

Returns
  0 on success

Definition at line 164 of file formats.c.

References rpmDataType_u::argv, _HE_s::c, _HE_s::freeData, _HE_s::p, RPM_STRING_ARRAY_TYPE, rpmfiBuildREContexts(), and _HE_s::t.

## Variable Documentation

struct headerSprintfExtension_s _rpmHeaderFormats[]

static

Initial value:
= {
{ HEADER_EXT_TAG, "RPMTAG_ENHANCES",
{ .tagFunction = missingokTag } },
{ HEADER_EXT_TAG, "RPMTAG_FILECLASS",
{ .tagFunction = fileclassTag } },
{ HEADER_EXT_TAG, "RPMTAG_FILECONTEXTS",
{ .tagFunction = filecontextsTag } },
{ HEADER_EXT_TAG, "RPMTAG_FILEPROVIDE",
{ .tagFunction = fileprovideTag } },
{ HEADER_EXT_TAG, "RPMTAG_FILEREQUIRE",
{ .tagFunction = filerequireTag } },
{ HEADER_EXT_TAG, "RPMTAG_FSCONTEXTS",
{ .tagFunction = fscontextsTag } },
{ HEADER_EXT_TAG, "RPMTAG_FSNAMES",
{ .tagFunction = fsnamesTag } },
{ HEADER_EXT_TAG, "RPMTAG_FSSIZES",
{ .tagFunction = fssizesTag } },
{ HEADER_EXT_TAG, "RPMTAG_RECONTEXTS",
{ .tagFunction = recontextsTag } },
{ HEADER_EXT_TAG, "RPMTAG_SUGGESTS",
{ .tagFunction = missingokTag } },
{ HEADER_EXT_MORE, NULL, { (void *) &headerCompoundFormats } }
}

Definition at line 268 of file formats.c.

Referenced by rpmDisplayQueryTags().

headerSprintfExtension rpmHeaderFormats = &_rpmHeaderFormats[0]

Table of query format extensions.

Note
  Chains *headerCompoundFormats -> *headerDefaultFormats.

Definition at line 293 of file formats.c.

Referenced by addRpmTags(), hdr_subscript(), hdrSprintf(), packageBinaries(), parseForSimple(), printNewSpecfile(), queryHeader(), rpmcliImportPubkey(), rpmfiNew(), rpmpsmStage(), rpmShowProgress(), and rpmtsSolve().