rpm: rpmfi.h Source File

rpm 4.11.2-rc1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rpmfi.h
Go to the documentation of this file.
1 #ifndef H_RPMFI
2 #define H_RPMFI
3
9 #include <rpm/rpmtypes.h>
10 #include <rpm/rpmvf.h>
11 #include <rpm/rpmpgp.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
24 typedef enum rpmFileTypes_e {
25 PIPE = 1,
26 CDEV = 2,
27 XDIR = 4,
28 BDEV = 6,
29 REG = 8,
30 LINK = 10,
31 SOCK = 12
32 } rpmFileTypes;
33
37 typedef enum rpmfileState_e {
38 RPMFILE_STATE_MISSING = -1, /* used for unavailable data */
39 RPMFILE_STATE_NORMAL = 0,
40 RPMFILE_STATE_REPLACED = 1,
41 RPMFILE_STATE_NOTINSTALLED = 2,
42 RPMFILE_STATE_NETSHARED = 3,
43 RPMFILE_STATE_WRONGCOLOR = 4
44 } rpmfileState;
45
46 #define RPMFILE_IS_INSTALLED(_x) ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)
47
51 enum rpmfileAttrs_e {
52 RPMFILE_NONE = 0,
53 RPMFILE_CONFIG = (1 << 0),
54 RPMFILE_DOC = (1 << 1),
55 RPMFILE_ICON = (1 << 2),
56 RPMFILE_MISSINGOK = (1 << 3),
57 RPMFILE_NOREPLACE = (1 << 4),
58 RPMFILE_SPECFILE = (1 << 5),
59 RPMFILE_GHOST = (1 << 6),
60 RPMFILE_LICENSE = (1 << 7),
61 RPMFILE_README = (1 << 8),
62 /* bits 9-10 unused */
63 RPMFILE_PUBKEY = (1 << 11),
64 };
65
66 typedef rpmFlags rpmfileAttrs;
67
68 #define RPMFILE_ALL ~(RPMFILE_NONE)
69
73 typedef enum rpmFileAction_e {
74 FA_UNKNOWN = 0,
75 FA_CREATE,
76 FA_COPYIN,
77 FA_COPYOUT,
78 FA_BACKUP,
79 FA_SAVE,
80 FA_SKIP,
81 FA_ALTNAME,
82 FA_ERASE,
83 FA_SKIPNSTATE,
84 FA_SKIPNETSHARED,
85 FA_SKIPCOLOR
86 } rpmFileAction;
87
88 #define XFA_SKIPPING(_a) \
89 ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
90
94 struct rpmRelocation_s {
95 char * oldPath;
96 char * newPath;
97 };
98
104 rpmfi rpmfiLink (rpmfi fi);
105
111 rpm_count_t rpmfiFC(rpmfi fi);
112
118 int rpmfiFX(rpmfi fi);
119
126 int rpmfiSetFX(rpmfi fi, int fx);
127
133 rpm_count_t rpmfiDC(rpmfi fi);
134
140 int rpmfiDX(rpmfi fi);
141
148 int rpmfiSetDX(rpmfi fi, int dx);
149
155 const char * rpmfiBN(rpmfi fi);
156
162 const char * rpmfiDN(rpmfi fi);
163
169 const char * rpmfiFN(rpmfi fi);
170
176 rpmfileAttrs rpmfiFFlags(rpmfi fi);
177
183 rpmVerifyAttrs rpmfiVFlags(rpmfi fi);
184
190 rpm_mode_t rpmfiFMode(rpmfi fi);
191
197 rpmfileState rpmfiFState(rpmfi fi);
198
204 int rpmfiDigestAlgo(rpmfi fi);
205
213 const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen);
214
224 char * rpmfiFDigestHex(rpmfi fi, int *algo);
225
232 const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED;
233
239 const char * rpmfiFLink(rpmfi fi);
240
246 rpm_loff_t rpmfiFSize(rpmfi fi);
247
253 rpm_rdev_t rpmfiFRdev(rpmfi fi);
254
260 rpm_ino_t rpmfiFInode(rpmfi fi);
261
267 rpm_color_t rpmfiColor(rpmfi fi);
268
274 rpm_color_t rpmfiFColor(rpmfi fi);
275
281 const char * rpmfiFClass(rpmfi fi);
282
289 uint32_t rpmfiFDepends(rpmfi fi,
290 const uint32_t ** fddictp);
291
297 uint32_t rpmfiFNlink(rpmfi fi);
298
304 rpm_time_t rpmfiFMtime(rpmfi fi);
305
311 const char * rpmfiFUser(rpmfi fi);
312
318 const char * rpmfiFGroup(rpmfi fi);
319
327 const char * rpmfiFCaps(rpmfi fi);
328
334 const char * rpmfiFLangs(rpmfi fi);
335
341 int rpmfiNext(rpmfi fi);
342
349 rpmfi rpmfiInit(rpmfi fi, int fx);
350
356 int rpmfiNextD(rpmfi fi);
357
364 rpmfi rpmfiInitD(rpmfi fi, int dx);
365
371 rpmfi rpmfiFree(rpmfi fi);
372
373 enum rpmfiFlags_e {
374 RPMFI_NOHEADER = 0,
375 RPMFI_KEEPHEADER = (1 << 0),
376 RPMFI_NOFILECLASS = (1 << 1),
377 RPMFI_NOFILEDEPS = (1 << 2),
378 RPMFI_NOFILELANGS = (1 << 3),
379 RPMFI_NOFILEUSER = (1 << 4),
380 RPMFI_NOFILEGROUP = (1 << 5),
381 RPMFI_NOFILEMODES = (1 << 6),
382 RPMFI_NOFILESIZES = (1 << 7),
383 RPMFI_NOFILECAPS = (1 << 8),
384 RPMFI_NOFILELINKTOS = (1 << 9),
385 RPMFI_NOFILEDIGESTS = (1 << 10),
386 RPMFI_NOFILEMTIMES = (1 << 11),
387 RPMFI_NOFILERDEVS = (1 << 12),
388 RPMFI_NOFILEINODES = (1 << 13),
389 RPMFI_NOFILESTATES = (1 << 14),
390 RPMFI_NOFILECOLORS = (1 << 15),
391 RPMFI_NOFILEVERIFYFLAGS = (1 << 16),
392 RPMFI_NOFILEFLAGS = (1 << 17),
393 };
394
395 typedef rpmFlags rpmfiFlags;
396
397 #define RPMFI_FLAGS_ERASE \
398 (RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
399 RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \
400 RPMFI_NOFILEVERIFYFLAGS)
401
402 #define RPMFI_FLAGS_INSTALL \
403 (RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)
404
405 #define RPMFI_FLAGS_VERIFY \
406 (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
407 RPMFI_NOFILECOLORS)
408
409 #define RPMFI_FLAGS_QUERY \
410 (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
411 RPMFI_NOFILECOLORS | RPMFI_NOFILEVERIFYFLAGS)
412
421 rpmfi rpmfiNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags);
422
431 rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags);
432
438 rpmFileTypes rpmfiWhatis(rpm_mode_t mode);
439
446 int rpmfiCompare(const rpmfi afi, const rpmfi bfi);
447
455 rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing);
456
462 int rpmfiConfigConflict(const rpmfi fi);
463
464 #ifdef __cplusplus
465 }
466 #endif
467
468 #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.