rpm  4.17.0
Macros | Typedefs | Enumerations | Functions | Variables
rpmds.h File Reference

Structure(s) used for dependency tag sets. More...

#include <time.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmps.h>
Include dependency graph for rpmds.h:

Go to the source code of this file.

Macros

#define RPMSENSE_SENSEMASK   15 /* Mask to get senses, ie serial, */
 
#define RPMSENSE_TRIGGER    (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
 
#define _ALL_REQUIRES_MASK
 
#define _notpre(_x)   ((_x) & ~RPMSENSE_PREREQ)
 
#define _INSTALL_ONLY_MASK    _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
 
#define _ERASE_ONLY_MASK    _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
 
#define _UNORDERED_ONLY_MASK    _notpre(RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS|RPMSENSE_SCRIPT_VERIFY|RPMSENSE_META)
 
#define _FORCE_ORDER_ONLY_MASK    _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
 
#define isLegacyPreReq(_x)   (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
 
#define isInstallPreReq(_x)   ((_x) & _INSTALL_ONLY_MASK)
 
#define isErasePreReq(_x)   ((_x) & _ERASE_ONLY_MASK)
 
#define isUnorderedReq(_x)
 
#define isTransientReq(_x)
 

Typedefs

typedef rpmFlags rpmsenseFlags
 
typedef enum rpmrichOp_e rpmrichOp
 
typedef enum rpmrichParseType_e rpmrichParseType
 
typedef rpmRC(* rpmrichParseFunction) (void *cbdata, rpmrichParseType type, const char *n, int nl, const char *e, int el, rpmsenseFlags sense, rpmrichOp op, char **emsg)
 

Enumerations

enum  rpmsenseFlags_e {
  RPMSENSE_ANY = 0 , RPMSENSE_LESS = (1 << 1) , RPMSENSE_GREATER = (1 << 2) , RPMSENSE_EQUAL = (1 << 3) ,
  RPMSENSE_POSTTRANS = (1 << 5) , RPMSENSE_PREREQ = (1 << 6) , RPMSENSE_PRETRANS = (1 << 7) , RPMSENSE_INTERP = (1 << 8) ,
  RPMSENSE_SCRIPT_PRE = (1 << 9) , RPMSENSE_SCRIPT_POST = (1 << 10) , RPMSENSE_SCRIPT_PREUN = (1 << 11) , RPMSENSE_SCRIPT_POSTUN = (1 << 12) ,
  RPMSENSE_SCRIPT_VERIFY = (1 << 13) , RPMSENSE_FIND_REQUIRES = (1 << 14) , RPMSENSE_FIND_PROVIDES = (1 << 15) , RPMSENSE_TRIGGERIN = (1 << 16) ,
  RPMSENSE_TRIGGERUN = (1 << 17) , RPMSENSE_TRIGGERPOSTUN = (1 << 18) , RPMSENSE_MISSINGOK = (1 << 19) , RPMSENSE_RPMLIB = (1 << 24) ,
  RPMSENSE_TRIGGERPREIN = (1 << 25) , RPMSENSE_KEYRING = (1 << 26) , RPMSENSE_CONFIG = (1 << 28) , RPMSENSE_META = (1 << 29)
}
 Dependency Attributes. More...
 
enum  rpmrichOp_e {
  RPMRICHOP_SINGLE = 1 , RPMRICHOP_AND = 2 , RPMRICHOP_OR = 3 , RPMRICHOP_IF = 4 ,
  RPMRICHOP_ELSE = 5 , RPMRICHOP_WITH = 6 , RPMRICHOP_WITHOUT = 7 , RPMRICHOP_UNLESS = 8
}
 
enum  rpmrichParseType_e { RPMRICH_PARSE_SIMPLE = 1 , RPMRICH_PARSE_ENTER = 2 , RPMRICH_PARSE_LEAVE = 3 , RPMRICH_PARSE_OP = 4 }
 

Functions

