luaur_vm/functions/
prepstate.rs1use crate::macros::luai_maxccalls::LUAI_MAXCCALLS;
2use crate::records::match_state::MatchState;
3use crate::type_aliases::lua_state::lua_State;
4use core::ffi::{c_char, c_void};
5
6#[allow(non_snake_case)]
7pub(crate) unsafe fn prepstate(
8 ms: *mut MatchState,
9 l: *mut lua_State,
10 s: *const c_char,
11 ls: usize,
12 p: *const c_char,
13 lp: usize,
14) {
15 (*ms).L = l;
16 (*ms).matchdepth = LUAI_MAXCCALLS;
17 (*ms).src_init = s;
18 (*ms).src_end = s.add(ls);
19 (*ms).p_end = p.add(lp);
20}