rpm 5.2.1

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

- File List
- Globals

lib/rpmfi.h
Go to the documentation of this file.

    00001 #ifndef H_RPMFI
    00002 #define H_RPMFI
    00003
    00009 /*@-exportlocal@*/
    00010 /*@unchecked@*/
    00011 extern int _rpmfi_debug;
    00012 /*@=exportlocal@*/
    00013
    00021 typedef enum rpmFileTypes_e {
    00022     PIPE        =  1,
    00023     CDEV        =  2,
    00024     XDIR        =  4,
    00025     BDEV        =  6,
    00026     REG         =  8,
    00027     LINK        = 10,
    00028     SOCK        = 12
    00029 } rpmFileTypes;
    00030
    00034 typedef enum rpmfileState_e {
    00035     RPMFILE_STATE_NORMAL        = 0,
    00036     RPMFILE_STATE_REPLACED      = 1,
    00037     RPMFILE_STATE_NOTINSTALLED  = 2,
    00038     RPMFILE_STATE_NETSHARED     = 3,
    00039     RPMFILE_STATE_WRONGCOLOR    = 4
    00040 } rpmfileState;
    00041 #define RPMFILE_STATE_MISSING   -1      /* XXX used for unavailable data */
    00042
    00046 typedef enum rpmfileAttrs_e {
    00047 /*@-enummemuse@*/
    00048     RPMFILE_NONE        = 0,
    00049 /*@=enummemuse@*/
    00050     RPMFILE_CONFIG      = (1 <<  0),
    00051     RPMFILE_DOC         = (1 <<  1),
    00052     RPMFILE_ICON        = (1 <<  2),
    00053     RPMFILE_MISSINGOK   = (1 <<  3),
    00054     RPMFILE_NOREPLACE   = (1 <<  4),
    00055     RPMFILE_SPECFILE    = (1 <<  5),
    00056     RPMFILE_GHOST       = (1 <<  6),
    00057     RPMFILE_LICENSE     = (1 <<  7),
    00058     RPMFILE_README      = (1 <<  8),
    00059     RPMFILE_EXCLUDE     = (1 <<  9),
    00060     RPMFILE_UNPATCHED   = (1 << 10),
    00061     RPMFILE_PUBKEY      = (1 << 11),
    00062     RPMFILE_POLICY      = (1 << 12),
    00063     RPMFILE_EXISTS      = (1 << 13),
    00064     RPMFILE_SPARSE      = (1 << 14),
    00065     RPMFILE_TYPED       = (1 << 15),
    00066     RPMFILE_SOURCE      = (1 << 16),
    00067     RPMFILE_PATCH       = (1 << 17),
    00068     RPMFILE_OPTIONAL    = (1 << 18),
    00069     RPMFILE_REMOVE      = (1 << 19)
    00070 } rpmfileAttrs;
    00071
    00072 #define RPMFILE_SPOOK   (RPMFILE_GHOST|RPMFILE_TYPED)
    00073 #define RPMFILE_ALL     ~(RPMFILE_NONE)
    00074
    00078 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
    00079
    00080 #if defined(_RPMFI_INTERNAL)
    00081
    00082 #include "mire.h"
    00083
    00087 struct rpmfi_s {
    00088     struct rpmioItem_s _item;
    00089     int i;
    00090     int j;
    00092 /*@observer@*/
    00093     const char * Type;
    00095     rpmTag tagN;
    00096 /*@refcounted@*/ /*@null@*/
    00097     Header h;
    00099 /*@only@*/ /*@relnull@*/
    00100     const char ** bnl;
    00101 /*@only@*/ /*@relnull@*/
    00102     const char ** dnl;
    00104 /*@only@*/ /*@relnull@*/
    00105     const char ** fdigests;
    00106 /*@only@*/ /*@null@*/
    00107     rpmuint32_t * fdigestalgos;
    00108 /*@only@*/ /*@relnull@*/
    00109     const char ** flinks;
    00110 /*@only@*/ /*@null@*/
    00111     const char ** flangs;
    00113 /*@only@*/ /*@relnull@*/
    00114           rpmuint32_t * dil;
    00115 /*@only@*/ /*@relnull@*/
    00116     const rpmuint32_t * fflags;
    00117 /*@only@*/ /*@relnull@*/
    00118     const rpmuint32_t * fsizes;
    00119 /*@only@*/ /*@relnull@*/
    00120     const rpmuint32_t * fmtimes;
    00121 /*@only@*/ /*@relnull@*/
    00122           rpmuint16_t * fmodes;
    00123 /*@only@*/ /*@relnull@*/
    00124     const rpmuint16_t * frdevs;
    00125 /*@only@*/ /*@relnull@*/
    00126     const rpmuint32_t * finodes;
    00128 /*@only@*/ /*@null@*/
    00129     const char ** fuser;
    00130 /*@only@*/ /*@null@*/
    00131     const char ** fgroup;
    00133 /*@only@*/ /*@null@*/
    00134     rpmuint8_t * fstates;
    00136 /*@only@*/ /*@null@*/
    00137     const rpmuint32_t * fcolors;
    00139 /*@only@*/ /*@null@*/
    00140     const char ** fcaps;
    00142 /*@only@*/ /*@null@*/
    00143     const char ** fcontexts;
    00145 /*@only@*/ /*@null@*/
    00146     const char ** cdict;
    00147     rpmuint32_t ncdict;
    00148 /*@only@*/ /*@null@*/
    00149     const rpmuint32_t * fcdictx;
    00151 /*@only@*/ /*@null@*/
    00152     const rpmuint32_t * ddict;
    00153     rpmuint32_t nddict;
    00154 /*@only@*/ /*@null@*/
    00155     const rpmuint32_t * fddictx;
    00156 /*@only@*/ /*@null@*/
    00157     const rpmuint32_t * fddictn;
    00159 /*@only@*/ /*@relnull@*/
    00160     const rpmuint32_t * vflags;
    00162     rpmuint32_t dc;
    00163     rpmuint32_t fc;
    00165 /*=============================*/
    00166 /*@dependent@*/ /*@relnull@*/
    00167     void * te;
    00168
    00169 /*@only@*/ /*@null@*/
    00170     miRE exclude;
    00171     int nexclude;
    00172 /*@only@*/ /*@null@*/
    00173     miRE include;
    00174     int ninclude;
    00176 /*-----------------------------*/
    00177     uid_t uid;
    00178     gid_t gid;
    00179     rpmuint32_t flags;
    00180     int action;
    00181 /*@owned@*/ /*@relnull@*/
    00182     int * actions;
    00183 /*@owned@*/
    00184     struct fingerPrint_s * fps;
    00185 /*@owned@*/
    00186     const char ** obnl;
    00187 /*@owned@*/
    00188     const char ** odnl;
    00189 /*@unused@*/
    00190     rpmuint32_t * odil;
    00192 /*@only@*/ /*@relnull@*/
    00193     unsigned char * digests;
    00194     rpmuint32_t digestalgo;
    00195     rpmuint32_t digestlen;
    00197 /*@only@*/ /*@relnull@*/
    00198     const char * pretrans;
    00199 /*@only@*/ /*@relnull@*/
    00200     const char * pretransprog;
    00201 /*@only@*/ /*@relnull@*/
    00202     const char * posttrans;
    00203 /*@only@*/ /*@relnull@*/
    00204     const char * posttransprog;
    00205 /*@only@*/ /*@relnull@*/
    00206     const char * verifyscript;
    00207 /*@only@*/ /*@relnull@*/
    00208     const char * verifyscriptprog;
    00209
    00210 /*@only@*/ /*@null@*/
    00211     char * fn;
    00212     size_t fnlen;
    00214     size_t astriplen;
    00215     size_t striplen;
    00216     unsigned long long archivePos;
    00217     unsigned long long archiveSize;
    00218     mode_t dperms;
    00219     mode_t fperms;
    00220 /*@only@*/ /*@null@*/
    00221     const char ** apath;
    00222     int mapflags;
    00223 /*@owned@*/ /*@null@*/
    00224     int * fmapflags;
    00225 /*@owned@*/
    00226     void * fsm;
    00227     rpmuint32_t color;
    00229     int isSource;
    00231 /*@owned@*/
    00232     rpmuint32_t * replacedSizes;
    00234     unsigned int record;
    00235     int magic;
    00236 #define RPMFIMAGIC      0x09697923
    00237 /*=============================*/
    00238 #if defined(__LCLINT__)
    00239 /*@refs@*/
    00240     int nrefs;
    00241 #endif
    00242 };
    00243
    00244 #endif  /* _RPMFI_INTERNAL */
    00245
    00246 #ifdef __cplusplus
    00247 extern "C" {
    00248 #endif
    00249
    00250 #if !defined(_RPMFI_NOMETHODS)
    00251
    00253
    00260 /*@unused@*/ /*@null@*/
    00261 rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi,
    00262                 /*@null@*/ const char * msg)
    00263         /*@modifies fi @*/;
    00264 #define rpmfiUnlink(_fi, _msg)  \
    00265     ((rpmfi) rpmioUnlinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
    00266
    00273 /*@unused@*/ /*@null@*/
    00274 rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg)
    00275         /*@modifies fi @*/;
    00276 #define rpmfiLink(_fi, _msg)    \
    00277     ((rpmfi) rpmioLinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
    00278
    00284 int rpmfiFC(/*@null@*/ rpmfi fi)
    00285         /*@*/;
    00286
    00292 /*@unused@*/
    00293 int rpmfiFX(/*@null@*/ rpmfi fi)
    00294         /*@*/;
    00295
    00302 /*@unused@*/
    00303 int rpmfiSetFX(/*@null@*/ rpmfi fi, int fx)
    00304         /*@modifies fi @*/;
    00305
    00311 int rpmfiDC(/*@null@*/ rpmfi fi)
    00312         /*@*/;
    00313
    00319 int rpmfiDX(/*@null@*/ rpmfi fi)
    00320         /*@*/;
    00321
    00328 int rpmfiSetDX(/*@null@*/ rpmfi fi, int dx)
    00329         /*@modifies fi @*/;
    00330
    00336 int rpmfiIsSource(/*@null@*/ rpmfi fi)
    00337         /*@*/;
    00338
    00344 /*@observer@*/ /*@null@*/
    00345 extern const char * rpmfiBN(/*@null@*/ rpmfi fi)
    00346         /*@*/;
    00347
    00353 /*@observer@*/ /*@null@*/
    00354 extern const char * rpmfiDN(/*@null@*/ rpmfi fi)
    00355         /*@*/;
    00356
    00362 /*@observer@*/
    00363 extern const char * rpmfiFN(/*@null@*/ rpmfi fi)
    00364         /*@modifies fi @*/;
    00365
    00371 extern size_t rpmfiFNMaxLen(/*@null@*/ rpmfi fi)
    00372         /*@*/;
    00373
    00379 rpmuint32_t rpmfiFFlags(/*@null@*/ rpmfi fi)
    00380         /*@*/;
    00381
    00388 rpmuint32_t rpmfiSetFFlags(/*@null@*/ rpmfi fi, rpmuint32_t FFlags)
    00389         /*@modifies fi @*/;
    00390
    00396 rpmuint32_t rpmfiVFlags(/*@null@*/ rpmfi fi)
    00397         /*@*/;
    00398
    00405 rpmuint32_t rpmfiSetVFlags(/*@null@*/ rpmfi fi, rpmuint32_t VFlags)
    00406         /*@modifies fi @*/;
    00407
    00413 rpmuint16_t rpmfiFMode(/*@null@*/ rpmfi fi)
    00414         /*@*/;
    00415
    00421 rpmfileState rpmfiFState(/*@null@*/ rpmfi fi)
    00422         /*@*/;
    00423
    00430 rpmfileState rpmfiSetFState(/*@null@*/ rpmfi fi, rpmfileState fstate)
    00431         /*@modifies fi @*/;
    00432
    00440 /*@observer@*/ /*@null@*/
    00441 extern const unsigned char * rpmfiDigest(/*@null@*/ rpmfi fi,
    00442                 /*@out@*/ /*@null@*/ int * algop,
    00443                 /*@out@*/ /*@null@*/ size_t * lenp)
    00444         /*@modifies *algop, *lenp @*/;
    00445
    00451 /*@observer@*/ /*@null@*/
    00452 extern const char * rpmfiFLink(/*@null@*/ rpmfi fi)
    00453         /*@*/;
    00454
    00460 rpmuint32_t rpmfiFSize(/*@null@*/ rpmfi fi)
    00461         /*@*/;
    00462
    00468 rpmuint16_t rpmfiFRdev(/*@null@*/ rpmfi fi)
    00469         /*@*/;
    00470
    00476 rpmuint32_t rpmfiFInode(/*@null@*/ rpmfi fi)
    00477         /*@*/;
    00478
    00484 rpmuint32_t rpmfiColor(/*@null@*/ rpmfi fi)
    00485         /*@*/;
    00486
    00492 rpmuint32_t rpmfiFColor(/*@null@*/ rpmfi fi)
    00493         /*@*/;
    00494
    00500 /*@-exportlocal@*/
    00501 /*@observer@*/ /*@null@*/
    00502 extern const char * rpmfiFClass(/*@null@*/ rpmfi fi)
    00503         /*@*/;
    00504 /*@=exportlocal@*/
    00505
    00511 /*@-exportlocal@*/
    00512 /*@observer@*/ /*@null@*/
    00513 extern const char * rpmfiFContext(/*@null@*/ rpmfi fi)
    00514         /*@*/;
    00515 /*@=exportlocal@*/
    00516
    00523 rpmuint32_t rpmfiFDepends(/*@null@*/ rpmfi fi,
    00524                 /*@out@*/ /*@null@*/ const rpmuint32_t ** fddictp)
    00525         /*@modifies *fddictp @*/;
    00526
    00532 rpmuint32_t rpmfiFNlink(/*@null@*/ rpmfi fi)
    00533         /*@*/;
    00534
    00540 rpmuint32_t rpmfiFMtime(/*@null@*/ rpmfi fi)
    00541         /*@*/;
    00542
    00548 /*@observer@*/ /*@null@*/
    00549 extern const char * rpmfiFUser(/*@null@*/ rpmfi fi)
    00550         /*@*/;
    00551
    00557 /*@observer@*/ /*@null@*/
    00558 extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi)
    00559         /*@*/;
    00560
    00566 /*@null@*/
    00567 void * rpmfiExclude(/*@null@*/ const rpmfi fi)
    00568         /*@*/;
    00569
    00575 int rpmfiNExclude(/*@null@*/ const rpmfi fi)
    00576         /*@*/;
    00577
    00583 /*@null@*/
    00584 void * rpmfiInclude(/*@null@*/ const rpmfi fi)
    00585         /*@*/;
    00586
    00592 int rpmfiNInclude(/*@null@*/ const rpmfi fi)
    00593         /*@*/;
    00594
    00600 int rpmfiNext(/*@null@*/ rpmfi fi)
    00601         /*@modifies fi @*/;
    00602
    00609 /*@null@*/
    00610 rpmfi rpmfiInit(/*@null@*/ rpmfi fi, int fx)
    00611         /*@modifies fi @*/;
    00612
    00618 /*@unused@*/
    00619 int rpmfiNextD(/*@null@*/ rpmfi fi)
    00620         /*@modifies fi @*/;
    00621
    00628 /*@unused@*/ /*@null@*/
    00629 rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx)
    00630         /*@modifies fi @*/;
    00631
    00638 int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h)
    00639         /*@modifies fi, h @*/;
    00640
    00646 /*@null@*/
    00647 rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi)
    00648         /*@globals fileSystem @*/
    00649         /*@modifies fi, fileSystem @*/;
    00650 #define rpmfiFree(_fi)  \
    00651     ((rpmfi) rpmioFreePoolItem((rpmioItem)(_fi), __FUNCTION__, __FILE__, __LINE__))
    00652
    00661 /*@null@*/
    00662 rpmfi rpmfiNew(/*@null@*/ const void * _ts, Header h, rpmTag tagN, int flags)
    00663         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00664         /*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
    00665
    00672 int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st)
    00673         /*@modifies *st @*/;
    00674
    00682 int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st)
    00683         /*@modifies fi, *st @*/;
    00684
    00691 /*@null@*/
    00692 DIR * rpmfiOpendir(rpmfi fi, const char * name)
    00693         /*@globals fileSystem, internalState @*/
    00694         /*@modifies fi, fileSystem, internalState @*/;
    00695
    00705 void rpmfiBuildFClasses(Header h,
    00706                 /*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fcp)
    00707         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00708         /*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext,
    00709                 fileSystem, internalState @*/;
    00710
    00720 void rpmfiBuildFContexts(Header h,
    00721                 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
    00722         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00723         /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
    00724                 fileSystem, internalState @*/;
    00725
    00735 void rpmfiBuildFSContexts(Header h,
    00736                 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
    00737         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00738         /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
    00739                 fileSystem, internalState @*/;
    00740
    00750 void rpmfiBuildREContexts(Header h,
    00751                 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
    00752         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00753         /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
    00754                 fileSystem, internalState @*/;
    00755
    00766 void rpmfiBuildFDeps(Header h, rpmTag tagN,
    00767                 /*@out@*/ const char *** fdepsp, /*@out@*/ rpmuint32_t * fcp)
    00768         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00769         /*@modifies h, *fdepsp, *fcp,
    00770                 rpmGlobalMacroContext, fileSystem, internalState @*/;
    00771
    00778 int rpmfiCompare(const rpmfi afi, const rpmfi bfi)
    00779         /*@*/;
    00780
    00788 int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
    00789         /*@globals h_errno, fileSystem, internalState @*/
    00790         /*@modifies nfi, fileSystem, internalState @*/;
    00791
    00797 /*@-redef@*/
    00798 /*@observer@*/
    00799 const char * rpmfiTypeString(rpmfi fi)
    00800         /*@*/;
    00801 /*@=redef@*/
    00802
    00808 /*@null@*/
    00809 rpmRelocation rpmfiFreeRelocations(/*@only@*/ rpmRelocation relocs)
    00810         /*@modifies relocs@*/;
    00811
    00818 /*@only@*/ /*@null@*/
    00819 rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp)
    00820         /*@modifies *nrelocsp @*/;
    00821
    00830 int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp,
    00831                 const char * oldPath, const char * newPath)
    00832         /*@modifies *relp, *nrelp @*/;
    00833
    00835 #endif  /* _RPMFI_NOMETHODS */
    00836
    00837 #ifdef __cplusplus
    00838 }
    00839 #endif
    00840
    00841 #endif  /* H_RPMDS */