MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaB_select

Function luaB_select

freebsd/contrib/openzfs/module/lua/lbaselib.c:234–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234static int luaB_select (lua_State *L) {
235 int n = lua_gettop(L);
236 if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
237 lua_pushinteger(L, n-1);
238 return 1;
239 }
240 else {
241 int i = luaL_checkint(L, 1);
242 if (i < 0) i = n + i;
243 else if (i > n) i = n;
244 luaL_argcheck(L, 1 <= i, 1, "index out of range");
245 return n - i;
246 }
247}
248
249static int luaB_tostring (lua_State *L) {
250 luaL_checkany(L, 1);

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.70
lua_typeFunction · 0.70
lua_pushintegerFunction · 0.70

Tested by

no test coverage detected