mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
New function 'luaL_openselectedlibs'
Makes it easier to start Lua with only some standard libraries.
This commit is contained in:
parent
0270c204c2
commit
d738c8d18b
7 changed files with 85 additions and 83 deletions
6
lua.c
6
lua.c
|
|
@ -609,6 +609,10 @@ static void doREPL (lua_State *L) {
|
|||
|
||||
/* }================================================================== */
|
||||
|
||||
#if !defined(luai_openlibs)
|
||||
#define luai_openlibs(L) luaL_openlibs(L)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Main body of stand-alone interpreter (to be called in protected mode).
|
||||
|
|
@ -631,7 +635,7 @@ static int pmain (lua_State *L) {
|
|||
lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV");
|
||||
}
|
||||
luaL_openlibs(L); /* open standard libraries */
|
||||
luai_openlibs(L); /* open standard libraries */
|
||||
createargtable(L, argv, argc, script); /* create table 'arg' */
|
||||
lua_gc(L, LUA_GCRESTART); /* start GC... */
|
||||
lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue