summaryrefslogtreecommitdiff
path: root/src/hook.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hook.rs')
-rw-r--r--src/hook.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hook.rs b/src/hook.rs
index f00e09b..f56adfe 100644
--- a/src/hook.rs
+++ b/src/hook.rs
@@ -165,7 +165,8 @@ impl HookTriggers {
}
}
-pub(crate) unsafe extern "C" fn hook_proc(state: *mut lua_State, ar: *mut lua_Debug) {
+#[no_mangle]
+pub unsafe extern "C" fn mlua_hook_proc(state: *mut lua_State, ar: *mut lua_Debug) -> c_int {
callback_error(state, |_| {
let debug = Debug {
ar,
@@ -182,8 +183,8 @@ pub(crate) unsafe extern "C" fn hook_proc(state: *mut lua_State, ar: *mut lua_De
Err(_) => mlua_panic!("Lua should not allow hooks to be called within another hook"),
}?;
- Ok(())
- });
+ Ok(0)
+ })
}
unsafe fn ptr_to_str<'a>(input: *const c_char) -> Option<&'a [u8]> {