| 1251 | |
| 1252 | |
| 1253 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1254 | Table *t; |
| 1255 | int more; |
| 1256 | lua_lock(L); |
| 1257 | api_checknelems(L, 1); |
| 1258 | t = gettable(L, idx); |
| 1259 | more = luaH_next(L, t, L->top.p - 1); |
| 1260 | if (more) { |
| 1261 | api_incr_top(L); |
| 1262 | } |
| 1263 | else /* no more elements */ |
| 1264 | L->top.p -= 1; /* remove key */ |
| 1265 | lua_unlock(L); |
| 1266 | return more; |
| 1267 | } |
| 1268 | |
| 1269 | |
| 1270 | LUA_API void lua_toclose (lua_State *L, int idx) { |
no test coverage detected