version 1.11, 2022/03/29 20:57:40 |
version 1.12, 2022/03/29 21:15:15 |
Line 33 static struct file { |
|
Line 33 static struct file { |
|
u_char *ungetbuf; |
u_char *ungetbuf; |
int eof_reached; |
int eof_reached; |
int lineno; |
int lineno; |
int errors; |
|
} *f; |
} *f; |
|
|
int lookup(char *); |
int lookup(char *); |
|
|
grammar : |
grammar : |
| grammar '\n' |
| grammar '\n' |
| grammar set '\n' |
| grammar set '\n' |
| grammar error '\n' { f->errors++; } |
| grammar error '\n' { errors++; } |
; |
; |
|
|
set : SET EXPIRE NUMBER { |
set : SET EXPIRE NUMBER { |
Line 111 yyerror(const char *fmt, ...) |
|
Line 110 yyerror(const char *fmt, ...) |
|
va_list ap; |
va_list ap; |
char *msg; |
char *msg; |
|
|
f->errors++; |
errors++; |
va_start(ap, fmt); |
va_start(ap, fmt); |
if (vasprintf(&msg, fmt, ap) == -1) |
if (vasprintf(&msg, fmt, ap) == -1) |
log_fatal("yyerror vasprintf"); |
log_fatal("yyerror vasprintf"); |
Line 198 lgetc(int quotec) |
|
Line 197 lgetc(int quotec) |
|
if ((c = igetc()) == EOF) { |
if ((c = igetc()) == EOF) { |
yyerror("reached end of file while parsing " |
yyerror("reached end of file while parsing " |
"quoted string"); |
"quoted string"); |
// if (file == top || config_pop() == EOF) |
|
if (config_pop() == EOF) |
if (config_pop() == EOF) |
return (EOF); |
return (EOF); |
return (quotec); |
return (quotec); |
Line 227 lgetc(int quotec) |
|
Line 225 lgetc(int quotec) |
|
return ('\n'); |
return ('\n'); |
} |
} |
while (c == EOF) { |
while (c == EOF) { |
//if (file == top || config_pop() == EOF) |
|
if (config_pop() == EOF) |
if (config_pop() == EOF) |
return (EOF); |
return (EOF); |
c = igetc(); |
c = igetc(); |
Line 444 config_load(struct blind *temp) |
|
Line 441 config_load(struct blind *temp) |
|
} |
} |
|
|
yyparse(); |
yyparse(); |
errors = f->errors; |
|
free(f); |
|
|
|
// setup |
// setup |
|
|
Line 503 config_pop(void) |
|
Line 498 config_pop(void) |
|
fclose(f->stream); |
fclose(f->stream); |
free(f->name); |
free(f->name); |
free(f->ungetbuf); |
free(f->ungetbuf); |
|
free(f); |
|
|
return (EOF); |
return (EOF); |
} |
} |