MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_topointer

Function lua_topointer

third-party/lua-5.2.4/src/lapi.c:443–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441
442
443LUA_API const void *lua_topointer (lua_State *L, int idx) {
444 StkId o = index2addr(L, idx);
445 switch (ttype(o)) {
446 case LUA_TTABLE: return hvalue(o);
447 case LUA_TLCL: return clLvalue(o);
448 case LUA_TCCL: return clCvalue(o);
449 case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
450 case LUA_TTHREAD: return thvalue(o);
451 case LUA_TUSERDATA:
452 case LUA_TLIGHTUSERDATA:
453 return lua_touserdata(L, idx);
454 default: return NULL;
455 }
456}
457
458
459

Callers 1

luaL_tolstringFunction · 0.70

Calls 2

index2addrFunction · 0.70
lua_touserdataFunction · 0.70

Tested by

no test coverage detected