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

# lib/rpmps.c File Reference

More...

`#include "system.h"`
`#include <rpmlib.h>`
`#include "rpmps.h"`
`#include "misc.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines
#define | XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b))))
## Functions
rpmps | XrpmpsUnlink (rpmps ps, const char *msg, const char *fn, unsigned ln)
rpmps | XrpmpsLink (rpmps ps, const char *msg, const char *fn, unsigned ln)
int | rpmpsNumProblems (rpmps ps)
| Return number of problems in set. More...
rpmps | rpmpsCreate (void)
| Create a problem set. More...
rpmps | rpmpsFree (rpmps ps)
| Destroy a problem set. More...
void | rpmpsAppend (rpmps ps, rpmProblemType type, const char *pkgNEVR, fnpyKey key, const char *dn, const char *bn, const char *altNEVR, unsigned long ulong1)
| Append a problem to current set of problems. More...
int | rpmpsTrim (rpmps ps, rpmps filter)
| Filter a problem set. More...
int | vsnprintf (char *buf, int nb, const char *fmt, va_list ap)
int | snprintf (char *buf, int nb, const char *fmt,...)
const char * | rpmProblemString (const rpmProblem prob)
| Return formatted string representation of a problem. More...
int | sameProblem (const rpmProblem ap, const rpmProblem bp)
void | rpmpsPrint (FILE *fp, rpmps ps)
| Print problems to file handle. More...
## Variables
int | _rpmps_debug = 0

## Detailed Description

Definition in file rpmps.c.

## Define Documentation

#define XSTRCMP | ( | a,
|  | b |  | ) | ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b))))

| Definition at line 126 of file rpmps.c. Referenced by rpmpsTrim.

## Function Documentation

const char* rpmProblemString | ( | const rpmProblem | prob | ) |

  | Return formatted string representation of a problem. Parameters:
  prob | rpm problem
Returns: formatted string (malloc'd) Definition at line 193 of file rpmps.c. References _, rpmProblem_s::altNEVR, N_, rpmProblem_s::pkgNEVR, RPMPROB_BADARCH, RPMPROB_BADOS, RPMPROB_BADPRETRANS, RPMPROB_BADRELOCATE, RPMPROB_CONFLICT, RPMPROB_DISKNODES, RPMPROB_DISKSPACE, RPMPROB_FILE_CONFLICT, RPMPROB_NEW_FILE_CONFLICT, RPMPROB_OLDPACKAGE, RPMPROB_PKG_INSTALLED, RPMPROB_REQUIRES, snprintf, rpmProblem_s::str1, strerror, rpmProblem_s::type, rpmProblem_s::ulong1, and xmalloc.

void rpmpsAppend | ( | rpmps | ps,
|  | rpmProblemType | type,
|  | const char * | pkgNEVR,
|  | fnpyKey | key,
|  | const char * | dn,
|  | const char * | bn,
|  | const char * | altNEVR,
|  | unsigned long | ulong1
| ) |

  | Append a problem to current set of problems. Parameters:
  ps | problem set
  type | type of problem
  pkgNEVR | package name
  key | filename or python object address
  dn | directory name
  bn | file base name
  altNEVR | related (e.g. through a dependency) package name
  ulong1 | generic pointer/long attribute
Definition at line 81 of file rpmps.c. References rpmProblem_s::altNEVR, rpmProblem_s::ignoreProblem, rpmProblem_s::key, rpmps_s::numProblems, rpmps_s::numProblemsAlloced, rpmProblem_s::pkgNEVR, rpmps_s::probs, rpmProblemType, stpcpy, rpmProblem_s::str1, rpmProblem_s::type, rpmProblem_s::ulong1, xcalloc, xrealloc, and xstrdup.

rpmps rpmpsCreate | ( | void |  | ) |

| Create a problem set. Returns: new problem set Definition at line 54 of file rpmps.c. References rpmpsLink, and xcalloc. Referenced by rpmtsCheck.

rpmps rpmpsFree | ( | rpmps | ps | ) |

  | Destroy a problem set. Parameters:
  ps | problem set
Returns: NULL always Definition at line 60 of file rpmps.c. References _free, rpmProblem_s::altNEVR, rpmps_s::nrefs, rpmps_s::numProblems, rpmProblem_s::pkgNEVR, rpmps_s::probs, rpmpsUnlink, and rpmProblem_s::str1.

int rpmpsNumProblems | ( | rpmps | ps | ) |

  | Return number of problems in set. Parameters:
  ps | problem set
Returns: number of problems Definition at line 46 of file rpmps.c. References rpmps_s::numProblems, and rpmps_s::probs.

void rpmpsPrint | ( | FILE * | fp,
|  | rpmps | ps
| ) |

  | Print problems to file handle. Parameters:
  fp | file handle (NULL uses stderr)
  ps | problem set
Definition at line 303 of file rpmps.c. References _free, rpmProblem_s::ignoreProblem, rpmps_s::numProblems, rpmps_s::probs, rpmProblemString, and sameProblem.

int rpmpsTrim | ( | rpmps | ps,
|  | rpmps | filter
| ) |

  | Filter a problem set. As the problem sets are generated in an order solely dependent on the ordering of the packages in the transaction, and that ordering can't be changed, the problem sets must be parallel to one another. Additionally, the filter set must be a subset of the target set, given the operations available on transaction set. This is good, as it lets us perform this trim in linear time, rather then logarithmic or quadratic. Parameters:
  ps | problem set
  filter | problem filter (or NULL)
Returns: 0 no problems, 1 if problems remain Definition at line 128 of file rpmps.c. References rpmProblem_s::ignoreProblem, rpmProblem_s::key, rpmps_s::numProblems, rpmps_s::probs, rpmProblem_s::str1, rpmProblem_s::type, and XSTRCMP.

int sameProblem | ( | const rpmProblem | ap,
|  | const rpmProblem | bp
| ) | `[static]`

| Definition at line 282 of file rpmps.c. Referenced by rpmpsPrint.

int snprintf | ( | char * | buf,
|  | int | nb,
|  | const char * | fmt,
|  | ... |
| ) | `[inline, static]`

| Definition at line 182 of file rpmps.c. References vsnprintf. Referenced by rpmProblemString.

int vsnprintf | ( | char * | buf,
|  | int | nb,
|  | const char * | fmt,
|  | va_list | ap
| ) | `[inline, static]`

| Definition at line 174 of file rpmps.c. Referenced by snprintf.

rpmps XrpmpsLink | ( | rpmps | ps,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

| Todo: Remove debugging entry from the ABI. Definition at line 33 of file rpmps.c. References _rpmps_debug, and rpmps_s::nrefs.

rpmps XrpmpsUnlink | ( | rpmps | ps,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

| Todo: Remove debugging entry from the ABI. Definition at line 20 of file rpmps.c. References _rpmps_debug, and rpmps_s::nrefs.

## Variable Documentation

int _rpmps_debug = 0

| Definition at line 18 of file rpmps.c. Referenced by XrpmpsLink, and XrpmpsUnlink.