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