| 970 | using Screen::PenArray; |
| 971 | |
| 972 | static PenArray *check_penarray_native(lua_State *L, int index) |
| 973 | { |
| 974 | lua_rawgetp(L, LUA_REGISTRYINDEX, &DFHACK_PENARRAY_TOKEN); |
| 975 | |
| 976 | if (!lua_getmetatable(L, index) || !lua_rawequal(L, -1, -2)) |
| 977 | luaL_argerror(L, index, "not a penarray object"); |
| 978 | |
| 979 | lua_pop(L, 2); |
| 980 | |
| 981 | return (PenArray*)lua_touserdata(L, index); |
| 982 | } |
| 983 | |
| 984 | static int dfhack_penarray_new(lua_State *L) |
| 985 | { |
no test coverage detected