luaur_vm/records/
lua_callbacks.rs1use crate::records::lua_debug::LuaDebug as lua_Debug;
5use crate::type_aliases::lua_state::lua_State;
6use core::ffi::{c_char, c_int, c_void};
7
8#[repr(C)]
9#[derive(Debug, Clone)]
10pub struct LuaCallbacks {
11 pub userdata: *mut c_void,
13
14 pub interrupt: Option<unsafe extern "C-unwind" fn(l: *mut lua_State, gc: c_int)>,
16 pub panic: Option<unsafe extern "C" fn(l: *mut lua_State, errcode: c_int)>,
18
19 pub userthread: Option<unsafe extern "C" fn(lp: *mut lua_State, l: *mut lua_State)>,
21 pub useratom:
23 Option<unsafe extern "C" fn(l: *mut lua_State, s: *const c_char, len: usize) -> i16>,
24
25 pub debugbreak: Option<unsafe extern "C" fn(l: *mut lua_State, ar: *mut lua_Debug)>,
27 pub debugstep: Option<unsafe extern "C" fn(l: *mut lua_State, ar: *mut lua_Debug)>,
29 pub debuginterrupt: Option<unsafe extern "C" fn(l: *mut lua_State, ar: *mut lua_Debug)>,
31 pub debugprotectederror: Option<unsafe extern "C-unwind" fn(l: *mut lua_State)>,
33
34 pub onallocate: Option<unsafe extern "C" fn(l: *mut lua_State, osize: usize, nsize: usize)>,
36}
37
38#[allow(non_camel_case_types)]
39pub type lua_Callbacks = LuaCallbacks;