rpm  4.11.1-rc1
rpmds.h
Go to the documentation of this file.
1 #ifndef H_RPMDS
2 #define H_RPMDS
3 
9 #include <time.h>
10 
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmps.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
20 extern int _rpmds_nopromote;
21 
27  RPMSENSE_LESS = (1 << 1),
28  RPMSENSE_GREATER = (1 << 2),
29  RPMSENSE_EQUAL = (1 << 3),
30  /* bit 4 unused */
31  RPMSENSE_POSTTRANS = (1 << 5),
32  RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
33  RPMSENSE_PRETRANS = (1 << 7),
34  RPMSENSE_INTERP = (1 << 8),
35  RPMSENSE_SCRIPT_PRE = (1 << 9),
36  RPMSENSE_SCRIPT_POST = (1 << 10),
37  RPMSENSE_SCRIPT_PREUN = (1 << 11),
38  RPMSENSE_SCRIPT_POSTUN = (1 << 12),
39  RPMSENSE_SCRIPT_VERIFY = (1 << 13),
40  RPMSENSE_FIND_REQUIRES = (1 << 14),
41  RPMSENSE_FIND_PROVIDES = (1 << 15),
43  RPMSENSE_TRIGGERIN = (1 << 16),
44  RPMSENSE_TRIGGERUN = (1 << 17),
45  RPMSENSE_TRIGGERPOSTUN = (1 << 18),
46  RPMSENSE_MISSINGOK = (1 << 19),
47  /* bits 20-23 unused */
48  RPMSENSE_RPMLIB = (1 << 24),
49  RPMSENSE_TRIGGERPREIN = (1 << 25),
50  RPMSENSE_KEYRING = (1 << 26),
51  /* bit 27 unused */
52  RPMSENSE_CONFIG = (1 << 28)
53 };
54 
56 
57 #define RPMSENSE_SENSEMASK 15 /* Mask to get senses, ie serial, */
58  /* less, greater, equal. */
59 
60 #define RPMSENSE_TRIGGER \
61  (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
62 
63 #define _ALL_REQUIRES_MASK (\
64  RPMSENSE_INTERP | \
65  RPMSENSE_SCRIPT_PRE | \
66  RPMSENSE_SCRIPT_POST | \
67  RPMSENSE_SCRIPT_PREUN | \
68  RPMSENSE_SCRIPT_POSTUN | \
69  RPMSENSE_SCRIPT_VERIFY | \
70  RPMSENSE_FIND_REQUIRES | \
71  RPMSENSE_RPMLIB | \
72  RPMSENSE_KEYRING | \
73  RPMSENSE_PRETRANS | \
74  RPMSENSE_POSTTRANS | \
75  RPMSENSE_PREREQ | \
76  RPMSENSE_MISSINGOK)
77 
78 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
79 #define _INSTALL_ONLY_MASK \
80  _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
81 #define _ERASE_ONLY_MASK \
82  _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
83 
84 #define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
85 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
86 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
87 
94 
100 rpmds rpmdsFree(rpmds ds);
101 
109 rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
110 
117 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
118 
126 rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags);
127 
136 rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
137 
144 
150 int rpmdsCount(const rpmds ds);
151 
157 int rpmdsIx(const rpmds ds);
158 
165 int rpmdsSetIx(rpmds ds, int ix);
166 
172 const char * rpmdsDNEVR(const rpmds ds);
173 
179 const char * rpmdsN(const rpmds ds);
180 
186 const char * rpmdsEVR(const rpmds ds);
187 
193 rpmsenseFlags rpmdsFlags(const rpmds ds);
194 
200 rpmTagVal rpmdsTagN(const rpmds ds);
201 
208 unsigned int rpmdsInstance(rpmds ds);
209 
223 int rpmdsNoPromote(const rpmds ds);
224 
231 int rpmdsSetNoPromote(rpmds ds, int nopromote);
232 
238 rpm_color_t rpmdsColor(const rpmds ds);
239 
246 rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
247 
254 /* FIX: rpmMessage annotation is a lie */
255 void rpmdsNotify(rpmds ds, const char * where, int rc);
256 
262 int rpmdsNext(rpmds ds);
263 
269 rpmds rpmdsInit(rpmds ds);
270 
277 int rpmdsFind(rpmds ds, const rpmds ods);
278 
285 int rpmdsMerge(rpmds * dsp, rpmds ods);
286 
295 int rpmdsSearch(rpmds ds, rpmds ods);
296 
303 int rpmdsCompare(const rpmds A, const rpmds B);
304 
312 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
313 
322 int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote);
323 
331 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
332 
339 int rpmdsRpmlib(rpmds * dsp, const void * tblp);
340 
349 rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags);
350 
360  Header h, rpmTagVal tagN, rpmsenseFlags Flags);
361 
372  const char * N, const char * EVR, rpmsenseFlags Flags);
373 
381 int rpmdsRpmlibPool(rpmstrPool pool, rpmds * dsp, const void * tblp);
382 
383 #ifdef __cplusplus
384 }
385 #endif
386 
387 #endif /* H_RPMDS */