Main Page Modules Data Structures File List Data Fields Globals Related Pages

# lib/rpmte.h File Reference

Structures used for an "rpmte" transaction element. More...

Go to the source code of this file.

## Defines

#define | rpmtsiFree(_tsi) XrpmtsiFree(_tsi, __FILE__, __LINE__)
#define | rpmtsiInit(_ts) XrpmtsiInit(_ts, __FILE__, __LINE__)

## Typedefs

typedef tsortInfo_s * | tsortInfo
| Transaction element ordering chain linkage. More...
typedef rpmtsi_s * | rpmtsi
| Transaction element iterator. More...
typedef enum rpmElementType_e | rpmElementType

## Enumerations

enum | rpmElementType_e { TR_ADDED = (1 << 0), TR_REMOVED = (1 << 1) }

## Functions

rpmte | rpmteFree (rpmte te)
| Destroy a transaction element. More...
rpmte | rpmteNew (const rpmts ts, Header h, rpmElementType type, fnpyKey key, rpmRelocation *relocs, int dboffset, alKey pkgKey)
| Create a transaction element. More...
rpmElementType | rpmteType (rpmte te)
| Retrieve type of transaction element. More...
const char * | rpmteN (rpmte te)
| Retrieve name string of transaction element. More...
const char * | rpmteE (rpmte te)
| Retrieve epoch string of transaction element. More...
const char * | rpmteV (rpmte te)
| Retrieve version string of transaction element. More...
const char * | rpmteR (rpmte te)
| Retrieve release string of transaction element. More...
const char * | rpmteA (rpmte te)
| Retrieve arch string of transaction element. More...
const char * | rpmteO (rpmte te)
| Retrieve os string of transaction element. More...
int | rpmteMultiLib (rpmte te)
| Retrieve multlib flags of transaction element. More...
int | rpmteSetMultiLib (rpmte te, int nmultiLib)
| Set multlib flags of transaction element. More...
int | rpmteDepth (rpmte te)
| Retrieve tsort tree depth of transaction element. More...
int | rpmteSetDepth (rpmte te, int ndepth)
| Set tsort tree depth of transaction element. More...
int | rpmteNpreds (rpmte te)
| Retrieve tsort no. More...
int | rpmteSetNpreds (rpmte te, int npreds)
| Set tsort no. More...
int | rpmteTree (rpmte te)
| Retrieve tree index of transaction element. More...
int | rpmteSetTree (rpmte te, int ntree)
| Set tree index of transaction element. More...
rpmte | rpmteParent (rpmte te)
| Retrieve parent transaction element. More...
rpmte | rpmteSetParent (rpmte te, rpmte pte)
| Set parent transaction element. More...
int | rpmteDegree (rpmte te)
| Retrieve number of children of transaction element. More...
int | rpmteSetDegree (rpmte te, int ndegree)
| Set number of children of transaction element. More...
tsortInfo | rpmteTSI (rpmte te)
| Retrieve tsort info for transaction element. More...
void | rpmteFreeTSI (rpmte te)
| Destroy tsort info of transaction element. More...
void | rpmteNewTSI (rpmte te)
| Initialize tsort info of transaction element. More...
void | rpmteCleanDS (rpmte te)
| Destroy dependency set info of transaction element. More...
alKey | rpmteAddedKey (rpmte te)
| Retrieve pkgKey of TR_ADDED transaction element. More...
alKey | rpmteSetAddedKey (rpmte te, alKey npkgKey)
| Set pkgKey of TR_ADDED transaction element. More...
alKey | rpmteDependsOnKey (rpmte te)
| Retrieve dependent pkgKey of TR_REMOVED transaction element. More...
int | rpmteDBOffset (rpmte te)
| Retrieve rpmdb instance of TR_REMOVED transaction element. More...
const char * | rpmteNEVR (rpmte te)
| Retrieve name-version-release string from transaction element. More...
FD_t | rpmteFd (rpmte te)
| Retrieve file handle from transaction element. More...
fnpyKey | rpmteKey (rpmte te)
| Retrieve key from transaction element. More...
rpmds | rpmteDS (rpmte te, rpmTag tag)
| Retrieve dependency tag set from transaction element. More...
rpmfi | rpmteFI (rpmte te, rpmTag tag)
| Retrieve file info tag set from transaction element. More...
int | rpmtsiOc (rpmtsi tsi)
| Return transaction element index. More...
rpmtsi | rpmtsiFree (rpmtsi tsi)
| Destroy transaction element iterator. More...
rpmtsi | XrpmtsiFree (rpmtsi tsi, const char *fn, unsigned int ln)
| Destroy transaction element iterator. More...
rpmtsi | rpmtsiInit (rpmts ts)
| Create transaction element iterator. More...
rpmtsi | XrpmtsiInit (rpmts ts, const char *fn, unsigned int ln)
| Create transaction element iterator. More...
rpmte | rpmtsiNext (rpmtsi tsi, rpmElementType type)
| Return next transaction element of type. More...