rpmsenseFlags rpmSanitizeDSFlags (rpmTagVal tagN, rpmsenseFlags Flags)
 Return only those flags allowed for given type of dependencies. More...
 
rpmsenseFlags rpmParseDSFlags (const char *str, size_t len)
 Convert a string to the sense flags. More...
 
rpmds rpmdsLink (rpmds ds)
 Reference a dependency set instance. More...
 
rpmds rpmdsFree (rpmds ds)
 Destroy a dependency set. More...
 
rpmds rpmdsNew (Header h, rpmTagVal tagN, int flags)
 Create and load a dependency set. More...
 
char * rpmdsNewDNEVR (const char *dspfx, const rpmds ds)
 Return new formatted dependency string. More...
 
rpmds rpmdsThis (Header h, rpmTagVal tagN, rpmsenseFlags Flags)
 Create, load and initialize a dependency for this header. More...
 
rpmds rpmdsSingle (rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
 Create, load and initialize a dependency set of size 1. More...
 
rpmds rpmdsCurrent (rpmds ds)
 Return a new dependency set of size 1 from the current iteration index. More...
 
int rpmdsPutToHeader (rpmds ds, Header h)
 Write content of the dependency set to the header. More...
 
int rpmdsCount (const rpmds ds)
 Return dependency set count. More...
 
int rpmdsIx (const rpmds ds)
 Return dependency set index. More...
 
int rpmdsSetIx (rpmds ds, int ix)
 Set dependency set index. More...
 
const char * rpmdsDNEVR (const rpmds ds)
 Return current formatted dependency string. More...
 
char rpmdsD (const rpmds ds)
 Return one char indicating the type of the dependency. More...
 
rpmTagVal rpmdsDToTagN (char deptype)
 Return matching tagN for one char dependency type description. More...
 
const char * rpmdsN (const rpmds ds)
 Return current dependency name. More...
 
const char * rpmdsEVR (const rpmds ds)
 Return current dependency epoch-version-release. More...
 
int rpmdsTi (const rpmds ds)
 Return current dependency triggerindex. More...
 
rpmsenseFlags rpmdsFlags (const rpmds ds)
 Return current dependency flags. More...
 
rpmTagVal rpmdsTagN (const rpmds ds)
 Return current dependency type. More...
 
rpmTagVal rpmdsTagEVR (const rpmds ds)
 Return current dependency type. More...
 
rpmTagVal rpmdsTagF (const rpmds ds)
 Return current dependency type. More...
 
rpmTagVal rpmdsTagTi (const rpmds ds)
 Return current dependency type. More...
 
unsigned int rpmdsInstance (rpmds ds)
 Return dependency header instance, ie whether the dependency comes from an installed header or not. More...
 
int rpmdsIsWeak (rpmds ds)
 Return whether dependency is weak. More...
 
int rpmdsIsReverse (rpmds ds)
 Return whether dependency is reversed. More...
 
int rpmdsNoPromote (const rpmds ds)
 Obsolete, do not use. More...
 
int rpmdsSetNoPromote (rpmds ds, int nopromote)
 Obsolete, do not use. More...
 
rpm_color_t rpmdsColor (const rpmds ds)
 Return current dependency color. More...
 
rpm_color_t rpmdsSetColor (const rpmds ds, rpm_color_t color)
 Return current dependency color. More...
 
int rpmdsNext (rpmds ds)
 Return next dependency set iterator index. More...
 
rpmds rpmdsInit (rpmds ds)
 Initialize dependency set iterator. More...
 
int rpmdsFind (rpmds ds, const rpmds ods)
 Find a dependency set element using binary search. More...
 
int rpmdsMerge (rpmds *dsp, rpmds ods)
 Merge a dependency set maintaining (N,EVR,Flags) sorted order. More...
 
int rpmdsSearch (rpmds ds, rpmds ods)
 Search a sorted dependency set for an element that overlaps. More...
 
int rpmdsCompare (const rpmds A, const rpmds B)
 Compare two versioned dependency ranges, looking for overlap. More...
 
int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
 Compare package provides dependencies from header with a single dependency. More...
 
int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote)
 Compare package provides dependencies from header with a single dependency. More...
 
