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 * payload_format;
00086
00087 const char * failedFile;
00088
00089 const char * pkgURL;
00090
00091 const char * pkgfn;
00092
00093 int *sstates;
00094 int scriptTag;
00095 int progTag;
00096 int npkgs_installed;
00097 int scriptArg;
00098 int sense;
00099 int countCorrection;
00100 int chrootDone;
00101 int unorderedSuccessor;
00102 rpmCallbackType what;
00103 unsigned long long amount;
00104 unsigned long long total;
00105 rpmRC rc;
00106 pkgStage goal;
00107
00108 pkgStage stage;
00109 pkgStage nstage;
00111
00112 int nrefs;
00113 };
00114
00115 #ifdef __cplusplus
00116 extern "C" {
00117 #endif
00118
00125
00126 rpmpsm rpmpsmUnlink ( rpmpsm psm,
00127 const char * msg)
00128 ;
00129
00131
00132
00133 rpmpsm XrpmpsmUnlink ( rpmpsm psm,
00134 const char * msg, const char * fn, unsigned ln)
00135 ;
00136
00137 #define rpmpsmUnlink(_psm, _msg) XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
00138
00145
00146 rpmpsm rpmpsmLink ( rpmpsm psm, const char * msg)
00147 ;
00148
00150
00151
00152 rpmpsm XrpmpsmLink ( rpmpsm psm, const char * msg,
00153 const char * fn, unsigned ln)
00154 ;
00155
00156 #define rpmpsmLink(_psm, _msg) XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
00157
00163
00164 rpmpsm rpmpsmFree( rpmpsm psm)
00165
00166 ;
00167
00175
00176 rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi)
00177 ;
00178
00185 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
00186
00187 ;
00188 #define rpmpsmUNSAFE rpmpsmSTAGE
00189
00190 #ifdef __cplusplus
00191 }
00192 #endif
00193
00194 #endif