https://github.com/Jurily/rust-c-example

`#[no_mangle] extern "C" foo() { ... }`

When you expose a C API, you need to observe the C rules: function names
must be globally unique. You have to write the headers yourself. Taking and
releasing ownership of C data needs some magic, but it's doable.

Take special care to use the `c_` types correctly, this is not the area where
Rust's error messages are strongest, and it's way too easy to confuse `int`
and `c_int` for example. (Rust `int` is `ptrdiff_t`)
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to