| 1203 | |
| 1204 | |
| 1205 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1206 | Table *t; |
| 1207 | int more; |
| 1208 | lua_lock(L); |
| 1209 | api_checknelems(L, 1); |
| 1210 | t = gettable(L, idx); |
| 1211 | more = luaH_next(L, t, L->top - 1); |
| 1212 | if (more) { |
| 1213 | api_incr_top(L); |
| 1214 | } |
| 1215 | else /* no more elements */ |
| 1216 | L->top -= 1; /* remove key */ |
| 1217 | lua_unlock(L); |
| 1218 | return more; |
| 1219 | } |
| 1220 | |
| 1221 | |
| 1222 | LUA_API void lua_toclose (lua_State *L, int idx) { |
no test coverage detected