00001 #ifndef H_RPMEVR
00002 #define H_RPMEVR
00003
00011
00012
00013 extern int _rpmevr_debug;
00014
00015
00016 typedef struct EVR_s * EVR_t;
00017
00021 typedef enum evrFlags_e rpmsenseFlags;
00022 typedef enum evrFlags_e evrFlags;
00023
00024
00025 enum evrFlags_e {
00026 #if defined(_RPMEVR_INTERNAL)
00027 RPMSENSE_ANY = 0,
00028
00029 RPMSENSE_SERIAL = (1 << 0),
00030
00031 #endif
00032 RPMSENSE_LESS = (1 << 1),
00033 RPMSENSE_GREATER = (1 << 2),
00034 RPMSENSE_EQUAL = (1 << 3),
00035 #if defined(_RPMEVR_INTERNAL)
00036 RPMSENSE_PROVIDES = (1 << 4),
00037 RPMSENSE_CONFLICTS = (1 << 5),
00038 #endif
00039 RPMSENSE_PREREQ = (1 << 6),
00040 #if defined(_RPMEVR_INTERNAL)
00041 RPMSENSE_OBSOLETES = (1 << 7),
00042 RPMSENSE_INTERP = (1 << 8),
00043 RPMSENSE_SCRIPT_PRE = (1 << 9),
00044 RPMSENSE_SCRIPT_POST = (1 << 10),
00045 RPMSENSE_SCRIPT_PREUN = (1 << 11),
00046 RPMSENSE_SCRIPT_POSTUN = (1 << 12),
00047 RPMSENSE_SCRIPT_VERIFY = (1 << 13),
00048 RPMSENSE_FIND_REQUIRES = (1 << 14),
00049 RPMSENSE_FIND_PROVIDES = (1 << 15),
00051 RPMSENSE_TRIGGERIN = (1 << 16),
00052 RPMSENSE_TRIGGERUN = (1 << 17),
00053 RPMSENSE_TRIGGERPOSTUN = (1 << 18),
00054 RPMSENSE_MISSINGOK = (1 << 19),
00055 RPMSENSE_SCRIPT_PREP = (1 << 20),
00056 RPMSENSE_SCRIPT_BUILD = (1 << 21),
00057 RPMSENSE_SCRIPT_INSTALL = (1 << 22),
00058 RPMSENSE_SCRIPT_CLEAN = (1 << 23),
00059 RPMSENSE_RPMLIB = (1 << 24),
00060 RPMSENSE_TRIGGERPREIN = (1 << 25),
00061 RPMSENSE_KEYRING = (1 << 26),
00062 RPMSENSE_STRONG = (1 << 27),
00063 RPMSENSE_CONFIG = (1 << 28),
00064 RPMSENSE_PROBE = (1 << 29),
00065 RPMSENSE_PACKAGE = (1 << 30)
00066 #endif
00067 };
00068
00069
00070 #define RPMSENSE_SENSEMASK 0x0e
00071
00072 #define RPMSENSE_NOTEQUAL (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
00073
00074 #if defined(_RPMEVR_INTERNAL)
00075
00078 struct EVR_s {
00079 const char * str;
00080
00081 const char * E;
00082 unsigned long Elong;
00083
00084 const char * V;
00085
00086 const char * R;
00087 evrFlags Flags;
00088 };
00089
00090 #define RPMSENSE_TRIGGER \
00091 (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
00092
00093 #define _ALL_REQUIRES_MASK (\
00094 RPMSENSE_INTERP | \
00095 RPMSENSE_SCRIPT_PRE | \
00096 RPMSENSE_SCRIPT_POST | \
00097 RPMSENSE_SCRIPT_PREUN | \
00098 RPMSENSE_SCRIPT_POSTUN | \
00099 RPMSENSE_SCRIPT_VERIFY | \
00100 RPMSENSE_FIND_REQUIRES | \
00101 RPMSENSE_MISSINGOK | \
00102 RPMSENSE_SCRIPT_PREP | \
00103 RPMSENSE_SCRIPT_BUILD | \
00104 RPMSENSE_SCRIPT_INSTALL | \
00105 RPMSENSE_SCRIPT_CLEAN | \
00106 RPMSENSE_RPMLIB | \
00107 RPMSENSE_KEYRING | \
00108 RPMSENSE_PACKAGE )
00109
00110 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
00111 #define _INSTALL_ONLY_MASK \
00112 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
00113 #define _ERASE_ONLY_MASK \
00114 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
00115
00116 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
00117 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
00118 #endif
00119
00120 #ifdef __cplusplus
00121 extern "C" {
00122 #endif
00123
00130 int rpmEVRcmp(const char *a, const char *b)
00131 ;
00132
00139 int rpmEVRparse(const char * evrstr, EVR_t evr)
00140 ;
00141
00148 int rpmEVRcompare(const EVR_t a, const EVR_t b)
00149 ;
00150
00157 extern int (*rpmvercmp)(const char *a, const char *b)
00158 ;
00159
00166 rpmsenseFlags rpmEVRflags(const char *op, const char **end)
00167 ;
00168
00169 #ifdef __cplusplus
00170 }
00171 #endif
00172
00173 #endif