6 * Structures and prototypes used for an "rpmps" problem set.
11 extern int _rpmps_debug;
15 * Raw data for an element of a problem set.
17 typedef /*@abstract@*/ struct rpmProblem_s * rpmProblem;
20 * Transaction problems found while processing a transaction set/
22 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmps_s * rpmps;
25 * Enumerate transaction set problem types.
27 typedef enum rpmProblemType_e {
28 RPMPROB_BADARCH, /*!< package ... is for a different architecture */
29 RPMPROB_BADOS, /*!< package ... is for a different operating system */
30 RPMPROB_PKG_INSTALLED, /*!< package ... is already installed */
31 RPMPROB_BADRELOCATE,/*!< path ... is not relocateable for package ... */
32 RPMPROB_REQUIRES, /*!< package ... has unsatisfied Requires: ... */
33 RPMPROB_CONFLICT, /*!< package ... has unsatisfied Conflicts: ... */
34 RPMPROB_NEW_FILE_CONFLICT, /*!< file ... conflicts between attemped installs of ... */
35 RPMPROB_FILE_CONFLICT,/*!< file ... from install of ... conflicts with file from package ... */
36 RPMPROB_OLDPACKAGE, /*!< package ... (which is newer than ...) is already installed */
37 RPMPROB_DISKSPACE, /*!< installing package ... needs ... on the ... filesystem */
38 RPMPROB_DISKNODES, /*!< installing package ... needs ... on the ... filesystem */
39 RPMPROB_BADPRETRANS /*!< (unimplemented) */
49 /*@exposed@*/ /*@null@*/
61 int numProblems; /*!< Current probs array size. */
62 int numProblemsAlloced; /*!< Allocated probs array size. */
63 rpmProblem probs; /*!< Array of specific problems. */
65 int nrefs; /*!< Reference count. */
73 * Return formatted string representation of a problem.
74 * @param prob rpm problem
75 * @return formatted string (malloc'd)
78 /*@-redecl@*/ /* LCL: is confused. */
79 /*@only@*/ extern const char * rpmProblemString(const rpmProblem prob)
85 * Unreference a problem set instance.
86 * @param ps problem set
91 rpmps rpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
95 /** @todo Remove debugging entry from the ABI. */
98 rpmps XrpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
99 const char * msg, const char * fn, unsigned ln)
101 #define rpmpsUnlink(_ps, _msg) XrpmpsUnlink(_ps, _msg, __FILE__, __LINE__)
105 * Reference a problem set instance.
106 * @param ps transaction set
108 * @return new transaction set reference
111 rpmps rpmpsLink (rpmps ps, const char * msg)
114 /** @todo Remove debugging entry from the ABI. */
115 rpmps XrpmpsLink (rpmps ps,
116 const char * msg, const char * fn, unsigned ln)
118 #define rpmpsLink(_ps, _msg) XrpmpsLink(_ps, _msg, __FILE__, __LINE__)
121 * Return number of problems in set.
122 * @param ps problem set
123 * @return number of problems
125 int rpmpsNumProblems(/*@null@*/ rpmps ps)
129 * Create a problem set.
130 * @return new problem set
132 rpmps rpmpsCreate(void)
136 * Destroy a problem set.
137 * @param ps problem set
138 * @return NULL always
141 rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps)
145 * Print problems to file handle.
146 * @param fp file handle (NULL uses stderr)
147 * @param ps problem set
149 void rpmpsPrint(/*@null@*/ FILE *fp, /*@null@*/ rpmps ps)
150 /*@globals fileSystem @*/
151 /*@modifies *fp, ps, fileSystem @*/;
154 * Append a problem to current set of problems.
155 * @param ps problem set
156 * @param type type of problem
157 * @param pkgNEVR package name
158 * @param key filename or python object address
159 * @param dn directory name
160 * @param bn file base name
161 * @param altNEVR related (e.g. through a dependency) package name
162 * @param ulong1 generic pointer/long attribute
164 void rpmpsAppend(/*@null@*/ rpmps ps, rpmProblemType type,
165 /*@null@*/ const char * pkgNEVR,
166 /*@exposed@*/ /*@null@*/ fnpyKey key,
167 /*@null@*/ const char * dn, /*@null@*/ const char * bn,
168 /*@null@*/ const char * altNEVR,
169 unsigned long ulong1)
173 * Filter a problem set.
175 * As the problem sets are generated in an order solely dependent
176 * on the ordering of the packages in the transaction, and that
177 * ordering can't be changed, the problem sets must be parallel to
178 * one another. Additionally, the filter set must be a subset of the
179 * target set, given the operations available on transaction set.
180 * This is good, as it lets us perform this trim in linear time, rather
181 * then logarithmic or quadratic.
183 * @param ps problem set
184 * @param filter problem filter (or NULL)
185 * @return 0 no problems, 1 if problems remain
187 int rpmpsTrim(/*@null@*/ rpmps ps, /*@null@*/ rpmps filter)