| 421 | |
| 422 | |
| 423 | LUA_API const void *lua_topointer (lua_State *L, int idx) { |
| 424 | StkId o = index2adr(L, idx); |
| 425 | switch (ttype(o)) { |
| 426 | case LUA_TTABLE: return hvalue(o); |
| 427 | case LUA_TFUNCTION: return clvalue(o); |
| 428 | case LUA_TTHREAD: return thvalue(o); |
| 429 | case LUA_TUSERDATA: |
| 430 | case LUA_TLIGHTUSERDATA: |
| 431 | return lua_touserdata(L, idx); |
| 432 | default: return NULL; |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | |
| 437 |
no test coverage detected