rpm 4.10.90

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

- File List
- Globals

rpmfi.h
Go to the documentation of this file.

    00001 #ifndef H_RPMFI
    00002 #define H_RPMFI
    00003
    00009 #include <rpm/rpmtypes.h>
    00010 #include <rpm/rpmvf.h>
    00011 #include <rpm/rpmpgp.h>
    00012
    00013 #ifdef __cplusplus
    00014 extern "C" {
    00015 #endif
    00016
    00024 typedef enum rpmFileTypes_e {
    00025     PIPE        =  1,
    00026     CDEV        =  2,
    00027     XDIR        =  4,
    00028     BDEV        =  6,
    00029     REG         =  8,
    00030     LINK        = 10,
    00031     SOCK        = 12
    00032 } rpmFileTypes;
    00033
    00037 typedef enum rpmfileState_e {
    00038     RPMFILE_STATE_MISSING       = -1,   /* used for unavailable data */
    00039     RPMFILE_STATE_NORMAL        = 0,
    00040     RPMFILE_STATE_REPLACED      = 1,
    00041     RPMFILE_STATE_NOTINSTALLED  = 2,
    00042     RPMFILE_STATE_NETSHARED     = 3,
    00043     RPMFILE_STATE_WRONGCOLOR    = 4
    00044 } rpmfileState;
    00045
    00046 #define RPMFILE_IS_INSTALLED(_x) ((_x) == RPMFILE_STATE_NORMAL || (_x) == RPMFILE_STATE_NETSHARED)
    00047
    00051 enum rpmfileAttrs_e {
    00052     RPMFILE_NONE        = 0,
    00053     RPMFILE_CONFIG      = (1 <<  0),
    00054     RPMFILE_DOC         = (1 <<  1),
    00055     RPMFILE_ICON        = (1 <<  2),
    00056     RPMFILE_MISSINGOK   = (1 <<  3),
    00057     RPMFILE_NOREPLACE   = (1 <<  4),
    00058     RPMFILE_SPECFILE    = (1 <<  5),
    00059     RPMFILE_GHOST       = (1 <<  6),
    00060     RPMFILE_LICENSE     = (1 <<  7),
    00061     RPMFILE_README      = (1 <<  8),
    00062     /* bits 9-10 unused */
    00063     RPMFILE_PUBKEY      = (1 << 11),
    00064 };
    00065
    00066 typedef rpmFlags rpmfileAttrs;
    00067
    00068 #define RPMFILE_ALL     ~(RPMFILE_NONE)
    00069
    00073 typedef enum rpmFileAction_e {
    00074     FA_UNKNOWN = 0,
    00075     FA_CREATE,
    00076     FA_COPYIN,
    00077     FA_COPYOUT,
    00078     FA_BACKUP,
    00079     FA_SAVE,
    00080     FA_SKIP,
    00081     FA_ALTNAME,
    00082     FA_ERASE,
    00083     FA_SKIPNSTATE,
    00084     FA_SKIPNETSHARED,
    00085     FA_SKIPCOLOR
    00086 } rpmFileAction;
    00087
    00088 #define XFA_SKIPPING(_a)        \
    00089     ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
    00090
    00094 struct rpmRelocation_s {
    00095     char * oldPath;
    00096     char * newPath;
    00097 };
    00098
    00104 rpmfi rpmfiLink (rpmfi fi);
    00105
    00111 rpm_count_t rpmfiFC(rpmfi fi);
    00112
    00118 int rpmfiFX(rpmfi fi);
    00119
    00126 int rpmfiSetFX(rpmfi fi, int fx);
    00127
    00133 rpm_count_t rpmfiDC(rpmfi fi);
    00134
    00140 int rpmfiDX(rpmfi fi);
    00141
    00148 int rpmfiSetDX(rpmfi fi, int dx);
    00149
    00155 const char * rpmfiBN(rpmfi fi);
    00156
    00162 const char * rpmfiDN(rpmfi fi);
    00163
    00169 const char * rpmfiFN(rpmfi fi);
    00170
    00176 rpmfileAttrs rpmfiFFlags(rpmfi fi);
    00177
    00183 rpmVerifyAttrs rpmfiVFlags(rpmfi fi);
    00184
    00190 rpm_mode_t rpmfiFMode(rpmfi fi);
    00191
    00197 rpmfileState rpmfiFState(rpmfi fi);
    00198
    00204 int rpmfiDigestAlgo(rpmfi fi);
    00205
    00213 const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen);
    00214
    00224 char * rpmfiFDigestHex(rpmfi fi, int *algo);
    00225
    00232 const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED;
    00233
    00239 const char * rpmfiFLink(rpmfi fi);
    00240
    00246 rpm_loff_t rpmfiFSize(rpmfi fi);
    00247
    00253 rpm_rdev_t rpmfiFRdev(rpmfi fi);
    00254
    00260 rpm_ino_t rpmfiFInode(rpmfi fi);
    00261
    00267 rpm_color_t rpmfiColor(rpmfi fi);
    00268
    00274 rpm_color_t rpmfiFColor(rpmfi fi);
    00275
    00281 const char * rpmfiFClass(rpmfi fi);
    00282
    00289 uint32_t rpmfiFDepends(rpmfi fi,
    00290                 const uint32_t ** fddictp);
    00291
    00297 uint32_t rpmfiFNlink(rpmfi fi);
    00298
    00304 rpm_time_t rpmfiFMtime(rpmfi fi);
    00305
    00311 const char * rpmfiFUser(rpmfi fi);
    00312
    00318 const char * rpmfiFGroup(rpmfi fi);
    00319
    00327 const char * rpmfiFCaps(rpmfi fi);
    00328
    00334 const char * rpmfiFLangs(rpmfi fi);
    00335
    00341 int rpmfiNext(rpmfi fi);
    00342
    00349 rpmfi rpmfiInit(rpmfi fi, int fx);
    00350
    00356 int rpmfiNextD(rpmfi fi);
    00357
    00364 rpmfi rpmfiInitD(rpmfi fi, int dx);
    00365
    00371 rpmfi rpmfiFree(rpmfi fi);
    00372
    00373 enum rpmfiFlags_e {
    00374     RPMFI_NOHEADER              = 0,
    00375     RPMFI_KEEPHEADER            = (1 << 0),
    00376     RPMFI_NOFILECLASS           = (1 << 1),
    00377     RPMFI_NOFILEDEPS            = (1 << 2),
    00378     RPMFI_NOFILELANGS           = (1 << 3),
    00379     RPMFI_NOFILEUSER            = (1 << 4),
    00380     RPMFI_NOFILEGROUP           = (1 << 5),
    00381     RPMFI_NOFILEMODES           = (1 << 6),
    00382     RPMFI_NOFILESIZES           = (1 << 7),
    00383     RPMFI_NOFILECAPS            = (1 << 8),
    00384     RPMFI_NOFILELINKTOS         = (1 << 9),
    00385     RPMFI_NOFILEDIGESTS         = (1 << 10),
    00386     RPMFI_NOFILEMTIMES          = (1 << 11),
    00387     RPMFI_NOFILERDEVS           = (1 << 12),
    00388     RPMFI_NOFILEINODES          = (1 << 13),
    00389     RPMFI_NOFILESTATES          = (1 << 14),
    00390     RPMFI_NOFILECOLORS          = (1 << 15),
    00391     RPMFI_NOFILEVERIFYFLAGS     = (1 << 16),
    00392     RPMFI_NOFILEFLAGS           = (1 << 17),
    00393 };
    00394
    00395 typedef rpmFlags rpmfiFlags;
    00396
    00397 #define RPMFI_FLAGS_ERASE \
    00398     (RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
    00399      RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \
    00400      RPMFI_NOFILEVERIFYFLAGS)
    00401
    00402 #define RPMFI_FLAGS_INSTALL \
    00403     (RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)
    00404
    00405 #define RPMFI_FLAGS_VERIFY \
    00406     (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
    00407      RPMFI_NOFILECOLORS)
    00408
    00409 #define RPMFI_FLAGS_QUERY \
    00410     (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
    00411      RPMFI_NOFILECOLORS | RPMFI_NOFILEVERIFYFLAGS)
    00412
    00421 rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags);
    00422
    00428 rpmFileTypes rpmfiWhatis(rpm_mode_t mode);
    00429
    00436 int rpmfiCompare(const rpmfi afi, const rpmfi bfi);
    00437
    00445 rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing);
    00446
    00452 int rpmfiConfigConflict(const rpmfi fi);
    00453
    00454 #ifdef __cplusplus
    00455 }
    00456 #endif
    00457
    00458 #endif  /* H_RPMDS */