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 /ltests.c | |
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 'ltests.c')
-rw-r--r-- | ltests.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1223,8 +1223,9 @@ static lua_State *getstate (lua_State *L) { | |||
1223 | 1223 | ||
1224 | static int loadlib (lua_State *L) { | 1224 | static int loadlib (lua_State *L) { |
1225 | lua_State *L1 = getstate(L); | 1225 | lua_State *L1 = getstate(L); |
1226 | int what = luaL_checkinteger(L, 2); | 1226 | int load = luaL_checkinteger(L, 2); |
1227 | luaL_openselectedlibs(L1, what); | 1227 | int preload = luaL_checkinteger(L, 3); |
1228 | luaL_openselectedlibs(L1, load, preload); | ||
1228 | luaL_requiref(L1, "T", luaB_opentests, 0); | 1229 | luaL_requiref(L1, "T", luaB_opentests, 0); |
1229 | lua_assert(lua_type(L1, -1) == LUA_TTABLE); | 1230 | lua_assert(lua_type(L1, -1) == LUA_TTABLE); |
1230 | /* 'requiref' should not reload module already loaded... */ | 1231 | /* 'requiref' should not reload module already loaded... */ |