util-src/*.c: Don't create globals when loaded

remotes/origin/0.11
Kim Alvefur 12 years ago
parent a685dfb89e
commit c57e98cd7d
  1. 7
      util-src/encodings.c
  2. 3
      util-src/hashes.c
  3. 3
      util-src/net.c
  4. 3
      util-src/pposix.c
  5. 3
      util-src/signal.c
  6. 3
      util-src/windows.c

@ -361,17 +361,12 @@ 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);

@ -203,7 +203,8 @@ static const luaL_Reg Reg[] =
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);

@ -112,6 +112,7 @@ int luaopen_util_net(lua_State* L)
{ NULL, NULL }
};
luaL_register(L, "net", exports);
lua_newtable(L);
luaL_register(L, NULL, exports);
return 1;
}

@ -768,7 +768,8 @@ int luaopen_util_pposix(lua_State *L)
{ NULL, NULL }
};
luaL_register(L, "pposix", exports);
lua_newtable(L);
luaL_register(L, NULL, exports);
lua_pushliteral(L, "pposix");
lua_setfield(L, -2, "_NAME");

@ -384,7 +384,8 @@ int luaopen_util_signal(lua_State *L)
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,

@ -81,7 +81,8 @@ static const luaL_Reg Reg[] =
};
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);

Loading…
Cancel
Save