MCPcopy Index your code
hub / github.com/AndroidPatch/Module-Template-Lua / rust_add

Function rust_add

my_lua_module/src/lib.rs:9–14  ·  view source on GitHub ↗
(state: *mut lua_State)

Source from the content-addressed store, hash-verified

7// --------------------------
8
9unsafe extern "C-unwind" fn rust_add(state: *mut lua_State) -> c_int {
10 let a = lua_tonumberx(state, 1, std::ptr::null_mut());
11 let b = lua_tonumberx(state, 2, std::ptr::null_mut());
12 lua_pushnumber(state, a + b);
13 return 1;
14}
15
16unsafe extern "C-unwind" fn say_hello(state: *mut lua_State) -> c_int {
17 //println!("Hello from Rust!");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected