rpm
4.5
|
00001 #ifndef H_PSM 00002 #define H_PSM 00003 00009 #include <rpmsq.h> 00010 00011 /*@-exportlocal@*/ 00012 /*@unchecked@*/ 00013 extern int _psm_debug; 00014 /*@=exportlocal@*/ 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 /*@refcounted@*/ 00068 rpmts ts; 00069 /*@dependent@*/ /*@null@*/ 00070 rpmte te; 00071 /*@refcounted@*/ /*@relnull@*/ 00072 rpmfi fi; 00073 /*@relnull@*/ 00074 FD_t cfd; 00075 /*@relnull@*/ 00076 FD_t fd; 00077 Header oh; 00078 /*@null@*/ 00079 rpmdbMatchIterator mi; 00080 /*@observer@*/ 00081 const char * stepName; 00082 /*@only@*/ /*@null@*/ 00083 const char * rpmio_flags; 00084 /*@only@*/ /*@null@*/ 00085 const char * payload_format; 00086 /*@only@*/ /*@null@*/ 00087 const char * failedFile; 00088 /*@only@*/ /*@null@*/ 00089 const char * pkgURL; 00090 /*@dependent@*/ 00091 const char * pkgfn; 00092 /*@only@*/ /*@null@*/ 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 /*@unused@*/ 00108 pkgStage stage; 00109 pkgStage nstage; 00111 /*@refs@*/ 00112 int nrefs; 00113 }; 00114 00115 #ifdef __cplusplus 00116 extern "C" { 00117 #endif 00118 00125 /*@unused@*/ /*@null@*/ 00126 rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm, 00127 /*@null@*/ const char * msg) 00128 /*@modifies psm @*/; 00129 00131 /*@-exportlocal@*/ 00132 /*@null@*/ 00133 rpmpsm XrpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm, 00134 /*@null@*/ const char * msg, const char * fn, unsigned ln) 00135 /*@modifies psm @*/; 00136 /*@=exportlocal@*/ 00137 #define rpmpsmUnlink(_psm, _msg) XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__) 00138 00145 /*@unused@*/ /*@newref@*/ /*@null@*/ 00146 rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg) 00147 /*@modifies psm @*/; 00148 00150 /*@-exportlocal@*/ 00151 /*@newref@*/ /*@null@*/ 00152 rpmpsm XrpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg, 00153 const char * fn, unsigned ln) 00154 /*@modifies psm @*/; 00155 /*@=exportlocal@*/ 00156 #define rpmpsmLink(_psm, _msg) XrpmpsmLink(_psm, _msg, __FILE__, __LINE__) 00157 00163 /*@null@*/ 00164 rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm) 00165 /*@globals fileSystem @*/ 00166 /*@modifies psm, fileSystem @*/; 00167 00175 /*@null@*/ 00176 rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi) 00177 /*@modifies ts, fi @*/; 00178 00185 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) 00186 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00187 /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/; 00188 #define rpmpsmUNSAFE rpmpsmSTAGE 00189 00190 #ifdef __cplusplus 00191 } 00192 #endif 00193 00194 #endif /* H_PSM */