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_debug;
00021
00024 extern int _rpmds_nopromote;
00025
00029 typedef enum rpmsenseFlags_e {
00030 RPMSENSE_ANY = 0,
00031 RPMSENSE_LESS = (1 << 1),
00032 RPMSENSE_GREATER = (1 << 2),
00033 RPMSENSE_EQUAL = (1 << 3),
00034 RPMSENSE_PROVIDES = (1 << 4),
00035 RPMSENSE_CONFLICTS = (1 << 5),
00036
00037 #define RPMSENSE_PREREQ RPMSENSE_ANY
00038 RPMSENSE_OBSOLETES = (1 << 7),
00039 RPMSENSE_INTERP = (1 << 8),
00040 RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ),
00041 RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ),
00042 RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ),
00043 RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ),
00044 RPMSENSE_SCRIPT_VERIFY = (1 << 13),
00045 RPMSENSE_FIND_REQUIRES = (1 << 14),
00046 RPMSENSE_FIND_PROVIDES = (1 << 15),
00048 RPMSENSE_TRIGGERIN = (1 << 16),
00049 RPMSENSE_TRIGGERUN = (1 << 17),
00050 RPMSENSE_TRIGGERPOSTUN = (1 << 18),
00051 RPMSENSE_MISSINGOK = (1 << 19),
00052 RPMSENSE_SCRIPT_PREP = (1 << 20),
00053 RPMSENSE_SCRIPT_BUILD = (1 << 21),
00054 RPMSENSE_SCRIPT_INSTALL = (1 << 22),
00055 RPMSENSE_SCRIPT_CLEAN = (1 << 23),
00056 RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ),
00057 RPMSENSE_TRIGGERPREIN = (1 << 25),
00058 RPMSENSE_KEYRING = (1 << 26),
00059 RPMSENSE_PATCHES = (1 << 27),
00060 RPMSENSE_CONFIG = (1 << 28)
00061 } rpmsenseFlags;
00062
00063 #define RPMSENSE_SENSEMASK 15
00064
00065
00066 #define RPMSENSE_TRIGGER \
00067 (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
00068
00069 #define _ALL_REQUIRES_MASK (\
00070 RPMSENSE_INTERP | \
00071 RPMSENSE_SCRIPT_PRE | \
00072 RPMSENSE_SCRIPT_POST | \
00073 RPMSENSE_SCRIPT_PREUN | \
00074 RPMSENSE_SCRIPT_POSTUN | \
00075 RPMSENSE_SCRIPT_VERIFY | \
00076 RPMSENSE_FIND_REQUIRES | \
00077 RPMSENSE_SCRIPT_PREP | \
00078 RPMSENSE_SCRIPT_BUILD | \
00079 RPMSENSE_SCRIPT_INSTALL | \
00080 RPMSENSE_SCRIPT_CLEAN | \
00081 RPMSENSE_RPMLIB | \
00082 RPMSENSE_KEYRING )
00083
00084 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
00085 #define _INSTALL_ONLY_MASK \
00086 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
00087 #define _ERASE_ONLY_MASK \
00088 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
00089
00090 #define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
00091 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
00092 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
00093
00100 rpmds rpmdsUnlink (rpmds ds, const char * msg);
00107 rpmds rpmdsLink (rpmds ds, const char * msg);
00108
00114 rpmds rpmdsFree(rpmds ds);
00122 rpmds rpmdsNew(Header h, rpmTag tagN, int flags);
00123
00130 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
00131
00139 rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags);
00140
00149 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
00150
00156 int rpmdsCount(const rpmds ds);
00157
00163 int rpmdsIx(const rpmds ds);
00164
00171 int rpmdsSetIx(rpmds ds, int ix);
00172
00178 const char * rpmdsDNEVR(const rpmds ds);
00179
00185 const char * rpmdsN(const rpmds ds);
00186
00192 const char * rpmdsEVR(const rpmds ds);
00193
00199 rpmsenseFlags rpmdsFlags(const rpmds ds);
00200
00206 rpmTag rpmdsTagN(const rpmds ds);
00207
00213 time_t rpmdsBT(const rpmds ds);
00214
00221 time_t rpmdsSetBT(const rpmds ds, time_t BT);
00222
00236 int rpmdsNoPromote(const rpmds ds);
00237
00244 int rpmdsSetNoPromote(rpmds ds, int nopromote);
00245
00251 rpm_color_t rpmdsColor(const rpmds ds);
00252
00259 rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
00260
00266 int32_t rpmdsRefs(const rpmds ds);
00267
00274 int32_t rpmdsSetRefs(const rpmds ds, int32_t refs);
00275
00282
00283 void rpmdsNotify(rpmds ds, const char * where, int rc);
00284
00290 int rpmdsNext(rpmds ds);
00291
00297 rpmds rpmdsInit(rpmds ds);
00298
00305 int rpmdsFind(rpmds ds, const rpmds ods);
00306
00313 int rpmdsMerge(rpmds * dsp, rpmds ods);
00314
00323 int rpmdsSearch(rpmds ds, rpmds ods);
00324
00325
00332 int rpmdsCompare(const rpmds A, const rpmds B);
00333
00342 void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds,
00343 const fnpyKey * suggestedKeys,
00344 int adding);
00345
00353 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
00354
00362 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
00363
00370 int rpmdsRpmlib(rpmds * dsp, void * tblp);
00371
00372 #ifdef __cplusplus
00373 }
00374 #endif
00375
00376 #endif