commit | 9fb016e32bfc2cd917c907e8b9e892eed89b24c7 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Mon Feb 11 09:58:33 2019 +0100 |
committer | GitHub <noreply@github.com> | Mon Feb 11 09:58:33 2019 +0100 |
tree | 2a7971c2fa927c617ac8948f8412d869d72c8478 | |
parent | 807033601808efb25e08ee6a3a1a8e98da02cd75 [diff] | |
parent | 5063e94c0ce0a0a8c3bd005c436a1136935ab870 [diff] |
Merge pull request #1519 from flier/fix-one-argument-block-pointer fix one argument block pointer issue, #1378
bindgen
bindgen
automatically generates Rust FFI bindings to C (and some C++) libraries.
For example, given the C header doggo.h
:
typedef struct Doggo { int many; char wow; } Doggo; void eleven_out_of_ten_majestic_af(Doggo* pupper);
bindgen
produces Rust FFI code allowing you to call into the doggo
library's functions and use its types:
/* automatically generated by rust-bindgen */ #[repr(C)] pub struct Doggo { pub many: ::std::os::raw::c_int, pub wow: ::std::os::raw::c_char, } extern "C" { pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo); }
📚 Read the bindgen
users guide here! 📚
API reference documentation is on docs.rs