6 * Structures and prototypes used for an "rpmps" problem set.
10 * Raw data for an element of a problem set.
12 typedef /*@abstract@*/ struct rpmProblem_s * rpmProblem;
15 * Transaction problems found while processing a transaction set/
17 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmps_s * rpmps;
20 * Enumerate transaction set problem types.
22 typedef enum rpmProblemType_e {
23 RPMPROB_BADARCH, /*!< package ... is for a different architecture */
24 RPMPROB_BADOS, /*!< package ... is for a different operating system */
25 RPMPROB_PKG_INSTALLED, /*!< package ... is already installed */
26 RPMPROB_BADRELOCATE,/*!< path ... is not relocateable for package ... */
27 RPMPROB_REQUIRES, /*!< package ... has unsatisfied Requires: ... */
28 RPMPROB_CONFLICT, /*!< package ... has unsatisfied Conflicts: ... */
29 RPMPROB_NEW_FILE_CONFLICT, /*!< file ... conflicts between attemped installs of ... */
30 RPMPROB_FILE_CONFLICT,/*!< file ... from install of ... conflicts with file from package ... */
31 RPMPROB_OLDPACKAGE, /*!< package ... (which is newer than ...) is already installed */
32 RPMPROB_DISKSPACE, /*!< installing package ... needs ... on the ... filesystem */
33 RPMPROB_DISKNODES, /*!< installing package ... needs ... on the ... filesystem */
34 RPMPROB_BADPRETRANS /*!< (unimplemented) */
44 /*@exposed@*/ /*@null@*/
56 int numProblems; /*!< Current probs array size. */
57 int numProblemsAlloced; /*!< Allocated probs array size. */
58 rpmProblem probs; /*!< Array of specific problems. */
60 int nrefs; /*!< Reference count. */
69 void printDepFlags(FILE *fp, const char *version, int flags)
70 /*@globals fileSystem @*/
71 /*@modifies *fp, fileSystem @*/;
74 * Print a problem array.
75 * @param fp output file
76 * @param ps dependency problems
78 void printDepProblems(FILE * fp, /*@null@*/ const rpmps ps)
79 /*@globals fileSystem @*/
80 /*@modifies *fp, fileSystem @*/;
83 * Return formatted string representation of a problem.
84 * @param prob rpm problem
85 * @return formatted string (malloc'd)
88 /*@-redecl@*/ /* LCL: is confused. */
89 /*@only@*/ extern const char * rpmProblemString(const rpmProblem prob)
95 * Unreference a problem set instance.
96 * @param ps problem set
101 rpmps rpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
105 /** @todo Remove debugging entry from the ABI. */
108 rpmps XrpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
109 const char * msg, const char * fn, unsigned ln)
111 #define rpmpsUnlink(_ps, _msg) XrpmpsUnlink(_ps, _msg, __FILE__, __LINE__)
115 * Reference a problem set instance.
116 * @param ps transaction set
118 * @return new transaction set reference
121 rpmps rpmpsLink (rpmps ps, const char * msg)
124 /** @todo Remove debugging entry from the ABI. */
125 rpmps XrpmpsLink (rpmps ps,
126 const char * msg, const char * fn, unsigned ln)
128 #define rpmpsLink(_ps, _msg) XrpmpsLink(_ps, _msg, __FILE__, __LINE__)
131 * Return number of problems in set.
132 * @param ps problem set
133 * @return number of problems
135 int rpmpsNumProblems(/*@null@*/ rpmps ps)
139 * Create a problem set.
140 * @return new problem set
142 rpmps rpmpsCreate(void)
146 * Destroy a problem set.
147 * @param ps problem set
148 * @return NULL always
151 rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps)
155 * Output formatted string representation of a problem to file handle.
156 * @deprecated API: prob used to be passed by value, now passed by reference.
157 * @param fp file handle
158 * @param prob rpm problem
161 void rpmProblemPrint(FILE *fp, rpmProblem prob)
162 /*@globals fileSystem @*/
163 /*@modifies prob, *fp, fileSystem @*/;
167 * Print problems to file handle.
168 * @param fp file handle
169 * @param ps problem set
171 void rpmpsPrint(FILE *fp, /*@null@*/ rpmps ps)
172 /*@globals fileSystem @*/
173 /*@modifies *fp, ps, fileSystem @*/;
176 * Append a problem to set.
178 void rpmpsAppend(/*@null@*/ rpmps ps, rpmProblemType type,
179 /*@null@*/ const char * pkgNEVR,
180 /*@exposed@*/ /*@null@*/ fnpyKey key,
181 /*@null@*/ const char * dn, /*@null@*/ const char * bn,
182 /*@null@*/ const char * altNEVR,
183 unsigned long ulong1)
187 * Filter a problem set.
189 * As the problem sets are generated in an order solely dependent
190 * on the ordering of the packages in the transaction, and that
191 * ordering can't be changed, the problem sets must be parallel to
192 * one another. Additionally, the filter set must be a subset of the
193 * target set, given the operations available on transaction set.
194 * This is good, as it lets us perform this trim in linear time, rather
195 * then logarithmic or quadratic.
197 * @param ps problem set
198 * @param filter problem filter (or NULL)
199 * @return 0 no problems, 1 if problems remain
201 int rpmpsTrim(/*@null@*/ rpmps ps, /*@null@*/ rpmps filter)