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
00026 enum rpmTransactionType type;
00027 fileAction action;
00028 fileAction * actions;
00029 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 const char * name;
00037 const char * version;
00038 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 const char ** bnl;
00045 const char ** dnl;
00046 int_32 * dil;
00047 const char ** obnl;
00048 const char ** odnl;
00049 int_32 * odil;
00050 const char ** fmd5s;
00051 const char ** flinks;
00052
00053 uint_16 * fmodes;
00054 uint_16 * frdevs;
00055 char * fstates;
00056 const char ** fuser;
00057 const char ** fgroup;
00058 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 const char ** apath;
00069 int mapflags;
00070 int * fmapflags;
00071 uid_t uid;
00072 uid_t * fuids;
00073 gid_t gid;
00074 gid_t * fgids;
00075 int magic;
00076 #define TFIMAGIC 0x09697923
00077 FSM_t fsm;
00079
00080 struct availablePackage * ap;
00081 struct sharedFileInfo * replaced;
00082 uint_32 * replacedSizes;
00083
00084
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 rpmTransactionSet ts;
00138 TFI_t fi;
00139 FD_t cfd;
00140 FD_t fd;
00141 Header oh;
00142 rpmdbMatchIterator mi;
00143 const char * stepName;
00144 const char * rpmio_flags;
00145 const char * failedFile;
00146 const char * pkgURL;
00147 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 pkgStage stage;
00161 };
00162
00163 #ifdef __cplusplus
00164 extern "C" {
00165 #endif
00166
00172 void loadFi(Header h, TFI_t fi)
00173 ;
00174
00179 void freeFi(TFI_t fi)
00180 ;
00181
00187 const char *const fiTypeString(TFI_t fi)
00188 ;
00189
00196 int psmStage(PSM_t psm, pkgStage stage)
00197 ;
00198
00199 #ifdef __cplusplus
00200 }
00201 #endif
00202
00203 #endif