struct nft_ctx {
const char *include_paths[INCLUDE_PATHS_MAX];
unsigned int num_include_paths;
+ unsigned int parser_max_errors;
struct output_ctx output;
bool check;
struct nft_cache cache;
};
-extern unsigned int max_errors;
extern unsigned int debug_level;
enum nftables_exit_codes {
#include <cli.h>
static struct nft_ctx nft;
-unsigned int max_errors = 10;
#ifdef DEBUG
unsigned int debug_level;
#endif
{
nft->include_paths[0] = DEFAULT_INCLUDE_PATH;
nft->num_include_paths = 1;
+ nft->parser_max_errors = 10;
}
int main(int argc, char * const *argv)
list_add_tail(&$2->list, &list);
if (cmd_evaluate(&state->ectx, $2) < 0) {
- if (++state->nerrs == max_errors)
+ if (++state->nerrs == nft->parser_max_errors)
YYABORT;
} else
list_splice_tail(&list, &state->cmds);
}
| error stmt_seperator
{
- if (++state->nerrs == max_errors)
+ if (++state->nerrs == nft->parser_max_errors)
YYABORT;
yyerrok;
}
list_add_tail(&$1->list, &list);
if (cmd_evaluate(&state->ectx, $1) < 0) {
- if (++state->nerrs == max_errors)
+ if (++state->nerrs == nft->parser_max_errors)
YYABORT;
} else
list_splice_tail(&list, &state->cmds);