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);
00123 rpmds rpmdsNew(Header h, rpmTag tagN, int flags);
00124
00131 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
00132
00140 rpmds rpmdsThis(Header h, rpmTag tagN, rpmsenseFlags Flags);
00141
00150 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
00151
00157 int rpmdsCount(const rpmds ds);
00158
00164 int rpmdsIx(const rpmds ds);
00165
00172 int rpmdsSetIx(rpmds ds, int ix);
00173
00179 const char * rpmdsDNEVR(const rpmds ds);
00180
00186 const char * rpmdsN(const rpmds ds);
00187
00193 const char * rpmdsEVR(const rpmds ds);
00194
00200 rpmsenseFlags rpmdsFlags(const rpmds ds);
00201
00207 rpmTag rpmdsTagN(const rpmds ds);
00208
00214 time_t rpmdsBT(const rpmds ds);
00215
00222 time_t rpmdsSetBT(const rpmds ds, time_t BT);
00223
00237 int rpmdsNoPromote(const rpmds ds);
00238
00245 int rpmdsSetNoPromote(rpmds ds, int nopromote);
00246
00252 rpm_color_t rpmdsColor(const rpmds ds);
00253
00260 rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
00261
00267 int32_t rpmdsRefs(const rpmds ds);
00268
00275 int32_t rpmdsSetRefs(const rpmds ds, int32_t refs);
00276
00283
00284 void rpmdsNotify(rpmds ds, const char * where, int rc);
00285
00291 int rpmdsNext(rpmds ds);
00292
00298 rpmds rpmdsInit(rpmds ds);
00299
00306 int rpmdsFind(rpmds ds, const rpmds ods);
00307
00314 int rpmdsMerge(rpmds * dsp, rpmds ods);
00315
00324 int rpmdsSearch(rpmds ds, rpmds ods);
00325
00326
00333 int rpmdsCompare(const rpmds A, const rpmds B);
00334
00343 void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds,
00344 const fnpyKey * suggestedKeys,
00345 int adding);
00346
00354 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
00355
00363 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
00364
00371 int rpmdsRpmlib(rpmds * dsp, void * tblp);
00372
00373 #ifdef __cplusplus
00374 }
00375 #endif
00376
00377 #endif