rpm  4.11.1-rc1
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 */
44 } rpmfileState;
45 
46 #define RPMFILE_IS_INSTALLED(_x) ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)
47 
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 
67 
68 #define RPMFILE_ALL ~(RPMFILE_NONE)
69 
73 typedef enum rpmFileAction_e {
74  FA_UNKNOWN = 0,
87 
88 #define XFA_SKIPPING(_a) \
89  ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
90 
95  char * oldPath;
96  char * newPath;
97 };
98 
104 rpmfi rpmfiLink (rpmfi fi);
105 
112 
118 int rpmfiFX(rpmfi fi);
119 
126 int rpmfiSetFX(rpmfi fi, int fx);
127 
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 
184 
191 
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 
247 
254 
261 
268 
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 
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 
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),
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),
392  RPMFI_NOFILEFLAGS = (1 << 17),
393 };
394 
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 
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 */