commit | aa1030ef4d19e527d1372d68f51b608598fe77f4 | [log] [tgz] |
---|---|---|
author | chrysn <chrysn@fsfe.org> | Sat Aug 25 01:00:55 2018 +0200 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Tue Aug 28 12:47:44 2018 +0200 |
tree | cf1b3c253f1bc6014fe83884de6afb36916d22b3 | |
parent | b3fca4df2eda2f2bfe8861ab88b05a2573a7b502 [diff] |
Tests: Add a --use-core --impl-debug case This demonstrates the [...] abbreviation of large arrays in contrast to the std variety. (Long (>32) arrays currently don't have a dedicated test, but are piggy-backed on the derive-debug-bitfield and derive-debug-function-pointer tests). Note that the single occurrence of the `std` namespace in the expectation is valid: No --ctypes-prefix was set, and ::std::os::raw is the default value that needs to be overridden in most practical --use-core applications.
bindgen
impl period
has been started! Join us at Gitter.im.
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