From 165389b27bc54e7c5214276db177e3ef75226f18 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 15 Feb 2024 11:17:39 -0300 Subject: New interface to function 'luaL_openselectedlibs' Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload. --- ltests.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 6081aba6..59df7cad 100644 --- a/ltests.c +++ b/ltests.c @@ -1223,8 +1223,9 @@ static lua_State *getstate (lua_State *L) { static int loadlib (lua_State *L) { lua_State *L1 = getstate(L); - int what = luaL_checkinteger(L, 2); - luaL_openselectedlibs(L1, what); + int load = luaL_checkinteger(L, 2); + int preload = luaL_checkinteger(L, 3); + luaL_openselectedlibs(L1, load, preload); luaL_requiref(L1, "T", luaB_opentests, 0); lua_assert(lua_type(L1, -1) == LUA_TTABLE); /* 'requiref' should not reload module already loaded... */ -- cgit v1.2.3-55-g6feb