int rpmdsNVRMatchesDep (const Header h, const rpmds req, int nopromote)
 Compare package name-version-release from header with a single dependency. More...
 
int rpmdsRpmlib (rpmds *dsp, const void *tblp)
 Load rpmlib provides into a dependency set. More...
 
rpmds rpmdsNewPool (rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
 Create and load a dependency set. More...
 
rpmds rpmdsThisPool (rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
 Create, load and initialize a dependency for this header. More...
 
rpmds rpmdsSinglePool (rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
 Create, load and initialize a dependency set of size 1. More...
 
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. More...
 
int rpmdsRpmlibPool (rpmstrPool pool, rpmds *dsp, const void *tblp)
 Load rpmlib provides into a dependency set. More...
 
rpmRC rpmrichParse (const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata)
 Parse a rich dependency string. More...
 
rpmRC rpmrichParseForTag (const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN)
 Parse a rich dependency string for a specific tag. More...
 
int rpmdsIsRich (rpmds dep)
 Return if current depenency is rich. More...
 
const char * rpmrichOpStr (rpmrichOp op)
 Return a string representation of the rich dependency op. More...
 
rpmRC rpmdsParseRichDep (rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg)
 Parse a rich dependency string. More...
 

Variables

int _rpmds_nopromote
 

Detailed Description

Structure(s) used for dependency tag sets.

Definition in file rpmds.h.

Macro Definition Documentation

◆ _ALL_REQUIRES_MASK

#define _ALL_REQUIRES_MASK
Value:
(\
RPMSENSE_INTERP | \
RPMSENSE_SCRIPT_PRE | \
RPMSENSE_SCRIPT_POST | \
RPMSENSE_SCRIPT_PREUN | \
RPMSENSE_SCRIPT_POSTUN | \
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \
RPMSENSE_POSTTRANS | \
RPMSENSE_PREREQ | \
RPMSENSE_META | \
RPMSENSE_MISSINGOK)

Definition at line 64 of file rpmds.h.

◆ _ERASE_ONLY_MASK

#define _ERASE_ONLY_MASK    _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)

Definition at line 83 of file rpmds.h.

◆ _FORCE_ORDER_ONLY_MASK

Definition at line 87 of file rpmds.h.

◆ _INSTALL_ONLY_MASK

Definition at line 81 of file rpmds.h.

◆ _notpre

#define _notpre (   _x)    ((_x) & ~RPMSENSE_PREREQ)

Definition at line 80 of file rpmds.h.

◆ _UNORDERED_ONLY_MASK

Definition at line 85 of file rpmds.h.

◆ isErasePreReq

#define isErasePreReq (   _x)    ((_x) & _ERASE_ONLY_MASK)

Definition at line 92 of file rpmds.h.

◆ isInstallPreReq

#define isInstallPreReq (   _x)    ((_x) & _INSTALL_ONLY_MASK)

Definition at line 91 of file rpmds.h.

◆ isLegacyPreReq

#define isLegacyPreReq (   _x)    (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)

Definition at line 90 of file rpmds.h.

◆ isTransientReq

#define isTransientReq (   _x)
Value:
(isInstallPreReq(_x) && \
!isErasePreReq(_x) && \
!((_x) & RPMSENSE_META))
@ RPMSENSE_META
Definition: rpmds.h:53
#define isErasePreReq(_x)
Definition: rpmds.h:92
#define isInstallPreReq(_x)
Definition: rpmds.h:91

Definition at line 95 of file rpmds.h.

◆ isUnorderedReq

#define isUnorderedReq (   _x)
Value:
((_x) & _UNORDERED_ONLY_MASK && \
#define _FORCE_ORDER_ONLY_MASK
Definition: rpmds.h:87
#define _UNORDERED_ONLY_MASK
Definition: rpmds.h:85

Definition at line 93 of file rpmds.h.

◆ RPMSENSE_SENSEMASK

#define RPMSENSE_SENSEMASK   15 /* Mask to get senses, ie serial, */

Definition at line 58 of file rpmds.h.

◆ RPMSENSE_TRIGGER

Definition at line 61 of file rpmds.h.

Typedef Documentation

◆ rpmrichOp

typedef enum rpmrichOp_e rpmrichOp

◆ rpmrichParseFunction

typedef rpmRC(* rpmrichParseFunction) (void *cbdata, rpmrichParseType type, const char *n, int nl, const char *e, int el, rpmsenseFlags sense, rpmrichOp op, char **emsg)

Definition at line 490 of file rpmds.h.

◆ rpmrichParseType

◆ rpmsenseFlags

Definition at line 56 of file rpmds.h.

Enumeration Type Documentation

◆ rpmrichOp_e

Enumerator
RPMRICHOP_SINGLE 
RPMRICHOP_AND 
RPMRICHOP_OR 
RPMRICHOP_IF 
RPMRICHOP_ELSE 
RPMRICHOP_WITH 
RPMRICHOP_WITHOUT 
RPMRICHOP_UNLESS 

Definition at line 472 of file rpmds.h.

◆ rpmrichParseType_e

Enumerator
RPMRICH_PARSE_SIMPLE 
RPMRICH_PARSE_ENTER 
RPMRICH_PARSE_LEAVE 
RPMRICH_PARSE_OP 

Definition at line 483 of file rpmds.h.

Function Documentation

◆ rpmdsIsRich()

int rpmdsIsRich ( rpmds  dep)

Return if current depenency is rich.

Parameters
depthe dependency
Returns
1 is dependency is a rich 0 otherwise

◆ rpmdsParseRichDep()

rpmRC rpmdsParseRichDep ( rpmds  dep,
rpmds leftds,
rpmds rightds,
rpmrichOp op,
char **  emsg 
)

Parse a rich dependency string.

Parameters
depthe dependency
leftdsreturns the left dependency
rightdsreturns the right dependency
opreturns the rich dep op
emsgreturns the error string
Returns
RPMRC_OK on success

◆ rpmdsRpmlib()

int rpmdsRpmlib ( rpmds dsp,
const void *  tblp 
)

Load rpmlib provides into a dependency set.

Parameters
[out]*dsp(loaded) dependency set
tblprpmlib provides table (NULL uses internal table)
Returns
0 on success

◆ rpmdsRpmlibPool()

int rpmdsRpmlibPool ( rpmstrPool  pool,
rpmds dsp,
const void *  tblp 
)

Load rpmlib provides into a dependency set.

Parameters
poolshared string pool (or NULL for private pool)
[out]*dsp(loaded) dependency set
tblprpmlib provides table (NULL uses internal table)
Returns
0 on success

◆ rpmrichOpStr()

const char* rpmrichOpStr ( rpmrichOp  op)

Return a string representation of the rich dependency op.

Parameters
opthe dependency op
Returns
constant string, do not free

◆ rpmrichParse()

rpmRC rpmrichParse ( const char **  dstrp,
char **  emsg,
rpmrichParseFunction  cb,
void *  cbdata 
)

Parse a rich dependency string.

Parameters
dstrppointer to sting, will be updated
emsgreturns the error string, can be NULL
cbcallback function
cbdatacallback function data
Returns
RPMRC_OK on success

◆ rpmrichParseForTag()

rpmRC rpmrichParseForTag ( const char **  dstrp,
char **  emsg,
rpmrichParseFunction  cb,
void *  cbdata,
rpmTagVal  tagN 
)

Parse a rich dependency string for a specific tag.

Parameters
dstrppointer to sting, will be updated
emsgreturns the error string, can be NULL
cbcallback function
cbdatacallback function data
tagNtype of dependency
Returns
RPMRC_OK on success

Variable Documentation

◆ _rpmds_nopromote

int _rpmds_nopromote
extern