static struct res_items fs_items[] = {
{"name", store_name, ITEM(res_fs.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_fs.hdr.desc), 0, 0, 0},
- {"include", store_inc, NULL, 0, 0, 0},
- {"finclude", store_finc, NULL, 0, ITEM_NO_EQUALS, 0},
- {"exclude", store_inc, NULL, 1, 0, 0},
- {"fexclude", store_finc, NULL, 1, ITEM_NO_EQUALS, 0},
+ {"include", store_inc, NULL, 0, ITEM_NO_EQUALS, 0},
+ {"exclude", store_inc, NULL, 1, ITEM_NO_EQUALS, 0},
{NULL, NULL, NULL, 0, 0, 0}
};
res->res_con.hdr.name, res->res_con.enable_ssl);
break;
case R_COUNTER:
- sendit(sock, "Counter: name=%s min=%d max=%d\n",
- res->res_counter.hdr.name, res->res_counter.MinValue,
- res->res_counter.MaxValue);
+ if (res->res_counter.WrapCounter) {
+ sendit(sock, "Counter: name=%s min=%d max=%d wrapcntr=%s\n",
+ res->res_counter.hdr.name, res->res_counter.MinValue,
+ res->res_counter.MaxValue, res->res_counter.WrapCounter->hdr.name);
+ } else {
+ sendit(sock, "Counter: name=%s min=%d max=%d\n",
+ res->res_counter.hdr.name, res->res_counter.MinValue,
+ res->res_counter.MaxValue);
+ }
if (res->res_counter.Catalog) {
sendit(sock, " --> ");
dump_resource(-R_CATALOG, (RES *)res->res_counter.Catalog, sendit, sock);
}
- if (res->res_counter.WrapCounter) {
- sendit(sock, " --> ");
- dump_resource(-R_COUNTER, (RES *)res->res_counter.WrapCounter, sendit, sock);
- }
break;
case R_CLIENT:
/*
- * Configuration file parser for Include, Exclude, Finclude
- * and FExclude records.
+ * Configuration file parser for new and old Include and
+ * Exclude records
*
* Kern Sibbald, March MMIII
*
/* Forward referenced subroutines */
void store_inc(LEX *lc, struct res_items *item, int index, int pass);
-void store_finc(LEX *lc, struct res_items *item, int index, int pass);
+static void store_newinc(LEX *lc, struct res_items *item, int index, int pass);
static void store_match(LEX *lc, struct res_items *item, int index, int pass);
static void store_opts(LEX *lc, struct res_items *item, int index, int pass);
static void store_fname(LEX *lc, struct res_items *item, int index, int pass);
extern URES res_all;
extern int res_all_size;
-/* We build the current Finclude Fexclude item here */
+/* We build the current new Include and Exclude items here */
static INCEXE res_incexe;
/*
- * FInclude/FExclude items
+ * new Include/Exclude items
* name handler value code flags default_value
*/
-static struct res_items finc_items[] = {
+static struct res_items newinc_items[] = {
{"compression", store_opts, NULL, 0, 0, 0},
{"signature", store_opts, NULL, 0, 0, 0},
{"verify", store_opts, NULL, 0, 0, 0},
#define INC_KW_PORTABLE 10
/* Include keywords -- these are keywords that can appear
- * in the options lists of an include ( Include = compression= ...)
+ * in the options lists of an old include ( Include = compression= ...)
*/
static struct s_kw FS_option_kw[] = {
{"compression", INC_KW_COMPRESSION},
/*
- * Scan for Include options (keyword=option) is converted into one or
+ * Scan for old Include options (keyword=option) is converted into one or
* two characters. Verifyopts=xxxx is Vxxxx:
*/
static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
char inc_opts[100];
int inc_opts_len;
+ /*
+ * Decide if we are doing a new Include or an old include. The
+ * new Include is followed immediately by {, whereas the
+ * old include has options following the Include.
+ */
+ token = lex_get_token(lc, T_ALL);
+ if (token == T_BOB) {
+ store_newinc(lc, item, index, pass);
+ return;
+ }
+ if (token != T_EQUALS) {
+ scan_err1(lc, _("Expecting an equals sign, got: %s\n"), lc->str);
+ }
lc->options |= LOPT_NO_IDENT; /* make spaces significant */
memset(&res_incexe, 0, sizeof(INCEXE));
/* Get include options */
inc_opts[0] = 0;
while ((token=lex_get_token(lc, T_ALL)) != T_BOB) {
+
keyword = INC_KW_NONE;
for (i=0; FS_option_kw[i].name; i++) {
if (strcasecmp(lc->str, FS_option_kw[i].name) == 0) {
break;
}
}
+
if (!inc_opts[0]) {
strcat(inc_opts, "0"); /* set no options */
}
* resource. We treat the Finclude/Fexeclude like a sort of
* mini-resource within the FileSet resource.
*/
-void store_finc(LEX *lc, struct res_items *item, int index, int pass)
+static void store_newinc(LEX *lc, struct res_items *item, int index, int pass)
{
int token, i;
INCEXE *incexe;
MD5Init(&res_all.res_fs.md5c);
res_all.res_fs.have_MD5 = TRUE;
}
- res_all.res_fs.finclude = TRUE;
- token = lex_get_token(lc, T_ALL);
- if (token != T_BOB) {
- scan_err1(lc, _("Expecting a beginning brace, got: %s\n"), lc->str);
- }
memset(&res_incexe, 0, sizeof(INCEXE));
+ res_all.res_fs.new_include = TRUE;
while ((token = lex_get_token(lc, T_ALL)) != T_EOF) {
if (token == T_EOL) {
continue;
if (token != T_IDENTIFIER) {
scan_err1(lc, _("Expecting keyword, got: %s\n"), lc->str);
}
- for (i=0; finc_items[i].name; i++) {
- if (strcasecmp(finc_items[i].name, lc->str) == 0) {
+ for (i=0; newinc_items[i].name; i++) {
+ if (strcasecmp(newinc_items[i].name, lc->str) == 0) {
token = lex_get_token(lc, T_ALL);
if (token != T_EQUALS) {
scan_err1(lc, "expected an equals, got: %s", lc->str);
}
/* Call item handler */
- finc_items[i].handler(lc, &finc_items[i], i, pass);
+ newinc_items[i].handler(lc, &newinc_items[i], i, pass);
i = -1;
break;
}