From 274ba1aa0ec7104d5d2b701f09be2b3cfe10504f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 3 Jan 2008 16:32:57 +0000 Subject: [PATCH] Plugin update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6189 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/plugins/fd/example-plugin-fd.c | 11 ++++++++++- bacula/src/plugins/fd/main.c | 1 - bacula/src/plugins/fd/plugin-fd.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bacula/src/plugins/fd/example-plugin-fd.c b/bacula/src/plugins/fd/example-plugin-fd.c index fd5e6326c0..13315586f5 100644 --- a/bacula/src/plugins/fd/example-plugin-fd.c +++ b/bacula/src/plugins/fd/example-plugin-fd.c @@ -129,9 +129,18 @@ static bpError setPluginValue(bpContext *ctx, pVariable var, void *value) static bpError handlePluginEvent(bpContext *ctx, bEvent *event) { char *name; - printf("plugin: HandleEvent Event=%d\n", event->eventType); + switch (event->eventType) { + case bEventJobStart: + printf("plugin: HandleEvent JobStart\n"); + break; + case bEventJobEnd: + printf("plugin: HandleEvent JobEnd\n"); + break; + } bfuncs->getBaculaValue(ctx, bVarFDName, (void *)&name); printf("FD Name=%s\n", name); + bfuncs->JobMessage(ctx, __FILE__, __LINE__, 1, 0, "JobMesssage message"); + bfuncs->DebugMessage(ctx, __FILE__, __LINE__, 1, "DebugMesssage message"); return 0; } diff --git a/bacula/src/plugins/fd/main.c b/bacula/src/plugins/fd/main.c index 98c8ef7898..9c6710be6c 100644 --- a/bacula/src/plugins/fd/main.c +++ b/bacula/src/plugins/fd/main.c @@ -32,7 +32,6 @@ * Kern Sibbald, October 2007 */ #include "bacula.h" -#include #include "lib/plugin.h" #include "plugin-fd.h" diff --git a/bacula/src/plugins/fd/plugin-fd.h b/bacula/src/plugins/fd/plugin-fd.h index 21167c2eb3..80aea4ab78 100644 --- a/bacula/src/plugins/fd/plugin-fd.h +++ b/bacula/src/plugins/fd/plugin-fd.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2008 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. -- 2.39.5