## Variables

int | _rpmte_debug

## Detailed Description

Structures used for an "rpmte" transaction element.

Definition in file rpmte.h.

## Define Documentation

#define rpmtsiFree | ( | _tsi |  | ) | XrpmtsiFree(_tsi, __FILE__, __LINE__)

| Definition at line 476 of file rpmte.h. Referenced by addRelation, rpmGraph, rpmts_iternext, rpmtsAddInstallElement, rpmtsCheck, rpmtsClean, rpmtsEmpty, rpmtsGetKeys, and rpmtsOrder.

#define rpmtsiInit | ( | _ts |  | ) | XrpmtsiInit(_ts, __FILE__, __LINE__)

| Definition at line 498 of file rpmte.h. Referenced by addRelation, rpmGraph, rpmts_iternext, rpmtsAddInstallElement, rpmtsCheck, rpmtsClean, rpmtsEmpty, rpmtsGetKeys, and rpmtsOrder.

## Typedef Documentation

typedef struct rpmtsi_s* rpmtsi

| Transaction element iterator. Definition at line 24 of file rpmte.h. Referenced by addRelation, rpmGraph, rpmtsAddInstallElement, rpmtsCheck, rpmtsClean, rpmtsEmpty, rpmtsGetKeys, rpmtsiNext, rpmtsiNextElement, rpmtsiOc, rpmtsOrder, XrpmtsiFree, and XrpmtsiInit.

typedef struct tsortInfo_s* tsortInfo

| Transaction element ordering chain linkage. Definition at line 19 of file rpmte.h. Referenced by addRelation, markLoop, rpmteFreeTSI, rpmteSetParent, rpmteTSI, rpmtsOrder, and zapRelation.

## Function Documentation

const char* rpmteA | ( | rpmte | te | ) |

Retrieve arch string of transaction element.

Parameters:

  te | transaction element

Returns:
  arch string

Definition at line 207 of file rpmte.c.

Referenced by rpmte_A.

alKey rpmteAddedKey | ( | rpmte | te | ) |

Retrieve pkgKey of TR_ADDED transaction element.

Parameters:

  te | transaction element

Returns:
  pkgKey

Definition at line 344 of file rpmte.c.

Referenced by addRelation, rpmtsAddInstallElement, and rpmtsOrder.

void rpmteCleanDS | ( | rpmte | te | ) |

Destroy dependency set info of transaction element.

Parameters:

  te | transaction element

Definition at line 26 of file rpmte.c.

Referenced by delTE, and rpmtsClean.

int rpmteDBOffset | ( | rpmte | te | ) |

Retrieve rpmdb instance of TR_REMOVED transaction element.

Parameters:

  te | transaction element

Returns:
  rpmdb instance

Definition at line 365 of file rpmte.c.

int rpmteDegree | ( | rpmte | te | ) |

Retrieve number of children of transaction element.

Parameters:

  te | transaction element

Returns:
  tree index

Definition at line 296 of file rpmte.c.

Referenced by rpmte_AddedKey, rpmte_Degree, and rpmtsOrder.

alKey rpmteDependsOnKey | ( | rpmte | te | ) |

Retrieve dependent pkgKey of TR_REMOVED transaction element.

Parameters:

  te | transaction element

Returns:
  dependent pkgKey

Definition at line 360 of file rpmte.c.

Referenced by rpmtsOrder.

int rpmteDepth | ( | rpmte | te | ) |

Retrieve tsort tree depth of transaction element.

Parameters:

  te | transaction element

Returns:
  depth

Definition at line 232 of file rpmte.c.

Referenced by addRelation, rpmGraph, rpmte_Depth, and rpmtsOrder.

rpmds rpmteDS | ( | rpmte | te,
|  | rpmTag | tag
| ) |

Retrieve dependency tag set from transaction element.

Parameters:

  te | transaction element
  tag | dependency tag

Returns:
  dependency tag set

Definition at line 387 of file rpmte.c.

Referenced by rpmte_DS, rpmtsAddInstallElement, rpmtsCheck, and rpmtsOrder.

const char* rpmteE | ( | rpmte | te | ) |

Retrieve epoch string of transaction element.

Parameters:

  te | transaction element

Returns:
  epoch string

Definition at line 192 of file rpmte.c.

References rpmte.

Referenced by rpmte_E.

FD_t rpmteFd | ( | rpmte | te | ) |

Retrieve file handle from transaction element.

Parameters:

  te | transaction element

Returns:
  file handle

Definition at line 375 of file rpmte.c.

rpmfi rpmteFI | ( | rpmte | te,
|  | rpmTag | tag
| ) |

Retrieve file info tag set from transaction element.

