rpm 4.11.90

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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
25 enum rpmsenseFlags_e {
26 RPMSENSE_ANY = 0,
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
55 typedef rpmFlags rpmsenseFlags;
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
88
89
96 rpmFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmFlags Flags);
97
103 rpmds rpmdsLink(rpmds ds);
104
110 rpmds rpmdsFree(rpmds ds);
111
119 rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
120
127 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
128
136 rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags);
137
146 rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
147
153 rpmds rpmdsCurrent(rpmds ds);
154
161 int rpmdsPutToHeader(rpmds ds, Header h);
162
168 int rpmdsCount(const rpmds ds);
169
175 int rpmdsIx(const rpmds ds);
176
183 int rpmdsSetIx(rpmds ds, int ix);
184
190 const char * rpmdsDNEVR(const rpmds ds);
191
197 char rpmdsD(const rpmds ds);
198
204 rpmTagVal rpmdsDToTagN(char deptype);
205
211 const char * rpmdsN(const rpmds ds);
212
218 const char * rpmdsEVR(const rpmds ds);
219
225 int rpmdsTi(const rpmds ds);
226
232 rpmsenseFlags rpmdsFlags(const rpmds ds);
233
239 rpmTagVal rpmdsTagN(const rpmds ds);
240
246 rpmTagVal rpmdsTagEVR(const rpmds ds);
247
253 rpmTagVal rpmdsTagF(const rpmds ds);
254
260 rpmTagVal rpmdsTagTi(const rpmds ds);
261
268 unsigned int rpmdsInstance(rpmds ds);
269
283 int rpmdsNoPromote(const rpmds ds);
284
291 int rpmdsSetNoPromote(rpmds ds, int nopromote);
292
298 rpm_color_t rpmdsColor(const rpmds ds);
299
306 rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
307
314 /* FIX: rpmMessage annotation is a lie */
315 void rpmdsNotify(rpmds ds, const char * where, int rc);
316
322 int rpmdsNext(rpmds ds);
323
329 rpmds rpmdsInit(rpmds ds);
330
337 int rpmdsFind(rpmds ds, const rpmds ods);
338
345 int rpmdsMerge(rpmds * dsp, rpmds ods);
346
355 int rpmdsSearch(rpmds ds, rpmds ods);
356
363 int rpmdsCompare(const rpmds A, const rpmds B);
364
372 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
373
382 int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote);
383
391 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
392
399 int rpmdsRpmlib(rpmds * dsp, const void * tblp);
400
409 rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags);
410
419 rpmds rpmdsThisPool(rpmstrPool pool,
420 Header h, rpmTagVal tagN, rpmsenseFlags Flags);
421
431 rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN,
432 const char * N, const char * EVR, rpmsenseFlags Flags);
433
444 rpmds rpmdsSinglePoolTix(rpmstrPool pool, rpmTagVal tagN,
445 const char * N, const char * EVR,
446 rpmsenseFlags Flags, int triggerIndex);
447
455 int rpmdsRpmlibPool(rpmstrPool pool, rpmds * dsp, const void * tblp);
456
457 #ifdef __cplusplus
458 }
459 #endif
460
461 #endif /* H_RPMDS */
rpmdsCurrent
rpmds rpmdsCurrent(rpmds ds)
Return a new dependency set of size 1 from the current iteration index.
rpmdsNext
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
rpmdsMatchesDep
int rpmdsMatchesDep(const Header h, int ix, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
rpmdsNewPool
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
RPMSENSE_TRIGGERPREIN
Definition: rpmds.h:49
rpmdsTagN
rpmTagVal rpmdsTagN(const rpmds ds)
Return current dependency type.
rpmdsTagTi
rpmTagVal rpmdsTagTi(const rpmds ds)
Return current dependency type.
RPMSENSE_PREREQ
Definition: rpmds.h:32
RPMSENSE_FIND_PROVIDES
Definition: rpmds.h:41
rpmdsNewDNEVR
char * rpmdsNewDNEVR(const char *dspfx, const rpmds ds)
Return new formatted dependency string.
RPMSENSE_CONFIG
Definition: rpmds.h:52
rpmdsFind
int rpmdsFind(rpmds ds, const rpmds ods)
Find a dependency set element using binary search.
RPMSENSE_ANY
Definition: rpmds.h:26
rpmdsMerge
int rpmdsMerge(rpmds *dsp, rpmds ods)
Merge a dependency set maintaining (N,EVR,Flags) sorted order.
rpmdsIx
int rpmdsIx(const rpmds ds)
Return dependency set index.
RPMSENSE_SCRIPT_PRE
Definition: rpmds.h:35
rpmdsNVRMatchesDep
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package name-version-release from header with a single dependency.
rpmdsLink
rpmds rpmdsLink(rpmds ds)
Reference a dependency set instance.
RPMSENSE_RPMLIB
Definition: rpmds.h:48
RPMSENSE_PRETRANS
Definition: rpmds.h:33
RPMSENSE_SCRIPT_PREUN
Definition: rpmds.h:37
RPMSENSE_GREATER
Definition: rpmds.h:28
RPMSENSE_TRIGGERIN
Definition: rpmds.h:43
rpmdsRpmlib
int rpmdsRpmlib(rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
rpmdsRpmlibPool
int rpmdsRpmlibPool(rpmstrPool pool, rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
rpmdsFlags
rpmsenseFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmsenseFlags_e
rpmsenseFlags_e
Dependency Attributes.
Definition: rpmds.h:25
rpmdsNotify
void rpmdsNotify(rpmds ds, const char *where, int rc)
Notify of results of dependency match.
rpmdsSetIx
int rpmdsSetIx(rpmds ds, int ix)
Set dependency set index.
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmdsTagEVR
rpmTagVal rpmdsTagEVR(const rpmds ds)
Return current dependency type.
rpmdsN
const char * rpmdsN(const rpmds ds)
Return current dependency name.
rpmdsSearch
int rpmdsSearch(rpmds ds, rpmds ods)
Search a sorted dependency set for an element that overlaps.
rpmstrPool
struct rpmstrPool_s * rpmstrPool
Definition: rpmtypes.h:83
RPMSENSE_SCRIPT_POSTUN
Definition: rpmds.h:38
RPMSENSE_LESS
Definition: rpmds.h:27
rpmdsAnyMatchesDep
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
RPMSENSE_FIND_REQUIRES
Definition: rpmds.h:40
RPMSENSE_MISSINGOK
Definition: rpmds.h:46
rpmdsSinglePoolTix
rpmds rpmdsSinglePoolTix(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags, int triggerIndex)
Create, load and initialize a trigger dependency set of size 1.
rpmdsThisPool
rpmds rpmdsThisPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
rpmdsNoPromote
int rpmdsNoPromote(const rpmds ds)
Return current "Don't promote Epoch:" flag.
rpm_color_t
uint32_t rpm_color_t
Definition: rpmtypes.h:38
RPMSENSE_TRIGGERPOSTUN
Definition: rpmds.h:45
rpmdsThis
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmdsCount
int rpmdsCount(const rpmds ds)
Return dependency set count.
rpmdsD
char rpmdsD(const rpmds ds)
Return one char indicating the type of the dependency.
rpmdsSinglePool
rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmdsSingle
rpmds rpmdsSingle(rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmds
struct rpmds_s * rpmds
Definition: rpmtypes.h:65
rpmdsDToTagN
rpmTagVal rpmdsDToTagN(char deptype)
Return matching tagN for one char dependency type description.
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
rpmdsFree
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
_rpmds_nopromote
int _rpmds_nopromote
RPMSENSE_SCRIPT_POST
Definition: rpmds.h:36
rpmdsNew
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
rpmdsColor
rpm_color_t rpmdsColor(const rpmds ds)
Return current dependency color.
rpmSanitizeDSFlags
rpmFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmFlags Flags)
Return only those flags allowed for given type of dependencies.
rpmdsPutToHeader
int rpmdsPutToHeader(rpmds ds, Header h)
Write content of the dependency set to the header.
RPMSENSE_EQUAL
Definition: rpmds.h:29
rpmdsCompare
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
rpmdsTagF
rpmTagVal rpmdsTagF(const rpmds ds)
Return current dependency type.
rpmdsInit
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
RPMSENSE_SCRIPT_VERIFY
Definition: rpmds.h:39
rpmdsEVR
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
rpmdsDNEVR
const char * rpmdsDNEVR(const rpmds ds)
Return current formatted dependency string.
RPMSENSE_INTERP
Definition: rpmds.h:34
rpmdsInstance
unsigned int rpmdsInstance(rpmds ds)
Return dependency header instance, ie whether the dependency comes from an installed header or not...
RPMSENSE_TRIGGERUN
Definition: rpmds.h:44
rpmdsSetColor
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color)
Return current dependency color.
RPMSENSE_POSTTRANS
Definition: rpmds.h:31
rpmdsTi
int rpmdsTi(const rpmds ds)
Return current dependency triggerindex.
rpmsenseFlags
rpmFlags rpmsenseFlags
Definition: rpmds.h:55
rpmdsSetNoPromote
int rpmdsSetNoPromote(rpmds ds, int nopromote)
Set "Don't promote Epoch:" flag.
RPMSENSE_KEYRING
Definition: rpmds.h:50