]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/inc_conf.c
- Tweak catalog make scripts.
[bacula/bacula] / bacula / src / dird / inc_conf.c
index a15757711985d1a4b444cd5662ea50ae74ec001e..3b5e0d8d52d6dda23eb358734b78e47c75a3c381 100644 (file)
@@ -23,7 +23,9 @@
 
 #include "bacula.h"
 #include "dird.h"
-#ifdef HAVE_REGEX_H
+#ifndef HAVE_REGEX_H
+#include "lib/regex.h"
+#else
 #include <regex.h>
 #endif
 
@@ -49,7 +51,13 @@ static void setup_current_opts(void);
  * then move it to allocated memory when the resource
  * scan is complete.
  */
+#if defined(_MSC_VER)
+extern "C" { // work around visual compiler mangling variables
+    extern URES res_all;
+}
+#else
 extern URES res_all;
+#endif
 extern int  res_all_size;
 
 /* We build the current new Include and Exclude items here */
@@ -60,42 +68,43 @@ static INCEXE res_incexe;
  *   name             handler     value    code flags default_value
  */
 static RES_ITEM newinc_items[] = {
-   {"file",            store_fname,   NULL,     0, 0, 0},
-   {"options",         options_res,   NULL,     0, 0, 0},
-   {NULL, NULL, NULL, 0, 0, 0}
+   {"file",            store_fname,   {0},      0, 0, 0},
+   {"options",         options_res,   {0},      0, 0, 0},
+   {NULL, NULL, {0}, 0, 0, 0}
 };
 
 /*
  * Items that are valid in an Options resource
  */
 static RES_ITEM options_items[] = {
-   {"compression",     store_opts,    NULL,     0, 0, 0},
-   {"signature",       store_opts,    NULL,     0, 0, 0},
-   {"verify",          store_opts,    NULL,     0, 0, 0},
-   {"onefs",           store_opts,    NULL,     0, 0, 0},
-   {"recurse",         store_opts,    NULL,     0, 0, 0},
-   {"sparse",          store_opts,    NULL,     0, 0, 0},
-   {"hardlinks",       store_opts,    NULL,     0, 0, 0},
-   {"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},
-   {"regexdir",        store_regex,   NULL,     1, 0, 0},
-   {"regexfile",       store_regex,   NULL,     2, 0, 0},
-   {"base",            store_base,    NULL,     0, 0, 0},
-   {"wild",            store_wild,    NULL,     0, 0, 0},
-   {"wilddir",         store_wild,    NULL,     1, 0, 0},
-   {"wildfile",        store_wild,    NULL,     2, 0, 0},
-   {"exclude",         store_opts,    NULL,     0, 0, 0},
-   {"aclsupport",      store_opts,    NULL,     0, 0, 0},
-   {"reader",          store_reader,  NULL,     0, 0, 0},
-   {"writer",          store_writer,  NULL,     0, 0, 0},
-   {"ignorecase",      store_opts,    NULL,     0, 0, 0},
-   {"fstype",          store_fstype,  NULL,     0, 0, 0},
-   {"hfsplussupport",  store_opts,    NULL,     0, 0, 0},
-   {NULL, NULL, NULL, 0, 0, 0}
+   {"compression",     store_opts,    {0},     0, 0, 0},
+   {"signature",       store_opts,    {0},     0, 0, 0},
+   {"verify",          store_opts,    {0},     0, 0, 0},
+   {"onefs",           store_opts,    {0},     0, 0, 0},
+   {"recurse",         store_opts,    {0},     0, 0, 0},
+   {"sparse",          store_opts,    {0},     0, 0, 0},
+   {"hardlinks",       store_opts,    {0},     0, 0, 0},
+   {"readfifo",        store_opts,    {0},     0, 0, 0},
+   {"replace",         store_opts,    {0},     0, 0, 0},
+   {"portable",        store_opts,    {0},     0, 0, 0},
+   {"mtimeonly",       store_opts,    {0},     0, 0, 0},
+   {"keepatime",       store_opts,    {0},     0, 0, 0},
+   {"regex",           store_regex,   {0},     0, 0, 0},
+   {"regexdir",        store_regex,   {0},     1, 0, 0},
+   {"regexfile",       store_regex,   {0},     2, 0, 0},
+   {"base",            store_base,    {0},     0, 0, 0},
+   {"wild",            store_wild,    {0},     0, 0, 0},
+   {"wilddir",         store_wild,    {0},     1, 0, 0},
+   {"wildfile",        store_wild,    {0},     2, 0, 0},
+   {"exclude",         store_opts,    {0},     0, 0, 0},
+   {"aclsupport",      store_opts,    {0},     0, 0, 0},
+   {"reader",          store_reader,  {0},     0, 0, 0},
+   {"writer",          store_writer,  {0},     0, 0, 0},
+   {"ignorecase",      store_opts,    {0},     0, 0, 0},
+   {"fstype",          store_fstype,  {0},     0, 0, 0},
+   {"hfsplussupport",  store_opts,    {0},     0, 0, 0},
+   {"noatime",         store_opts,    {0},     0, 0, 0},
+   {NULL, NULL, {0}, 0, 0, 0}
 };
 
 
@@ -118,7 +127,8 @@ enum {
    INC_KW_EXCLUDE,
    INC_KW_ACL,
    INC_KW_IGNORECASE,
-   INC_KW_HFSPLUS
+   INC_KW_HFSPLUS,
+   INC_KW_NOATIME
 };
 
 /*
@@ -145,6 +155,7 @@ static struct s_kw FS_option_kw[] = {
    {"aclsupport",  INC_KW_ACL},
    {"ignorecase",  INC_KW_IGNORECASE},
    {"hfsplussupport", INC_KW_HFSPLUS},
+   {"noatime",     INC_KW_NOATIME},
    {NULL,          0}
 };
 
@@ -206,6 +217,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_IGNORECASE,    "0"},
    {"yes",      INC_KW_HFSPLUS,       "R"},   /* "R" for resource fork */
    {"no",       INC_KW_HFSPLUS,       "0"},
+   {"yes",      INC_KW_NOATIME,       "K"},
+   {"no",       INC_KW_NOATIME,       "0"},
    {NULL,       0,                      0}
 };
 
@@ -239,7 +252,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
     */
    } else {
       for (i=0; FS_options[i].name; i++) {
-         if (strcasecmp(lc->str, FS_options[i].name) == 0 && FS_options[i].keyword == keyword) {
+         if (FS_options[i].keyword == keyword && strcasecmp(lc->str, FS_options[i].name) == 0) {
             /* NOTE! maximum 2 letters here or increase option[3] */
             option[0] = FS_options[i].option[0];
             option[1] = FS_options[i].option[1];