rpm: rpmfi.h Source File

rpm 4.11.1-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 */