MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_topointer

Function lua_topointer

depends/lua/src/lapi.c:429–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428
429LUA_API const void *lua_topointer (lua_State *L, int idx) {
430 StkId o = index2addr(L, idx);
431 switch (ttype(o)) {
432 case LUA_TTABLE: return hvalue(o);
433 case LUA_TLCL: return clLvalue(o);
434 case LUA_TCCL: return clCvalue(o);
435 case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
436 case LUA_TTHREAD: return thvalue(o);
437 case LUA_TUSERDATA: return getudatamem(uvalue(o));
438 case LUA_TLIGHTUSERDATA: return pvalue(o);
439 default: return NULL;
440 }
441}
442
443
444

Callers 1

luaL_tolstringFunction · 0.85

Calls 2

index2addrFunction · 0.85
castFunction · 0.85

Tested by

no test coverage detected