rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

psm.h
Go to the documentation of this file.
1 #ifndef H_PSM
2 #define H_PSM
3
13 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmpsm_s * rpmpsm;
14
15 #include <rpmsq.h>
16
17 /*@-exportlocal@*/
18 /*@unchecked@*/
19 extern int _psm_debug;
20 /*@=exportlocal@*/
21
24 #define PSM_VERBOSE 0x8000
25 #define PSM_INTERNAL 0x4000
26 #define PSM_SYSCALL 0x2000
27 #define PSM_DEAD 0x1000
28 #define _fv(_a) ((_a) | PSM_VERBOSE)
29 #define _fi(_a) ((_a) | PSM_INTERNAL)
30 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
31 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
32 typedef enum pkgStage_e {
33 PSM_UNKNOWN = 0,
34 PSM_INIT = 1,
35 PSM_PRE = 2,
36 PSM_PROCESS = 3,
37 PSM_POST = 4,
38 PSM_UNDO = 5,
39 PSM_FINI = 6,
40
41 PSM_PKGINSTALL = 7,
42 PSM_PKGERASE = 8,
43 PSM_PKGCOMMIT = 10,
44 PSM_PKGSAVE = 12,
45
46 PSM_CREATE = 17,
47 PSM_NOTIFY = 22,
48 PSM_DESTROY = 23,
49 PSM_COMMIT = 25,
50
51 PSM_CHROOT_IN = 51,
52 PSM_CHROOT_OUT = 52,
53 PSM_SCRIPT = 53,
54 PSM_TRIGGERS = 54,
55 PSM_IMMED_TRIGGERS = 55,
56 PSM_RPMIO_FLAGS = 56,
57
58 PSM_RPMDB_LOAD = 97,
59 PSM_RPMDB_ADD = 98,
60 PSM_RPMDB_REMOVE = 99
61
62 } pkgStage;
63 #undef _fv
64 #undef _fi
65 #undef _fs
66 #undef _fd
67
71 typedef enum rpmScriptID_e {
72 RPMSCRIPT_UNKNOWN = 0,
73 RPMSCRIPT_PRETRANS = 1,
74 RPMSCRIPT_TRIGGERPREIN = 2,
75 RPMSCRIPT_PREIN = 3,
76 RPMSCRIPT_POSTIN = 4,
77 RPMSCRIPT_TRIGGERIN = 5,
78 RPMSCRIPT_TRIGGERUN = 6,
79 RPMSCRIPT_PREUN = 7,
80 RPMSCRIPT_POSTUN = 8,
81 RPMSCRIPT_TRIGGERPOSTUN = 9,
82 RPMSCRIPT_POSTTRANS = 10,
83 /* 11-15 unused */
84 RPMSCRIPT_VERIFY = 16,
85 RPMSCRIPT_SANITYCHECK = 17,
86 RPMSCRIPT_MAX = 32
87 } rpmScriptID;
88
92 typedef enum rpmScriptState_e {
93 RPMSCRIPT_STATE_UNKNOWN = 0,
94 /* 0-15 reserved for waitpid return. */
95 RPMSCRIPT_STATE_EXEC = (1 << 16),
96 RPMSCRIPT_STATE_REAPED = (1 << 17),
97 /* 18-23 unused */
98 RPMSCRIPT_STATE_SELINUX = (1 << 24),
99 RPMSCRIPT_STATE_EMULATOR = (1 << 25),
100 RPMSCRIPT_STATE_LUA = (1 << 26)
101 } rpmScriptState;
102
106 typedef enum rpmpsmFlags_e {
107 RPMPSM_FLAGS_DEBUG = (1 << 0),
108 RPMPSM_FLAGS_CHROOTDONE = (1 << 1),
109 RPMPSM_FLAGS_UNORDERED = (1 << 2),
110 RPMPSM_FLAGS_GOTTRIGGERS = (1 << 3),
111 } rpmpsmFlags;
112
115 struct rpmpsm_s {
116 struct rpmioItem_s _item;
117 struct rpmsqElem sq;
119 /*@only@*/ /*@null@*/
120 const char * NVRA;
121 rpmpsmFlags flags;
122 /*@refcounted@*/
123 rpmts ts;
124 /*@dependent@*/ /*@null@*/
125 rpmte te;
126 /*@refcounted@*/ /*@relnull@*/
127 rpmfi fi;
128 /*@refcounted@*/ /*@relnull@*/
129 rpmds triggers;
130 /*@null@*/
131 const char ** Tpats;
132 /*@null@*/
133 void * Tmires;
134 int nTmires;
135 /*@only@*/
136 HE_t IPhe;
137 /*@relnull@*/
138 FD_t cfd;
139 /*@relnull@*/
140 FD_t fd;
141 Header oh;
142 /*@null@*/
143 rpmmi mi;
144 /*@observer@*/
145 const char * stepName;
146 /*@only@*/ /*@null@*/
147 const char * rpmio_flags;
148 /*@only@*/ /*@null@*/
149 const char * payload_format;
150 /*@only@*/ /*@null@*/
151 const char * failedFile;
152 /*@only@*/ /*@null@*/
153 const char * pkgURL;
154 /*@dependent@*/
155 const char * pkgfn;
156 /*@only@*/ /*@null@*/
157 int *sstates;
158 rpmTag scriptTag;
159 rpmTag progTag;
160 int npkgs_installed;
161 int scriptArg;
162 int sense;
163 int countCorrection;
164 rpmCallbackType what;
165 unsigned long long amount;
166 unsigned long long total;
167 rpmRC rc;
168 pkgStage goal;
169 /*@unused@*/
170 pkgStage stage;
171 pkgStage nstage;
173 #if defined(__LCLINT__)
174 /*@refs@*/
175 int nrefs;
176 #endif
177 };
178
179 #ifdef __cplusplus
180 extern "C" {
181 #endif
182
189 /*@unused@*/ /*@null@*/
190 rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
191 /*@null@*/ const char * msg)
192 /*@modifies psm @*/;
193 #define rpmpsmUnlink(_psm, _msg) \
194 ((rpmpsm)rpmioUnlinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
195
202 /*@unused@*/ /*@newref@*/ /*@null@*/
203 rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg)
204 /*@modifies psm @*/;
205 #define rpmpsmLink(_psm, _msg) \
206 ((rpmpsm)rpmioLinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
207
213 /*@null@*/
214 rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
215 /*@null@*/ const char * msg)
216 /*@globals fileSystem @*/
217 /*@modifies psm, fileSystem @*/;
218 #define rpmpsmFree(_psm, _msg) \
219 ((rpmpsm)rpmioFreePoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
220
228 /*@null@*/
229 rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi)
230 /*@modifies ts, fi @*/;
231
238 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
239 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
240 /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
241 #define rpmpsmUNSAFE rpmpsmSTAGE
242
243 #ifdef __cplusplus
244 }
245 #endif
246
247 #endif /* H_PSM */