rpm  5.4.10
rpmevr.h
Go to the documentation of this file.
1 #ifndef H_RPMEVR
2 #define H_RPMEVR
3 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
15 /*@-exportlocal@*/
16 /*@unchecked@*/
17 extern int _rpmevr_debug;
18 /*@=exportlocal@*/
19 
20 typedef /*@abstract@*/ struct EVR_s * EVR_t;
21 
25 /*@-matchfields@*/
26 typedef enum evrFlags_e {
27 #if defined(_RPMEVR_INTERNAL)
28  RPMSENSE_ANY = 0,
29 /*@-enummemuse@*/
30  RPMSENSE_TRIGGERTRANS = (1 << 0),
31 /*@=enummemuse@*/
32 #endif
33  RPMSENSE_LESS = (1 << 1),
34  RPMSENSE_GREATER = (1 << 2),
35  RPMSENSE_EQUAL = (1 << 3),
36 #if defined(_RPMEVR_INTERNAL)
37  RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */
38  RPMSENSE_CONFLICTS = (1 << 5), /* only used internally by builds */
39 #endif
40  RPMSENSE_PREREQ = (1 << 6),
41 #if defined(_RPMEVR_INTERNAL)
42  RPMSENSE_OBSOLETES = (1 << 7), /* only used internally by builds */
43  RPMSENSE_INTERP = (1 << 8),
44  RPMSENSE_SCRIPT_PRE = (1 << 9),
45  RPMSENSE_SCRIPT_POST = (1 << 10),
46  RPMSENSE_SCRIPT_PREUN = (1 << 11),
47  RPMSENSE_SCRIPT_POSTUN = (1 << 12),
48  RPMSENSE_SCRIPT_VERIFY = (1 << 13),
49  RPMSENSE_FIND_REQUIRES = (1 << 14),
50  RPMSENSE_FIND_PROVIDES = (1 << 15),
52  RPMSENSE_TRIGGERIN = (1 << 16),
53  RPMSENSE_TRIGGERUN = (1 << 17),
54  RPMSENSE_TRIGGERPOSTUN = (1 << 18),
55  RPMSENSE_MISSINGOK = (1 << 19),
56  RPMSENSE_SCRIPT_PREP = (1 << 20),
57  RPMSENSE_SCRIPT_BUILD = (1 << 21),
58  RPMSENSE_SCRIPT_INSTALL = (1 << 22),
59  RPMSENSE_SCRIPT_CLEAN = (1 << 23),
60  RPMSENSE_RPMLIB = (1 << 24),
61  RPMSENSE_TRIGGERPREIN = (1 << 25),
62  RPMSENSE_KEYRING = (1 << 26),
63  RPMSENSE_STRONG = (1 << 27),
64  RPMSENSE_CONFIG = (1 << 28),
65  RPMSENSE_PROBE = (1 << 29),
66  RPMSENSE_PACKAGE = (1 << 30),
67  RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31)
68 #endif
69 } evrFlags;
70 /*@=matchfields@*/
71 
73 
74 #define RPMSENSE_SENSEMASK \
75  (RPMSENSE_EQUAL | RPMSENSE_GREATER | RPMSENSE_LESS)
76 #define RPMSENSE_NOTEQUAL \
77  (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
78 
79 #if defined(_RPMEVR_INTERNAL)
80 
83 struct EVR_s {
84 /*@owned@*/
85  const char * str;
86 #ifndef DYING
87  unsigned long Elong;
88 #endif
89  evrFlags Flags;
90  const char * F[6];
91 #define RPMEVR_E 1
92 #define RPMEVR_V 2
93 #define RPMEVR_T 3
94 #define RPMEVR_R 4
95 #define RPMEVR_D 5
96 };
97 
98 #define RPMSENSE_TRIGGER \
99  (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN | RPMSENSE_TRIGGERTRANS)
100 
101 #define _ALL_REQUIRES_MASK (\
102  RPMSENSE_INTERP | \
103  RPMSENSE_SCRIPT_PRE | \
104  RPMSENSE_SCRIPT_POST | \
105  RPMSENSE_SCRIPT_PREUN | \
106  RPMSENSE_SCRIPT_POSTUN | \
107  RPMSENSE_SCRIPT_VERIFY | \
108  RPMSENSE_FIND_REQUIRES | \
109  RPMSENSE_MISSINGOK | \
110  RPMSENSE_SCRIPT_PREP | \
111  RPMSENSE_SCRIPT_BUILD | \
112  RPMSENSE_SCRIPT_INSTALL | \
113  RPMSENSE_SCRIPT_CLEAN | \
114  RPMSENSE_RPMLIB | \
115  RPMSENSE_KEYRING | \
116  RPMSENSE_PACKAGE )
117 
118 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
119 #define _INSTALL_ONLY_MASK \
120  _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
121 #define _ERASE_ONLY_MASK \
122  _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
123 
124 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
125 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
126 #endif /* _RPMEVR_INTERNAL */
127 
134 EVR_t rpmEVRnew(uint32_t Flags, int initialize)
135  /*@*/;
136 
142 /*@null@*/
143 EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
144  /*@modifies evr @*/;
145 
152 int rpmEVRcmp(const char *a, const char *b)
153  /*@*/;
154 
161 int rpmEVRparse(const char * evrstr, EVR_t evr)
162  /*@modifies evrstr, evr @*/;
163 
170 int rpmEVRcompare(const EVR_t a, const EVR_t b)
171  /*@*/;
172 
179 int rpmEVRoverlap(EVR_t a, EVR_t b)
180  /*@*/;
181 
188 extern int (*rpmvercmp)(const char *a, const char *b)
189  /*@*/;
190 
197 rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char **end)
198  /*@modifies *end @*/;
199 
200 #if defined(_RPMEVR_INTERNAL)
201 
210  /*@globals internalState @*/
211  /*@modifies internalState @*/;
212 #endif
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif /* H_RPMEVR */
EVR_t rpmEVRnew(uint32_t Flags, int initialize)
Create a new EVR container.
Definition: rpmevr.c:31
evrFlags_e
Dependency Attributes.
Definition: rpmevr.h:26
The Header data structure.
int(* rpmvercmp)(const char *a, const char *b)
Segmented string compare vector.
Definition: rpmevr.c:373
struct EVR_s * EVR_t
Definition: rpmevr.h:20
enum evrFlags_e evrFlags
Dependency Attributes.
enum evrFlags_e rpmsenseFlags
Definition: rpmevr.h:72
int rpmEVRparse(const char *evrstr, EVR_t evr)
Split EVR string into epoch, version, and release components.
Definition: rpmevr.c:179
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:400
#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:274
int _rpmevr_debug
Definition: rpmevr.c:25
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:333
int rpmVersionCompare(Header A, Header B)
Definition: rpmevr.c:419