| 1576 | } |
| 1577 | |
| 1578 | static int dfhack_event_next(lua_State *L) |
| 1579 | { |
| 1580 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 1581 | lua_getuservalue(L, 1); |
| 1582 | lua_pushvalue(L, 2); |
| 1583 | while (lua_next(L, -2)) |
| 1584 | { |
| 1585 | if (is_null_userdata(L, -2)) |
| 1586 | lua_pop(L, 1); |
| 1587 | else |
| 1588 | return 2; |
| 1589 | } |
| 1590 | lua_pushnil(L); |
| 1591 | return 1; |
| 1592 | } |
| 1593 | |
| 1594 | static int dfhack_event_pairs(lua_State *L) |
| 1595 | { |
nothing calls this directly
no test coverage detected