rpm  4.10.0
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     RPMFILE_EXCLUDE     = (1 <<  9),    
00063     RPMFILE_UNPATCHED   = (1 << 10),    
00064     RPMFILE_PUBKEY      = (1 << 11),    
00065 };
00066 
00067 typedef rpmFlags rpmfileAttrs;
00068 
00069 #define RPMFILE_ALL     ~(RPMFILE_NONE)
00070 
00074 typedef enum rpmFileAction_e {
00075     FA_UNKNOWN = 0,     
00076     FA_CREATE,          
00077     FA_COPYIN,          
00078     FA_COPYOUT,         
00079     FA_BACKUP,          
00080     FA_SAVE,            
00081     FA_SKIP,            
00082     FA_ALTNAME,         
00083     FA_ERASE,           
00084     FA_SKIPNSTATE,      
00085     FA_SKIPNETSHARED,   
00086     FA_SKIPCOLOR        
00087 } rpmFileAction;
00088 
00089 #define XFA_SKIPPING(_a)        \
00090     ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
00091 
00095 struct rpmRelocation_s {
00096     char * oldPath;     
00097     char * newPath;     
00098 };
00099 
00105 rpmfi rpmfiLink (rpmfi fi);
00106 
00112 rpm_count_t rpmfiFC(rpmfi fi);
00113 
00119 int rpmfiFX(rpmfi fi);
00120 
00127 int rpmfiSetFX(rpmfi fi, int fx);
00128 
00134 rpm_count_t rpmfiDC(rpmfi fi);
00135 
00141 int rpmfiDX(rpmfi fi);
00142 
00149 int rpmfiSetDX(rpmfi fi, int dx);
00150 
00156 const char * rpmfiBN(rpmfi fi);
00157 
00163 const char * rpmfiDN(rpmfi fi);
00164 
00170 const char * rpmfiFN(rpmfi fi);
00171 
00177 rpmfileAttrs rpmfiFFlags(rpmfi fi);
00178 
00184 rpmVerifyAttrs rpmfiVFlags(rpmfi fi);
00185 
00191 rpm_mode_t rpmfiFMode(rpmfi fi);
00192 
00198 rpmfileState rpmfiFState(rpmfi fi);
00199 
00205 int rpmfiDigestAlgo(rpmfi fi);
00206 
00214 const unsigned char * rpmfiFDigest(rpmfi fi, int *algo, size_t *diglen);
00215 
00225 char * rpmfiFDigestHex(rpmfi fi, int *algo);
00226 
00233 const unsigned char * rpmfiMD5(rpmfi fi) RPM_GNUC_DEPRECATED;
00234 
00240 const char * rpmfiFLink(rpmfi fi);
00241 
00247 rpm_loff_t rpmfiFSize(rpmfi fi);
00248 
00254 rpm_rdev_t rpmfiFRdev(rpmfi fi);
00255 
00261 rpm_ino_t rpmfiFInode(rpmfi fi);
00262 
00268 rpm_color_t rpmfiColor(rpmfi fi);
00269 
00275 rpm_color_t rpmfiFColor(rpmfi fi);
00276 
00282 const char * rpmfiFClass(rpmfi fi);
00283 
00290 uint32_t rpmfiFDepends(rpmfi fi,
00291                 const uint32_t ** fddictp);
00292 
00298 uint32_t rpmfiFNlink(rpmfi fi);
00299 
00305 rpm_time_t rpmfiFMtime(rpmfi fi);
00306 
00312 const char * rpmfiFUser(rpmfi fi);
00313 
00319 const char * rpmfiFGroup(rpmfi fi);
00320 
00328 const char * rpmfiFCaps(rpmfi fi);
00329 
00335 const char * rpmfiFLangs(rpmfi fi);
00336 
00342 int rpmfiNext(rpmfi fi);
00343 
00350 rpmfi rpmfiInit(rpmfi fi, int fx);
00351 
00357 int rpmfiNextD(rpmfi fi);
00358 
00365 rpmfi rpmfiInitD(rpmfi fi, int dx);
00366 
00372 rpmfi rpmfiFree(rpmfi fi);
00373 
00374 enum rpmfiFlags_e {
00375     RPMFI_NOHEADER              = 0,
00376     RPMFI_KEEPHEADER            = (1 << 0),
00377     RPMFI_NOFILECLASS           = (1 << 1),
00378     RPMFI_NOFILEDEPS            = (1 << 2),
00379     RPMFI_NOFILELANGS           = (1 << 3),
00380     RPMFI_NOFILEUSER            = (1 << 4),
00381     RPMFI_NOFILEGROUP           = (1 << 5),
00382     RPMFI_NOFILEMODES           = (1 << 6),
00383     RPMFI_NOFILESIZES           = (1 << 7),
00384     RPMFI_NOFILECAPS            = (1 << 8),
00385     RPMFI_NOFILELINKTOS         = (1 << 9),
00386     RPMFI_NOFILEDIGESTS         = (1 << 10),
00387     RPMFI_NOFILEMTIMES          = (1 << 11),
00388     RPMFI_NOFILERDEVS           = (1 << 12),
00389     RPMFI_NOFILEINODES          = (1 << 13),
00390     RPMFI_NOFILESTATES          = (1 << 14),
00391     RPMFI_NOFILECOLORS          = (1 << 15),
00392     RPMFI_NOFILEVERIFYFLAGS     = (1 << 16),
00393     RPMFI_NOFILEFLAGS           = (1 << 17),
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 */