MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_getn

Function luaL_getn

lua/lauxlib.c:369–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367
368
369LUALIB_API int luaL_getn (lua_State *L, int t) {
370 int n;
371 t = abs_index(L, t);
372 lua_pushliteral(L, "n"); /* try t.n */
373 lua_rawget(L, t);
374 if ((n = checkint(L, 1)) >= 0) return n;
375 getsizes(L); /* else try sizes[t] */
376 lua_pushvalue(L, t);
377 lua_rawget(L, -2);
378 if ((n = checkint(L, 2)) >= 0) return n;
379 return (int)lua_objlen(L, t);
380}
381
382#endif
383

Callers 4

luaB_unpackFunction · 0.85
table_to_cson_arrayFunction · 0.85
is_arrayFunction · 0.85
tconcatFunction · 0.85

Calls 5

lua_rawgetFunction · 0.85
checkintFunction · 0.85
getsizesFunction · 0.85
lua_pushvalueFunction · 0.85
lua_objlenFunction · 0.85

Tested by

no test coverage detected