aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-03-27 00:29:35 +0100
committerKim Alvefur <zash@zash.se>2015-03-27 00:29:35 +0100
commit847f4204accf62ae15f623698c4842b08440a2cd (patch)
treead3ee8d4a9b63497d30feb2402030d74219a246b /util-src
parentf52319aeb3d82d34fdf8699084cdff3460d43c5c (diff)
parent77b653d31a2a47e92cae7ddfa18961bdc2b365e8 (diff)
downloadprosody-847f4204accf62ae15f623698c4842b08440a2cd.tar.gz
prosody-847f4204accf62ae15f623698c4842b08440a2cd.zip
Merge 0.10->trunk
Diffstat (limited to 'util-src')
-rw-r--r--util-src/encodings.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index 0841e29f..5fa9706b 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -452,40 +452,30 @@ static const luaL_Reg Reg_idna[] =
/***************** end *****************/
-static const luaL_Reg Reg[] =
-{
- { NULL, NULL }
-};
-
LUALIB_API int luaopen_util_encodings(lua_State *L)
{
#ifdef USE_STRINGPREP_ICU
init_icu();
#endif
- luaL_register(L, "encodings", Reg);
+ lua_newtable(L);
- lua_pushliteral(L, "base64");
lua_newtable(L);
luaL_register(L, NULL, Reg_base64);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "base64");
- lua_pushliteral(L, "stringprep");
lua_newtable(L);
luaL_register(L, NULL, Reg_stringprep);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "stringprep");
- lua_pushliteral(L, "idna");
lua_newtable(L);
luaL_register(L, NULL, Reg_idna);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "idna");
- lua_pushliteral(L, "utf8");
lua_newtable(L);
luaL_register(L, NULL, Reg_utf8);
- lua_settable(L, -3);
+ lua_setfield(L, -2, "utf8");
- lua_pushliteral(L, "version"); /** version */
lua_pushliteral(L, "-3.14");
- lua_settable(L,-3);
+ lua_setfield(L, -2, "version");
return 1;
}