2002-05-20 02:42:25 +08:00
|
|
|
#ifndef H_RPMPS
|
|
|
|
#define H_RPMPS
|
|
|
|
|
|
|
|
/** \ingroup rpmps
|
|
|
|
* \file lib/rpmps.h
|
|
|
|
* Structures and prototypes used for an "rpmps" problem set.
|
|
|
|
*/
|
|
|
|
|
2008-01-28 19:43:32 +08:00
|
|
|
#include <stdio.h>
|
2008-01-30 17:49:25 +08:00
|
|
|
#include <rpm/rpmtypes.h>
|
2010-03-25 22:46:39 +08:00
|
|
|
#include <rpm/rpmprob.h>
|
2007-10-08 17:03:57 +08:00
|
|
|
|
2007-10-08 16:05:06 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2010-03-12 22:11:15 +08:00
|
|
|
* Problem set iterator
|
2002-05-20 02:42:25 +08:00
|
|
|
*/
|
2007-10-18 18:45:25 +08:00
|
|
|
typedef struct rpmpsi_s * rpmpsi;
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* Unreference a problem set instance.
|
|
|
|
* @param ps problem set
|
|
|
|
* @return problem set
|
|
|
|
*/
|
2010-03-22 18:54:44 +08:00
|
|
|
rpmps rpmpsUnlink (rpmps ps);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* Reference a problem set instance.
|
|
|
|
* @param ps transaction set
|
|
|
|
* @return new transaction set reference
|
|
|
|
*/
|
2010-03-22 18:54:44 +08:00
|
|
|
rpmps rpmpsLink (rpmps ps);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-06-12 22:52:59 +08:00
|
|
|
* Return number of problems in set.
|
|
|
|
* @param ps problem set
|
|
|
|
* @return number of problems
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
int rpmpsNumProblems(rpmps ps);
|
2002-06-12 22:52:59 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2007-10-18 18:45:25 +08:00
|
|
|
* Initialize problem set iterator.
|
|
|
|
* @param ps problem set
|
|
|
|
* @return problem set iterator
|
|
|
|
*/
|
|
|
|
rpmpsi rpmpsInitIterator(rpmps ps);
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2007-10-18 18:45:25 +08:00
|
|
|
* Destroy problem set iterator.
|
|
|
|
* @param psi problem set iterator
|
|
|
|
* @return problem set iterator (NULL)
|
|
|
|
*/
|
|
|
|
rpmpsi rpmpsFreeIterator(rpmpsi psi);
|
|
|
|
|
2010-03-26 14:50:30 +08:00
|
|
|
/** \ingroup rpmps
|
|
|
|
* Return next problem from iterator
|
|
|
|
* @param psi problem set iterator
|
|
|
|
* @return next problem (weak ref), NULL on termination
|
|
|
|
*/
|
|
|
|
rpmProblem rpmpsiNext(rpmpsi psi);
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2007-10-18 18:45:25 +08:00
|
|
|
* Return next problem set iterator index
|
|
|
|
* @param psi problem set iterator
|
|
|
|
* @return iterator index, -1 on termination
|
|
|
|
*/
|
|
|
|
int rpmpsNextIterator(rpmpsi psi);
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2007-10-18 18:45:25 +08:00
|
|
|
* Return current problem from problem set
|
|
|
|
* @param psi problem set iterator
|
|
|
|
* @return current rpmProblem
|
|
|
|
*/
|
2007-10-19 18:25:08 +08:00
|
|
|
rpmProblem rpmpsGetProblem(rpmpsi psi);
|
2007-10-18 18:45:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* Create a problem set.
|
2002-06-12 22:52:59 +08:00
|
|
|
* @return new problem set
|
2002-05-20 02:42:25 +08:00
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
rpmps rpmpsCreate(void);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* Destroy a problem set.
|
|
|
|
* @param ps problem set
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
rpmps rpmpsFree(rpmps ps);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* Print problems to file handle.
|
2002-06-29 05:54:24 +08:00
|
|
|
* @param fp file handle (NULL uses stderr)
|
2002-05-20 02:42:25 +08:00
|
|
|
* @param ps problem set
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
void rpmpsPrint(FILE *fp, rpmps ps);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2007-10-19 18:01:58 +08:00
|
|
|
* Append a problem to current set of problems.
|
|
|
|
* @param ps problem set
|
|
|
|
* @param prob rpmProblem
|
|
|
|
*/
|
|
|
|
void rpmpsAppendProblem(rpmps ps, rpmProblem prob);
|
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-07-01 06:47:32 +08:00
|
|
|
* Append a problem to current set of problems.
|
2002-06-29 05:54:24 +08:00
|
|
|
* @param ps problem set
|
|
|
|
* @param type type of problem
|
|
|
|
* @param pkgNEVR package name
|
|
|
|
* @param key filename or python object address
|
|
|
|
* @param dn directory name
|
|
|
|
* @param bn file base name
|
2002-07-01 06:47:32 +08:00
|
|
|
* @param altNEVR related (e.g. through a dependency) package name
|
2008-06-11 15:31:14 +08:00
|
|
|
* @param number generic number attribute
|
2002-05-20 02:42:25 +08:00
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
void rpmpsAppend(rpmps ps, rpmProblemType type,
|
|
|
|
const char * pkgNEVR,
|
|
|
|
fnpyKey key,
|
|
|
|
const char * dn, const char * bn,
|
|
|
|
const char * altNEVR,
|
2008-06-11 15:31:14 +08:00
|
|
|
uint64_t number);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
2007-11-23 20:32:45 +08:00
|
|
|
/** \ingroup rpmps
|
2002-05-20 02:42:25 +08:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param ps problem set
|
|
|
|
* @param filter problem filter (or NULL)
|
|
|
|
* @return 0 no problems, 1 if problems remain
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
int rpmpsTrim(rpmps ps, rpmps filter);
|
2002-05-20 02:42:25 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* H_RPMPS */
|