Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/psm.h

Go to the documentation of this file.
00001 #ifndef H_PSM
00002 #define H_PSM
00003 
00009 #include <rpmlib.h>
00010 #include "depends.h"
00011 #include "fsm.h"
00012 
00015 struct sharedFile {
00016     int mainFileNumber;
00017     int secRecOffset;
00018     int secFileNumber;
00019 } ;
00020 
00023 struct sharedFileInfo {
00024     int pkgFileNum;
00025     int otherFileNum;
00026     int otherPkg;
00027     int isRemoved;
00028 };
00029 
00032 struct transactionFileInfo_s {
00033   /* for all packages */
00034     enum rpmTransactionType type;
00035     fileAction action;          
00036 /*@owned@*/ fileAction * actions;       
00037 /*@owned@*/ struct fingerPrint_s * fps; 
00038     HGE_t hge;                  
00039     HFD_t hfd;                  
00040     Header h;                   
00041 /*@owned@*/ const char * name;
00042 /*@owned@*/ const char * version;
00043 /*@owned@*/ const char * release;
00044     int_32 epoch;
00045     uint_32 flags;              
00046     const uint_32 * fflags;     
00047     const uint_32 * fsizes;     
00048     const uint_32 * fmtimes;    
00049 /*@owned@*/ const char ** bnl;  
00050 /*@owned@*/ const char ** dnl;  
00051     int_32 * dil;               
00052 /*@owned@*/ const char ** obnl; 
00053 /*@owned@*/ const char ** odnl; 
00054     int_32 * odil;      
00055 /*@owned@*/ const char ** fmd5s;
00056 /*@owned@*/ const char ** flinks;       
00057 /* XXX setuid/setgid bits are turned off if fuser/fgroup doesn't map. */
00058     uint_16 * fmodes;           
00059 /*@owned@*/ char * fstates;     
00060 /*@owned@*/ const char ** fuser;        
00061 /*@owned@*/ const char ** fgroup;       
00062 /*@owned@*/ const char ** flangs;       
00063     int fc;                     
00064     int dc;                     
00065     int bnlmax;                 
00066     int dnlmax;                 
00067     int astriplen;
00068     int striplen;
00069     unsigned int archiveSize;
00070     mode_t dperms;              
00071     mode_t fperms;              
00072 /*@owned@*/ const char ** apath;
00073     int mapflags;
00074 /*@owned@*/ int * fmapflags;
00075     uid_t uid;
00076 /*@owned@*/ /*@null@*/ uid_t * fuids;   
00077     gid_t gid;
00078 /*@owned@*/ /*@null@*/ gid_t * fgids;   
00079     int magic;
00080 #define TFIMAGIC        0x09697923
00081 /*@owned@*/ FSM_t fsm;          
00083   /* these are for TR_ADDED packages */
00084 /*@dependent@*/ struct availablePackage * ap;
00085 /*@owned@*/ struct sharedFileInfo * replaced;
00086 /*@owned@*/ uint_32 * replacedSizes;
00087   /* for TR_REMOVED packages */
00088     unsigned int record;
00089 };
00090 
00093 #define PSM_VERBOSE     0x8000
00094 #define PSM_INTERNAL    0x4000
00095 #define PSM_SYSCALL     0x2000
00096 #define PSM_DEAD        0x1000
00097 #define _fv(_a)         ((_a) | PSM_VERBOSE)
00098 #define _fi(_a)         ((_a) | PSM_INTERNAL)
00099 #define _fs(_a)         ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
00100 #define _fd(_a)         ((_a) | (PSM_INTERNAL | PSM_DEAD))
00101 typedef enum pkgStage_e {
00102     PSM_UNKNOWN         =  0,
00103     PSM_INIT            =  1,
00104     PSM_PRE             =  2,
00105     PSM_PROCESS         =  3,
00106     PSM_POST            =  4,
00107     PSM_UNDO            =  5,
00108     PSM_FINI            =  6,
00109 
00110     PSM_PKGINSTALL      =  7,
00111     PSM_PKGERASE        =  8,
00112     PSM_PKGCOMMIT       = 10,
00113     PSM_PKGSAVE         = 12,
00114 
00115     PSM_CREATE          = 17,
00116     PSM_NOTIFY          = 22,
00117     PSM_DESTROY         = 23,
00118     PSM_COMMIT          = 25,
00119 
00120     PSM_CHROOT_IN       = 51,
00121     PSM_CHROOT_OUT      = 52,
00122     PSM_SCRIPT          = 53,
00123     PSM_TRIGGERS        = 54,
00124     PSM_IMMED_TRIGGERS  = 55,
00125     PSM_RPMIO_FLAGS     = 56,
00126 
00127     PSM_RPMDB_LOAD      = 97,
00128     PSM_RPMDB_ADD       = 98,
00129     PSM_RPMDB_REMOVE    = 99,
00130 
00131 } pkgStage;
00132 #undef  _fv
00133 #undef  _fi
00134 #undef  _fs
00135 #undef  _fd
00136 
00139 struct psm_s {
00140 /*@kept@*/ rpmTransactionSet ts;
00141 /*@kept@*/ TFI_t fi;            
00142     FD_t cfd;                   
00143     FD_t fd;                    
00144     Header oh;                  
00145     rpmdbMatchIterator mi;
00146 /*@observer@*/ const char * stepName;
00147 /*@owned@*/ const char * rpmio_flags;
00148 /*@owned@*/ const char * failedFile;
00149 /*@owned@*/ const char * pkgURL;        
00150 /*@dependent@*/ const char * pkgfn;     
00151     int scriptTag;              
00152     int progTag;                
00153     int npkgs_installed;        
00154     int scriptArg;              
00155     int sense;                  
00156     int countCorrection;        
00157     int chrootDone;             
00158     rpmCallbackType what;       
00159     unsigned long amount;       
00160     unsigned long total;        
00161     rpmRC rc;
00162     pkgStage goal;
00163     pkgStage stage;
00164 };
00165 
00166 #ifdef __cplusplus
00167 extern "C" {
00168 #endif
00169 
00175 void loadFi(Header h, TFI_t fi)
00176         /*@modifies h, fi @*/;
00177 
00182 void freeFi(TFI_t fi)
00183         /*@modifies fi @*/;
00184 
00190 /*@observer@*/ const char *const fiTypeString(TFI_t fi);
00191 
00198 int psmStage(PSM_t psm, pkgStage stage)
00199         /*@modifies psm @*/;
00200 
00201 #ifdef __cplusplus
00202 }
00203 #endif
00204 
00205 #endif  /* H_ROLLBACK */

Generated at Thu Apr 19 15:29:43 2001 for rpm by doxygen1.2.6-20010408 written by Dimitri van Heesch, © 1997-2001