New interface to function 'luaL_openselectedlibs'
Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
This commit is contained in:
8
lualib.h
8
lualib.h
@@ -14,11 +14,11 @@
|
||||
/* version suffix for environment variable names */
|
||||
#define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR
|
||||
|
||||
#define LUA_GK 1
|
||||
#define LUA_GLIBK 1
|
||||
LUAMOD_API int (luaopen_base) (lua_State *L);
|
||||
|
||||
#define LUA_LOADLIBNAME "package"
|
||||
#define LUA_LOADLIBK (LUA_GK << 1)
|
||||
#define LUA_LOADLIBK (LUA_GLIBK << 1)
|
||||
LUAMOD_API int (luaopen_package) (lua_State *L);
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ LUAMOD_API int (luaopen_utf8) (lua_State *L);
|
||||
|
||||
|
||||
/* open selected libraries */
|
||||
LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int what);
|
||||
LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int load, int preload);
|
||||
|
||||
/* open all libraries */
|
||||
#define luaL_openlibs(L) luaL_openselectedlibs(L, ~0)
|
||||
#define luaL_openlibs(L) luaL_openselectedlibs(L, ~0, 0)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user