| 427 | |
| 428 | |
| 429 | LUA_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 |
no test coverage detected