From c5da512d2ef02b4ce434eff19fce2048232f74bf Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 18 Nov 2008 11:01:18 +0000 Subject: [PATCH] ebl Add debug hook git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8053 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/sd_plugins.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bacula/src/stored/sd_plugins.c b/bacula/src/stored/sd_plugins.c index 6c0d6dc571..ef0b8fde79 100644 --- a/bacula/src/stored/sd_plugins.c +++ b/bacula/src/stored/sd_plugins.c @@ -95,6 +95,21 @@ void generate_plugin_event(JCR *jcr, bEventType eventType, void *value) return; } +static void dump_sd_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) { @@ -103,6 +118,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_sd_plugin); } /* -- 2.39.5