From: Vsevolod Stakhov Date: Mon, 21 Jul 2014 18:51:04 +0000 (-0700) Subject: Adopt for the new lua ucl API. X-Git-Tag: 0.7.0~201 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=133ea7b1cae8acedf46af9a0ea0610431845fab1;p=rspamd.git Adopt for the new lua ucl API. --- diff --git a/src/lua/CMakeLists.txt b/src/lua/CMakeLists.txt index db9a2b6f6..fead8405c 100644 --- a/src/lua/CMakeLists.txt +++ b/src/lua/CMakeLists.txt @@ -28,6 +28,7 @@ ELSE(ENABLE_LUAJIT MATCHES "ON") TARGET_LINK_LIBRARIES(rspamd-lua "${LUA_LIBRARY}") ENDIF(ENABLE_LUAJIT MATCHES "ON") TARGET_LINK_LIBRARIES(rspamd-lua ${GLIB2_LIBRARIES}) +TARGET_LINK_LIBRARIES(rspamd-lua lua-ucl) IF(GMIME24) TARGET_LINK_LIBRARIES(rspamd-lua ${GMIME24_LIBRARIES}) ELSE(GMIME24) diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c index fb65f1d37..83ac4545c 100644 --- a/src/lua/lua_cfg_file.c +++ b/src/lua/lua_cfg_file.c @@ -138,7 +138,7 @@ lua_post_load_config (struct rspamd_config *cfg) /* Key must be a string and value must be a table */ name = luaL_checklstring (L, -2, &keylen); if (name != NULL && lua_istable (L, -1)) { - obj = lua_rcl_obj_get (L, -1); + obj = ucl_object_lua_import (L, lua_gettop (L)); if (obj != NULL) { ucl_object_insert_key_merged (cfg->rcl_obj, obj, name, keylen, true); } diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 0f047d3b1..8e57aae94 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -164,7 +164,7 @@ lua_config_get_module_opt (lua_State * L) if (mname && optname) { obj = rspamd_config_get_module_opt (cfg, mname, optname); if (obj) { - return lua_rcl_obj_push (L, obj, TRUE); + return ucl_object_push_lua (L, obj, TRUE); } } } @@ -199,7 +199,7 @@ lua_config_get_all_opt (lua_State * L) if (mname) { obj = ucl_obj_get_key (cfg->rcl_obj, mname); if (obj != NULL) { - return lua_rcl_obj_push (L, obj, TRUE); + return ucl_object_push_lua (L, obj, TRUE); } } } diff --git a/src/lua_worker.c b/src/lua_worker.c index 3bb3621e5..8aeeb94d1 100644 --- a/src/lua_worker.c +++ b/src/lua_worker.c @@ -203,7 +203,7 @@ lua_worker_get_option (lua_State *L) lua_pushnil (L); } else { - lua_rcl_obj_push (L, val, TRUE); + ucl_object_push_lua (L, val, TRUE); } } }