]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/parse_conf.h
Strip pathname portion off all message routines that print filename:line.
[bacula/bacula] / bacula / src / lib / parse_conf.h
index 4943f6abe66c195fe025f341687b4376f4b54008..181d55343d0a0adc51cb65fdc252c15338507aaf 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 struct RES_ITEM;                    /* Declare forward referenced structure */
+struct RES;                         /* Declare forware referenced structure */
 typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass);
 
 /* This is the structure that defines
@@ -27,14 +28,25 @@ typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass);
 struct RES_ITEM {
    const char *name;                  /* Resource name i.e. Director, ... */
    MSG_RES_HANDLER *handler;          /* Routine storing the resource item */
-   char **value;                      /* Where to store the 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;
+   };
    int  code;                         /* item code/additional info */
    int  flags;                        /* flags: default, required, ... */
    int  default_value;                /* default value */
 };
 
 /* For storing name_addr items in res_items table */
-#define ITEM(x) ((char **)&res_all.x)
+#define ITEM(x) {(char **)&res_all.x}
 
 #define MAX_RES_ITEMS 70              /* maximum resource items per RES */
 
@@ -91,7 +103,7 @@ union CURES {
 
 
 /* Configuration routines */
-int   parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error = NULL);
+int   parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error = NULL, int err_type=M_ERROR_TERM);
 void    free_config_resources(void);
 RES   **save_config_resources(void);
 RES   **new_res_head();
@@ -109,7 +121,7 @@ void save_resource(int type, RES_ITEM *item, int pass);
 const char *res_to_str(int rcode);
 
 /* Loop through each resource of type, returning in var */
-#ifdef HAVE_GCC
+#ifdef HAVE_TYPEOF
 #define foreach_res(var, type) \
         for((var)=NULL; ((var)=(typeof(var))GetNextRes((type), (RES *)var));)
 #else