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 * NEVRA;         
00068 
00069     const char * name;          
00070  
00071     char * epoch;
00072  
00073     char * version;             
00074  
00075     char * release;             
00076  
00077     const char * arch;          
00078  
00079     const char * os;            
00080     int archScore;              
00081     int osScore;                
00082     int isSource;               
00084     rpmte parent;               
00085     int degree;                 
00086     int npreds;                 
00087     int tree;                   
00088     int depth;                  
00089     int breadth;                
00090     unsigned int db_instance;   
00091 
00092     tsortInfo tsi;              
00094  
00095     rpmds this;                 
00096  
00097     rpmds provides;             
00098  
00099     rpmds requires;             
00100  
00101     rpmds conflicts;            
00102  
00103     rpmds obsoletes;            
00104  
00105     rpmfi fi;                   
00107     uint_32 color;              
00108     uint_32 pkgFileSize;        
00110   
00111     fnpyKey key;                
00112  
00113     rpmRelocation * relocs;     
00114     int nrelocs;                
00115     int autorelocatex;          
00116       
00117     FD_t fd;                    
00119  
00120     union {
00121   
00122         alKey addedKey;
00123         struct {
00124   
00125             alKey dependsOnKey;
00126             int dboffset;
00127         } removed;
00128     } u;
00129 
00130 
00131 };
00132 
00136 struct rpmtsi_s {
00137 
00138     rpmts ts;           
00139     int reverse;        
00140     int ocsave;         
00141     int oc;             
00142 };
00143 
00144 #endif  
00145 
00146 #ifdef __cplusplus
00147 extern "C" {
00148 #endif
00149 
00155 
00156 rpmte rpmteFree(  rpmte te)
00157         
00158         ;
00159 
00171  
00172 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
00173                    fnpyKey key,
00174                  rpmRelocation * relocs,
00175                 int dboffset,
00176                    alKey pkgKey)
00177         
00178         ;
00179 
00185 extern Header rpmteHeader(rpmte te)
00186         ;
00187 
00194 extern Header rpmteSetHeader(rpmte te, Header h)
00195         ;
00196 
00202 rpmElementType rpmteType(rpmte te)
00203         ;
00204 
00210 
00211 extern const char * rpmteN(rpmte te)
00212         ;
00213 
00219  
00220 extern const char * rpmteE(rpmte te)
00221         ;
00222 
00228  
00229 extern const char * rpmteV(rpmte te)
00230         ;
00231 
00237  
00238 extern const char * rpmteR(rpmte te)
00239         ;
00240 
00246  
00247 extern const char * rpmteA(rpmte te)
00248         ;
00249 
00255  
00256 extern const char * rpmteO(rpmte te)
00257         ;
00258 
00264 extern int rpmteIsSource(rpmte te)
00265         ;
00266 
00272 uint_32 rpmteColor(rpmte te)
00273         ;
00274 
00281 uint_32 rpmteSetColor(rpmte te, uint_32 color)
00282         ;
00283 
00289 unsigned int rpmteDBInstance(rpmte te)
00290         ;
00291 
00298 void rpmteSetDBInstance(rpmte te, unsigned int instance)
00299         ;
00300 
00307 uint_32 rpmtePkgFileSize(rpmte te)
00308         ;
00309 
00315 int rpmteDepth(rpmte te)
00316         ;
00317 
00324 int rpmteSetDepth(rpmte te, int ndepth)
00325         ;
00326 
00332 int rpmteBreadth(rpmte te)
00333         ;
00334 
00341 int rpmteSetBreadth(rpmte te, int nbreadth)
00342         ;
00343 
00349 int rpmteNpreds(rpmte te)
00350         ;
00351 
00358 int rpmteSetNpreds(rpmte te, int npreds)
00359         ;
00360 
00366 int rpmteTree(rpmte te)
00367         ;
00368 
00375 int rpmteSetTree(rpmte te, int ntree)
00376         ;
00377 
00383  
00384 rpmte rpmteParent(rpmte te)
00385         ;
00386 
00393 
00394 rpmte rpmteSetParent(rpmte te, rpmte pte)
00395         ;
00396 
00402 int rpmteDegree(rpmte te)
00403         ;
00404 
00411 int rpmteSetDegree(rpmte te, int ndegree)
00412         ;
00413 
00419 tsortInfo rpmteTSI(rpmte te)
00420         ;
00421 
00426 void rpmteFreeTSI(rpmte te)
00427         ;
00428 
00433 void rpmteNewTSI(rpmte te)
00434         ;
00435 
00440 
00441 void rpmteCleanDS(rpmte te)
00442         ;
00443 
00449   
00450 alKey rpmteAddedKey(rpmte te)
00451         ;
00452 
00459   
00460 alKey rpmteSetAddedKey(rpmte te,
00461                    alKey npkgKey)
00462         ;
00463 
00469   
00470 alKey rpmteDependsOnKey(rpmte te)
00471         ;
00472 
00478 int rpmteDBOffset(rpmte te)
00479         ;
00480 
00486 
00487 extern const char * rpmteNEVR(rpmte te)
00488         ;
00489 
00495 
00496 
00497 extern const char * rpmteNEVRA(rpmte te)
00498         ;
00499 
00500 
00506 FD_t rpmteFd(rpmte te)
00507         ;
00508 
00514 
00515 fnpyKey rpmteKey(rpmte te)
00516         ;
00517 
00524 rpmds rpmteDS(rpmte te, rpmTag tag)
00525         ;
00526 
00533 rpmfi rpmteFI(rpmte te, rpmTag tag)
00534         ;
00535 
00541 
00542 void rpmteColorDS(rpmte te, rpmTag tag)
00543         ;
00544 
00545 
00551 int rpmtsiOc(rpmtsi tsi)
00552         ;
00553 
00559  
00560 rpmtsi rpmtsiFree( rpmtsi tsi)
00561         
00562         ;
00563 
00571 
00572 rpmtsi XrpmtsiFree( rpmtsi tsi,
00573                 const char * fn, unsigned int ln)
00574         
00575         ;
00576 #define rpmtsiFree(_tsi)        XrpmtsiFree(_tsi, __FILE__, __LINE__)
00577 
00583  
00584 rpmtsi rpmtsiInit(rpmts ts)
00585         ;
00586 
00594  
00595 rpmtsi XrpmtsiInit(rpmts ts,
00596                 const char * fn, unsigned int ln)
00597         ;
00598 #define rpmtsiInit(_ts)         XrpmtsiInit(_ts, __FILE__, __LINE__)
00599 
00606  
00607 rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
00608         ;
00609 
00610 #ifdef __cplusplus
00611 }
00612 #endif
00613 
00614 #endif