Skip to main content

luaur_vm/functions/
iter_codes.rs

1use crate::functions::lua_pushinteger::lua_pushinteger;
2use crate::functions::lua_pushvalue::lua_pushvalue;
3use crate::luaL_checkstring;
4use crate::macros::lua_pushcfunction::LUA_PUSHCFUNCTION;
5use crate::type_aliases::lua_state::lua_State;
6
7#[no_mangle]
8pub unsafe fn iter_codes(L: *mut lua_State) -> core::ffi::c_int {
9    luaL_checkstring!(L, 1);
10    LUA_PUSHCFUNCTION(
11        L,
12        Some(crate::functions::iter_aux::iter_aux),
13        core::ptr::null(),
14    );
15    lua_pushvalue(L, 1);
16    lua_pushinteger(L, 0);
17    3
18}