00001 #ifndef H_PSM
00002 #define H_PSM
00003
00009
00010
00011 extern int _psm_debug;
00012
00013
00016 #define PSM_VERBOSE 0x8000
00017 #define PSM_INTERNAL 0x4000
00018 #define PSM_SYSCALL 0x2000
00019 #define PSM_DEAD 0x1000
00020 #define _fv(_a) ((_a) | PSM_VERBOSE)
00021 #define _fi(_a) ((_a) | PSM_INTERNAL)
00022 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
00023 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
00024 typedef enum pkgStage_e {
00025 PSM_UNKNOWN = 0,
00026 PSM_INIT = 1,
00027 PSM_PRE = 2,
00028 PSM_PROCESS = 3,
00029 PSM_POST = 4,
00030 PSM_UNDO = 5,
00031 PSM_FINI = 6,
00032
00033 PSM_PKGINSTALL = 7,
00034 PSM_PKGERASE = 8,
00035 PSM_PKGCOMMIT = 10,
00036 PSM_PKGSAVE = 12,
00037
00038 PSM_CREATE = 17,
00039 PSM_NOTIFY = 22,
00040 PSM_DESTROY = 23,
00041 PSM_COMMIT = 25,
00042
00043 PSM_CHROOT_IN = 51,
00044 PSM_CHROOT_OUT = 52,
00045 PSM_SCRIPT = 53,
00046 PSM_TRIGGERS = 54,
00047 PSM_IMMED_TRIGGERS = 55,
00048 PSM_RPMIO_FLAGS = 56,
00049
00050 PSM_RPMDB_LOAD = 97,
00051 PSM_RPMDB_ADD = 98,
00052 PSM_RPMDB_REMOVE = 99
00053
00054 } pkgStage;
00055 #undef _fv
00056 #undef _fi
00057 #undef _fs
00058 #undef _fd
00059
00062 struct rpmpsm_s {
00063
00064 rpmts ts;
00065
00066 rpmte te;
00067
00068 rpmfi fi;
00069 FD_t cfd;
00070 FD_t fd;
00071 Header oh;
00072
00073 rpmdbMatchIterator mi;
00074
00075 const char * stepName;
00076
00077 const char * rpmio_flags;
00078
00079 const char * failedFile;
00080
00081 const char * pkgURL;
00082
00083 const char * pkgfn;
00084 int scriptTag;
00085 int progTag;
00086 int npkgs_installed;
00087 int scriptArg;
00088 int sense;
00089 int countCorrection;
00090 int chrootDone;
00091 int unorderedSuccessor;
00092 int reaper;
00093 pid_t reaped;
00094 pid_t child;
00095 int status;
00096 rpmCallbackType what;
00097 unsigned long amount;
00098 unsigned long total;
00099 rpmRC rc;
00100 pkgStage goal;
00101
00102 pkgStage stage;
00103
00104
00105 int nrefs;
00106 };
00107
00108 #ifdef __cplusplus
00109 extern "C" {
00110 #endif
00111
00118
00119 rpmpsm rpmpsmUnlink ( rpmpsm psm,
00120 const char * msg)
00121 ;
00122
00124
00125
00126 rpmpsm XrpmpsmUnlink ( rpmpsm psm,
00127 const char * msg, const char * fn, unsigned ln)
00128 ;
00129
00130 #define rpmpsmUnlink(_psm, _msg) XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
00131
00138
00139 rpmpsm rpmpsmLink ( rpmpsm psm, const char * msg)
00140 ;
00141
00143
00144
00145 rpmpsm XrpmpsmLink ( rpmpsm psm, const char * msg,
00146 const char * fn, unsigned ln)
00147 ;
00148
00149 #define rpmpsmLink(_psm, _msg) XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
00150
00156
00157 rpmpsm rpmpsmFree( rpmpsm psm)
00158
00159 ;
00160
00168 rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi)
00169 ;
00170
00177 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
00178
00179 ;
00180
00181 #ifdef __cplusplus
00182 }
00183 #endif
00184
00185 #endif