extern struct cfg_kw_list cfg_keywords;
extern char *cursection;
extern int non_global_section_parsed;
+extern int cfg_curr_kwm;
extern struct proxy *curproxy;
extern struct proxy *last_defproxy;
char *cfg_scope = NULL; /* the current scope during the configuration parsing */
int non_global_section_parsed = 0;
+/* keyword modifier ("no" or "default") found in front of the keyword which is
+ * currently being parsed. It is reset for each new line, and is only meaningful
+ * during the config parsing. Section parsers receive it as an argument, but the
+ * keyword parsers registered in a cfg_kw_list don't, so those which support a
+ * modifier have to consult this variable.
+ */
+int cfg_curr_kwm = KWM_STD;
+
/* how to handle default paths */
static enum default_path_mode {
DEFAULT_PATH_CURRENT = 0, /* "current": paths are relative to CWD (this is the default) */
lshift_args(args);
}
+ /* also expose it to the keyword parsers, which don't receive it */
+ cfg_curr_kwm = kwm;
+
if (kwm != KWM_STD && strcmp(args[0], "option") != 0 &&
strcmp(args[0], "log") != 0 && strcmp(args[0], "busy-polling") != 0 &&
strcmp(args[0], "set-dumpable") != 0 && strcmp(args[0], "strict-limits") != 0 &&
}
ha_free(&global.cfg_curr_section);
+ cfg_curr_kwm = KWM_STD;
/* call post_section_parser of the last section when there is no more lines */
if (cs) {