rpmfiles.h File Reference

File info set API. More...

`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <unistd.h>`
`#include <rpm/rpmtypes.h>`
`#include <rpm/rpmvf.h>`
`#include <rpm/rpmpgp.h>`
Include dependency graph for rpmfiles.h:

Go to the source code of this file.

## Data Structures

struct | rpmRelocation_s
| We pass these around as an array with a sentinel. More...

## Macros

#define | RPMFILE_IS_INSTALLED(_x) ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)
#define | RPMFILE_ALL ~(RPMFILE_NONE)
#define | XFA_SKIPPING(_a) ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
#define | RPMFI_FLAGS_ERASE
#define | RPMFI_FLAGS_INSTALL (RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)
#define | RPMFI_FLAGS_VERIFY
#define | RPMFI_FLAGS_QUERY
#define | RPMFI_FLAGS_ONLY_FILENAMES
#define | RPMFILEITERMAX 6

## Typedefs

typedef enum rpmFileTypes_e | rpmFileTypes
| File types. More...
typedef enum rpmfileState_e | rpmfileState
| File States (when installed). More...
typedef rpmFlags | rpmfileAttrs
typedef enum rpmFileAction_e | rpmFileAction
| File disposition(s) during package install/erase transaction. More...
typedef rpmFlags | rpmfiFlags
typedef enum rpmFileIter_e | rpmFileIter

## Enumerations

enum | rpmFileTypes_e { PIPE = 1, CDEV = 2, XDIR = 4, BDEV = 6, REG = 8, LINK = 10, SOCK = 12 }
| File types. More...
enum | rpmfileState_e { RPMFILE_STATE_MISSING = -1, RPMFILE_STATE_NORMAL = 0, RPMFILE_STATE_REPLACED = 1, RPMFILE_STATE_NOTINSTALLED = 2, RPMFILE_STATE_NETSHARED = 3, RPMFILE_STATE_WRONGCOLOR = 4 }
| File States (when installed). More...
enum | rpmfileAttrs_e { RPMFILE_NONE = 0, RPMFILE_CONFIG = (1 << 0), RPMFILE_DOC = (1 << 1), RPMFILE_ICON = (1 << 2), RPMFILE_MISSINGOK = (1 << 3), RPMFILE_NOREPLACE = (1 << 4), RPMFILE_SPECFILE = (1 << 5), RPMFILE_GHOST = (1 << 6), RPMFILE_LICENSE = (1 << 7), RPMFILE_README = (1 << 8), RPMFILE_PUBKEY = (1 << 11) }
| Exported File Attributes (ie RPMTAG_FILEFLAGS) More...
enum | rpmFileAction_e { FA_UNKNOWN = 0, FA_CREATE = 1, FA_COPYIN = 2, FA_COPYOUT = 3, FA_BACKUP = 4, FA_SAVE = 5, FA_SKIP = 6, FA_ALTNAME = 7, FA_ERASE = 8, FA_SKIPNSTATE = 9, FA_SKIPNETSHARED = 10, FA_SKIPCOLOR = 11 }
| File disposition(s) during package install/erase transaction. More...

enum

rpmfiFlags_e {
RPMFI_NOHEADER = 0, RPMFI_KEEPHEADER = (1 << 0), RPMFI_NOFILECLASS = (1 << 1), RPMFI_NOFILEDEPS = (1 << 2),
RPMFI_NOFILELANGS = (1 << 3), RPMFI_NOFILEUSER = (1 << 4), RPMFI_NOFILEGROUP = (1 << 5), RPMFI_NOFILEMODES = (1 << 6),
RPMFI_NOFILESIZES = (1 << 7), RPMFI_NOFILECAPS = (1 << 8), RPMFI_NOFILELINKTOS = (1 << 9), RPMFI_NOFILEDIGESTS = (1 << 10),
RPMFI_NOFILEMTIMES = (1 << 11), RPMFI_NOFILERDEVS = (1 << 12), RPMFI_NOFILEINODES = (1 << 13), RPMFI_NOFILESTATES = (1 << 14),
RPMFI_NOFILECOLORS = (1 << 15), RPMFI_NOFILEVERIFYFLAGS = (1 << 16), RPMFI_NOFILEFLAGS = (1 << 17), RPMFI_NOFILESIGNATURES = (1 << 18)
}

