MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / lua_Unsigned lua_rawlen

Function lua_Unsigned lua_rawlen

src/lapi.cpp:484–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482
483
484LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) {
485 const TValue *o = index2value(L, idx);
486 switch (ttypetag(o)) {
487 case LUA_VSHRSTR: return cast(lua_Unsigned, tsvalue(o)->shrlen);
488 case LUA_VLNGSTR: return cast(lua_Unsigned, tsvalue(o)->u.lnglen);
489 case LUA_VUSERDATA: return cast(lua_Unsigned, uvalue(o)->len);
490 case LUA_VTABLE: {
491 lua_Unsigned res;
492 lua_lock(L);
493 res = luaH_getn(L, hvalue(o));
494 lua_unlock(L);
495 return res;
496 }
497 default: return 0;
498 }
499}
500
501
502LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {

Callers

nothing calls this directly

Calls 2

index2valueFunction · 0.85
luaH_getnFunction · 0.85

Tested by

no test coverage detected