| 441 | |
| 442 | |
| 443 | LUA_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 |
no test coverage detected