enum | rpmFileIter_e { RPMFI_ITER_FWD = 0, RPMFI_ITER_BACK = 1, RPMFI_ITER_WRITE_ARCHIVE = 2, RPMFI_ITER_READ_ARCHIVE = 3, RPMFI_ITER_READ_ARCHIVE_CONTENT_FIRST = 4, RPMFI_ITER_READ_ARCHIVE_OMIT_HARDLINKS = 5, RPMFI_ITER_INTERVAL = 6 }

## Functions

rpmfiles | rpmfilesNew (rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags)
| Create and load a file info set. More...
rpmfiles | rpmfilesLink (rpmfiles fi)
| Reference a file info set instance. More...
rpmfiles | rpmfilesFree (rpmfiles fi)
| Destroy a file info set. More...
rpm_count_t | rpmfilesFC (rpmfiles fi)
| Return file count from file info set. More...
rpm_count_t | rpmfilesDC (rpmfiles fi)
| Return directory count from file info set. More...
int | rpmfilesFindFN (rpmfiles files, const char *fn)
| Return file index of the given file name or -1 if file is not in the rpmfi. More...
int | rpmfilesFindOFN (rpmfiles files, const char *fn)
| Return file index of the given original file name or -1 if file is not in the rpmfi. More...
rpmfi | rpmfilesIter (rpmfiles files, int itype)
int | rpmfilesDigestAlgo (rpmfiles fi)
| Return digest algorithm of a file info set. More...
rpm_color_t | rpmfilesColor (rpmfiles files)
| Return union of all file color bits from file info set. More...
int | rpmfilesCompare (rpmfiles afi, int aix, rpmfiles bfi, int bix)
| Return file info comparison. More...
const char * | rpmfilesBN (rpmfiles fi, int ix)
| Return base name from file info set. More...
const char * | rpmfilesDN (rpmfiles fi, int jx)
| Return directory name from file info set. More...
int | rpmfilesDI (rpmfiles fi, int ix)
| Return directory index from file info set. More...
char * | rpmfilesFN (rpmfiles fi, int ix)
| Return file name from file info set. More...
int | rpmfilesODI (rpmfiles fi, int ix)
| Return original directory index from file info set. More...
const char * | rpmfilesOBN (rpmfiles fi, int ix)
| Return original base name from file info set. More...
const char * | rpmfilesODN (rpmfiles fi, int jx)
| Return original directory name from file info set. More...
char * | rpmfilesOFN (rpmfiles fi, int ix)
| Return original file name from file info set. More...
rpmVerifyAttrs | rpmfilesVFlags (rpmfiles fi, int ix)
| Return file verify flags from file info set. More...
rpmfileState | rpmfilesFState (rpmfiles fi, int ix)
| Return file state from file info set. More...
const char * | rpmfilesFLink (rpmfiles fi, int ix)
| Return file linkto (i.e. More...
rpm_loff_t | rpmfilesFSize (rpmfiles fi, int ix)
| Return file size from file info set. More...
rpm_color_t | rpmfilesFColor (rpmfiles fi, int ix)
| Return file color bits from file info set. More...
const char * | rpmfilesFClass (rpmfiles fi, int ix)
| Return file class from file info set. More...
uint32_t | rpmfilesFDepends (rpmfiles fi, int ix, const uint32_t **fddictp)
| Return file depends dictionary from file info set. More...
uint32_t | rpmfilesFNlink (rpmfiles fi, int ix)
| Return (calculated) file nlink count from file info set. More...
uint32_t | rpmfilesFLinks (rpmfiles fi, int ix, const int **files)
| Return (calculated) file nlink count from file info set. More...
const char * | rpmfilesFLangs (rpmfiles fi, int ix)
| Return file language(s) from file info set. More...
rpmfileAttrs | rpmfilesFFlags (rpmfiles fi, int ix)
| Return file flags from file info set. More...
rpm_mode_t | rpmfilesFMode (rpmfiles fi, int ix)
| Return file mode from file info set. More...
const unsigned char * | rpmfilesFDigest (rpmfiles fi, int ix, int *algo, size_t *len)
| Return file (binary) digest of file info set. More...
const unsigned char * | rpmfilesFSignature (rpmfiles fi, int ix, size_t *len)
| Return file (binary) digest of file info set. More...
rpm_rdev_t | rpmfilesFRdev (rpmfiles fi, int ix)
| Return file rdev from file info set. More...
rpm_ino_t | rpmfilesFInode (rpmfiles fi, int ix)
| Return file inode from file info set. More...
rpm_time_t | rpmfilesFMtime (rpmfiles fi, int ix)
| Return file modify time from file info set. More...
const char * | rpmfilesFUser (rpmfiles fi, int ix)
| Return file owner from file info set. More...
const char * | rpmfilesFGroup (rpmfiles fi, int ix)
| Return file group from file info set. More...
const char * | rpmfilesFCaps (rpmfiles fi, int ix)
| Return textual representation of file capabilities from file info set. More...
int | rpmfilesStat (rpmfiles fi, int ix, int flags, struct stat *sb)
| Map file stat(2) info. More...

## Detailed Description

File info set API.

Definition in file rpmfiles.h.

## Macro Definition Documentation

#define RPMFI_FLAGS_ERASE

Value:
(RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \
RPMFI_NOFILEVERIFYFLAGS)
RPMFI_NOFILERDEVS
Definition: rpmfiles.h:113
RPMFI_NOFILECLASS
Definition: rpmfiles.h:102
RPMFI_NOFILELANGS
Definition: rpmfiles.h:104
RPMFI_NOFILEINODES
Definition: rpmfiles.h:114

Definition at line 124 of file rpmfiles.h.

#define RPMFI_FLAGS_INSTALL (RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)

Definition at line 129 of file rpmfiles.h.

#define RPMFI_FLAGS_ONLY_FILENAMES

Value:
(RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
RPMFI_NOFILEUSER | RPMFI_NOFILEGROUP | RPMFI_NOFILEMODES | \
RPMFI_NOFILESIZES | RPMFI_NOFILECAPS | RPMFI_NOFILELINKTOS | \
RPMFI_NOFILEDIGESTS | RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | \
RPMFI_NOFILEINODES | RPMFI_NOFILESTATES | RPMFI_NOFILECOLORS | \
RPMFI_NOFILEVERIFYFLAGS | RPMFI_NOFILEFLAGS)
RPMFI_NOFILERDEVS
Definition: rpmfiles.h:113
RPMFI_NOFILECLASS
Definition: rpmfiles.h:102
RPMFI_NOFILECOLORS
Definition: rpmfiles.h:116
RPMFI_NOFILEDEPS
Definition: rpmfiles.h:103
RPMFI_NOFILECAPS
Definition: rpmfiles.h:109
RPMFI_NOFILESTATES
Definition: rpmfiles.h:115
RPMFI_NOFILELINKTOS
Definition: rpmfiles.h:110
RPMFI_NOFILEGROUP
Definition: rpmfiles.h:106
RPMFI_NOFILEMODES
Definition: rpmfiles.h:107
RPMFI_NOFILELANGS
Definition: rpmfiles.h:104
RPMFI_NOFILEMTIMES
Definition: rpmfiles.h:112
RPMFI_NOFILEFLAGS
Definition: rpmfiles.h:118

Definition at line 140 of file rpmfiles.h.

#define RPMFI_FLAGS_QUERY

Value:
(RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
RPMFI_NOFILECOLORS | RPMFI_NOFILEVERIFYFLAGS)
RPMFI_NOFILECLASS
Definition: rpmfiles.h:102
RPMFI_NOFILEDEPS
Definition: rpmfiles.h:103
RPMFI_NOFILEVERIFYFLAGS
Definition: rpmfiles.h:117
RPMFI_NOFILELANGS
Definition: rpmfiles.h:104

Definition at line 136 of file rpmfiles.h.

#define RPMFI_FLAGS_VERIFY

Value:
(RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
RPMFI_NOFILECOLORS)
RPMFI_NOFILECLASS
Definition: rpmfiles.h:102
RPMFI_NOFILEDEPS
Definition: rpmfiles.h:103
RPMFI_NOFILELANGS
Definition: rpmfiles.h:104

Definition at line 132 of file rpmfiles.h.

#define RPMFILE_ALL ~(RPMFILE_NONE)

Definition at line 67 of file rpmfiles.h.

#define RPMFILE_IS_INSTALLED | ( |  | _x | ) | ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)

Definition at line 45 of file rpmfiles.h.

#define RPMFILEITERMAX 6

Definition at line 158 of file rpmfiles.h.

#define XFA_SKIPPING | ( |  | _a | ) | ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)

Definition at line 88 of file rpmfiles.h.

## Typedef Documentation

typedef rpmFlags rpmfiFlags

Definition at line 122 of file rpmfiles.h.

typedef enum rpmFileAction_e rpmFileAction

File disposition(s) during package install/erase transaction.

typedef rpmFlags rpmfileAttrs

Definition at line 65 of file rpmfiles.h.

typedef enum rpmFileIter_e rpmFileIter

typedef enum rpmfileState_e rpmfileState

File States (when installed).

typedef enum rpmFileTypes_e rpmFileTypes

File types.

These are the file types used internally by rpm. The file type is determined by applying stat(2) macros like S_ISDIR to the file mode tag from a header. The values are arbitrary, but are identical to the linux stat(2) file types.

## Enumeration Type Documentation

enum rpmfiFlags_e

Enumerator
RPMFI_NOHEADER |
RPMFI_KEEPHEADER |
RPMFI_NOFILECLASS |
RPMFI_NOFILEDEPS |
RPMFI_NOFILELANGS |
RPMFI_NOFILEUSER |
RPMFI_NOFILEGROUP |
RPMFI_NOFILEMODES |
RPMFI_NOFILESIZES |
RPMFI_NOFILECAPS |
RPMFI_NOFILELINKTOS |
RPMFI_NOFILEDIGESTS |
RPMFI_NOFILEMTIMES |
RPMFI_NOFILERDEVS |
RPMFI_NOFILEINODES |
RPMFI_NOFILESTATES |
RPMFI_NOFILECOLORS |
RPMFI_NOFILEVERIFYFLAGS |
RPMFI_NOFILEFLAGS |
RPMFI_NOFILESIGNATURES |

Definition at line 99 of file rpmfiles.h.

enum rpmFileAction_e

File disposition(s) during package install/erase transaction.

Enumerator
FA_UNKNOWN | initial action for file ...
FA_CREATE | ... create from payload.
FA_COPYIN | obsolete, unused.
FA_COPYOUT | obsolete, unused.
FA_BACKUP | ... renamed with ".rpmorig" extension.
FA_SAVE | ... renamed with ".rpmsave" extension.
FA_SKIP | ... already replaced, don't remove.
FA_ALTNAME | ... create with ".rpmnew" extension.
FA_ERASE | ... to be removed.
FA_SKIPNSTATE | ... untouched, state "not installed".
FA_SKIPNETSHARED | ... untouched, state "netshared".
FA_SKIPCOLOR | ... untouched, state "wrong color".

Definition at line 72 of file rpmfiles.h.

enum rpmfileAttrs_e

Exported File Attributes (ie RPMTAG_FILEFLAGS)

Enumerator
RPMFILE_NONE |
RPMFILE_CONFIG | from %config
RPMFILE_DOC | from %doc
RPMFILE_ICON | from %donotuse.
RPMFILE_MISSINGOK | from %config(missingok)
RPMFILE_NOREPLACE | from %config(noreplace)

RPMFILE_SPECFILE

Todo:
  (unnecessary) marks 1st file in srpm.

RPMFILE_GHOST | from %ghost
RPMFILE_LICENSE | from %license
RPMFILE_README | from %readme
RPMFILE_PUBKEY | from %pubkey

Definition at line 50 of file rpmfiles.h.

enum rpmFileIter_e

Enumerator
RPMFI_ITER_FWD |
RPMFI_ITER_BACK |
RPMFI_ITER_WRITE_ARCHIVE |
RPMFI_ITER_READ_ARCHIVE |
RPMFI_ITER_READ_ARCHIVE_CONTENT_FIRST |
RPMFI_ITER_READ_ARCHIVE_OMIT_HARDLINKS |
RPMFI_ITER_INTERVAL |

Definition at line 148 of file rpmfiles.h.

enum rpmfileState_e

File States (when installed).

Enumerator
RPMFILE_STATE_MISSING |
RPMFILE_STATE_NORMAL |
RPMFILE_STATE_REPLACED |
RPMFILE_STATE_NOTINSTALLED |
RPMFILE_STATE_NETSHARED |
RPMFILE_STATE_WRONGCOLOR |

Definition at line 36 of file rpmfiles.h.

enum rpmFileTypes_e

File types.

These are the file types used internally by rpm. The file type is determined by applying stat(2) macros like S_ISDIR to the file mode tag from a header. The values are arbitrary, but are identical to the linux stat(2) file types.

Enumerator
PIPE | pipe/fifo
CDEV | character device
XDIR | directory
BDEV | block device
REG | regular file
LINK | hard link
SOCK | socket

Definition at line 23 of file rpmfiles.h.

## Function Documentation

const char* rpmfilesBN | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return base name from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  base name, NULL on invalid

rpm_color_t rpmfilesColor | ( | rpmfiles | files | ) |

Return union of all file color bits from file info set.

Parameters

  files | file info set

Returns
  color

int rpmfilesCompare | ( | rpmfiles | afi,
|  | int | aix,
|  | rpmfiles | bfi,
|  | int | bix
| ) |  |

Return file info comparison.

Parameters

  afi | 1st file info
  aix | index of the 1st file
  bfi | 2nd file info
  bix | index of the 2nd file

Returns
  0 if identical

rpm_count_t rpmfilesDC | ( | rpmfiles | fi | ) |

Return directory count from file info set.

Parameters

  fi | file info set

Returns
  directory count

int rpmfilesDI | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return directory index from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  directory index, -1 on invalid

int rpmfilesDigestAlgo | ( | rpmfiles | fi | ) |

Return digest algorithm of a file info set.

Parameters

  fi | file info set

Returns
  digest algorithm of file info set, 0 on invalid

const char* rpmfilesDN | ( | rpmfiles | fi,
|  | int | jx
| ) |  |

Return directory name from file info set.

Note the index is on distinct directories within the file set, not a file index. The directory index associated with a given file index can be retrieved with rpmfilesDI(). Ie to constuct the full path of file index X you'd catenate the results of rpmfilesDN(f, rpmfilesDI(f, X)) and rpmfilesBN(f, X).

Parameters

  fi | file info set
  jx | directory index

Returns
  directory, NULL on invalid

rpm_count_t rpmfilesFC | ( | rpmfiles | fi | ) |

Return file count from file info set.

Parameters

  fi | file info set

Returns
  file count

const char* rpmfilesFCaps | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return textual representation of file capabilities from file info set.

See cap_from_text(3) for details.

Parameters

  fi | file info set
  ix | file index

Returns
  file capability description, "" for no capabilities and NULL on invalid

const char* rpmfilesFClass | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file class from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file class, 0 on invalid

rpm_color_t rpmfilesFColor | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file color bits from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file color

uint32_t rpmfilesFDepends | ( | rpmfiles | fi,
|  | int | ix,
|  | const uint32_t ** | fddictp
| ) |  |

Return file depends dictionary from file info set.

Parameters

  fi | file info set
  ix | file index

Return values

  *fddictp | file depends dictionary array (or NULL)

Returns
  no. of file depends entries, 0 on invalid

const unsigned char* rpmfilesFDigest | ( | rpmfiles | fi,
|  | int | ix,
|  | int * | algo,
|  | size_t * | len
| ) |  |

Return file (binary) digest of file info set.

Parameters

  fi | file info set
  ix | file index

Return values

  algo | digest hash algorithm used (pass NULL to ignore)
  len | digest hash length (pass NULL to ignore)

Returns
  file digest, NULL on invalid

rpmfileAttrs rpmfilesFFlags | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file flags from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file flags, 0 on invalid

const char* rpmfilesFGroup | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file group from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file group, NULL on invalid

int rpmfilesFindFN | ( | rpmfiles | files,
|  | const char * | fn
| ) |  |

Return file index of the given file name or -1 if file is not in the rpmfi.

The file name may have "." prefixed but is then interpreted as a global path without the prefixing "."

Parameters

  files | file info set
  fn | file name

Returns
  file index or -1

int rpmfilesFindOFN | ( | rpmfiles | files,
|  | const char * | fn
| ) |  |

Return file index of the given original file name or -1 if file is not in the rpmfi.

The file name may have "." prefixed but is then interpreted as a global path without the prefixing "."

Parameters

  files | file info set
  fn | file name

Returns
  file index or -1

rpm_ino_t rpmfilesFInode | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file inode from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file inode, 0 on invalid

const char* rpmfilesFLangs | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file language(s) from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file language(s), NULL on invalid

const char* rpmfilesFLink | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file linkto (i.e.

symlink(2) target) from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file linkto, NULL on invalid

uint32_t rpmfilesFLinks | ( | rpmfiles | fi,
|  | int | ix,
|  | const int ** | files
| ) |  |

Return (calculated) file nlink count from file info set.

Parameters

  fi | file info set
  ix | file index
  files | returns array of file ids hardlinked including ix, NULL for nlink count == 1

Returns
  file nlink count, 0 on invalid

rpm_mode_t rpmfilesFMode | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file mode from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file mode, 0 on invalid

rpm_time_t rpmfilesFMtime | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file modify time from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file modify time, 0 on invalid

char* rpmfilesFN | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file name from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file name (malloced)

uint32_t rpmfilesFNlink | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return (calculated) file nlink count from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file nlink count, 0 on invalid

rpm_rdev_t rpmfilesFRdev | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file rdev from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file rdev, 0 on invalid

rpmfiles rpmfilesFree | ( | rpmfiles | fi | ) |

Destroy a file info set.

Parameters

  fi | file info set

Returns
  NULL always

Referenced by process_package().

const unsigned char* rpmfilesFSignature | ( | rpmfiles | fi,
|  | int | ix,
|  | size_t * | len
| ) |  |

Return file (binary) digest of file info set.

Parameters

  fi | file info set
  ix | file index

Return values

  len | signature length (pass NULL to ignore)

Returns
  file signature, NULL on invalid

rpm_loff_t rpmfilesFSize | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file size from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file size, 0 on invalid

rpmfileState rpmfilesFState | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file state from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file state, 0 on invalid

const char* rpmfilesFUser | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file owner from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file owner, NULL on invalid

rpmfi rpmfilesIter | ( | rpmfiles | files,
|  | int | itype
| ) |  |

rpmfiles rpmfilesLink | ( | rpmfiles | fi | ) |

Reference a file info set instance.

Parameters

  fi | file info set

Returns
  new file info set reference

rpmfiles rpmfilesNew | ( | rpmstrPool | pool,
|  | Header | h,
|  | rpmTagVal | tagN,
|  | rpmfiFlags | flags
| ) |  |

Create and load a file info set.

Parameters

  pool | shared string pool (or NULL for private pool)
  h | header
  tagN | unused
  flags | Flags to control what information is loaded.

Returns
  new file info set

Referenced by process_package().

const char* rpmfilesOBN | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return original base name from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  base name, NULL on invalid

int rpmfilesODI | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return original directory index from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  directory index, -1 on invalid

const char* rpmfilesODN | ( | rpmfiles | fi,
|  | int | jx
| ) |  |

Return original directory name from file info set.

Note the index is on distinct directories within the file set, not a file index. The directory index associated with a given file index can be retrieved with rpmfilesODI(). Ie to constuct the full path of file index X you'd catenate the results of rpmfilesODN(f, rpmfilesODI(f, X)) and rpmfilesOBN(f, X).

Parameters

  fi | file info set
  jx | directory index

Returns
  directory, NULL on invalid

char* rpmfilesOFN | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return original file name from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file name

int rpmfilesStat | ( | rpmfiles | fi,
|  | int | ix,
|  | int | flags,
|  | struct stat * | sb
| ) |  |

Map file stat(2) info.

Parameters

  fi | file info set
  ix | file index
  flags | flags

Return values

  sb | mapped stat(2) data

Returns
  0 on success

rpmVerifyAttrs rpmfilesVFlags | ( | rpmfiles | fi,
|  | int | ix
| ) |  |

Return file verify flags from file info set.

Parameters

  fi | file info set
  ix | file index

Returns
  file verify flags, 0 on invalid