diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-02-15 11:17:39 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-02-15 11:17:39 -0300 |
commit | 165389b27bc54e7c5214276db177e3ef75226f18 (patch) | |
tree | f6ce6e7bff04ff6cbe735ee68d64290cc04c04bf /lualib.h | |
parent | c8121ce34b39c6fd31899f4da91e26063c8af54f (diff) | |
download | lua-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.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |
18 | LUAMOD_API int (luaopen_base) (lua_State *L); | 18 | LUAMOD_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) |
22 | LUAMOD_API int (luaopen_package) (lua_State *L); | 22 | LUAMOD_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 */ |
59 | LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int what); | 59 | LUALIB_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 |