rpmds.h
Go to the documentation of this file.
#ifndef H_RPMDS
#define H_RPMDS
#include <time.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmps.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int _rpmds_nopromote;
enum rpmsenseFlags_e {
RPMSENSE_ANY = 0,
RPMSENSE_LESS = (1 << 1),
RPMSENSE_GREATER = (1 << 2),
RPMSENSE_EQUAL = (1 << 3),
/* bit 4 unused */
RPMSENSE_POSTTRANS = (1 << 5),
RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
RPMSENSE_PRETRANS = (1 << 7),
RPMSENSE_INTERP = (1 << 8),
RPMSENSE_SCRIPT_PRE = (1 << 9),
RPMSENSE_SCRIPT_POST = (1 << 10),
RPMSENSE_SCRIPT_PREUN = (1 << 11),
RPMSENSE_SCRIPT_POSTUN = (1 << 12),
RPMSENSE_SCRIPT_VERIFY = (1 << 13),
RPMSENSE_FIND_REQUIRES = (1 << 14),
RPMSENSE_FIND_PROVIDES = (1 << 15),
RPMSENSE_TRIGGERIN = (1 << 16),
RPMSENSE_TRIGGERUN = (1 << 17),
RPMSENSE_TRIGGERPOSTUN = (1 << 18),
RPMSENSE_MISSINGOK = (1 << 19),
/* bits 20-23 unused */
RPMSENSE_RPMLIB = (1 << 24),
RPMSENSE_TRIGGERPREIN = (1 << 25),
RPMSENSE_KEYRING = (1 << 26),
/* bit 27 unused */
RPMSENSE_CONFIG = (1 << 28)
};
typedef rpmFlags rpmsenseFlags;
#define RPMSENSE_SENSEMASK 15 /* Mask to get senses, ie serial, */
/* less, greater, equal. */
#define RPMSENSE_TRIGGER \
(RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
#define _ALL_REQUIRES_MASK (\
RPMSENSE_INTERP | \
RPMSENSE_SCRIPT_PRE | \
RPMSENSE_SCRIPT_POST | \
RPMSENSE_SCRIPT_PREUN | \
RPMSENSE_SCRIPT_POSTUN | \
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \
RPMSENSE_POSTTRANS | \
RPMSENSE_PREREQ | \
RPMSENSE_MISSINGOK)
#define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
#define _INSTALL_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
#define _ERASE_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
#define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
rpmds rpmdsLink(rpmds ds);
rpmds rpmdsFree(rpmds ds);
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags);
rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
rpmds rpmdsCurrent(rpmds ds);
int rpmdsCount(const rpmds ds);
int rpmdsIx(const rpmds ds);
int rpmdsSetIx(rpmds ds, int ix);
const char * rpmdsDNEVR(const rpmds ds);
const char * rpmdsN(const rpmds ds);
const char * rpmdsEVR(const rpmds ds);
rpmsenseFlags rpmdsFlags(const rpmds ds);
rpmTagVal rpmdsTagN(const rpmds ds);
unsigned int rpmdsInstance(rpmds ds);
int rpmdsNoPromote(const rpmds ds);
int rpmdsSetNoPromote(rpmds ds, int nopromote);
rpm_color_t rpmdsColor(const rpmds ds);
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
/* FIX: rpmMessage annotation is a lie */
void rpmdsNotify(rpmds ds, const char * where, int rc);
int rpmdsNext(rpmds ds);
rpmds rpmdsInit(rpmds ds);
int rpmdsFind(rpmds ds, const rpmds ods);
int rpmdsMerge(rpmds * dsp, rpmds ods);
int rpmdsSearch(rpmds ds, rpmds ods);
int rpmdsCompare(const rpmds A, const rpmds B);
int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote);
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
int rpmdsRpmlib(rpmds * dsp, const void * tblp);
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags);
rpmds rpmdsThisPool(rpmstrPool pool,
Header h, rpmTagVal tagN, rpmsenseFlags Flags);
rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN,
const char * N, const char * EVR, rpmsenseFlags Flags);
int rpmdsRpmlibPool(rpmstrPool pool, rpmds * dsp, const void * tblp);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMDS */