| 1265 | |
| 1266 | |
| 1267 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1268 | Table *t; |
| 1269 | int more; |
| 1270 | lua_lock(L); |
| 1271 | api_checkpop(L, 1); |
| 1272 | t = gettable(L, idx); |
| 1273 | more = luaH_next(L, t, L->top.p - 1); |
| 1274 | if (more) |
| 1275 | api_incr_top(L); |
| 1276 | else /* no more elements */ |
| 1277 | L->top.p--; /* pop key */ |
| 1278 | lua_unlock(L); |
| 1279 | return more; |
| 1280 | } |
| 1281 | |
| 1282 | |
| 1283 | LUA_API void lua_toclose (lua_State *L, int idx) { |
no test coverage detected