using constants for "_LOADED" and "PRELOAD"

This commit is contained in:
Roberto Ierusalimschy
2016-12-04 18:17:24 -02:00
parent beec5af201
commit b2aa2ba046
5 changed files with 34 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: linit.c,v 1.37 2014/12/09 15:00:17 roberto Exp roberto $
** $Id: linit.c,v 1.38 2015/01/05 13:48:33 roberto Exp roberto $
** Initialization of libraries for lua.c and other clients
** See Copyright Notice in lua.h
*/
@@ -18,10 +18,10 @@
** open the library, which is already linked to the application.
** For that, do the following code:
**
** luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD");
** luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE);
** lua_pushcfunction(L, luaopen_modname);
** lua_setfield(L, -2, modname);
** lua_pop(L, 1); // remove _PRELOAD table
** lua_pop(L, 1); // remove PRELOAD table
*/
#include "lprefix.h"