| 1243 | |
| 1244 | |
| 1245 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1246 | Table *t; |
| 1247 | int more; |
| 1248 | lua_lock(L); |
| 1249 | api_checknelems(L, 1); |
| 1250 | t = gettable(L, idx); |
| 1251 | more = luaH_next(L, t, L->top - 1); |
| 1252 | if (more) { |
| 1253 | api_incr_top(L); |
| 1254 | } |
| 1255 | else /* no more elements */ |
| 1256 | L->top -= 1; /* remove key */ |
| 1257 | lua_unlock(L); |
| 1258 | return more; |
| 1259 | } |
| 1260 | |
| 1261 | |
| 1262 | LUA_API void lua_toclose (lua_State *L, int idx) { |
no test coverage detected