rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
rpmplugin.h
1#ifndef _RPMPLUGIN_H
2#define _RPMPLUGIN_H
3
4#include <rpm/rpmtypes.h>
5#include <rpm/rpmfi.h>
6
11/* indicates the way the scriptlet is executed */
12typedef enum rpmScriptletExecutionFlow_e {
13 RPMSCRIPTLET_NONE = 0,
14 RPMSCRIPTLET_FORK = 1 << 0,
15 RPMSCRIPTLET_EXEC = 1 << 1
16} rpmScriptletExecutionFlow;
17
18
24 /* bits 0-15 reserved for actions */
25 FAF_UNOWNED = (1 << 31)
26};
27typedef rpmFlags rpmFileActionFlags;
28
32typedef rpmFlags rpmFsmOp;
33
34#define XFA_MASK 0x0000ffff
35#define XFAF_MASK ~(XFA_MASK)
36#define XFO_ACTION(_a) ((_a) & XFA_MASK)
37#define XFO_FLAGS(_a) ((_a) & XFAF_MASK)
39/* plugin hook typedefs */
40typedef rpmRC (*plugin_init_func)(rpmPlugin plugin, rpmts ts);
41typedef void (*plugin_cleanup_func)(rpmPlugin plugin);
42typedef rpmRC (*plugin_tsm_pre_func)(rpmPlugin plugin, rpmts ts);
43typedef rpmRC (*plugin_tsm_post_func)(rpmPlugin plugin, rpmts ts, int res);
44typedef rpmRC (*plugin_psm_pre_func)(rpmPlugin plugin, rpmte te);
45typedef rpmRC (*plugin_psm_post_func)(rpmPlugin plugin, rpmte te, int res);
46typedef rpmRC (*plugin_scriptlet_pre_func)(rpmPlugin plugin,
47 const char *s_name, int type);
48typedef rpmRC (*plugin_scriptlet_fork_post_func)(rpmPlugin plugin,
49 const char *path, int type);
50typedef rpmRC (*plugin_scriptlet_post_func)(rpmPlugin plugin,
51 const char *s_name, int type,
52 int res);
53typedef rpmRC (*plugin_fsm_file_pre_func)(rpmPlugin plugin, rpmfi fi,
54 const char* path, mode_t file_mode,
55 rpmFsmOp op);
56typedef rpmRC (*plugin_fsm_file_post_func)(rpmPlugin plugin, rpmfi fi,
57 const char* path, mode_t file_mode,
58 rpmFsmOp op, int res);
59typedef rpmRC (*plugin_fsm_file_prepare_func)(rpmPlugin plugin, rpmfi fi,
60 int fd, const char* path,
61 const char *dest,
62 mode_t file_mode, rpmFsmOp op);
63
64typedef struct rpmPluginHooks_s * rpmPluginHooks;
66 /* plugin constructor and destructor hooks */
67 plugin_init_func init;
68 plugin_cleanup_func cleanup;
69 /* per transaction plugin hooks */
70 plugin_tsm_pre_func tsm_pre;
71 plugin_tsm_post_func tsm_post;
72 /* per transaction element hooks */
73 plugin_psm_pre_func psm_pre;
74 plugin_psm_post_func psm_post;
75 /* per scriptlet hooks */
76 plugin_scriptlet_pre_func scriptlet_pre;
77 plugin_scriptlet_fork_post_func scriptlet_fork_post;
78 plugin_scriptlet_post_func scriptlet_post;
79 /* per file hooks */
80 plugin_fsm_file_pre_func fsm_file_pre;
81 plugin_fsm_file_post_func fsm_file_post;
82 plugin_fsm_file_prepare_func fsm_file_prepare;
83};
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
94const char *rpmPluginName(rpmPlugin plugin);
95
101const char *rpmPluginOpts(rpmPlugin plugin);
102
108void rpmPluginSetData(rpmPlugin plugin, void *data);
109
115void * rpmPluginGetData(rpmPlugin plugin);
116
117#ifdef __cplusplus
118}
119#endif
120#endif /* _RPMPLUGIN_H */
rpmFlags rpmFsmOp
Definition rpmplugin.h:32
rpmFileActionFlags_e
Definition rpmplugin.h:23
struct rpmts_s * rpmts
Definition rpmtypes.h:63
enum rpmRC_e rpmRC
Definition rpmplugin.h:65