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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lcorolib.c,v $
|
||||
** $Id: lcorolib.c,v 1.1 2010/06/10 21:30:26 roberto Exp roberto $
|
||||
** Coroutine Library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ static const luaL_Reg co_funcs[] = {
|
||||
|
||||
|
||||
LUAMOD_API int luaopen_coroutine (lua_State *L) {
|
||||
luaL_register(L, LUA_COLIBNAME, co_funcs);
|
||||
luaL_newlib(L, co_funcs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user