luaur-vm 0.1.1

The Luau register virtual machine and standard library (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::functions::lua_l_checkinteger_64::lua_l_checkinteger_64;
use crate::macros::lua_l_opt::luaL_opt;
use crate::type_aliases::lua_state::lua_State;
use core::ffi::c_int;

#[no_mangle]
pub unsafe fn lua_l_optinteger_64(L: *mut lua_State, narg: c_int, def: i64) -> i64 {
    // The macro luaL_opt! expands to:
    // if lua_isnoneornil(L, narg) { def } else { luaL_checkinteger64(L, narg) }
    // We use the already-translated lua_l_checkinteger_64 as the function argument.
    luaL_opt!(L, lua_l_checkinteger_64, narg, def)
}