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

Function lua_objlen

Source/Misc/lua/src/lua.c:2210–2225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2208
2209
2210LUA_API size_t lua_objlen (lua_State *L, int idx) {
2211StkId o = index2adr(L, idx);
2212switch (ttype(o)) {
2213case LUA_TSTRING: return tsvalue(o)->len;
2214case LUA_TUSERDATA: return uvalue(o)->len;
2215case LUA_TTABLE: return luaH_getn(hvalue(o));
2216case LUA_TNUMBER: {
2217size_t l;
2218lua_lock(L); /* `luaV_tostring' may create a new string */
2219l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0);
2220lua_unlock(L);
2221return l;
2222}
2223default: return 0;
2224}
2225}
2226
2227
2228LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {

Callers 4

luaL_getnFunction · 0.85
luaL_refFunction · 0.85
read_lineFunction · 0.85
read_charsFunction · 0.85

Calls 3

index2adrFunction · 0.85
luaH_getnFunction · 0.85
luaV_tostringFunction · 0.85

Tested by

no test coverage detected