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

# lib/rpmte.c File Reference

Routine(s) to handle an "rpmte" transaction element. More...

`#include "system.h"`
`#include <rpmlib.h>`
`#include "psm.h"`
`#include "rpmds.h"`
`#include "rpmfi.h"`
`#include "rpmte.h"`
`#include "rpmts.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines
#define | _RPMTE_INTERNAL
## Functions
void | rpmteCleanDS (rpmte te)
| Destroy dependency set info of transaction element. More...
void | delTE (rpmte p)
void | addTE (rpmts ts, rpmte p, Header h, fnpyKey key, rpmRelocation *relocs)
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...
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 | XrpmtsiFree (rpmtsi tsi, const char *fn, unsigned int ln)
| Destroy transaction element iterator. More...
rpmtsi | XrpmtsiInit (rpmts ts, const char *fn, unsigned int ln)
| Create transaction element iterator. More...
rpmte | rpmtsiNextElement (rpmtsi tsi)
| Return next transaction element. More...
rpmte | rpmtsiNext (rpmtsi tsi, rpmElementType type)
| Return next transaction element of type. More...
## Variables
int | _rpmte_debug = 0

## Detailed Description

Routine(s) to handle an "rpmte" transaction element.

Definition in file rpmte.c.

## Define Documentation

#define _RPMTE_INTERNAL

| Definition at line 13 of file rpmte.c.

## Function Documentation

void addTE | ( | rpmts | ts,
|  | rpmte | p,
|  | Header | h,
|  | fnpyKey | key,
|  | rpmRelocation * | relocs
| ) | `[static]`

| Definition at line 79 of file rpmte.c. References HGE_t, hGetNEVR, int_32, rpmRelocation_s::newPath, rpmRelocation_s::oldPath, rpmdsNew, rpmdsThis, RPMSENSE_EQUAL, RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_CONFLICTNAME, RPMTAG_EPOCH, RPMTAG_OBSOLETENAME, RPMTAG_OS, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmte, rpmts, xmalloc, and xstrdup. Referenced by rpmteNew.

void delTE | ( | rpmte | p | ) | `[static]`

| Definition at line 37 of file rpmte.c. References _free, fdFree, headerFree, rpmRelocation_s::newPath, rpmRelocation_s::oldPath, rpmte, and rpmteCleanDS. Referenced by rpmteFree.

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. References rpmte.

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. References alKey, RPMAL_NOMATCH, and rpmte.

void rpmteCleanDS | ( | rpmte | te | ) |

  | Destroy dependency set info of transaction element. Parameters:
  te | transaction element
Definition at line 26 of file rpmte.c. References rpmdsFree, and rpmte.

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. References rpmte.

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. References rpmte.

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. References alKey, RPMAL_NOMATCH, and rpmte.

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. References rpmte.

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. References rpmds, rpmTag, RPMTAG_CONFLICTNAME, RPMTAG_NAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, and rpmte.

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.

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. References rpmte.

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. References rpmfi, rpmTag, RPMTAG_BASENAMES, and rpmte.

rpmte rpmteFree | ( | rpmte | te | ) |

  | Destroy a transaction element. Parameters:
  te | transaction element
Returns: NULL always Definition at line 148 of file rpmte.c. References _free, delTE, and rpmte.

void rpmteFreeTSI | ( | rpmte | te | ) |

  | Destroy tsort info of transaction element. Parameters:
  te | transaction element
Definition at line 318 of file rpmte.c. References _free, rpmte, rpmteTSI, and tsortInfo.

fnpyKey rpmteKey | ( | rpmte | te | ) |

  | Retrieve key from transaction element. Parameters:
  te | transaction element
Returns: key Definition at line 382 of file rpmte.c. References rpmte.

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. References rpmte.

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. References rpmte.

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 rpmte.

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. References addTE, alKey, rpmElementType, rpmte, rpmts, TR_ADDED, TR_REMOVED, and xcalloc.

void rpmteNewTSI | ( | rpmte | te | ) |

  | Initialize tsort info of transaction element. Parameters:
  te | transaction element
Definition at line 336 of file rpmte.c. References rpmte, rpmteFreeTSI, and xcalloc.

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.

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.

rpmte rpmteParent | ( | rpmte | te | ) |

  | Retrieve parent transaction element. Parameters:
  te | transaction element
Returns: parent transaction element Definition at line 277 of file rpmte.c. References rpmte.

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.

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 alKey, RPMAL_NOMATCH, and rpmte.

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. References rpmte.

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.

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.

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. References rpmte.

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.

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. References rpmte.

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. References rpmte.

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. References rpmte, and tsortInfo.

rpmElementType rpmteType | ( | rpmte | te | ) |

  | Retrieve type of transaction element. Parameters:
  te | transaction element
Returns: type Definition at line 182 of file rpmte.c. References rpmElementType, and rpmte.

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. References rpmte.

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. References rpmElementType, rpmte, rpmtsi, and rpmtsiNextElement.

rpmte rpmtsiNextElement | ( | rpmtsi | tsi | ) | `[static]`

  | Return next transaction element. Parameters:
  tsi | transaction element iterator
Returns: transaction element, NULL on termination Definition at line 466 of file rpmte.c. References rpmte, rpmtsElement, rpmtsi, and rpmtsNElements. Referenced by rpmtsiNext.

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 rpmtsi.

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. References _free, rpmtsFree, and rpmtsi.

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 RPMTRANS_FLAG_REVERSE, rpmts, rpmtsFlags, rpmtsi, rpmtsLink, rpmtsNElements, and xcalloc.

## Variable Documentation

int _rpmte_debug = 0

| Definition at line 20 of file rpmte.c.