summaryrefslogtreecommitdiff
path: root/conf/conf.h
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-09-11 16:55:41 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-09-11 17:35:13 +0200
commitd50b0bc437f5ffd0d2c9f843217f8ed098c8d675 (patch)
treeececf183d0de0293c59b4db8b2cdaeb48a71085f /conf/conf.h
parent89b0af3978caf15e1478922a8d9d4f7e38145a61 (diff)
Conf: Show the line:char position where the syntax error happens
Diffstat (limited to 'conf/conf.h')
-rw-r--r--conf/conf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/conf/conf.h b/conf/conf.h
index f174d352..5689fb67 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -47,6 +47,7 @@ struct config {
u32 watchdog_timeout; /* Watchdog timeout (in seconds, 0 = disabled) */
char *err_msg; /* Parser error message */
int err_lino; /* Line containing error */
+ int err_chno; /* Character where the parser stopped */
char *err_file_name; /* File name containing error */
char *file_name; /* Name of main configuration file */
int file_fd; /* File descriptor of main configuration file */
@@ -139,6 +140,8 @@ struct include_file_stack {
char *file_name; /* File name */
int fd; /* File descriptor */
int lino; /* Current line num */
+ int chno; /* Current char num (on current line) */
+ int toklen; /* Current token length */
int depth; /* Include depth, 0 = cannot include */
struct include_file_stack *prev; /* Previous record in stack */
@@ -147,7 +150,6 @@ struct include_file_stack {
extern struct include_file_stack *ifs;
-
int cf_lex(void);
void cf_lex_init(int is_cli, struct config *c);
void cf_lex_unwind(void);