]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/inc_conf.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / inc_conf.c
index 3e9e3d5f744db7305eec8317ae14e3c8b37332fe..b4c26c3f8bf4ff58759e554351a21a28da211574 100644 (file)
@@ -60,7 +60,6 @@ static INCEXE res_incexe;
  */
 static RES_ITEM newinc_items[] = {
    {"file",            store_fname,   NULL,     0, 0, 0},
-   {"include",         store_fname,   NULL,     0, 0, 0},
    {"options",         options_res,   NULL,     0, 0, 0},
    {NULL, NULL, NULL, 0, 0, 0} 
 };
@@ -78,30 +77,39 @@ static RES_ITEM options_items[] = {
    {"readfifo",        store_opts,    NULL,     0, 0, 0},
    {"replace",         store_opts,    NULL,     0, 0, 0},
    {"portable",        store_opts,    NULL,     0, 0, 0},
+   {"mtimeonly",       store_opts,    NULL,     0, 0, 0},
+   {"keepatime",       store_opts,    NULL,     0, 0, 0},
    {"regex",           store_regex,   NULL,     0, 0, 0},
    {"base",            store_base,    NULL,     0, 0, 0},
    {"wild",            store_wild,    NULL,     0, 0, 0},
+   {"exclude",         store_opts,    NULL,     0, 0, 0},
+   {"aclsupport",      store_opts,    NULL,     0, 0, 0},
    {NULL, NULL, NULL, 0, 0, 0} 
 };
 
 
 /* Define FileSet KeyWord values */
 
-#define INC_KW_NONE        0
-#define INC_KW_COMPRESSION  1
-#define INC_KW_SIGNATURE    2
-#define INC_KW_ENCRYPTION   3
-#define INC_KW_VERIFY      4
-#define INC_KW_ONEFS       5
-#define INC_KW_RECURSE     6
-#define INC_KW_SPARSE      7
-#define INC_KW_REPLACE     8         /* restore options */
-#define INC_KW_READFIFO     9        /* Causes fifo data to be read */
-#define INC_KW_PORTABLE    10
-#define INC_KW_MTIMEONLY   11
-#define INC_KW_KEEPATIME   12
-
-/* Include keywords -- these are keywords that can appear
+enum {
+   INC_KW_NONE,
+   INC_KW_COMPRESSION,
+   INC_KW_SIGNATURE,
+   INC_KW_ENCRYPTION,
+   INC_KW_VERIFY,
+   INC_KW_ONEFS,
+   INC_KW_RECURSE,
+   INC_KW_SPARSE,
+   INC_KW_REPLACE,              /* restore options */
+   INC_KW_READFIFO,             /* Causes fifo data to be read */
+   INC_KW_PORTABLE,
+   INC_KW_MTIMEONLY,
+   INC_KW_KEEPATIME,
+   INC_KW_EXCLUDE,
+   INC_KW_ACL
+};
+
+/*
+ * Include keywords -- these are keywords that can appear
  *    in the options lists of an old include ( Include = compression= ...)
  */
 static struct s_kw FS_option_kw[] = {
@@ -117,15 +125,17 @@ static struct s_kw FS_option_kw[] = {
    {"portable",    INC_KW_PORTABLE},
    {"mtimeonly",   INC_KW_MTIMEONLY},
    {"keepatime",   INC_KW_KEEPATIME},
+   {"exclude",     INC_KW_EXCLUDE},
+   {"aclsupport",  INC_KW_ACL},
    {NULL,         0}
 };
 
 /* Options for FileSet keywords */
 
 struct s_fs_opt {
-   char *name;
+   const char *name;
    int keyword;
-   char *option;
+   const char *option;
 };
 
 /*
@@ -166,6 +176,10 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_MTIMEONLY,     "0"},
    {"yes",      INC_KW_KEEPATIME,     "k"},
    {"no",       INC_KW_KEEPATIME,     "0"},
+   {"yes",      INC_KW_EXCLUDE,       "e"},
+   {"no",       INC_KW_EXCLUDE,       "0"},
+   {"yes",           INC_KW_ACL,        "A"},
+   {"no",           INC_KW_ACL,         "0"},
    {NULL,      0,                   0}
 };
 
@@ -190,7 +204,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
       bstrncat(opts, "V", optlen);         /* indicate Verify */
       bstrncat(opts, lc->str, optlen);
       bstrncat(opts, ":", optlen);         /* terminate it */
-      Dmsg3(100, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
+      Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
 
    /*
     * Standard keyword options for Include/Exclude 
@@ -209,7 +223,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
          scan_err1(lc, "Expected a FileSet option keyword, got:%s:", lc->str);
       } else { /* add option */
         bstrncat(opts, option, optlen);
-         Dmsg3(100, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
+         Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
       }
    }
 
@@ -233,7 +247,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
 
    /*
     * Decide if we are doing a new Include or an old include. The
-    *  new Include is followed immediately by {, whereas the
+    *  new Include is followed immediately by open brace, whereas the
     *  old include has options following the Include.
     */
    token = lex_get_token(lc, T_ALL);           
@@ -286,10 +300,10 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
       }
       setup_current_opts();
       bstrncpy(res_incexe.current_opts->opts, inc_opts, MAX_FOPTS);
-      Dmsg2(100, "old pass=%d incexe opts=%s\n", pass, res_incexe.current_opts->opts);
+      Dmsg2(900, "old pass=%d incexe opts=%s\n", pass, res_incexe.current_opts->opts);
 
       /* Create incexe structure */
