00001 #ifndef H_RPMTE
00002 #define H_RPMTE
00003
00011
00012
00013 extern int _rpmte_debug;
00014
00015
00019 typedef struct tsortInfo_s * tsortInfo;
00020
00024 typedef struct rpmtsi_s * rpmtsi;
00025
00029 typedef enum rpmElementType_e {
00030 TR_ADDED = (1 << 0),
00031 TR_REMOVED = (1 << 1)
00032 } rpmElementType;
00033
00034 #if defined(_RPMTE_INTERNAL)
00035
00038
00039 struct tsortInfo_s {
00040 union {
00041 int count;
00042
00043 rpmte suc;
00044 } tsi_u;
00045 #define tsi_count tsi_u.count
00046 #define tsi_suc tsi_u.suc
00047
00048 struct tsortInfo_s * tsi_next;
00049
00050 rpmte tsi_chain;
00051 int tsi_reqx;
00052 int tsi_qcnt;
00053 };
00054
00055
00059 struct rpmte_s {
00060 rpmElementType type;
00062
00063 Header h;
00064
00065 const char * NEVR;
00066
00067 const char * name;
00068
00069 char * epoch;
00070
00071 char * version;
00072
00073 char * release;
00074
00075 const char * arch;
00076
00077 const char * os;
00079 rpmte parent;
00080 int degree;
00081 int depth;
00082 int npreds;
00083 int tree;
00084
00085 tsortInfo tsi;
00087
00088 rpmds this;
00089
00090 rpmds provides;
00091
00092 rpmds requires;
00093
00094 rpmds conflicts;
00095
00096 rpmds obsoletes;
00097
00098 rpmfi fi;
00100 uint_32 multiLib;
00102
00103 fnpyKey key;
00104
00105 rpmRelocation * relocs;
00106
00107 FD_t fd;
00109
00110 union {
00111
00112 alKey addedKey;
00113 struct {
00114
00115 alKey dependsOnKey;
00116 int dboffset;
00117 } removed;
00118 } u;
00119
00120
00121 };
00122
00126 struct rpmtsi_s {
00127
00128 rpmts ts;
00129 int reverse;
00130 int ocsave;
00131 int oc;
00132 };
00133
00134 #endif
00135
00136 #ifdef __cplusplus
00137 extern "C" {
00138 #endif
00139
00145
00146 rpmte rpmteFree( rpmte te)
00147
00148 ;
00149
00161
00162 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
00163 fnpyKey key,
00164 rpmRelocation * relocs,
00165 int dboffset,
00166 alKey pkgKey)
00167
00168 ;
00169
00175 rpmElementType rpmteType(rpmte te)
00176 ;
00177
00183
00184 extern const char * rpmteN(rpmte te)
00185 ;
00186
00192
00193 extern const char * rpmteE(rpmte te)
00194 ;
00195
00201
00202 extern const char * rpmteV(rpmte te)
00203 ;
00204
00210
00211 extern const char * rpmteR(rpmte te)
00212 ;
00213
00219
00220 extern const char * rpmteA(rpmte te)
00221 ;
00222
00228
00229 extern const char * rpmteO(rpmte te)
00230 ;
00231
00237 int rpmteMultiLib(rpmte te)
00238 ;
00239
00246 int rpmteSetMultiLib(rpmte te, int nmultiLib)
00247 ;
00248
00254 int rpmteDepth(rpmte te)
00255 ;
00256
00263 int rpmteSetDepth(rpmte te, int ndepth)
00264 ;
00265
00271 int rpmteNpreds(rpmte te)
00272 ;
00273
00280 int rpmteSetNpreds(rpmte te, int npreds)
00281 ;
00282
00288 int rpmteTree(rpmte te)
00289 ;
00290
00297 int rpmteSetTree(rpmte te, int ntree)
00298 ;
00299
00305
00306 rpmte rpmteParent(rpmte te)
00307 ;
00308
00315 rpmte rpmteSetParent(rpmte te, rpmte pte)
00316 ;
00317
00323 int rpmteDegree(rpmte te)
00324 ;
00325
00332 int rpmteSetDegree(rpmte te, int ndegree)
00333 ;
00334
00340 tsortInfo rpmteTSI(rpmte te)
00341 ;
00342
00347 void rpmteFreeTSI(rpmte te)
00348 ;
00349
00354 void rpmteNewTSI(rpmte te)
00355 ;
00356
00361
00362 void rpmteCleanDS(rpmte te)
00363 ;
00364
00370
00371 alKey rpmteAddedKey(rpmte te)
00372 ;
00373
00380
00381 alKey rpmteSetAddedKey(rpmte te,
00382 alKey npkgKey)
00383 ;
00384
00390
00391 alKey rpmteDependsOnKey(rpmte te)
00392 ;
00393
00399 int rpmteDBOffset(rpmte te)
00400 ;
00401
00407
00408 extern const char * rpmteNEVR(rpmte te)
00409 ;
00410
00416 FD_t rpmteFd(rpmte te)
00417 ;
00418
00424
00425 fnpyKey rpmteKey(rpmte te)
00426 ;
00427
00434 rpmds rpmteDS(rpmte te, rpmTag tag)
00435 ;
00436
00443 rpmfi rpmteFI(rpmte te, rpmTag tag)
00444 ;
00445
00451 int rpmtsiOc(rpmtsi tsi)
00452 ;
00453
00459
00460 rpmtsi rpmtsiFree( rpmtsi tsi)
00461
00462 ;
00463
00471
00472 rpmtsi XrpmtsiFree( rpmtsi tsi,
00473 const char * fn, unsigned int ln)
00474
00475 ;
00476 #define rpmtsiFree(_tsi) XrpmtsiFree(_tsi, __FILE__, __LINE__)
00477
00483
00484 rpmtsi rpmtsiInit(rpmts ts)
00485 ;
00486
00494
00495 rpmtsi XrpmtsiInit(rpmts ts,
00496 const char * fn, unsigned int ln)
00497 ;
00498 #define rpmtsiInit(_ts) XrpmtsiInit(_ts, __FILE__, __LINE__)
00499
00506
00507 rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
00508 ;
00509
00510 #ifdef __cplusplus
00511 }
00512 #endif
00513
00514 #endif