Open notdanilo opened 3 years ago
#[ligen(C)] fn f(data: &mut [u8]) { ... }
generates this
extern "C" fn c_f(data: &mut [u8]) { f(data); }
because C and Rust are ABI compatible.
#[ligen(C)] fn f(string: &mut String) { ... }
generates something like this
extern "C" fn c_f(string: mut CString) { let mut rust_string = string.to_string(); f(&mut rust_string); string = rust_string.to_cstring(); }
Because marshalling for Strings is necessary.
generates this
because C and Rust are ABI compatible.
generates something like this
Because marshalling for Strings is necessary.