]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/plugins.h
kes Apply Marco van Wieringen's set of patches, cleans up Migration/Copy
[bacula/bacula] / bacula / src / lib / plugins.h
index 5af9e05c4a04ec2aaea6109faa3151814d826fbf..be08be96595b666ff1b5721965196852831bcced 100644 (file)
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -34,9 +34,7 @@
 #define __PLUGINS_H
 
 #include "bacula.h"
-#ifndef HAVE_WIN32
 #include <dlfcn.h>
-#endif
 #ifdef HAVE_DIRENT_H
 #include <dirent.h>
 #define NAMELEN(dirent) (strlen((dirent)->d_name))
@@ -55,11 +53,15 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
  *                                                                          *
  ****************************************************************************/
 
-extern alist *plugin_list;
-
+extern DLL_IMP_EXP alist *plugin_list;
 
-/* Universal return code from all functions */
-typedef int32_t bpError;
+/* Universal return codes from all functions */
+typedef enum {
+  bRC_OK    = 0,                         /* OK */
+  bRC_Stop  = 1,                         /* Stop calling other plugins */
+  bRC_Error = 2,                         /* Some kind of error */
+  bRC_More  = 3,                         /* More files to backup */
+} bRC;
 
 /* Context packet as first argument of all functions */
 typedef struct s_bpContext {
@@ -68,8 +70,8 @@ typedef struct s_bpContext {
 } bpContext;
 
 extern "C" {
-typedef bpError (*t_loadPlugin)(void *binfo, void *bfuncs, void **pinfo, void **pfuncs);
-typedef bpError (*t_unloadPlugin)(void);
+typedef bRC (*t_loadPlugin)(void *binfo, void *bfuncs, void **pinfo, void **pfuncs);
+typedef bRC (*t_unloadPlugin)(void);
 }
 
 class Plugin {