rpm  4.9.1.3
rpmds.h
Go to the documentation of this file.
00001 #ifndef H_RPMDS
00002 #define H_RPMDS
00003 
00009 #include <time.h>
00010 
00011 #include <rpm/rpmtypes.h>
00012 #include <rpm/rpmps.h>
00013 
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00020 extern int _rpmds_nopromote;
00021 
00025 enum rpmsenseFlags_e {
00026     RPMSENSE_ANY        = 0,
00027     RPMSENSE_LESS       = (1 << 1),
00028     RPMSENSE_GREATER    = (1 << 2),
00029     RPMSENSE_EQUAL      = (1 << 3),
00030     /* bit 4 unused */
00031     RPMSENSE_POSTTRANS  = (1 << 5),     
00032     RPMSENSE_PREREQ     = (1 << 6),     /* legacy prereq dependency */
00033     RPMSENSE_PRETRANS   = (1 << 7),     
00034     RPMSENSE_INTERP     = (1 << 8),     
00035     RPMSENSE_SCRIPT_PRE = (1 << 9),     
00036     RPMSENSE_SCRIPT_POST = (1 << 10),   
00037     RPMSENSE_SCRIPT_PREUN = (1 << 11),  
00038     RPMSENSE_SCRIPT_POSTUN = (1 << 12), 
00039     RPMSENSE_SCRIPT_VERIFY = (1 << 13), 
00040     RPMSENSE_FIND_REQUIRES = (1 << 14), 
00041     RPMSENSE_FIND_PROVIDES = (1 << 15), 
00043     RPMSENSE_TRIGGERIN  = (1 << 16),    
00044     RPMSENSE_TRIGGERUN  = (1 << 17),    
00045     RPMSENSE_TRIGGERPOSTUN = (1 << 18), 
00046     RPMSENSE_MISSINGOK  = (1 << 19),    
00047     /* bits 20-23 unused */
00048     RPMSENSE_RPMLIB = (1 << 24),        
00049     RPMSENSE_TRIGGERPREIN = (1 << 25),  
00050     RPMSENSE_KEYRING    = (1 << 26),
00051     /* bit 27 unused */
00052     RPMSENSE_CONFIG     = (1 << 28)
00053 };
00054 
00055 typedef rpmFlags rpmsenseFlags;
00056 
00057 #define RPMSENSE_SENSEMASK      15       /* Mask to get senses, ie serial, */
00058                                          /* less, greater, equal.          */
00059 
00060 #define RPMSENSE_TRIGGER        \
00061         (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
00062 
00063 #define _ALL_REQUIRES_MASK      (\
00064     RPMSENSE_INTERP | \
00065     RPMSENSE_SCRIPT_PRE | \
00066     RPMSENSE_SCRIPT_POST | \
00067     RPMSENSE_SCRIPT_PREUN | \
00068     RPMSENSE_SCRIPT_POSTUN | \
00069     RPMSENSE_SCRIPT_VERIFY | \
00070     RPMSENSE_FIND_REQUIRES | \
00071     RPMSENSE_RPMLIB | \
00072     RPMSENSE_KEYRING | \
00073     RPMSENSE_PRETRANS | \
00074     RPMSENSE_POSTTRANS | \
00075     RPMSENSE_PREREQ)
00076 
00077 #define _notpre(_x)             ((_x) & ~RPMSENSE_PREREQ)
00078 #define _INSTALL_ONLY_MASK \
00079     _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
00080 #define _ERASE_ONLY_MASK  \
00081     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
00082 
00083 #define isLegacyPreReq(_x)  (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
00084 #define isInstallPreReq(_x)     ((_x) & _INSTALL_ONLY_MASK)
00085 #define isErasePreReq(_x)       ((_x) & _ERASE_ONLY_MASK)
00086 
00092 rpmds rpmdsLink(rpmds ds);
00093 
00099 rpmds rpmdsFree(rpmds ds);
00107 rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
00108 
00115 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
00116 
00124 rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags);
00125 
00134 rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
00135 
00141 rpmds rpmdsCurrent(rpmds ds);
00142 
00148 int rpmdsCount(const rpmds ds);
00149 
00155 int rpmdsIx(const rpmds ds);
00156 
00163 int rpmdsSetIx(rpmds ds, int ix);
00164 
00170 const char * rpmdsDNEVR(const rpmds ds);
00171 
00177 const char * rpmdsN(const rpmds ds);
00178 
00184 const char * rpmdsEVR(const rpmds ds);
00185 
00191 rpmsenseFlags rpmdsFlags(const rpmds ds);
00192 
00198 rpmTagVal rpmdsTagN(const rpmds ds);
00199 
00206 unsigned int rpmdsInstance(rpmds ds);
00207 
00221 int rpmdsNoPromote(const rpmds ds);
00222 
00229 int rpmdsSetNoPromote(rpmds ds, int nopromote);
00230 
00236 rpm_color_t rpmdsColor(const rpmds ds);
00237 
00244 rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
00245 
00252 /* FIX: rpmMessage annotation is a lie */
00253 void rpmdsNotify(rpmds ds, const char * where, int rc);
00254 
00260 int rpmdsNext(rpmds ds);
00261 
00267 rpmds rpmdsInit(rpmds ds);
00268 
00275 int rpmdsFind(rpmds ds, const rpmds ods);
00276 
00283 int rpmdsMerge(rpmds * dsp, rpmds ods);
00284 
00293 int rpmdsSearch(rpmds ds, rpmds ods);
00294 
00301 int rpmdsCompare(const rpmds A, const rpmds B);
00302 
00310 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
00311 
00319 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
00320 
00327 int rpmdsRpmlib(rpmds * dsp, const void * tblp);
00328 
00329 #ifdef __cplusplus
00330 }
00331 #endif
00332 
00333 #endif  /* H_RPMDS */