Parameters:

  te | transaction element
  tag | file info tag

Returns:
  file info tag set

Definition at line 412 of file rpmte.c.

Referenced by rpmte_FI, rpmtsAddInstallElement, rpmtsCheck, and rpmtsCheckDSIProblems.

rpmte rpmteFree | ( | rpmte | te | ) |

Destroy a transaction element.

Parameters:

  te | transaction element

Returns:
  NULL always

Definition at line 148 of file rpmte.c.

References alKey, rpmElementType, rpmte, and rpmts.

Referenced by rpmtsAddInstallElement, and rpmtsEmpty.

void rpmteFreeTSI | ( | rpmte | te | ) |

Destroy tsort info of transaction element.

Parameters:

  te | transaction element

Definition at line 318 of file rpmte.c.

Referenced by rpmteNewTSI, and rpmtsOrder.

fnpyKey rpmteKey | ( | rpmte | te | ) |

Retrieve key from transaction element.

Parameters:

  te | transaction element

Returns:
  key

Definition at line 382 of file rpmte.c.

References alKey, and rpmte.

Referenced by rpmtsCheckDSIProblems, and rpmtsGetKeys.

int rpmteMultiLib | ( | rpmte | te | ) |

Retrieve multlib flags of transaction element.

Parameters:

  te | transaction element

Returns:
  multilib flags

Definition at line 217 of file rpmte.c.

Referenced by rpmte_MultiLib, and rpmtsCheck.

const char* rpmteN | ( | rpmte | te | ) |

Retrieve name string of transaction element.

Parameters:

  te | transaction element

Returns:
  name string

Definition at line 187 of file rpmte.c.

Referenced by ignoreDep, rpmGraph, rpmte_N, rpmtsAddInstallElement, and rpmtsCheck.

const char* rpmteNEVR | ( | rpmte | te | ) |

Retrieve name-version-release string from transaction element.

Parameters:

  te | transaction element

Returns:
  name-version-release string

Definition at line 370 of file rpmte.c.

References alKey, and rpmte.

Referenced by rpmte_NEVR, rpmtsCheck, rpmtsCheckDSIProblems, rpmtsOrder, and zapRelation.

rpmte rpmteNew | ( | const rpmts | ts,
|  | Header | h,
|  | rpmElementType | type,
|  | fnpyKey | key,
|  | rpmRelocation * | relocs,
|  | int | dboffset,
|  | alKey | pkgKey
| ) |

Create a transaction element.

Parameters:

  ts | transaction set
  h | header
  type | TR_ADDED/TR_REMOVED
  key | (TR_ADDED) package retrieval key (e.g. file name)
  relocs | (TR_ADDED) package file relocations
  dboffset | (TR_REMOVED) rpmdb instance
  pkgKey | associated added package (if any)

Returns:
  new transaction element

Definition at line 158 of file rpmte.c.

Referenced by removePackage, and rpmtsAddInstallElement.

void rpmteNewTSI | ( | rpmte | te | ) |

Initialize tsort info of transaction element.

Parameters:

  te | transaction element

Definition at line 336 of file rpmte.c.

Referenced by rpmtsOrder.

int rpmteNpreds | ( | rpmte | te | ) |

Retrieve tsort no.

of predecessors of transaction element.

Parameters:

  te | transaction element

Returns:
  no. of predecessors

Definition at line 247 of file rpmte.c.

References rpmte.

Referenced by rpmte_Npreds, and rpmtsOrder.

const char* rpmteO | ( | rpmte | te | ) |

Retrieve os string of transaction element.

Parameters:

  te | transaction element

Returns:
  os string

Definition at line 212 of file rpmte.c.

References rpmte.

Referenced by rpmte_O.

rpmte rpmteParent | ( | rpmte | te | ) |

Retrieve parent transaction element.

Parameters:

  te | transaction element

Returns:
  parent transaction element

Definition at line 277 of file rpmte.c.

Referenced by rpmGraph.

const char* rpmteR | ( | rpmte | te | ) |

Retrieve release string of transaction element.

Parameters:

  te | transaction element

Returns:
  release string

Definition at line 202 of file rpmte.c.

References rpmte.

Referenced by rpmte_R.

alKey rpmteSetAddedKey | ( | rpmte | te,
|  | alKey | npkgKey
| ) |

Set pkgKey of TR_ADDED transaction element.

Parameters:

  te | transaction element
  npkgKey | new pkgKey

Returns:
  previous pkgKey

Definition at line 349 of file rpmte.c.

References rpmte.

Referenced by rpmtsAddInstallElement.

int rpmteSetDegree | ( | rpmte | te,
|  | int | ndegree
| ) |

Set number of children of transaction element.

Parameters:

  te | transaction element
  ndegree | new number of children

Returns:
  previous number of children

Definition at line 301 of file rpmte.c.

