2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version two of the GNU General Public
10 License as published by the Free Software Foundation, which is
11 listed in the file LICENSE.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of John Walker.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
29 * Interface definition for Bacula Plugins
31 * Kern Sibbald, October 2007
38 #include <sys/types.h>
44 #include "lib/plugin.h"
53 /****************************************************************************
55 * Bacula definitions *
57 ****************************************************************************/
59 /* Bacula Variable Ids */
76 typedef struct s_bEvent {
80 typedef struct s_baculaInfo {
85 /* Bacula interface version and function pointers */
86 typedef struct s_baculaFuncs {
89 bpError (*registerBaculaEvents)(bpContext *ctx, ...);
90 bpError (*getBaculaValue)(bpContext *ctx, bVariable var, void *value);
91 bpError (*setBaculaValue)(bpContext *ctx, bVariable var, void *value);
92 bpError (*JobMessage)(bpContext *ctx, const char *file, int line,
93 int type, time_t mtime, const char *msg);
94 bpError (*DebugMessage)(bpContext *ctx, const char *file, int line,
95 int level, const char *msg);
98 /* Bacula Subroutines */
99 void load_fd_plugins(const char *plugin_dir);
100 void new_plugins(JCR *jcr);
101 void free_plugins(JCR *jcr);
102 void generate_plugin_event(JCR *jcr, bEventType event);
106 /****************************************************************************
108 * Plugin definitions *
110 ****************************************************************************/
118 #define PLUGIN_MAGIC "*PluginData*"
119 #define PLUGIN_INTERFACE 1
121 typedef struct s_pluginInfo {
125 char *plugin_license;
128 char *plugin_version;
129 char *plugin_description;
132 typedef struct s_pluginFuncs {
135 bpError (*newPlugin)(bpContext *ctx);
136 bpError (*freePlugin)(bpContext *ctx);
137 bpError (*getPluginValue)(bpContext *ctx, pVariable var, void *value);
138 bpError (*setPluginValue)(bpContext *ctx, pVariable var, void *value);
139 bpError (*handlePluginEvent)(bpContext *ctx, bEvent *event);
142 #define plug_func(plugin) ((pFuncs *)(plugin->pfuncs))
143 #define plug_info(plugin) ((pInfo *)(plugin->pinfo))
149 #endif /* __PLUGIN_FD_H */