Skip to main content

lumen_app_expose_v2

Function lumen_app_expose_v2 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn lumen_app_expose_v2( app: *mut LumenApp, name: *const c_char, arg_count: u32, func: Option<LumenFnV2>, user_data: *mut c_void, ) -> LumenStatus
Expand description

Expose a native callback to the app’s script under name, using the out-parameter callback convention (ABI 0.3).

Identical to lumen_app_expose except func is a LumenFnV2: it receives a *mut LumenValue out-pointer as its first argument and writes its result there instead of returning a LumenValue by value. This lets ctypes / libffi-only bindings register callbacks without hand-encoding the platform’s aggregate-return (sret) convention. Prefer this over lumen_app_expose for non-Rust embedders; v1 is retained for source compatibility.