rpm  4.9.1.3
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 
00049 enum rpmfileAttrs_e {
00050     RPMFILE_NONE        = 0,
00051     RPMFILE_CONFIG      = (1 <<  0),    
00052     RPMFILE_DOC         = (1 <<  1),    
00053     RPMFILE_ICON        = (1 <<  2),    
00054     RPMFILE_MISSINGOK   = (1 <<  3),    
00055     RPMFILE_NOREPLACE   = (1 <<  4),    
00056     RPMFILE_SPECFILE    = (1 <<  5),    
00057     RPMFILE_GHOST       = (1 <<  6),    
00058     RPMFILE_LICENSE     = (1 <<  7),    
00059     RPMFILE_README      = (1 <<  8),    
00060     RPMFILE_EXCLUDE     = (1 <<  9),    
00061     RPMFILE_UNPATCHED   = (1 << 10),    
00062     RPMFILE_PUBKEY      = (1 << 11),    
00063 };
00064 
00065 typedef rpmFlags rpmfileAttrs;
00066 
00067 #define RPMFILE_ALL     ~(RPMFILE_NONE)
00068 
00072 typedef enum rpmFileAction_e {
00073     FA_UNKNOWN = 0,     
00074     FA_CREATE,          
00075     FA_COPYIN,          
00076     FA_COPYOUT,         
00077     FA_BACKUP,          
00078     FA_SAVE,            
00079     FA_SKIP,            
00080     FA_ALTNAME,         
00081     FA_ERASE,           
00082     FA_SKIPNSTATE,      
00083     FA_SKIPNETSHARED,   
00084     FA_SKIPCOLOR        
00085 } rpmFileAction;
00086 
00087 #define XFA_SKIPPING(_a)        \
00088     ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
00089 
00093 struct rpmRelocation_s {
00094     char * oldPath;     
00095     char * newPath;     
00096 };
00097 
00103 rpmfi rpmfiLink (rpmfi fi);
00104 
00110 rpm_count_t rpmfiFC(rpmfi fi);
00111 
00117 int rpmfiFX(rpmfi fi);
00118 
00125 int rpmfiSetFX(rpmfi fi, int fx);
00126 
00132 rpm_count_t rpmfiDC(rpmfi fi);
00133 
00139 int rpmfiDX(rpmfi fi);
00140 
00147 int rpmfiSetDX(rpmfi fi, int dx);
00148 
00154 const char * rpmfiBN(rpmfi fi);
00155 
00161 const char * rpmfiDN(rpmfi fi);
00162 
00168 const char * rpmfiFN(rpmfi fi);
00169 
00175 rpmfileAttrs rpmfiFFlags(rpmfi fi);
00176 
00182 rpmVerifyAttrs rpmfiVFlags(rpmfi fi);
00183 
00189 rpm_mode_t rpmfiFMode(rpmfi fi);
00190 
00196 rpmfileState rpmfiFState(rpmfi fi);
00197 
00203 int rpmfiDigestAlgo(rpmfi fi);
00204 
00212 const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen);
00213 
00223 char * rpmfiFDigestHex(rpmfi fi, int *algo);
00224 
00231 const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED;
00232 
00238 const char * rpmfiFLink(rpmfi fi);
00239 
00245 rpm_loff_t rpmfiFSize(rpmfi fi);
00246 
00252 rpm_rdev_t rpmfiFRdev(rpmfi fi);
00253 
00259 rpm_ino_t rpmfiFInode(rpmfi fi);
00260 
00266 rpm_color_t rpmfiColor(rpmfi fi);
00267 
00273 rpm_color_t rpmfiFColor(rpmfi fi);
00274 
00280 const char * rpmfiFClass(rpmfi fi);
00281 
00288 uint32_t rpmfiFDepends(rpmfi fi,
00289                 const uint32_t ** fddictp);
00290 
00296 uint32_t rpmfiFNlink(rpmfi fi);
00297 
00303 rpm_time_t rpmfiFMtime(rpmfi fi);
00304 
00310 const char * rpmfiFUser(rpmfi fi);
00311 
00317 const char * rpmfiFGroup(rpmfi fi);
00318 
00326 const char * rpmfiFCaps(rpmfi fi);
00327 
00333 const char * rpmfiFLangs(rpmfi fi);
00334 
00340 int rpmfiNext(rpmfi fi);
00341 
00348 rpmfi rpmfiInit(rpmfi fi, int fx);
00349 
00355 int rpmfiNextD(rpmfi fi);
00356 
00363 rpmfi rpmfiInitD(rpmfi fi, int dx);
00364 
00370 rpmfi rpmfiFree(rpmfi fi);
00371 
00372 enum rpmfiFlags_e {
00373     RPMFI_NOHEADER              = 0,
00374     RPMFI_KEEPHEADER            = (1 << 0),
00375     RPMFI_NOFILECLASS           = (1 << 1),
00376     RPMFI_NOFILEDEPS            = (1 << 2),
00377     RPMFI_NOFILELANGS           = (1 << 3),
00378     RPMFI_NOFILEUSER            = (1 << 4),
00379     RPMFI_NOFILEGROUP           = (1 << 5),
00380     RPMFI_NOFILEMODES           = (1 << 6),
00381     RPMFI_NOFILESIZES           = (1 << 7),
00382     RPMFI_NOFILECAPS            = (1 << 8),
00383     RPMFI_NOFILELINKTOS         = (1 << 9),
00384     RPMFI_NOFILEDIGESTS         = (1 << 10),
00385     RPMFI_NOFILEMTIMES          = (1 << 11),
00386     RPMFI_NOFILERDEVS           = (1 << 12),
00387     RPMFI_NOFILEINODES          = (1 << 13),
00388     RPMFI_NOFILESTATES          = (1 << 14),
00389     RPMFI_NOFILECOLORS          = (1 << 15),
00390     RPMFI_NOFILEVERIFYFLAGS     = (1 << 16),
00391     RPMFI_NOFILEFLAGS           = (1 << 17),
00392     RPMFI_ISBUILD               = (1 << 30),    /* internal */
00393     RPMFI_ISSOURCE              = (1 << 31),    /* internal */
00394 };
00395 
00396 typedef rpmFlags rpmfiFlags;
00397 
00398 #define RPMFI_FLAGS_ERASE \
00399     (RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
00400      RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \
00401      RPMFI_NOFILEVERIFYFLAGS)
00402 
00403 #define RPMFI_FLAGS_INSTALL \
00404     (RPMFI_NOFILECLASS | RPMFI_NOFILEVERIFYFLAGS)
00405 
00406 #define RPMFI_FLAGS_VERIFY \
00407     (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
00408      RPMFI_NOFILECOLORS)
00409 
00410 #define RPMFI_FLAGS_QUERY \
00411     (RPMFI_NOFILECLASS | RPMFI_NOFILEDEPS | RPMFI_NOFILELANGS | \
00412      RPMFI_NOFILECOLORS | RPMFI_NOFILEVERIFYFLAGS)
00413 
00422 rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags);
00423 
00429 rpmFileTypes rpmfiWhatis(rpm_mode_t mode);
00430 
00437 int rpmfiCompare(const rpmfi afi, const rpmfi bfi);
00438 
00446 rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing);
00447 
00453 int rpmfiConfigConflict(const rpmfi fi);
00454 
00455 #ifdef __cplusplus
00456 }
00457 #endif
00458 
00459 #endif  /* H_RPMDS */