6 * Structures and prototypes used for an "rpmps" problem set.
9 extern int _rpmps_debug;
12 * Raw data for an element of a problem set.
14 typedef struct rpmProblem_s * rpmProblem;
17 * Transaction problems found while processing a transaction set/
19 typedef struct rpmps_s * rpmps;
22 * Enumerate transaction set problem types.
24 typedef enum rpmProblemType_e {
25 RPMPROB_BADARCH, /*!< package ... is for a different architecture */
26 RPMPROB_BADOS, /*!< package ... is for a different operating system */
27 RPMPROB_PKG_INSTALLED, /*!< package ... is already installed */
28 RPMPROB_BADRELOCATE,/*!< path ... is not relocatable for package ... */
29 RPMPROB_REQUIRES, /*!< package ... has unsatisfied Requires: ... */
30 RPMPROB_CONFLICT, /*!< package ... has unsatisfied Conflicts: ... */
31 RPMPROB_NEW_FILE_CONFLICT, /*!< file ... conflicts between attemped installs of ... */
32 RPMPROB_FILE_CONFLICT,/*!< file ... from install of ... conflicts with file from package ... */
33 RPMPROB_OLDPACKAGE, /*!< package ... (which is newer than ...) is already installed */
34 RPMPROB_DISKSPACE, /*!< installing package ... needs ... on the ... filesystem */
35 RPMPROB_DISKNODES, /*!< installing package ... needs ... on the ... filesystem */
36 RPMPROB_BADPRETRANS /*!< (unimplemented) */
54 int numProblems; /*!< Current probs array size. */
55 int numProblemsAlloced; /*!< Allocated probs array size. */
56 rpmProblem probs; /*!< Array of specific problems. */
57 int nrefs; /*!< Reference count. */
65 * Return formatted string representation of a problem.
66 * @param prob rpm problem
67 * @return formatted string (malloc'd)
69 extern const char * rpmProblemString(const rpmProblem prob);
72 * Unreference a problem set instance.
73 * @param ps problem set
77 rpmps rpmpsUnlink (rpmps ps,
80 /** @todo Remove debugging entry from the ABI. */
81 rpmps XrpmpsUnlink (rpmps ps,
82 const char * msg, const char * fn, unsigned ln);
83 #define rpmpsUnlink(_ps, _msg) XrpmpsUnlink(_ps, _msg, __FILE__, __LINE__)
86 * Reference a problem set instance.
87 * @param ps transaction set
89 * @return new transaction set reference
91 rpmps rpmpsLink (rpmps ps, const char * msg);
93 /** @todo Remove debugging entry from the ABI. */
94 rpmps XrpmpsLink (rpmps ps,
95 const char * msg, const char * fn, unsigned ln);
96 #define rpmpsLink(_ps, _msg) XrpmpsLink(_ps, _msg, __FILE__, __LINE__)
99 * Return number of problems in set.
100 * @param ps problem set
101 * @return number of problems
103 int rpmpsNumProblems(rpmps ps);
106 * Create a problem set.
107 * @return new problem set
109 rpmps rpmpsCreate(void);
112 * Destroy a problem set.
113 * @param ps problem set
114 * @return NULL always
116 rpmps rpmpsFree(rpmps ps);
119 * Print problems to file handle.
120 * @param fp file handle (NULL uses stderr)
121 * @param ps problem set
123 void rpmpsPrint(FILE *fp, rpmps ps);
126 * Append a problem to current set of problems.
127 * @param ps problem set
128 * @param type type of problem
129 * @param pkgNEVR package name
130 * @param key filename or python object address
131 * @param dn directory name
132 * @param bn file base name
133 * @param altNEVR related (e.g. through a dependency) package name
134 * @param ulong1 generic pointer/long attribute
136 void rpmpsAppend(rpmps ps, rpmProblemType type,
137 const char * pkgNEVR,
139 const char * dn, const char * bn,
140 const char * altNEVR,
141 unsigned long ulong1);
144 * Filter a problem set.
146 * As the problem sets are generated in an order solely dependent
147 * on the ordering of the packages in the transaction, and that
148 * ordering can't be changed, the problem sets must be parallel to
149 * one another. Additionally, the filter set must be a subset of the
150 * target set, given the operations available on transaction set.
151 * This is good, as it lets us perform this trim in linear time, rather
152 * then logarithmic or quadratic.
154 * @param ps problem set
155 * @param filter problem filter (or NULL)
156 * @return 0 no problems, 1 if problems remain
158 int rpmpsTrim(rpmps ps, rpmps filter);