Referenced by rpmtsOrder.

int rpmteSetDepth | ( | rpmte | te,
|  | int | ndepth
| ) |

Set tsort tree depth of transaction element.

Parameters:

  te | transaction element
  ndepth | new depth

Returns:
  previous depth

Definition at line 237 of file rpmte.c.

References rpmte.

Referenced by addRelation, and rpmtsOrder.

int rpmteSetMultiLib | ( | rpmte | te,
|  | int | nmultiLib
| ) |

Set multlib flags of transaction element.

Parameters:

  te | transaction element
  nmultiLib | new multilib flags

Returns:
  previous multilib flags

Definition at line 222 of file rpmte.c.

References rpmte.

Referenced by rpmtsAddInstallElement.

int rpmteSetNpreds | ( | rpmte | te,
|  | int | npreds
| ) |

Set tsort no.

of predecessors of transaction element.

Parameters:

  te | transaction element
  npreds | new no. of predecessors

Returns:
  previous no. of predecessors

Definition at line 252 of file rpmte.c.

Referenced by rpmtsOrder.

rpmte rpmteSetParent | ( | rpmte | te,
|  | rpmte | pte
| ) |

Set parent transaction element.

Parameters:

  te | transaction element
  pte | new parent transaction element

Returns:
  previous parent transaction element

Definition at line 282 of file rpmte.c.

References rpmte, and tsortInfo.

Referenced by rpmtsOrder.

int rpmteSetTree | ( | rpmte | te,
|  | int | ntree
| ) |

Set tree index of transaction element.

Parameters:

  te | transaction element
  ntree | new tree index

Returns:
  previous tree index

Definition at line 267 of file rpmte.c.

Referenced by rpmtsOrder.

int rpmteTree | ( | rpmte | te | ) |

Retrieve tree index of transaction element.

Parameters:

  te | transaction element

Returns:
  tree index

Definition at line 262 of file rpmte.c.

Referenced by rpmGraph, and rpmtsOrder.

tsortInfo rpmteTSI | ( | rpmte | te | ) |

Retrieve tsort info for transaction element.

Parameters:

  te | transaction element

Returns:
  tsort info

Definition at line 311 of file rpmte.c.

Referenced by addQ, addRelation, markLoop, rpmteFreeTSI, rpmtsOrder, and zapRelation.

rpmElementType rpmteType | ( | rpmte | te | ) |

Retrieve type of transaction element.

Parameters:

  te | transaction element

Returns:
  type

Definition at line 182 of file rpmte.c.

Referenced by addRelation, rpmtsAddInstallElement, rpmtsGetKeys, and rpmtsOrder.

const char* rpmteV | ( | rpmte | te | ) |

Retrieve version string of transaction element.

Parameters:

  te | transaction element

Returns:
  version string

Definition at line 197 of file rpmte.c.

Referenced by rpmte_V.

rpmtsi rpmtsiFree | ( | rpmtsi | tsi | ) |

Destroy transaction element iterator.

Parameters:

  tsi | transaction element iterator

Returns:
  NULL always

rpmtsi rpmtsiInit | ( | rpmts | ts | ) |

Create transaction element iterator.

Parameters:

  ts | transaction set

Returns:
  transaction element iterator

rpmte rpmtsiNext | ( | rpmtsi | tsi,
|  | rpmElementType | type
| ) |

Return next transaction element of type.

Parameters:

  tsi | transaction element iterator
  type | transaction element type selector (0 for any)

Returns:
  next transaction element of type, NULL on termination

Definition at line 488 of file rpmte.c.

Referenced by addRelation, rpmGraph, rpmts_iternext, rpmtsAddInstallElement, rpmtsCheck, rpmtsClean, rpmtsEmpty, rpmtsGetKeys, and rpmtsOrder.

int rpmtsiOc | ( | rpmtsi | tsi | ) |

Return transaction element index.

Parameters:

  tsi | transaction element iterator

Returns:
  transaction element index

Definition at line 425 of file rpmte.c.

References rpmds, rpmfi, rpmTag, and rpmte.

Referenced by rpmtsOrder.

rpmtsi XrpmtsiFree | ( | rpmtsi | tsi,
|  | const char * | fn,
|  | unsigned int | ln
| ) |

Destroy transaction element iterator.

Parameters:

  tsi | transaction element iterator
  fn |
  ln |

Returns:
  NULL always

Definition at line 430 of file rpmte.c.

rpmtsi XrpmtsiInit | ( | rpmts | ts,
|  | const char * | fn,
|  | unsigned int | ln
| ) |

Create transaction element iterator.

Parameters:

  ts | transaction set
  fn |
  ln |

Returns:
  transaction element iterator

Definition at line 444 of file rpmte.c.

References rpmtsi.

## Variable Documentation

int _rpmte_debug

| Definition at line 13 of file rpmte.h.