MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaB_select

Function luaB_select

Source/Misc/lua/src/lua.c:11222–11235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11220
11221
11222static int luaB_select (lua_State *L) {
11223int n = lua_gettop(L);
11224if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
11225lua_pushinteger(L, n-1);
11226return 1;
11227}
11228else {
11229int i = luaL_checkint(L, 1);
11230if (i < 0) i = n + i;
11231else if (i > n) i = n;
11232luaL_argcheck(L, 1 <= i, 1, "index out of range");
11233return n - i;
11234}
11235}
11236
11237
11238static int luaB_pcall (lua_State *L) {

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
lua_typeFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected