]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl add debug dump for plugins in director
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 12 Nov 2008 13:50:00 +0000 (13:50 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 12 Nov 2008 13:50:00 +0000 (13:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8040 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dir_plugins.c
bacula/src/dird/dird.h

index 3c5243656fc338c495499de7f05193cf45f30097..b2487543da872f460a64cd23e05ecb4dc7bdc5d8 100644 (file)
@@ -94,6 +94,21 @@ void generate_plugin_event(JCR *jcr, bEventType eventType, void *value)
    return;
 }
 
+static void dump_dir_plugin(Plugin *plugin, FILE *fp)
+{
+   if (!plugin) {
+      return ;
+   }
+   pInfo *info = (pInfo *) plugin->pinfo;
+   fprintf(fp, "\tversion=%d\n", info->version);
+   fprintf(fp, "\tdate=%s\n", NPRTB(info->plugin_date));
+   fprintf(fp, "\tmagic=%s\n", NPRTB(info->plugin_magic));
+   fprintf(fp, "\tauthor=%s\n", NPRTB(info->plugin_author));
+   fprintf(fp, "\tlicence=%s\n", NPRTB(info->plugin_license));
+   fprintf(fp, "\tversion=%s\n", NPRTB(info->plugin_version));
+   fprintf(fp, "\tdescription=%s\n", NPRTB(info->plugin_description));
+}
+
 void load_dir_plugins(const char *plugin_dir)
 {
    if (!plugin_dir) {
@@ -102,6 +117,7 @@ void load_dir_plugins(const char *plugin_dir)
 
    plugin_list = New(alist(10, not_owned_by_alist));
    load_plugins((void *)&binfo, (void *)&bfuncs, plugin_dir, plugin_type);
+   dbg_plugin_add_hook(dump_dir_plugin);
 }
 
 /*
@@ -156,7 +172,6 @@ void free_plugins(JCR *jcr)
    jcr->plugin_ctx_list = NULL;
 }
 
-
 /* ==============================================================
  *
  * Callbacks from the plugin
index 71083412e96c86dd8b70a739915d1da5f62ae8f3..f6ba3692eca59bc8d86381a8556f39bd251bceef 100644 (file)
 #include "lib/runscript.h"
 #include "lib/breg.h"
 #include "dird_conf.h"
-#include "dir_plugins.h"
 
 #define DIRECTOR_DAEMON 1
 
+#include "dir_plugins.h"
 #include "cats/cats.h"
 
 #include "jcr.h"