rpmevr.h
Go to the documentation of this file.
#ifndef H_RPMEVR
#define H_RPMEVR
#ifdef __cplusplus
extern "C" {
#endif
/*@-exportlocal@*/
/*@unchecked@*/
extern int _rpmevr_debug;
/*@=exportlocal@*/
typedef /*@abstract@*/ struct EVR_s * EVR_t;
/*@-matchfields@*/
typedef enum evrFlags_e {
#if defined(_RPMEVR_INTERNAL)
RPMSENSE_ANY = 0,
/*@-enummemuse@*/
RPMSENSE_SERIAL = (1 << 0),
/*@=enummemuse@*/
#endif
RPMSENSE_LESS = (1 << 1),
RPMSENSE_GREATER = (1 << 2),
RPMSENSE_EQUAL = (1 << 3),
#if defined(_RPMEVR_INTERNAL)
RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */
RPMSENSE_CONFLICTS = (1 << 5), /* only used internally by builds */
#endif
RPMSENSE_PREREQ = (1 << 6),
#if defined(_RPMEVR_INTERNAL)
RPMSENSE_OBSOLETES = (1 << 7), /* only used internally by builds */
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),
RPMSENSE_SCRIPT_PREP = (1 << 20),
RPMSENSE_SCRIPT_BUILD = (1 << 21),
RPMSENSE_SCRIPT_INSTALL = (1 << 22),
RPMSENSE_SCRIPT_CLEAN = (1 << 23),
RPMSENSE_RPMLIB = (1 << 24),
RPMSENSE_TRIGGERPREIN = (1 << 25),
RPMSENSE_KEYRING = (1 << 26),
RPMSENSE_STRONG = (1 << 27),
RPMSENSE_CONFIG = (1 << 28),
RPMSENSE_PROBE = (1 << 29),
RPMSENSE_PACKAGE = (1 << 30),
RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31)
#endif
} evrFlags;
/*@=matchfields@*/
typedef enum evrFlags_e rpmsenseFlags;
#define RPMSENSE_SENSEMASK 0x0e /* Mask to get senses, ie serial, */
/* less, greater, equal. */
#define RPMSENSE_NOTEQUAL (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
#if defined(_RPMEVR_INTERNAL)
struct EVR_s {
/*@owned@*/
const char * str;
#ifndef DYING
unsigned long Elong;
#endif
evrFlags Flags;
const char * F[5];
#define RPMEVR_E 1
#define RPMEVR_V 2
#define RPMEVR_R 3
#define RPMEVR_D 4
};
#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_MISSINGOK | \
RPMSENSE_SCRIPT_PREP | \
RPMSENSE_SCRIPT_BUILD | \
RPMSENSE_SCRIPT_INSTALL | \
RPMSENSE_SCRIPT_CLEAN | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PACKAGE )
#define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
#define _INSTALL_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
#define _ERASE_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
#endif /* _RPMEVR_INTERNAL */
EVR_t rpmEVRnew(rpmuint32_t Flags, int initialize)
/*@*/;
/*@null@*/
EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
/*@modifies evr @*/;
int rpmEVRcmp(const char *a, const char *b)
/*@*/;
int rpmEVRparse(const char * evrstr, EVR_t evr)
/*@modifies evrstr, evr @*/;
int rpmEVRcompare(const EVR_t a, const EVR_t b)
/*@*/;
int rpmEVRoverlap(EVR_t a, EVR_t b)
/*@*/;
extern int (*rpmvercmp)(const char *a, const char *b)
/*@*/;
rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char **end)
/*@modifies *end @*/;
int rpmVersionCompare(Header A, Header B)
/*@globals internalState @*/
/*@modifies internalState @*/;
#ifdef __cplusplus
}
#endif
#endif /* H_RPMEVR */