2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2007 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>
50 /****************************************************************************
52 * Common definitions *
54 ****************************************************************************/
56 /* Universal return code from all functions */
57 typedef int32_t bpError;
59 /* Context packet as first argument of all functions */
60 typedef struct s_bpContext {
61 void *bContext; /* Bacula private context */
62 void *pContext; /* Plugin private context */
66 /****************************************************************************
68 * Bacula definitions *
70 ****************************************************************************/
72 /* Bacula Variable Ids */
83 bEventVolumePurged = 6,
87 typedef struct s_bEvent {
92 /* Bacula interface version and function pointers */
93 typedef struct s_baculaFuncs {
96 bpError (*bGetValue)(bpContext *ctx, bVariable var, void *value);
97 bpError (*bSetValue)(bpContext *ctx, bVariable var, void *value);
98 bpError (*bMemAlloc)(bpContext *ctx, uint32_t size, char *addr);
99 bpError (*bMemFree)(bpContext *ctx, char *addr);
100 bpError (*bMemFlush)(bpContext *ctx);
101 bpError (*bVersion)(bVariable var, void *value);
105 /****************************************************************************
107 * Plugin definitions *
109 ****************************************************************************/
117 typedef struct s_pluginFuncs {
120 bpError (*pNew)(bpContext *ctx);
121 bpError (*pDestroy)(bpContext *ctx);
122 bpError (*pGetValue)(bpContext *ctx, pVariable var, void *value);
123 bpError (*pSetValue)(bpContext *ctx, pVariable var, void *value);
124 bpError (*pHandleEvent)(bpContext *ctx, bEvent *event);
127 typedef bpError (*t_bpInitialize)(bFuncs *bfuncs, pFuncs *pfuncs);
128 typedef bpError (*t_bpShutdown)(void);
135 #endif /* __PLUGIN_H */