浏览代码

[Fix] Link lpeg to rspamd lua library

tags/1.3.0
Vsevolod Stakhov 8 年前
父节点
当前提交
565c37fca0
共有 4 个文件被更改,包括 7 次插入6 次删除
  1. 1
    0
      CMakeLists.txt
  2. 1
    3
      contrib/lpeg/lptree.c
  3. 3
    3
      contrib/lpeg/lptree.h
  4. 2
    0
      src/lua/lua_common.c

+ 1
- 0
CMakeLists.txt 查看文件

@@ -486,6 +486,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/contrib/librdns"
"${CMAKE_SOURCE_DIR}/contrib/aho-corasick"
"${CMAKE_SOURCE_DIR}/contrib/lc-btrie"
"${CMAKE_SOURCE_DIR}/contrib/lpeg"
"${CMAKE_BINARY_DIR}/src" #Stored in the binary dir
"${CMAKE_BINARY_DIR}/src/libcryptobox")


+ 1
- 3
contrib/lpeg/lptree.c 查看文件

@@ -21,7 +21,7 @@
/* number of siblings for each tree */
const byte numsiblings[] = {
0, 0, 0, /* char, set, any */
0, 0, /* true, false */
0, 0, /* true, false */
1, /* rep */
2, 2, /* seq, choice */
1, 1, /* not, and */
@@ -1280,8 +1280,6 @@ static struct luaL_Reg metareg[] = {
{NULL, NULL}
};


int luaopen_lpeg (lua_State *L);
int luaopen_lpeg (lua_State *L) {
luaL_newmetatable(L, PATTERN_T);
lua_pushnumber(L, MAXBACK); /* initialize maximum backtracking */

+ 3
- 3
contrib/lpeg/lptree.h 查看文件

@@ -1,4 +1,4 @@
/*
/*
** $Id: lptree.h,v 1.2 2013/03/24 13:51:12 roberto Exp $
*/

@@ -6,7 +6,7 @@
#define lptree_h


#include "lptypes.h"
#include "lptypes.h"


/*
@@ -69,7 +69,7 @@ extern const byte numsiblings[];
#define sib2(t) ((t) + (t)->u.ps)


int luaopen_lpeg (lua_State *L);




+ 2
- 0
src/lua/lua_common.c 查看文件

@@ -15,6 +15,7 @@
*/
#include "lua_common.h"
#include "lua/global_functions.lua.h"
#include "lptree.h"

/* Lua module init function */
#define MODULE_INIT_FUNC "module_init"
@@ -242,6 +243,7 @@ rspamd_lua_init ()
luaopen_fann (L);
luaopen_sqlite3 (L);
luaopen_cryptobox (L);
luaopen_lpeg (L);

rspamd_lua_add_preload (L, "ucl", luaopen_ucl);


正在加载...
取消
保存