From 7192afafeeb1a96b3de60af90a72cd8762b09d94 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 2 Jul 2010 08:38:13 -0300 Subject: new module policy: C modules do not create globals and do not register themselves with 'require' (let 'require' do its work); new auxiliary functions luaL_newlib/luaL_newlibtable/luaL_setfuncs/luaL_requiref. Old luaL_register will be deprecated. --- loadlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'loadlib.c') diff --git a/loadlib.c b/loadlib.c index bb517801..712fcfef 100644 --- a/loadlib.c +++ b/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.85 2010/06/18 17:23:02 roberto Exp roberto $ +** $Id: loadlib.c,v 1.86 2010/06/30 17:40:27 roberto Exp roberto $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -616,7 +616,7 @@ LUAMOD_API int luaopen_package (lua_State *L) { lua_pushcfunction(L, gctm); lua_setfield(L, -2, "__gc"); /* create `package' table */ - luaL_register(L, LUA_LOADLIBNAME, pk_funcs); + luaL_newlib(L, pk_funcs); /* create `loaders' table */ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0); /* fill it with pre-defined loaders */ -- cgit v1.2.3-55-g6feb