luaur_vm/functions/
lua_rawequal.rs1use crate::functions::index_2_addr::index2addr;
2use crate::functions::lua_o_rawequal_obj::luaO_rawequalObj;
3use crate::type_aliases::lua_state::lua_State;
4use crate::type_aliases::stk_id::StkId;
5
6use crate::macros::lua_o_nilobject::luaO_nilobject;
7
8#[no_mangle]
9#[allow(non_snake_case)]
10pub unsafe fn lua_rawequal(
11 L: *mut lua_State,
12 index1: core::ffi::c_int,
13 index2: core::ffi::c_int,
14) -> core::ffi::c_int {
15 let o1: StkId = index2addr(L, index1);
16 let o2: StkId = index2addr(L, index2);
17
18 if o1 == luaO_nilobject as StkId || o2 == luaO_nilobject as StkId {
19 0
20 } else {
21 luaO_rawequalObj(
22 o1 as *const crate::type_aliases::t_value::TValue,
23 o2 as *const crate::type_aliases::t_value::TValue,
24 )
25 }
26}