rpm  4.5
psm.h
Go to the documentation of this file.
1 #ifndef H_PSM
2 #define H_PSM
3 
9 #include <rpmsq.h>
10 
11 /*@-exportlocal@*/
12 /*@unchecked@*/
13 extern int _psm_debug;
14 /*@=exportlocal@*/
15 
18 #define PSM_VERBOSE 0x8000
19 #define PSM_INTERNAL 0x4000
20 #define PSM_SYSCALL 0x2000
21 #define PSM_DEAD 0x1000
22 #define _fv(_a) ((_a) | PSM_VERBOSE)
23 #define _fi(_a) ((_a) | PSM_INTERNAL)
24 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
25 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
26 typedef enum pkgStage_e {
28  PSM_INIT = 1,
29  PSM_PRE = 2,
31  PSM_POST = 4,
32  PSM_UNDO = 5,
33  PSM_FINI = 6,
34 
39 
40  PSM_CREATE = 17,
41  PSM_NOTIFY = 22,
43  PSM_COMMIT = 25,
44 
47  PSM_SCRIPT = 53,
51 
55 
56 } pkgStage;
57 #undef _fv
58 #undef _fi
59 #undef _fs
60 #undef _fd
61 
64 struct rpmpsm_s {
65  struct rpmsqElem sq;
67 /*@refcounted@*/
69 /*@dependent@*/ /*@null@*/
71 /*@refcounted@*/ /*@relnull@*/
73 /*@relnull@*/
75 /*@relnull@*/
76  FD_t fd;
78 /*@null@*/
80 /*@observer@*/
81  const char * stepName;
82 /*@only@*/ /*@null@*/
83  const char * rpmio_flags;
84 /*@only@*/ /*@null@*/
85  const char * payload_format;
86 /*@only@*/ /*@null@*/
87  const char * failedFile;
88 /*@only@*/ /*@null@*/
89  const char * pkgURL;
90 /*@dependent@*/
91  const char * pkgfn;
92 /*@only@*/ /*@null@*/
93  int *sstates;
94  int scriptTag;
95  int progTag;
97  int scriptArg;
98  int sense;
103  unsigned long long amount;
104  unsigned long long total;
107 /*@unused@*/
111 /*@refs@*/
112  int nrefs;
113 };
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
125 /*@unused@*/ /*@null@*/
126 rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
127  /*@null@*/ const char * msg)
128  /*@modifies psm @*/;
129 
131 /*@-exportlocal@*/
132 /*@null@*/
133 rpmpsm XrpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
134  /*@null@*/ const char * msg, const char * fn, unsigned ln)
135  /*@modifies psm @*/;
136 /*@=exportlocal@*/
137 #define rpmpsmUnlink(_psm, _msg) XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
138 
145 /*@unused@*/ /*@newref@*/ /*@null@*/
146 rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg)
147  /*@modifies psm @*/;
148 
150 /*@-exportlocal@*/
151 /*@newref@*/ /*@null@*/
152 rpmpsm XrpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg,
153  const char * fn, unsigned ln)
154  /*@modifies psm @*/;
155 /*@=exportlocal@*/
156 #define rpmpsmLink(_psm, _msg) XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
157 
163 /*@null@*/
164 rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm)
165  /*@globals fileSystem @*/
166  /*@modifies psm, fileSystem @*/;
167 
175 /*@null@*/
176 rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi)
177  /*@modifies ts, fi @*/;
178 
185 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
186  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
187  /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
188 #define rpmpsmUNSAFE rpmpsmSTAGE
189 
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #endif /* H_PSM */