]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/plugins/sd/example-plugin-sd.c
Backport from Bacula Enterprise
[bacula/bacula] / bacula / src / plugins / sd / example-plugin-sd.c
index be14924077ce2a313bd58e848a88fb5ba41128e7..21b674a2863bdf5719414dab4eb8d4f64958504c 100644 (file)
@@ -1,17 +1,21 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
+   Copyright (C) 2000-2015 Kern Sibbald
    Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
 
-   The main author of Bacula is Kern Sibbald, with contributions from many
-   others, a complete list can be found in the file AUTHORS.
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
 
    You may use this file and others of this release according to the
    license defined in the LICENSE file, which includes the Affero General
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
-   Bacula® is a registered trademark of Kern Sibbald.
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
 /*
  * Sample Storage daemon Plugin program
@@ -26,7 +30,7 @@
 extern "C" {
 #endif
 
-#define PLUGIN_LICENSE      "Bacula AGPLv3"
+#define PLUGIN_LICENSE      "AGPLv3"
 #define PLUGIN_AUTHOR       "Kern Sibbald"
 #define PLUGIN_DATE         "November 2011"
 #define PLUGIN_VERSION      "2"
@@ -38,6 +42,7 @@ static bRC freePlugin(bpContext *ctx);
 static bRC getPluginValue(bpContext *ctx, psdVariable var, void *value);
 static bRC setPluginValue(bpContext *ctx, psdVariable var, void *value);
 static bRC handlePluginEvent(bpContext *ctx, bsdEvent *event, void *value);
+static bRC handleGlobalPluginEvent(bsdEvent *event, void *value);
 
 
 /* Pointers to Bacula functions */
@@ -64,7 +69,8 @@ static psdFuncs pluginFuncs = {
    freePlugin,                        /* free plugin instance */
    getPluginValue,
    setPluginValue,
-   handlePluginEvent
+   handlePluginEvent,
+   handleGlobalPluginEvent
 };
 
 /*
@@ -87,17 +93,17 @@ loadPlugin(bsdInfo *lbinfo, bsdFuncs *lbfuncs, psdInfo **pinfo, psdFuncs **pfunc
 }
 
 /*
- * External entry point to unload the plugin
+ * External entry point to unload the plugin 
  */
 bRC DLL_IMP_EXP
-unloadPlugin()
+unloadPlugin() 
 {
    printf("example-plugin-sd: Unloaded\n");
    return bRC_OK;
 }
 
 /*
- * The following entry points are accessed through the function
+ * The following entry points are accessed through the function 
  *   pointers we supplied to Bacula. Each plugin type (dir, fd, sd)
  *   has its own set of entry points that the plugin must define.
  */
@@ -127,7 +133,7 @@ static bRC freePlugin(bpContext *ctx)
 /*
  * Return some plugin value (none defined)
  */
-static bRC getPluginValue(bpContext *ctx, psdVariable var, void *value)
+static bRC getPluginValue(bpContext *ctx, psdVariable var, void *value) 
 {
    printf("example-plugin-sd: getPluginValue var=%d\n", var);
    return bRC_OK;
@@ -136,7 +142,7 @@ static bRC getPluginValue(bpContext *ctx, psdVariable var, void *value)
 /*
  * Set a plugin value (none defined)
  */
-static bRC setPluginValue(bpContext *ctx, psdVariable var, void *value)
+static bRC setPluginValue(bpContext *ctx, psdVariable var, void *value) 
 {
    printf("example-plugin-sd: setPluginValue var=%d\n", var);
    return bRC_OK;
@@ -163,6 +169,15 @@ static bRC handlePluginEvent(bpContext *ctx, bsdEvent *event, void *value)
    return bRC_OK;
 }
 
+/*
+ * Handle a Global event -- no context
+ */
+static bRC handleGlobalPluginEvent(bsdEvent *event, void *value)
+{
+   return bRC_OK;
+}
+
+
 #ifdef __cplusplus
 }
 #endif