projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
300378b
)
util-src/*.c: Don't create globals when loaded
author
Kim Alvefur
<zash@zash.se>
Tue, 16 Sep 2014 19:56:18 +0000
(21:56 +0200)
committer
Kim Alvefur
<zash@zash.se>
Tue, 16 Sep 2014 19:56:18 +0000
(21:56 +0200)
util-src/encodings.c
patch
|
blob
|
history
util-src/hashes.c
patch
|
blob
|
history
util-src/net.c
patch
|
blob
|
history
util-src/pposix.c
patch
|
blob
|
history
util-src/signal.c
patch
|
blob
|
history
util-src/windows.c
patch
|
blob
|
history
diff --git
a/util-src/encodings.c
b/util-src/encodings.c
index b9b6160a03809c2eb7b1c04a2622f0a90814592b..3a0749494e68d8e94287625cd7d3396c023694cc 100644
(file)
--- a/
util-src/encodings.c
+++ b/
util-src/encodings.c
@@
-361,17
+361,12
@@
static const luaL_Reg Reg_idna[] =
/***************** end *****************/
/***************** end *****************/
-static const luaL_Reg Reg[] =
-{
- { NULL, NULL }
-};
-
LUALIB_API int luaopen_util_encodings(lua_State *L)
{
#ifdef USE_STRINGPREP_ICU
init_icu();
#endif
LUALIB_API int luaopen_util_encodings(lua_State *L)
{
#ifdef USE_STRINGPREP_ICU
init_icu();
#endif
- lua
L_register(L, "encodings", Reg
);
+ lua
_newtable(L
);
lua_pushliteral(L, "base64");
lua_newtable(L);
lua_pushliteral(L, "base64");
lua_newtable(L);
diff --git
a/util-src/hashes.c
b/util-src/hashes.c
index 33041e83bdb8929f3673d860a408a3e89b22c064..7ca00867d7f6c81b1417587703c5032644e64691 100644
(file)
--- a/
util-src/hashes.c
+++ b/
util-src/hashes.c
@@
-203,7
+203,8
@@
static const luaL_Reg Reg[] =
LUALIB_API int luaopen_util_hashes(lua_State *L)
{
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);
lua_pushliteral(L, "version"); /** version */
lua_pushliteral(L, "-3.14");
lua_settable(L,-3);
diff --git
a/util-src/net.c
b/util-src/net.c
index e307c628146351873175d0dd92eb25d66188f73d..84d7e84ec9e2956432e7ac3c4902502476a88e07 100644
(file)
--- a/
util-src/net.c
+++ b/
util-src/net.c
@@
-112,6
+112,7
@@
int luaopen_util_net(lua_State* L)
{ NULL, NULL }
};
{ NULL, NULL }
};
- luaL_register(L, "net", exports);
+ lua_newtable(L);
+ luaL_register(L, NULL, exports);
return 1;
}
return 1;
}
diff --git
a/util-src/pposix.c
b/util-src/pposix.c
index 9b3e97eb772b6756d76e598376e3d49ba8b67893..62bd0339486ffa3c5f2d591b2ff739e91a4db740 100644
(file)
--- a/
util-src/pposix.c
+++ b/
util-src/pposix.c
@@
-768,7
+768,8
@@
int luaopen_util_pposix(lua_State *L)
{ NULL, NULL }
};
{ NULL, NULL }
};
- luaL_register(L, "pposix", exports);
+ lua_newtable(L);
+ luaL_register(L, NULL, exports);
lua_pushliteral(L, "pposix");
lua_setfield(L, -2, "_NAME");
lua_pushliteral(L, "pposix");
lua_setfield(L, -2, "_NAME");
diff --git
a/util-src/signal.c
b/util-src/signal.c
index 961d2d3e06acda484613a0ebdfc54a8f25625586..405689f5688a9b87c933b8ee02386785877a3f89 100644
(file)
--- a/
util-src/signal.c
+++ b/
util-src/signal.c
@@
-384,7
+384,8
@@
int luaopen_util_signal(lua_State *L)
int i = 0;
/* add the library */
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,
/* push lua_signals table into the registry */
/* put the signals inside the library table too,
diff --git
a/util-src/windows.c
b/util-src/windows.c
index 3d14ca956496c4cd8a02103182c7a3b356016b1a..9b79c66297cca57c434eaecf2a383b0a97fa3256 100644
(file)
--- a/
util-src/windows.c
+++ b/
util-src/windows.c
@@
-81,7
+81,8
@@
static const luaL_Reg Reg[] =
};
LUALIB_API int luaopen_util_windows(lua_State *L) {
};
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);
lua_pushliteral(L, "version"); /** version */
lua_pushliteral(L, "-3.14");
lua_settable(L,-3);