Software /
code /
prosody
Changeset
6411:6c8f6364bc48
util-src/*.c: Don't create globals when loaded
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 16 Sep 2014 21:56:18 +0200 |
parents | 6407:4bbd198cf3e6 |
children | 6412:0e94f89d0e62 |
files | util-src/encodings.c util-src/hashes.c util-src/net.c util-src/pposix.c util-src/signal.c util-src/windows.c |
diffstat | 6 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/util-src/encodings.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/encodings.c Tue Sep 16 21:56:18 2014 +0200 @@ -361,17 +361,12 @@ /***************** 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);
--- a/util-src/hashes.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/hashes.c Tue Sep 16 21:56:18 2014 +0200 @@ -203,7 +203,8 @@ LUALIB_API int luaopen_util_hashes(lua_State *L) { - luaL_register(L, "hashes", Reg); + lua_newtable(L); + luaL_register(L, NULL, Reg); lua_pushliteral(L, "version"); /** version */ lua_pushliteral(L, "-3.14"); lua_settable(L,-3);
--- a/util-src/net.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/net.c Tue Sep 16 21:56:18 2014 +0200 @@ -112,6 +112,7 @@ { NULL, NULL } }; - luaL_register(L, "net", exports); + lua_newtable(L); + luaL_register(L, NULL, exports); return 1; }
--- a/util-src/pposix.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/pposix.c Tue Sep 16 21:56:18 2014 +0200 @@ -768,7 +768,8 @@ { NULL, NULL } }; - luaL_register(L, "pposix", exports); + lua_newtable(L); + luaL_register(L, NULL, exports); lua_pushliteral(L, "pposix"); lua_setfield(L, -2, "_NAME");
--- a/util-src/signal.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/signal.c Tue Sep 16 21:56:18 2014 +0200 @@ -384,7 +384,8 @@ int i = 0; /* add the library */ - luaL_register(L, "signal", lsignal_lib); + lua_newtable(L); + luaL_register(L, NULL, lsignal_lib); /* push lua_signals table into the registry */ /* put the signals inside the library table too,
--- a/util-src/windows.c Thu Sep 11 00:55:51 2014 +0200 +++ b/util-src/windows.c Tue Sep 16 21:56:18 2014 +0200 @@ -81,7 +81,8 @@ }; LUALIB_API int luaopen_util_windows(lua_State *L) { - luaL_register(L, "windows", Reg); + lua_newtable(L); + luaL_register(L, NULL, Reg); lua_pushliteral(L, "version"); /** version */ lua_pushliteral(L, "-3.14"); lua_settable(L,-3);