2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from many
7 others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 Bacula® is a registered trademark of Kern Sibbald.
17 * Common plugin definitions
19 * Kern Sibbald, October 2007
24 /****************************************************************************
26 * Common definitions for all plugins *
28 ****************************************************************************/
31 extern DLL_IMP_EXP alist *bplugin_list;
34 /* Universal return codes from all plugin functions */
37 bRC_Stop = 1, /* Stop calling other plugins */
38 bRC_Error = 2, /* Some kind of error */
39 bRC_More = 3, /* More files to backup */
40 bRC_Term = 4, /* Unload me */
41 bRC_Seen = 5, /* Return code from checkFiles */
42 bRC_Core = 6, /* Let Bacula core handles this file */
43 bRC_Skip = 7, /* Skip the proposed file */
44 bRC_Cancel = 8, /* Job cancelled */
46 bRC_Max = 9999 /* Max code Bacula can use */
51 /* Context packet as first argument of all functions */
53 void *bContext; /* Bacula private context */
54 void *pContext; /* Plugin private context */
58 typedef bRC (*t_loadPlugin)(void *binfo, void *bfuncs, void **pinfo, void **pfuncs);
59 typedef bRC (*t_unloadPlugin)(void);
66 t_unloadPlugin unloadPlugin;
71 bool restoreFileStarted;
72 bool createFileCalled;
76 extern Plugin *new_plugin();
77 extern bool load_plugins(void *binfo, void *bfuncs, const char *plugin_dir,
78 const char *type, bool is_plugin_compatible(Plugin *plugin));
79 extern void unload_plugins();
81 /* Each daemon can register a debug hook that will be called
82 * after a fatal signal
84 typedef void (dbg_plugin_hook_t)(Plugin *plug, FILE *fp);
85 extern void dbg_plugin_add_hook(dbg_plugin_hook_t *fct);
87 #endif /* __PLUGINS_H */