-      Dmsg0(200, "Create INCEXE structure\n");
+      Dmsg0(900, "Create INCEXE structure\n");
       incexe = (INCEXE *)malloc(sizeof(INCEXE));
       memcpy(incexe, &res_incexe, sizeof(INCEXE));
       memset(&res_incexe, 0, sizeof(INCEXE));
@@ -301,7 +315,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
                           sizeof(INCEXE *) * (res_all.res_fs.num_includes + 1));
          }
          res_all.res_fs.include_items[res_all.res_fs.num_includes++] = incexe;
-          Dmsg1(200, "num_includes=%d\n", res_all.res_fs.num_includes);
+          Dmsg1(900, "num_includes=%d\n", res_all.res_fs.num_includes);
       } else {   /* exclude */
         if (res_all.res_fs.num_excludes == 0) {
            res_all.res_fs.exclude_items = (INCEXE **)malloc(sizeof(INCEXE *));
@@ -310,7 +324,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
                           sizeof(INCEXE *) * (res_all.res_fs.num_excludes + 1));
          }
          res_all.res_fs.exclude_items[res_all.res_fs.num_excludes++] = incexe;
-          Dmsg1(200, "num_excludes=%d\n", res_all.res_fs.num_excludes);
+          Dmsg1(900, "num_excludes=%d\n", res_all.res_fs.num_excludes);
       }
 
       /* Pickup include/exclude names. They are stored in INCEXE
@@ -332,7 +346,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
               incexe->name_list.init(10, true);
            }
            incexe->name_list.append(bstrdup(lc->str));
-            Dmsg1(200, "Add to name_list %s\n", lc->str);
+            Dmsg1(900, "Add to name_list %s\n", lc->str);
            break;
         default:
             scan_err1(lc, "Expected a filename, got: %s", lc->str);
@@ -352,7 +366,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
 /*
  * Store FileSet FInclude/FExclude info   
  *  Note, when this routine is called, we are inside a FileSet
- *  resource.  We treat the Finclude/Fexeclude like a sort of
+ *  resource.  We treat the Include/Execlude like a sort of
  *  mini-resource within the FileSet resource.
  */
 static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
@@ -366,7 +380,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
       res_all.res_fs.have_MD5 = TRUE;
    }
    memset(&res_incexe, 0, sizeof(INCEXE));
-   res_all.res_fs.new_include = TRUE;
+   res_all.res_fs.new_include = true;
    while ((token = lex_get_token(lc, T_ALL)) != T_EOF) {
       if (token == T_EOL) {
         continue;
@@ -408,7 +422,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
                           sizeof(INCEXE *) * (res_all.res_fs.num_includes + 1));
         }
         res_all.res_fs.include_items[res_all.res_fs.num_includes++] = incexe;
-         Dmsg1(200, "num_includes=%d\n", res_all.res_fs.num_includes);
+         Dmsg1(900, "num_includes=%d\n", res_all.res_fs.num_includes);
       } else {   /* exclude */
         if (res_all.res_fs.num_excludes == 0) {
            res_all.res_fs.exclude_items = (INCEXE **)malloc(sizeof(INCEXE *));
@@ -417,7 +431,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
                           sizeof(INCEXE *) * (res_all.res_fs.num_excludes + 1));
         }
         res_all.res_fs.exclude_items[res_all.res_fs.num_excludes++] = incexe;
-         Dmsg1(200, "num_excludes=%d\n", res_all.res_fs.num_excludes);
+         Dmsg1(900, "num_excludes=%d\n", res_all.res_fs.num_excludes);
       }
    }
    scan_to_eol(lc);
@@ -439,7 +453,7 @@ static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass)
       case T_UNQUOTED_STRING:
       case T_QUOTED_STRING:
         res_incexe.current_opts->regex.append(bstrdup(lc->str));
-         Dmsg3(200, "set regex %p size=%d %s\n", 
+         Dmsg3(900, "set regex %p size=%d %s\n", 
            res_incexe.current_opts, res_incexe.current_opts->regex.size(),lc->str);
         break;
       default:
@@ -484,7 +498,7 @@ static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass)
       case T_UNQUOTED_STRING:
       case T_QUOTED_STRING:
         res_incexe.current_opts->wild.append(bstrdup(lc->str));
-         Dmsg3(200, "set wild %p size=%d %s\n", 
+         Dmsg3(900, "set wild %p size=%d %s\n", 
            res_incexe.current_opts, res_incexe.current_opts->wild.size(),lc->str);
         break;
       default:
@@ -523,7 +537,7 @@ static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass)
               incexe->name_list.init(10, true);
            }
            incexe->name_list.append(bstrdup(lc->str));
-            Dmsg1(200, "Add to name_list %s\n", lc->str);
+            Dmsg1(900, "Add to name_list %s\n", lc->str);
            break;
         default:
             scan_err1(lc, _("Expected a filename, got: %s"), lc->str);
@@ -605,7 +619,7 @@ static void store_opts(LEX *lc, RES_ITEM *item, int index, int pass)
    scan_include_options(lc, keyword, inc_opts, sizeof(inc_opts));
    if (pass == 1) {
       bstrncat(res_incexe.current_opts->opts, inc_opts, MAX_FOPTS);
-      Dmsg2(100, "new pass=%d incexe opts=%s\n", pass, res_incexe.current_opts->opts);
+      Dmsg2(900, "new pass=%d incexe opts=%s\n", pass, res_incexe.current_opts->opts);
    }
    scan_to_eol(lc);
 }