rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
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/rpmutil.h>
13#include <rpm/rpmps.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
23 RPMSENSE_ANY = 0,
24 RPMSENSE_LESS = (1 << 1),
25 RPMSENSE_GREATER = (1 << 2),
26 RPMSENSE_EQUAL = (1 << 3),
27 /* bit 4 unused */
28 RPMSENSE_POSTTRANS = (1 << 5),
29 RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
30 RPMSENSE_PRETRANS = (1 << 7),
31 RPMSENSE_INTERP = (1 << 8),
40 RPMSENSE_TRIGGERIN = (1 << 16),
41 RPMSENSE_TRIGGERUN = (1 << 17),
43 RPMSENSE_MISSINGOK = (1 << 19),
44 RPMSENSE_PREUNTRANS = (1 << 20),
46 /* bits 22-23 unused */
47 RPMSENSE_RPMLIB = (1 << 24),
49 RPMSENSE_KEYRING = (1 << 26),
50 /* bit 27 unused */
51 RPMSENSE_CONFIG = (1 << 28),
52 RPMSENSE_META = (1 << 29),
53};
54
55typedef 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_PREUNTRANS | \
76 RPMSENSE_POSTUNTRANS | \
77 RPMSENSE_PREREQ | \
78 RPMSENSE_META | \
79 RPMSENSE_MISSINGOK)
80
81#define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
82#define _INSTALL_ONLY_MASK \
83 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
84#define _ERASE_ONLY_MASK \
85 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN|RPMSENSE_PREUNTRANS|RPMSENSE_POSTUNTRANS)
86#define _UNORDERED_ONLY_MASK \
87 _notpre(RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS|RPMSENSE_PREUNTRANS|RPMSENSE_POSTUNTRANS|RPMSENSE_SCRIPT_VERIFY|RPMSENSE_META)
88#define _FORCE_ORDER_ONLY_MASK \
89 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
90
91#define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
92#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
93#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
94#define isUnorderedReq(_x) ((_x) & _UNORDERED_ONLY_MASK && \
95 !((_x) & _FORCE_ORDER_ONLY_MASK))
96#define isTransientReq(_x) (isInstallPreReq(_x) && \
97 !isErasePreReq(_x) && \
98 !((_x) & RPMSENSE_META))
99
106rpmsenseFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmsenseFlags Flags);
107
114rpmsenseFlags rpmParseDSFlags(const char *str, size_t len);
115
121rpmds rpmdsLink(rpmds ds);
122
128rpmds rpmdsFree(rpmds ds);
129
137rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
138
145char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
146
154rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags);
155
164rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
165
171rpmds rpmdsCurrent(rpmds ds);
172
179int rpmdsPutToHeader(rpmds ds, Header h);
180
186int rpmdsCount(const rpmds ds);
187
193int rpmdsIx(const rpmds ds);
194
201int rpmdsSetIx(rpmds ds, int ix);
202
208const char * rpmdsDNEVR(const rpmds ds);
209
215char rpmdsD(const rpmds ds);
216
222rpmTagVal rpmdsDToTagN(char deptype);
223
229const char * rpmdsN(const rpmds ds);
230
236const char * rpmdsEVR(const rpmds ds);
237
243int rpmdsTi(const rpmds ds);
244
250rpmsenseFlags rpmdsFlags(const rpmds ds);
251
257rpmTagVal rpmdsTagN(const rpmds ds);
258
264rpmTagVal rpmdsTagEVR(const rpmds ds);
265
271rpmTagVal rpmdsTagF(const rpmds ds);
272
278rpmTagVal rpmdsTagTi(const rpmds ds);
279
286unsigned int rpmdsInstance(rpmds ds);
287
293int rpmdsIsWeak(rpmds ds);
294
300int rpmdsIsReverse(rpmds ds);
301
308int rpmdsIsSysuser(rpmds ds, char **sysuser);
309
315rpm_color_t rpmdsColor(const rpmds ds);
316
323rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color);
324
330int rpmdsNext(rpmds ds);
331
337rpmds rpmdsInit(rpmds ds);
338
345int rpmdsFind(rpmds ds, const rpmds ods);
346
353int rpmdsMerge(rpmds * dsp, rpmds ods);
354
363int rpmdsSearch(rpmds ds, rpmds ods);
364
371int rpmdsCompare(const rpmds A, const rpmds B);
372
380int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
381
390int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote);
391
399int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);
400
407int rpmdsRpmlib(rpmds * dsp, const void * tblp);
408
417rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags);
418
427rpmds rpmdsThisPool(rpmstrPool pool,
428 Header h, rpmTagVal tagN, rpmsenseFlags Flags);
429
439rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN,
440 const char * N, const char * EVR, rpmsenseFlags Flags);
441
452rpmds rpmdsSinglePoolTix(rpmstrPool pool, rpmTagVal tagN,
453 const char * N, const char * EVR,
454 rpmsenseFlags Flags, int triggerIndex);
455
463int rpmdsRpmlibPool(rpmstrPool pool, rpmds * dsp, const void * tblp);
464
465
466typedef enum rpmrichOp_e {
467 RPMRICHOP_NONE = 0,
468 RPMRICHOP_SINGLE = 1,
469 RPMRICHOP_AND = 2,
470 RPMRICHOP_OR = 3,
471 RPMRICHOP_IF = 4,
472 RPMRICHOP_ELSE = 5,
473 RPMRICHOP_WITH = 6,
474 RPMRICHOP_WITHOUT = 7,
475 RPMRICHOP_UNLESS = 8
476} rpmrichOp;
477
478typedef enum rpmrichParseType_e {
479 RPMRICH_PARSE_SIMPLE = 1, /* standard N <=> EVR dep */
480 RPMRICH_PARSE_ENTER = 2, /* entering sub-dependency */
481 RPMRICH_PARSE_LEAVE = 3, /* leaving sub-dependency */
482 RPMRICH_PARSE_OP = 4 /* parsed a rich dependency op */
483} rpmrichParseType;
484
485typedef rpmRC (*rpmrichParseFunction) (void *cbdata, rpmrichParseType type,
486 const char *n, int nl, const char *e, int el, rpmsenseFlags sense,
487 rpmrichOp op, char **emsg);
488
497rpmRC rpmrichParse(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata);
498
508rpmRC rpmrichParseForTag(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN);
509
510
516int rpmdsIsRich(rpmds dep);
517
523const char *rpmrichOpStr(rpmrichOp op);
524
534rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg);
535
536#ifdef __cplusplus
537}
538#endif
539
540#endif /* H_RPMDS */
const char * rpmdsN(const rpmds ds)
int rpmdsIsWeak(rpmds ds)
int rpmdsIsSysuser(rpmds ds, char **sysuser)
int rpmdsIx(const rpmds ds)
rpmsenseFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmsenseFlags Flags)
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
rpmds rpmdsCurrent(rpmds ds)
rpmds rpmdsSinglePoolTix(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags, int triggerIndex)
int rpmdsTi(const rpmds ds)
int rpmdsCompare(const rpmds A, const rpmds B)
const char * rpmdsEVR(const rpmds ds)
int rpmdsFind(rpmds ds, const rpmds ods)
unsigned int rpmdsInstance(rpmds ds)
int rpmdsPutToHeader(rpmds ds, Header h)
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color)
rpmds rpmdsSingle(rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags)
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
int rpmdsMerge(rpmds *dsp, rpmds ods)
rpmTagVal rpmdsTagF(const rpmds ds)
rpmTagVal rpmdsTagEVR(const rpmds ds)
char rpmdsD(const rpmds ds)
rpmds rpmdsThisPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
rpmds rpmdsFree(rpmds ds)
rpmTagVal rpmdsTagTi(const rpmds ds)
int rpmdsSetIx(rpmds ds, int ix)
int rpmdsSearch(rpmds ds, rpmds ods)
int rpmdsIsReverse(rpmds ds)
int rpmdsCount(const rpmds ds)
rpmTagVal rpmdsTagN(const rpmds ds)
rpmds rpmdsLink(rpmds ds)
rpmTagVal rpmdsDToTagN(char deptype)
int rpmdsMatchesDep(const Header h, int ix, const rpmds req, int nopromote)
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
rpmsenseFlags rpmParseDSFlags(const char *str, size_t len)
rpmsenseFlags rpmdsFlags(const rpmds ds)
rpmds rpmdsInit(rpmds ds)
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
rpm_color_t rpmdsColor(const rpmds ds)
int rpmdsNext(rpmds ds)
char * rpmdsNewDNEVR(const char *dspfx, const rpmds ds)
rpmsenseFlags_e
Definition rpmds.h:22
const char * rpmdsDNEVR(const rpmds ds)
rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
@ RPMSENSE_POSTUNTRANS
Definition rpmds.h:45
@ RPMSENSE_FIND_PROVIDES
Definition rpmds.h:38
@ RPMSENSE_SCRIPT_POSTUN
Definition rpmds.h:35
@ RPMSENSE_TRIGGERPREIN
Definition rpmds.h:48
@ RPMSENSE_INTERP
Definition rpmds.h:31
@ RPMSENSE_TRIGGERUN
Definition rpmds.h:41
@ RPMSENSE_PREUNTRANS
Definition rpmds.h:44
@ RPMSENSE_FIND_REQUIRES
Definition rpmds.h:37
@ RPMSENSE_MISSINGOK
Definition rpmds.h:43
@ RPMSENSE_TRIGGERIN
Definition rpmds.h:40
@ RPMSENSE_TRIGGERPOSTUN
Definition rpmds.h:42
@ RPMSENSE_META
Definition rpmds.h:52
@ RPMSENSE_SCRIPT_PRE
Definition rpmds.h:32
@ RPMSENSE_SCRIPT_VERIFY
Definition rpmds.h:36
@ RPMSENSE_SCRIPT_PREUN
Definition rpmds.h:34
@ RPMSENSE_RPMLIB
Definition rpmds.h:47
@ RPMSENSE_SCRIPT_POST
Definition rpmds.h:33
@ RPMSENSE_POSTTRANS
Definition rpmds.h:28
@ RPMSENSE_PRETRANS
Definition rpmds.h:30
enum rpmRC_e rpmRC
struct headerToken_s * Header
Definition rpmtypes.h:24
const char * rpmrichOpStr(rpmrichOp op)
int rpmdsRpmlib(rpmds *dsp, const void *tblp)
int rpmdsIsRich(rpmds dep)
int rpmdsRpmlibPool(rpmstrPool pool, rpmds *dsp, const void *tblp)
rpmRC rpmrichParseForTag(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN)
rpmRC rpmrichParse(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata)
rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg)