aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_file.l
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-30 17:57:59 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-30 17:57:59 +0400
commitdd2fbb7a5b7e1c0d844900147486ad7ffd98c1e4 (patch)
treeab8bfcf6c21bd8a47f49b9f9331378e6454e90cf /src/cfg_file.l
parentc72912310c575a5ba7e7e50a5fdd425f3a4e4dbc (diff)
downloadrspamd-dd2fbb7a5b7e1c0d844900147486ad7ffd98c1e4.tar.gz
rspamd-dd2fbb7a5b7e1c0d844900147486ad7ffd98c1e4.zip
* Add message handling functions to lua API
* Add ability to add lua code in config with .lua and .endlua * Add consolidation functions support that are written in perl or lua
Diffstat (limited to 'src/cfg_file.l')
-rw-r--r--src/cfg_file.l10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cfg_file.l b/src/cfg_file.l
index be1e780f3..3224b4fde 100644
--- a/src/cfg_file.l
+++ b/src/cfg_file.l
@@ -1,5 +1,6 @@
%x incl
%x module
+%x lua
%{
@@ -7,6 +8,11 @@
#include "config.h"
#include "cfg_file.h"
#include "cfg_yacc.h"
+#ifdef WITH_LUA
+#include "lua.h"
+#else
+#define add_luabuf(x) yyerror ("lua support diabled"); YYERROR
+#endif
#define MAX_INCLUDE_DEPTH 10
YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
@@ -23,6 +29,7 @@ extern struct config_file *cfg;
[ \t]*#.* /* ignore comments */;
.include BEGIN(incl);
.module BEGIN(module);
+.lua BEGIN(lua);
composites return COMPOSITES;
tempdir return TEMPDIR;
pidfile return PIDFILE;
@@ -150,6 +157,9 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG;
<module>\$[a-zA-Z_][a-zA-Z0-9_]+ yylval.string=strdup(yytext + 1); return VARIABLE;
<module>\".+[^\\]\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; unescape_quotes(yylval.string); return QUOTEDSTRING;
+<lua>^.endlua$ BEGIN(INITIAL);
+<lua>.* add_luabuf(yytext);
+
%%
/*
* vi:ts=4