diff options
author | Patrick McHardy <kaber@trash.net> | 2009-03-18 04:55:00 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-03-18 04:55:00 +0100 |
commit | fac10ea799fe9b6158d74f66d6ad46536d38a545 (patch) | |
tree | 8c093bcbb2144aab54c70103e6ed438456ae0d48 /include/parser.h |
Initial commitv0.01-alpha1
Diffstat (limited to 'include/parser.h')
-rw-r--r-- | include/parser.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/parser.h b/include/parser.h new file mode 100644 index 00000000..2a4c73b4 --- /dev/null +++ b/include/parser.h @@ -0,0 +1,36 @@ +#ifndef _PARSER_H +#define _PARSER_H + +#include <list.h> + +#define MAX_INCLUDE_DEPTH 16 +#define TABSIZE 8 + +#define YYLTYPE struct location +#define YYLTYPE_IS_TRIVIAL 0 +#define YYENABLE_NLS 0 + +struct parser_state { + struct input_descriptor *indesc; + struct input_descriptor indescs[MAX_INCLUDE_DEPTH]; + unsigned int indesc_idx; + + struct list_head *msgs; + struct list_head cmds; +}; + +extern void parser_init(struct parser_state *state, struct list_head *msgs); +extern int nft_parse(void *, struct parser_state *state); + +extern void *scanner_init(struct parser_state *state); +extern void scanner_destroy(struct parser_state *state); + +extern int scanner_read_file(void *scanner, const char *filename, + const struct location *loc); +extern int scanner_include_file(void *scanner, const char *filename, + const struct location *loc); +extern void scanner_push_buffer(void *scanner, + const struct input_descriptor *indesc, + const char *buffer); + +#endif /* _PARSER_H */ |