00001 #ifndef H_PSM
00002 #define H_PSM
00003
00009 #include <rpmsq.h>
00010
00011
00012
00013 extern int _psm_debug;
00014
00015
00018 #define PSM_VERBOSE 0x8000
00019 #define PSM_INTERNAL 0x4000
00020 #define PSM_SYSCALL 0x2000
00021 #define PSM_DEAD 0x1000
00022 #define _fv(_a) ((_a) | PSM_VERBOSE)
00023 #define _fi(_a) ((_a) | PSM_INTERNAL)
00024 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
00025 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
00026 typedef enum pkgStage_e {
00027 PSM_UNKNOWN = 0,
00028 PSM_INIT = 1,
00029 PSM_PRE = 2,
00030 PSM_PROCESS = 3,
00031 PSM_POST = 4,
00032 PSM_UNDO = 5,
00033 PSM_FINI = 6,
00034
00035 PSM_PKGINSTALL = 7,
00036 PSM_PKGERASE = 8,
00037 PSM_PKGCOMMIT = 10,
00038 PSM_PKGSAVE = 12,
00039
00040 PSM_CREATE = 17,
00041 PSM_NOTIFY = 22,
00042 PSM_DESTROY = 23,
00043 PSM_COMMIT = 25,
00044
00045 PSM_CHROOT_IN = 51,
00046 PSM_CHROOT_OUT = 52,
00047 PSM_SCRIPT = 53,
00048 PSM_TRIGGERS = 54,
00049 PSM_IMMED_TRIGGERS = 55,
00050 PSM_RPMIO_FLAGS = 56,
00051
00052 PSM_RPMDB_LOAD = 97,
00053 PSM_RPMDB_ADD = 98,
00054 PSM_RPMDB_REMOVE = 99
00055
00056 } pkgStage;
00057 #undef _fv
00058 #undef _fi
00059 #undef _fs
00060 #undef _fd
00061
00064 struct rpmpsm_s {
00065 struct rpmsqElem sq;
00067
00068 rpmts ts;
00069
00070 rpmte te;
00071
00072 rpmfi fi;
00073
00074 FD_t cfd;
00075
00076 FD_t fd;
00077 Header oh;
00078
00079 rpmdbMatchIterator mi;
00080
00081 const char * stepName;
00082
00083 const char * rpmio_flags;
00084
00085 const char * failedFile;
00086
00087 const char * pkgURL;
00088
00089 const char * pkgfn;
00090 int scriptTag;
00091 int progTag;
00092 int npkgs_installed;
00093 int scriptArg;
00094 int sense;
00095 int countCorrection;
00096 int chrootDone;
00097 int unorderedSuccessor;
00098 rpmCallbackType what;
00099 unsigned long amount;
00100 unsigned long total;
00101 rpmRC rc;
00102 pkgStage goal;
00103
00104 pkgStage stage;
00105 pkgStage nstage;
00107
00108 int nrefs;
00109 };
00110
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif
00114
00121
00122 rpmpsm rpmpsmUnlink ( rpmpsm psm,
00123 const char * msg)
00124 ;
00125
00127
00128
00129 rpmpsm XrpmpsmUnlink ( rpmpsm psm,
00130 const char * msg, const char * fn, unsigned ln)
00131 ;
00132
00133 #define rpmpsmUnlink(_psm, _msg) XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
00134
00141
00142 rpmpsm rpmpsmLink ( rpmpsm psm, const char * msg)
00143 ;
00144
00146
00147
00148 rpmpsm XrpmpsmLink ( rpmpsm psm, const char * msg,
00149 const char * fn, unsigned ln)
00150 ;
00151
00152 #define rpmpsmLink(_psm, _msg) XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
00153
00159
00160 rpmpsm rpmpsmFree( rpmpsm psm)
00161
00162 ;
00163
00171
00172 rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi)
00173 ;
00174
00181 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
00182
00183 ;
00184 #define rpmpsmUNSAFE rpmpsmSTAGE
00185
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189
00190 #endif