aboutsummaryrefslogtreecommitdiff
path: root/lualib.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-02-15 11:17:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-02-15 11:17:39 -0300
commit165389b27bc54e7c5214276db177e3ef75226f18 (patch)
treef6ce6e7bff04ff6cbe735ee68d64290cc04c04bf /lualib.h
parentc8121ce34b39c6fd31899f4da91e26063c8af54f (diff)
downloadlua-165389b27bc54e7c5214276db177e3ef75226f18.tar.gz
lua-165389b27bc54e7c5214276db177e3ef75226f18.tar.bz2
lua-165389b27bc54e7c5214276db177e3ef75226f18.zip
New interface to function 'luaL_openselectedlibs'
Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
Diffstat (limited to 'lualib.h')
-rw-r--r--lualib.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lualib.h b/lualib.h
index e124cf1b..068f60ab 100644
--- a/lualib.h
+++ b/lualib.h
@@ -14,11 +14,11 @@
14/* version suffix for environment variable names */ 14/* version suffix for environment variable names */
15#define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 15#define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR
16 16
17#define LUA_GK 1 17#define LUA_GLIBK 1
18LUAMOD_API int (luaopen_base) (lua_State *L); 18LUAMOD_API int (luaopen_base) (lua_State *L);
19 19
20#define LUA_LOADLIBNAME "package" 20#define LUA_LOADLIBNAME "package"
21#define LUA_LOADLIBK (LUA_GK << 1) 21#define LUA_LOADLIBK (LUA_GLIBK << 1)
22LUAMOD_API int (luaopen_package) (lua_State *L); 22LUAMOD_API int (luaopen_package) (lua_State *L);
23 23
24 24
@@ -56,10 +56,10 @@ LUAMOD_API int (luaopen_utf8) (lua_State *L);
56 56
57 57
58/* open selected libraries */ 58/* open selected libraries */
59LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int what); 59LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int load, int preload);
60 60
61/* open all libraries */ 61/* open all libraries */
62#define luaL_openlibs(L) luaL_openselectedlibs(L, ~0) 62#define luaL_openlibs(L) luaL_openselectedlibs(L, ~0, 0)
63 63
64 64
65#endif 65#endif