00001 #ifndef H_RPMPS
00002 #define H_RPMPS
00003
00009 #include <stdio.h>
00010 #include <rpm/rpmtypes.h>
00011
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016 extern int _rpmps_debug;
00017
00021 typedef enum rpmprobFilterFlags_e {
00022 RPMPROB_FILTER_NONE = 0,
00023 RPMPROB_FILTER_IGNOREOS = (1 << 0),
00024 RPMPROB_FILTER_IGNOREARCH = (1 << 1),
00025 RPMPROB_FILTER_REPLACEPKG = (1 << 2),
00026 RPMPROB_FILTER_FORCERELOCATE= (1 << 3),
00027 RPMPROB_FILTER_REPLACENEWFILES= (1 << 4),
00028 RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5),
00029 RPMPROB_FILTER_OLDPACKAGE = (1 << 6),
00030 RPMPROB_FILTER_DISKSPACE = (1 << 7),
00031 RPMPROB_FILTER_DISKNODES = (1 << 8)
00032 } rpmprobFilterFlags;
00033
00037 typedef struct rpmProblem_s * rpmProblem;
00038
00042 typedef struct rpmps_s * rpmps;
00043
00044 typedef struct rpmpsi_s * rpmpsi;
00045
00049 typedef enum rpmProblemType_e {
00050 RPMPROB_BADARCH,
00051 RPMPROB_BADOS,
00052 RPMPROB_PKG_INSTALLED,
00053 RPMPROB_BADRELOCATE,
00054 RPMPROB_REQUIRES,
00055 RPMPROB_CONFLICT,
00056 RPMPROB_NEW_FILE_CONFLICT,
00057 RPMPROB_FILE_CONFLICT,
00058 RPMPROB_OLDPACKAGE,
00059 RPMPROB_DISKSPACE,
00060 RPMPROB_DISKNODES,
00061 } rpmProblemType;
00062
00074 rpmProblem rpmProblemCreate(rpmProblemType type,
00075 const char * pkgNEVR,
00076 fnpyKey key,
00077 const char * dn, const char * bn,
00078 const char * altNEVR,
00079 uint64_t number);
00080
00086 rpmProblem rpmProblemFree(rpmProblem prob);
00087
00093 rpmProblem rpmProblemLink(rpmProblem prob);
00094
00100 rpmProblem rpmProblemUnlink(rpmProblem prob);
00101
00107 const char * rpmProblemGetPkgNEVR(const rpmProblem prob);
00113 const char * rpmProblemGetAltNEVR(const rpmProblem prob);
00114
00121 rpmProblemType rpmProblemGetType(const rpmProblem prob);
00122
00128 fnpyKey rpmProblemGetKey(const rpmProblem prob);
00129
00136 const char * rpmProblemGetStr(const rpmProblem prob);
00137
00145 rpm_loff_t rpmProblemGetDiskNeed(const rpmProblem prob);
00146
00152 char * rpmProblemString(const rpmProblem prob);
00153
00160 rpmps rpmpsUnlink (rpmps ps,
00161 const char * msg);
00162
00169 rpmps rpmpsLink (rpmps ps, const char * msg);
00170
00176 int rpmpsNumProblems(rpmps ps);
00177
00183 rpmpsi rpmpsInitIterator(rpmps ps);
00184
00190 rpmpsi rpmpsFreeIterator(rpmpsi psi);
00191
00197 int rpmpsNextIterator(rpmpsi psi);
00198
00204 rpmProblem rpmpsGetProblem(rpmpsi psi);
00205
00210 rpmps rpmpsCreate(void);
00211
00217 rpmps rpmpsFree(rpmps ps);
00218
00224 void rpmpsPrint(FILE *fp, rpmps ps);
00225
00231 void rpmpsAppendProblem(rpmps ps, rpmProblem prob);
00232
00244 void rpmpsAppend(rpmps ps, rpmProblemType type,
00245 const char * pkgNEVR,
00246 fnpyKey key,
00247 const char * dn, const char * bn,
00248 const char * altNEVR,
00249 uint64_t number);
00250
00266 int rpmpsTrim(rpmps ps, rpmps filter);
00267
00268 #ifdef __cplusplus
00269 }
00270 #endif
00271
00272 #endif