]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/runscript.h
Add the updated version of the the win32 pathname fix.
[bacula/bacula] / bacula / src / lib / runscript.h
index 3d4360850568af3fc9ac0ee3a08cf439dca09a5b..f6b2ed99a3d520ef894d9d77dde2c0d6bd3fa73c 100644 (file)
@@ -4,7 +4,7 @@
  * Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
+   Copyright (C) 2006-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
 #ifndef __RUNSCRIPT_H_
 #define __RUNSCRIPT_H_ 1
 
-#if defined(FILE_DAEMON) || defined(DIRECTOR_DAEMON)
-# define USE_RUNSCRIPT
-#endif
-
-#ifdef USE_RUNSCRIPT
-
 /* Usage:
  *
  * #define USE_RUNSCRIPT
  */
 
 /* 
- * RUNSCRIPT->when can take following value : 
+ * RUNSCRIPT->when can take following bit values:
  */
 enum {
    SCRIPT_Never  = 0,
-   SCRIPT_After  = 1,          /* AfterJob */
-   SCRIPT_Before = 2,          /* BeforeJob */
-   SCRIPT_Any    = 3                   /* Before and After */
+   SCRIPT_After  = (1<<0),      /* AfterJob */
+   SCRIPT_Before = (1<<1),      /* BeforeJob */
+   SCRIPT_Any    = SCRIPT_Before | SCRIPT_After
 };
 
 /*
@@ -57,10 +51,10 @@ enum {
  */
 class RUNSCRIPT {
 public:
-   POOLMEM *command;           /* command string */
-   POOLMEM *target;            /* host target */
-   char level;                 /* Base|Full|Incr...|All (NYI) */
-   bool on_success;            /* executre command on job success (After) */
+   POOLMEM *command;            /* command string */
+   POOLMEM *target;             /* host target */
+   char level;                  /* Base|Full|Incr...|All (NYI) */
+   bool on_success;             /* executre command on job success (After) */
    bool on_failure;             /* executre command on job failure (After) */
    bool abort_on_error;         /* abort job on error (Before) */
    int  when;                   /* SCRIPT_Before|Script_After BEFORE/AFTER JOB*/
@@ -70,7 +64,7 @@ public:
    void set_command(const POOLMEM *cmd);
    void set_target(const POOLMEM *client_name);
    void reset_default(bool free_string = false);
-   bool is_local();            /* true if running on local host */
+   bool is_local();             /* true if running on local host */
    void debug();
 };
 
@@ -89,6 +83,4 @@ void free_runscript(RUNSCRIPT *script);
 /* foreach_alist free RUNSCRIPT */
 void free_runscripts(alist *runscripts); /* you have to free alist */
 
-#endif /* USE_RUNSCRIPT */
-
 #endif /* __RUNSCRIPT_H_ */