| 406 | |
| 407 | |
| 408 | LUA_API const void *lua_topointer (lua_State *L, int idx) { |
| 409 | StkId o = index2adr(L, idx); |
| 410 | switch (ttype(o)) { |
| 411 | case LUA_TTABLE: return hvalue(o); |
| 412 | case LUA_TFUNCTION: return clvalue(o); |
| 413 | case LUA_TTHREAD: return thvalue(o); |
| 414 | case LUA_TUSERDATA: |
| 415 | case LUA_TLIGHTUSERDATA: |
| 416 | return lua_touserdata(L, idx); |
| 417 | default: return NULL; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | |
| 422 |
no test coverage detected