]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/parse_conf.h
Fix typo.
[bacula/bacula] / bacula / src / lib / parse_conf.h
index 8012beeca4e099318e06c8191c85534285900edf..efa79f3c2bede60211e3ee4569f46d5c3d4129f8 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 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.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
  *
  *     Kern Sibbald, January MM
  *
- *   Version $Id$
- *
  */
 
 struct RES_ITEM;                    /* Declare forward referenced structure */
+struct RES_ITEM2;                  /* Declare forward referenced structure */
 class RES;                         /* Declare forware referenced structure */
 typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass);
+typedef void (INC_RES_HANDLER)(LEX *lc, RES_ITEM2 *item, int index, int pass, bool exclude);
 
 
 
@@ -64,6 +64,27 @@ struct RES_ITEM {
    int32_t  default_value;            /* default value */
 };
 
+struct RES_ITEM2 {
+   const char *name;                  /* Resource name i.e. Director, ... */
+   INC_RES_HANDLER *handler;          /* Routine storing the resource item */
+   union {
+      char **value;                   /* Where to store the item */
+      char **charvalue;
+      uint32_t ui32value;
+      int32_t i32value;
+      uint64_t ui64value;
+      int64_t i64value;
+      bool boolvalue;
+      utime_t utimevalue;
+      RES *resvalue;
+      RES **presvalue;
+   };
+   int32_t  code;                     /* item code/additional info */
+   uint32_t  flags;                   /* flags: default, required, ... */
+   int32_t  default_value;            /* default value */
+};
+
+
 /* For storing name_addr items in res_items table */
 #define ITEM(x) {(char **)&res_all.x}
 
@@ -114,8 +135,22 @@ public:
    DEST *dest_chain;                  /* chain of destinations */
    char send_msg[nbytes_for_bits(M_MAX+1)];  /* bit array of types */
 
+private:
+   bool m_in_use;                     /* set when using to send a message */
+   bool m_closing;                    /* set when closing message resource */
+
+public:
    /* Methods */
    char *name() const;
+   void clear_in_use() { lock(); m_in_use=false; unlock(); }
+   void set_in_use() { wait_not_in_use(); m_in_use=true; unlock(); }
+   void set_closing() { m_closing=true; }
+   void clear_closing() { lock(); m_closing=false; unlock(); }
+   bool is_closing() { lock(); bool rtn=m_closing; unlock(); return rtn; }
+
+   void wait_not_in_use();            /* in message.c */
+   void lock();                       /* in message.c */
+   void unlock();                     /* in message.c */
 };
 
 inline char *MSGS::name() const { return hdr.name; }
@@ -207,7 +242,8 @@ void store_int64(LEX *lc, RES_ITEM *item, int index, int pass);
 void store_bit(LEX *lc, RES_ITEM *item, int index, int pass);
 void store_bool(LEX *lc, RES_ITEM *item, int index, int pass);
 void store_time(LEX *lc, RES_ITEM *item, int index, int pass);
-void store_size(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_size64(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_size32(LEX *lc, RES_ITEM *item, int index, int pass);
 void store_defs(LEX *lc, RES_ITEM *item, int index, int pass);
 void store_label(LEX *lc, RES_ITEM *item, int index, int pass);