4 #include <rpm/rpmtypes.h>
6 #include "lib/rpmplugin.h"
12 /** \ingroup rpmplugins
13 * Create a new plugins structure
14 * @param ts transaction set
15 * @return new plugin structure
18 rpmPlugins rpmpluginsNew(rpmts ts);
20 /** \ingroup rpmplugins
21 * Destroy a plugins structure
22 * @param plugins plugins structure to destroy
26 rpmPlugins rpmpluginsFree(rpmPlugins plugins);
28 /** \ingroup rpmplugins
29 * Add and open a plugin
30 * @param plugins plugins structure to add a plugin to
31 * @param name name to access plugin
32 * @param path path of plugin to open
33 * @param opts options to pass to the plugin
34 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
37 rpmRC rpmpluginsAdd(rpmPlugins plugins, const char *name, const char *path, const char *opts);
39 /** \ingroup rpmplugins
40 * Add and open a rpm plugin
41 * @param plugins plugins structure to add a plugin to
42 * @param type type of plugin
43 * @param name name of plugin
44 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
47 rpmRC rpmpluginsAddPlugin(rpmPlugins plugins, const char *type, const char *name);
49 /** \ingroup rpmplugins
50 * Determine if a plugin has been added already
51 * @param plugins plugins structure
52 * @param name name of plugin to check
53 * @return 1 if plugin name has already been added, 0 otherwise
56 int rpmpluginsPluginAdded(rpmPlugins plugins, const char *name);
58 /** \ingroup rpmplugins
59 * Call the pre transaction plugin hook
60 * @param plugins plugins structure
61 * @param ts processed transaction
62 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
65 rpmRC rpmpluginsCallTsmPre(rpmPlugins plugins, rpmts ts);
67 /** \ingroup rpmplugins
68 * Call the post transaction plugin hook
69 * @param plugins plugins structure
70 * @param ts processed transaction
71 * @param res transaction result code
72 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
75 rpmRC rpmpluginsCallTsmPost(rpmPlugins plugins, rpmts ts, int res);
77 /** \ingroup rpmplugins
78 * Call the pre transaction element plugin hook
79 * @param plugins plugins structure
80 * @param te processed transaction element
81 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
84 rpmRC rpmpluginsCallPsmPre(rpmPlugins plugins, rpmte te);
86 /** \ingroup rpmplugins
87 * Call the post transaction element plugin hook
88 * @param plugins plugins structure
89 * @param te processed transaction element
90 * @param res transaction element result code
91 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
94 rpmRC rpmpluginsCallPsmPost(rpmPlugins plugins, rpmte te, int res);
96 /** \ingroup rpmplugins
97 * Call the pre scriptlet execution plugin hook
98 * @param plugins plugins structure
99 * @param s_name scriptlet name
100 * @param type indicates the scriptlet execution flow, see rpmScriptletExecutionFlow
101 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
104 rpmRC rpmpluginsCallScriptletPre(rpmPlugins plugins, const char *s_name, int type);
106 /** \ingroup rpmplugins
107 * Call the post fork scriptlet plugin hook.
108 * @param plugins plugins structure
109 * @param path scriptlet path
110 * @param type indicates the scriptlet execution flow, see rpmScriptletExecutionFlow
111 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
114 rpmRC rpmpluginsCallScriptletForkPost(rpmPlugins plugins, const char *path, int type);
116 /** \ingroup rpmplugins
117 * Call the post scriptlet execution plugin hook
118 * @param plugins plugins structure
119 * @param s_name scriptlet name
120 * @param type indicates the scriptlet execution flow, see rpmScriptletExecutionFlow
121 * @param res scriptlet execution result code
122 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
125 rpmRC rpmpluginsCallScriptletPost(rpmPlugins plugins, const char *s_name, int type, int res);
127 /** \ingroup rpmplugins
128 * Call the fsm file pre plugin hook
129 * @param plugins plugins structure
130 * @param fi file info iterator (or NULL)
131 * @param path file object path
132 * @param file_mode file object mode
133 * @param op file operation + associated flags
134 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
137 rpmRC rpmpluginsCallFsmFilePre(rpmPlugins plugins, rpmfi fi, const char* path,
138 mode_t file_mode, rpmFsmOp op);
140 /** \ingroup rpmplugins
141 * Call the fsm file post plugin hook
142 * @param plugins plugins structure
143 * @param fi file info iterator (or NULL)
144 * @param path file object path
145 * @param file_mode file object mode
146 * @param op file operation + associated flags
147 * @param res fsm result code
148 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
151 rpmRC rpmpluginsCallFsmFilePost(rpmPlugins plugins, rpmfi fi, const char* path,
152 mode_t file_mode, rpmFsmOp op, int res);
154 /** \ingroup rpmplugins
155 * Call the fsm file prepare plugin hook. Called after setting
156 * permissions etc, but before committing file to destination path.
157 * @param plugins plugins structure
158 * @param fi file info iterator (or NULL)
159 * @param path file object current path
160 * @param dest file object destination path
161 * @param mode file object mode
162 * @param op file operation + associated flags
163 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
166 rpmRC rpmpluginsCallFsmFilePrepare(rpmPlugins plugins, rpmfi fi,
167 const char *path, const char *dest,
168 mode_t mode, rpmFsmOp op);
169 /** \ingroup rpmplugins
170 * Call the verify hook
171 * @param plugins plugins structure
172 * @param keyring RPM keyring
173 * @param sigtd signature tag
174 * @param sig OpenPGP signature parameters
175 * @param res scriptlet execution result code
176 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
179 rpmRC rpmpluginsCallVerify(rpmPlugins plugins, rpmKeyring keyring, int sigTagId,
180 pgpDigParams sig, DIGEST_CTX ctx, int res);
182 /** \ingroup rpmplugins
183 * Call the fsm init hook
184 * @param plugins plugins structure
185 * @param path file full path
186 * @param mode file mode
187 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
190 rpmRC rpmpluginsCallFsmInit(rpmPlugins plugins, const char* path, mode_t mode);
192 /** \ingroup rpmplugins
193 * Call the fsm commit hook
194 * @param plugins plugins structure
195 * @param path file full path
196 * @param mode file mode
197 * @param type file type
198 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
201 rpmRC rpmpluginsCallFsmCommit(rpmPlugins plugins, const char* path, mode_t mode, int type);
203 /** \ingroup rpmplugins
204 * Call the fsm commit hook
205 * @param plugins plugins structure
206 * @param ts transaction set
207 * @param path new file path
208 * @param oldHeader old header
209 * @param oldFi old file
210 * @param res return code
211 * @return RPMRC_OK on success, RPMRC_FAIL otherwise
214 rpmRC rpmpluginsCallFileConflict(rpmPlugins plugins, rpmts ts, char* path, Header oldHeader, rpmfi oldFi, int res);
220 #endif /* _PLUGINS_H */