mirror of https://github.com/vacp2p/zerokit.git
FFI: New
This commit is contained in:
parent
7421c2b93b
commit
f52ba69439
|
@ -29,7 +29,15 @@ impl<'a> From<&Buffer> for &'a [u8] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn foobar() -> bool {
|
pub extern "C" fn new(ctx: *mut *mut Multiplier) -> bool {
|
||||||
|
println!("multiplier ffi: new");
|
||||||
|
let mul = Multiplier::new();
|
||||||
|
|
||||||
|
unsafe { *ctx = Box::into_raw(Box::new(mul)) };
|
||||||
|
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue