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

Generated at Wed Mar 27 03:56:50 2002 for rpm by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001