From: Vsevolod Stakhov Date: Tue, 10 May 2016 13:37:55 +0000 (+0100) Subject: [Feature] Allow to extract ucl_object from lua using common API X-Git-Tag: 1.3.0~501 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf2d3dfa4338b06a853fec3c45bddfc819127918;p=thirdparty%2Frspamd.git [Feature] Allow to extract ucl_object from lua using common API --- diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 63aab5830c..768b65bfce 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -673,6 +673,20 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos, return FALSE; } + if (is_table) { + lua_pop (L, 1); + } + break; + case 'u': + if (t != LUA_TNONE) { + *(va_arg (ap, ucl_object_t **)) = ucl_object_lua_import (L, + idx); + } + else { + failed = TRUE; + *(va_arg (ap, ucl_object_t **)) = NULL; + } + if (is_table) { lua_pop (L, 1); }