diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-09-02 19:42:58 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-09-02 19:42:58 +0400 |
commit | 2809ad4747b7e3a3795aec4e433d7754c7efc365 (patch) | |
tree | 924e32c2c66062b6b9b7e3525ada783b092aaea8 /cfg_file.l | |
parent | bacc29586271996154884ff8c531520385318a84 (diff) | |
download | rspamd-2809ad4747b7e3a3795aec4e433d7754c7efc365.tar.gz rspamd-2809ad4747b7e3a3795aec4e433d7754c7efc365.zip |
* Add ability to pass options to rspamd modules via flex start conditions
Diffstat (limited to 'cfg_file.l')
-rw-r--r-- | cfg_file.l | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cfg_file.l b/cfg_file.l index 760afc1ad..8cde589b5 100644 --- a/cfg_file.l +++ b/cfg_file.l @@ -1,4 +1,5 @@ %x incl +%x module %{ #include <stdio.h> @@ -98,6 +99,7 @@ parse_flag (const char *str) %% ^[ \t]*#.* /* ignore comments */; .include BEGIN(incl); +.module BEGIN(module); tempdir return TEMPDIR; pidfile return PIDFILE; workers return WORKERS; @@ -120,6 +122,7 @@ script_message return SCRIPT_MESSAGE; script_url return SCRIPT_URL; script_chain return SCRIPT_CHAIN; + \{ return OBRACE; \} return EBRACE; ; return SEMICOLON; @@ -177,6 +180,15 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG; } } +<module>\n /* ignore EOL */; +<module>[ \t]+ /* ignore whitespace */; +<module>\'[a-zA-Z0-9_-]\' yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; return MODULE_OPT; +<module>\{ return OBRACE; +<module>\} return EBRACE; +<module>\; return SEMICOLON; +<module>[a-zA-Z0-9_-] yylval.string=strdup(yytext); return PARAM; +<module>\"[^"]+\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; return QUOTEDSTRING; + %% /* * vi:ts=4 |