rpmfi.h
Go to the documentation of this file.
#ifndef H_RPMFI
#define H_RPMFI
#include <rpm/rpmtypes.h>
#include <rpm/rpmvf.h>
#include <rpm/rpmpgp.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum rpmFileTypes_e {
PIPE = 1,
CDEV = 2,
XDIR = 4,
BDEV = 6,
REG = 8,
LINK = 10,
SOCK = 12
} rpmFileTypes;
typedef enum rpmfileState_e {
RPMFILE_STATE_MISSING = -1, /* used for unavailable data */
RPMFILE_STATE_NORMAL = 0,
RPMFILE_STATE_REPLACED = 1,
RPMFILE_STATE_NOTINSTALLED = 2,
RPMFILE_STATE_NETSHARED = 3,
RPMFILE_STATE_WRONGCOLOR = 4
} rpmfileState;
#define RPMFILE_IS_INSTALLED(_x) ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)
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),
/* bits 9-10 unused */
RPMFILE_PUBKEY = (1 << 11),
};
typedef rpmFlags rpmfileAttrs;
#define RPMFILE_ALL ~(RPMFILE_NONE)
typedef enum rpmFileAction_e {
FA_UNKNOWN = 0,
FA_CREATE,
FA_COPYIN,
FA_COPYOUT,
FA_BACKUP,
FA_SAVE,
FA_SKIP,
FA_ALTNAME,
FA_ERASE,
FA_SKIPNSTATE,
FA_SKIPNETSHARED,
FA_SKIPCOLOR
} rpmFileAction;
#define XFA_SKIPPING(_a) \
((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
struct rpmRelocation_s {
char * oldPath;
char * newPath;
};
rpmfi rpmfiLink (rpmfi fi);
rpm_count_t rpmfiFC(rpmfi fi);
int rpmfiFX(rpmfi fi);
int rpmfiSetFX(rpmfi fi, int fx);
rpm_count_t rpmfiDC(rpmfi fi);
int rpmfiDX(rpmfi fi);
int rpmfiSetDX(rpmfi fi, int dx);
const char * rpmfiBN(rpmfi fi);
const char * rpmfiDN(rpmfi fi);
const char * rpmfiFN(rpmfi fi);
rpmfileAttrs rpmfiFFlags(rpmfi fi);
rpmVerifyAttrs rpmfiVFlags(rpmfi fi);
rpm_mode_t rpmfiFMode(rpmfi fi);
rpmfileState rpmfiFState(rpmfi fi);
int rpmfiDigestAlgo(rpmfi fi);
const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen);
char * rpmfiFDigestHex(rpmfi fi, int *algo);
const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED;
const char * rpmfiFLink(rpmfi fi);
rpm_loff_t rpmfiFSize(rpmfi fi);
rpm_rdev_t rpmfiFRdev(rpmfi fi);
rpm_ino_t rpmfiFInode(rpmfi fi);
rpm_color_t rpmfiColor(rpmfi fi);
rpm_color_t rpmfiFColor(rpmfi fi);
const char * rpmfiFClass(rpmfi fi);
uint32_t rpmfiFDepends(rpmfi fi,
const uint32_t ** fddictp);
uint32_t rpmfiFNlink(rpmfi fi);
rpm_time_t rpmfiFMtime(rpmfi fi);
const char * rpmfiFUser(rpmfi fi);
const char * rpmfiFGroup(rpmfi fi);
const char * rpmfiFCaps(rpmfi fi);
const char * rpmfiFLangs(rpmfi fi);
int rpmfiNext(rpmfi fi);
rpmfi rpmfiInit(rpmfi fi, int fx);
int rpmfiNextD(rpmfi fi);
rpmfi rpmfiInitD(rpmfi fi, int dx);
rpmfi rpmfiFree(rpmfi fi);
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),
};
typedef rpmFlags rpmfiFlags;
#define RPMFI_FLAGS_ERASE \
(RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \
RPMFI_NOFILEVERIFYFLAGS)
#define RPMFI_FLAGS_INSTALL \
(RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)
#define RPMFI_FLAGS_VERIFY \
(RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
RPMFI_NOFILECOLORS)
#define RPMFI_FLAGS_QUERY \
(RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
RPMFI_NOFILECOLORS | RPMFI_NOFILEVERIFYFLAGS)
rpmfi rpmfiNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags);
rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags);
rpmFileTypes rpmfiWhatis(rpm_mode_t mode);
int rpmfiCompare(const rpmfi afi, const rpmfi bfi);
rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing);
int rpmfiConfigConflict(const rpmfi fi);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMDS */
RPMFI_NOFILEUSER
Definition: rpmfi.h:379
RPMFILE_STATE_NETSHARED
Definition: rpmfi.h:42
RPMFI_NOHEADER
Definition: rpmfi.h:374
rpmfiFlags_e
rpmfiFlags_e
Definition: rpmfi.h:373
rpmfiFCaps
const char * rpmfiFCaps(rpmfi fi)
Return textual representation of current file capabilities from file info set.
RPMFILE_CONFIG
Definition: rpmfi.h:53
rpmVerifyAttrs
rpmFlags rpmVerifyAttrs
Definition: rpmvf.h:39
RPMFI_NOFILELANGS
Definition: rpmfi.h:378
rpmfiFLink
const char * rpmfiFLink(rpmfi fi)
Return current file linkto (i.e.
FA_UNKNOWN
Definition: rpmfi.h:74
rpmfiDigestAlgo
int rpmfiDigestAlgo(rpmfi fi)
Return digest algorithm of a file info set.
rpmfiDecideFate
rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
Return file disposition.
rpmFileAction_e
rpmFileAction_e
File disposition(s) during package install/erase transaction.
Definition: rpmfi.h:73
CDEV
Definition: rpmfi.h:26
rpmRelocation_s::oldPath
char * oldPath
Definition: rpmfi.h:95
RPMFI_NOFILEFLAGS
Definition: rpmfi.h:392
rpm_rdev_t
uint16_t rpm_rdev_t
Definition: rpmtypes.h:54
rpmfiConfigConflict
int rpmfiConfigConflict(const rpmfi fi)
Return whether file is conflicting config.
rpm_time_t
uint32_t rpm_time_t
Definition: rpmtypes.h:52
RPMFILE_DOC
Definition: rpmfi.h:54
rpmfiDC
rpm_count_t rpmfiDC(rpmfi fi)
Return directory count from file info set.
rpmfiFMode
rpm_mode_t rpmfiFMode(rpmfi fi)
Return current file mode from file info set.
rpmfiFX
int rpmfiFX(rpmfi fi)
Return current file index from file info set.
rpmfiCompare
int rpmfiCompare(const rpmfi afi, const rpmfi bfi)
Return file info comparison.
PIPE
Definition: rpmfi.h:25
RPMFILE_README
Definition: rpmfi.h:61
rpmRelocation_s::newPath
char * newPath
Definition: rpmfi.h:96
FA_CREATE
Definition: rpmfi.h:75
rpmfiInitD
rpmfi rpmfiInitD(rpmfi fi, int dx)
Initialize directory iterator index.
rpmfiFState
rpmfileState rpmfiFState(rpmfi fi)
Return current file state from file info set.
rpmfiDX
int rpmfiDX(rpmfi fi)
Return current directory index from file info set.
rpmfiWhatis
rpmFileTypes rpmfiWhatis(rpm_mode_t mode)
Return file type from mode_t.
rpmfiFC
rpm_count_t rpmfiFC(rpmfi fi)
Return file count from file info set.
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
rpmfiFColor
rpm_color_t rpmfiFColor(rpmfi fi)
Return current file color bits from file info set.
RPM_GNUC_DEPRECATED
#define RPM_GNUC_DEPRECATED
Definition: rpmutil.h:80
RPMFI_NOFILERDEVS
Definition: rpmfi.h:387
RPMFI_NOFILECOLORS
Definition: rpmfi.h:390
rpmRelocation_s
We pass these around as an array with a sentinel.
Definition: rpmfi.h:94
FA_COPYOUT
Definition: rpmfi.h:77
rpmFileTypes_e
rpmFileTypes_e
File types.
Definition: rpmfi.h:24
RPMFILE_STATE_REPLACED
Definition: rpmfi.h:40
rpmFileAction
enum rpmFileAction_e rpmFileAction
File disposition(s) during package install/erase transaction.
rpmfiInit
rpmfi rpmfiInit(rpmfi fi, int fx)
Initialize file iterator index.
rpmfiVFlags
rpmVerifyAttrs rpmfiVFlags(rpmfi fi)
Return current file verify flags from file info set.
rpmfiFRdev
rpm_rdev_t rpmfiFRdev(rpmfi fi)
Return current file rdev from file info set.
RPMFILE_NONE
Definition: rpmfi.h:52
RPMFI_NOFILEMODES
Definition: rpmfi.h:381
rpmfi
struct rpmfi_s * rpmfi
Definition: rpmtypes.h:66
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmfiFlags
rpmFlags rpmfiFlags
Definition: rpmfi.h:395
RPMFI_NOFILECLASS
Definition: rpmfi.h:376
rpmfiColor
rpm_color_t rpmfiColor(rpmfi fi)
Return union of all file color bits from file info set.
rpmstrPool
struct rpmstrPool_s * rpmstrPool
Definition: rpmtypes.h:81
FA_SKIPCOLOR
Definition: rpmfi.h:85
BDEV
Definition: rpmfi.h:28
FA_ALTNAME
Definition: rpmfi.h:81
rpmfiFUser
const char * rpmfiFUser(rpmfi fi)
Return current file owner from file info set.
RPMFI_NOFILEDEPS
Definition: rpmfi.h:377
rpmfiFDigestHex
char * rpmfiFDigestHex(rpmfi fi, int *algo)
Return current file (hex) digest of file info set.
RPMFILE_LICENSE
Definition: rpmfi.h:60
FA_ERASE
Definition: rpmfi.h:82
RPMFI_NOFILEDIGESTS
Definition: rpmfi.h:385
RPMFILE_ICON
Definition: rpmfi.h:55
rpm_color_t
uint32_t rpm_color_t
Definition: rpmtypes.h:38
rpmfiFGroup
const char * rpmfiFGroup(rpmfi fi)
Return current file group from file info set.
rpmfiBN
const char * rpmfiBN(rpmfi fi)
Return current base name from file info set.
RPMFILE_STATE_WRONGCOLOR
Definition: rpmfi.h:43
rpmfiLink
rpmfi rpmfiLink(rpmfi fi)
Reference a file info set instance.
rpmfiSetDX
int rpmfiSetDX(rpmfi fi, int dx)
Set current directory index in file info set.
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmfiFN
const char * rpmfiFN(rpmfi fi)
Return current file name from file info set.
rpmfiFSize
rpm_loff_t rpmfiFSize(rpmfi fi)
Return current file size from file info set.
rpmfiFDepends
uint32_t rpmfiFDepends(rpmfi fi, const uint32_t **fddictp)
Return current file depends dictionary from file info set.
rpmfiFInode
rpm_ino_t rpmfiFInode(rpmfi fi)
Return current file inode from file info set.
rpmfiFree
rpmfi rpmfiFree(rpmfi fi)
Destroy a file info set.
RPMFI_NOFILEGROUP
Definition: rpmfi.h:380
rpmfiNewPool
rpmfi rpmfiNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags)
Create and load a file info set.
RPMFILE_STATE_NORMAL
Definition: rpmfi.h:39
rpmfiSetFX
int rpmfiSetFX(rpmfi fi, int fx)
Set current file index in file info set.
FA_SAVE
Definition: rpmfi.h:79
rpmfiNextD
int rpmfiNextD(rpmfi fi)
Return next directory iterator index.
rpm_count_t
uint32_t rpm_count_t
Definition: rpmtypes.h:29
RPMFILE_PUBKEY
Definition: rpmfi.h:63
rpmFileTypes
enum rpmFileTypes_e rpmFileTypes
File types.
rpmfiNew
rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags)
Create and load a file info set.
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
rpmfileAttrs_e
rpmfileAttrs_e
Exported File Attributes (ie RPMTAG_FILEFLAGS)
Definition: rpmfi.h:51
RPMFILE_MISSINGOK
Definition: rpmfi.h:56
mode
static int mode
Definition: rpmdb.c:18
rpmfileState_e
rpmfileState_e
File States (when installed).
Definition: rpmfi.h:37
rpmfileState
enum rpmfileState_e rpmfileState
File States (when installed).
rpmfiNext
int rpmfiNext(rpmfi fi)
Return next file iterator index.
RPMFI_NOFILEINODES
Definition: rpmfi.h:388
rpmfiMD5
const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED
Return current file (binary) md5 digest from file info set.
FA_COPYIN
Definition: rpmfi.h:76
REG
Definition: rpmfi.h:29
rpmfiFClass
const char * rpmfiFClass(rpmfi fi)
Return current file class from file info set.
LINK
Definition: rpmfi.h:30
FA_SKIPNETSHARED
Definition: rpmfi.h:84
RPMFILE_STATE_MISSING
Definition: rpmfi.h:38
rpmfiFDigest
const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen)
Return current file (binary) digest of file info set.
RPMFILE_NOREPLACE
Definition: rpmfi.h:57
rpmfiDN
const char * rpmfiDN(rpmfi fi)
Return current directory name from file info set.
RPMFI_NOFILECAPS
Definition: rpmfi.h:383
RPMFILE_STATE_NOTINSTALLED
Definition: rpmfi.h:41
XDIR
Definition: rpmfi.h:27
FA_SKIPNSTATE
Definition: rpmfi.h:83
RPMFI_KEEPHEADER
Definition: rpmfi.h:375
RPMFI_NOFILEVERIFYFLAGS
Definition: rpmfi.h:391
rpm_mode_t
uint16_t rpm_mode_t
Definition: rpmtypes.h:53
rpm_ino_t
uint32_t rpm_ino_t
Definition: rpmtypes.h:56
FA_SKIP
Definition: rpmfi.h:80
rpmfiFNlink
uint32_t rpmfiFNlink(rpmfi fi)
Return (calculated) current file nlink count from file info set.
SOCK
Definition: rpmfi.h:31
rpmfileAttrs
rpmFlags rpmfileAttrs
Definition: rpmfi.h:66
RPMFILE_GHOST
Definition: rpmfi.h:59
rpmfiFFlags
rpmfileAttrs rpmfiFFlags(rpmfi fi)
Return current file flags from file info set.
RPMFI_NOFILEMTIMES
Definition: rpmfi.h:386
RPMFI_NOFILESTATES
Definition: rpmfi.h:389
RPMFILE_SPECFILE
Definition: rpmfi.h:58
rpm_loff_t
uint64_t rpm_loff_t
Definition: rpmtypes.h:51
FA_BACKUP
Definition: rpmfi.h:78
RPMFI_NOFILESIZES
Definition: rpmfi.h:382
rpmfiFLangs
const char * rpmfiFLangs(rpmfi fi)
Return current file language(s) from file info set.
RPMFI_NOFILELINKTOS
Definition: rpmfi.h:384
rpmfiFMtime
rpm_time_t rpmfiFMtime(rpmfi fi)
Return current file modify time from file info set.