commit | 09ac682f296b13aa2694a24a35fd60fa70bd0e45 | [log] [tgz] |
---|---|---|
author | bors-servo <lbergstrom+bors@mozilla.com> | Thu May 25 12:04:11 2017 -0500 |
committer | GitHub <noreply@github.com> | Thu May 25 12:04:11 2017 -0500 |
tree | 095ac84a295aa11e3f63cc2f72e13143c52aac1e | |
parent | e30f219a1ad393370d4c2fc3a65c62a49633e29c [diff] | |
parent | dc090123d3ba961fa019562ecea0b00c9df17f25 [diff] |
Auto merge of #720 - fitzgen:testing-libclang-versions, r=emilio Gate on libclang 4 CI passing :) Need those test expectation diffs across libclang versions from Travis CI...
bindgen
bindgen
automatically generates Rust FFI bindings to C and C++ libraries.
For example, given the C header cool.h
:
typedef struct CoolStruct { int x; int y; } CoolStruct; void cool_function(int i, char c, CoolStruct* cs);
bindgen
produces Rust FFI code allowing you to call into the cool
library's functions and use its types:
/* automatically generated by rust-bindgen */ #[repr(C)] pub struct CoolStruct { pub x: ::std::os::raw::c_int, pub y: ::std::os::raw::c_int, } extern "C" { pub fn cool_function(i: ::std::os::raw::c_int, c: ::std::os::raw::c_char, cs: *mut CoolStruct); }
📚 Read the bindgen
users guide here! 📚
API reference documentation is on docs.rs