rpm  5.4.15
rpmevr.h
Go to the documentation of this file.
1 #ifndef H_RPMEVR
2 #define H_RPMEVR
3 
4 #include <stdint.h> /* XXX unint32_t typedef */
5 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
17 /*@-exportlocal@*/
18 /*@unchecked@*/
19 extern int _rpmevr_debug;
20 /*@=exportlocal@*/
21 
22 typedef /*@abstract@*/ struct EVR_s * EVR_t;
23 
27 /*@-matchfields@*/
28 typedef enum evrFlags_e {
29 #if defined(_RPMEVR_INTERNAL)
30  RPMSENSE_ANY = 0,
31 /*@-enummemuse@*/
32  RPMSENSE_SERIAL = (1 << 0),
33 /*@=enummemuse@*/
34 #endif
35  RPMSENSE_LESS = (1 << 1),
36  RPMSENSE_GREATER = (1 << 2),
37  RPMSENSE_EQUAL = (1 << 3),
38 #if defined(_RPMEVR_INTERNAL)
39  RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */
40  RPMSENSE_CONFLICTS = (1 << 5), /* only used internally by builds */
41 #endif
42  RPMSENSE_PREREQ = (1 << 6),
43 #if defined(_RPMEVR_INTERNAL)
44  RPMSENSE_OBSOLETES = (1 << 7), /* only used internally by builds */
45  RPMSENSE_INTERP = (1 << 8),
46  RPMSENSE_SCRIPT_PRE = (1 << 9),
47  RPMSENSE_SCRIPT_POST = (1 << 10),
48  RPMSENSE_SCRIPT_PREUN = (1 << 11),
49  RPMSENSE_SCRIPT_POSTUN = (1 << 12),
50  RPMSENSE_SCRIPT_VERIFY = (1 << 13),
51  RPMSENSE_FIND_REQUIRES = (1 << 14),
52  RPMSENSE_FIND_PROVIDES = (1 << 15),
54  RPMSENSE_TRIGGERIN = (1 << 16),
55  RPMSENSE_TRIGGERUN = (1 << 17),
56  RPMSENSE_TRIGGERPOSTUN = (1 << 18),
57  RPMSENSE_MISSINGOK = (1 << 19),
58  RPMSENSE_SCRIPT_PREP = (1 << 20),
59  RPMSENSE_SCRIPT_BUILD = (1 << 21),
60  RPMSENSE_SCRIPT_INSTALL = (1 << 22),
61  RPMSENSE_SCRIPT_CLEAN = (1 << 23),
62  RPMSENSE_RPMLIB = (1 << 24),
63  RPMSENSE_TRIGGERPREIN = (1 << 25),
64  RPMSENSE_KEYRING = (1 << 26),
65  RPMSENSE_STRONG = (1 << 27),
66  RPMSENSE_CONFIG = (1 << 28),
67  RPMSENSE_PROBE = (1 << 29),
68  RPMSENSE_PACKAGE = (1 << 30),
69  RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31)
70 #endif
71 } evrFlags;
72 /*@=matchfields@*/
73 
75 
76 #define RPMSENSE_SENSEMASK \
77  (RPMSENSE_EQUAL | RPMSENSE_GREATER | RPMSENSE_LESS)
78 #define RPMSENSE_NOTEQUAL \
79  (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
80 
81 #if defined(_RPMEVR_INTERNAL)
82 
85 struct EVR_s {
86 /*@owned@*/
87  const char * str;
88 #ifndef DYING
89  unsigned long Elong;
90 #endif
91  evrFlags Flags;
92  const char * F[6];
93 #define RPMEVR_E 1
94 #define RPMEVR_V 2
95 #define RPMEVR_T 3
96 #define RPMEVR_R 4
97 #define RPMEVR_D 5
98 };
99 
100 #define RPMSENSE_TRIGGER \
101  (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
102 
103 #define _ALL_REQUIRES_MASK (\
104  RPMSENSE_INTERP | \
105  RPMSENSE_SCRIPT_PRE | \
106  RPMSENSE_SCRIPT_POST | \
107  RPMSENSE_SCRIPT_PREUN | \
108  RPMSENSE_SCRIPT_POSTUN | \
109  RPMSENSE_SCRIPT_VERIFY | \
110  RPMSENSE_FIND_REQUIRES | \
111  RPMSENSE_MISSINGOK | \
112  RPMSENSE_SCRIPT_PREP | \
113  RPMSENSE_SCRIPT_BUILD | \
114  RPMSENSE_SCRIPT_INSTALL | \
115  RPMSENSE_SCRIPT_CLEAN | \
116  RPMSENSE_RPMLIB | \
117  RPMSENSE_KEYRING | \
118  RPMSENSE_PACKAGE )
119 
120 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
121 #define _INSTALL_ONLY_MASK \
122  _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
123 #define _ERASE_ONLY_MASK \
124  _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
125 
126 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
127 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
128 #endif /* _RPMEVR_INTERNAL */
129 
136 EVR_t rpmEVRnew(uint32_t Flags, int initialize)
137  /*@*/;
138 
144 /*@null@*/
145 EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
146  /*@modifies evr @*/;
147 
154 int rpmEVRcmp(const char *a, const char *b)
155  /*@*/;
156 
163 int rpmEVRparse(const char * evrstr, EVR_t evr)
164  /*@modifies evrstr, evr @*/;
165 
172 int rpmEVRcompare(const EVR_t a, const EVR_t b)
173  /*@*/;
174 
181 int rpmEVRoverlap(EVR_t a, EVR_t b)
182  /*@*/;
183 
190 extern int (*rpmvercmp)(const char *a, const char *b)
191  /*@*/;
192 
199 rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char **end)
200  /*@modifies *end @*/;
201 
202 #if defined(_RPMEVR_INTERNAL)
203 
212  /*@globals internalState @*/
213  /*@modifies internalState @*/;
214 #endif
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif /* H_RPMEVR */
const bson * b
Definition: bson.h:280
EVR_t rpmEVRnew(uint32_t Flags, int initialize)
Create a new EVR container.
Definition: rpmevr.c:31
evrFlags_e
Dependency Attributes.
Definition: rpmevr.h:28
The Header data structure.
struct EVR_s * EVR_t
Definition: rpmevr.h:22
enum evrFlags_e evrFlags
Dependency Attributes.
const char * str
Definition: bson.h:593
enum evrFlags_e rpmsenseFlags
Definition: rpmevr.h:74
int rpmEVRparse(const char *evrstr, EVR_t evr)
Split EVR string into epoch, version, and release components.
Definition: rpmevr.c:181
int rpmEVRcmp(const char *a, const char *b)
Segmented string compare.
Definition: rpmevr.c:87
rpmsenseFlags rpmEVRflags(const char *op, const char **end)
Return comparison operator sense flags.
Definition: rpmevr.c:406
const char const bson const bson * op
Definition: mongo.h:505
#define _RPMEVR_INTERNAL
Definition: pack.c:19
int rpmEVRcompare(const EVR_t a, const EVR_t b)
Compare EVR containers for equality.
Definition: rpmevr.c:280
int _rpmevr_debug
Definition: rpmevr.c:25
int(* rpmvercmp)(const char *a, const char *b)
Segmented string compare vector.
Definition: rpmevr.c:379
EVR_t rpmEVRfree(EVR_t evr)
Destroy an EVR container.
Definition: rpmevr.c:47
int rpmEVRoverlap(EVR_t a, EVR_t b)
Compare EVR containers for overlap.
Definition: rpmevr.c:339
int rpmVersionCompare(Header A, Header B)
Definition: rpmevr.c:425