Automatically generates Rust FFI bindings to C (and some C++) libraries.
Branch: master
Clone or download
Pull request Compare This branch is 214 commits behind rust-lang:master.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github s/servo/rust-lang-nursery/ \o/ Jul 25, 2017
bindgen-integration Add tests for the new option. May 3, 2018
book Fix typos. Jun 13, 2018
ci Add -x to the CI script. Apr 3, 2018
csmith-fuzzing
releases Add a changelog Nov 1, 2017
src Fix typos. Jun 13, 2018
tests add --constified-enum to output consts when the default is changed Jun 4, 2018
.gitattributes Always check out test headers and expectations as LF Sep 23, 2017
.gitignore Ignore C-Reduce's backup files Oct 25, 2017
.travis.yml Adjust .travis.yml to only use maj-min versions. Apr 3, 2018
CHANGELOG.md Bump to version 0.33.1 Feb 14, 2018
CONTRIBUTING.md Address PR change requests Dec 9, 2017
Cargo.lock Bump libclang. Jun 17, 2018
Cargo.toml Bump libclang. Jun 17, 2018
LICENSE fix build and add license Aug 5, 2013
README.md Match tag line on github in README to downplay implied reliability of… Apr 3, 2018
appveyor.yml Now that we have stuff that depends on libclang-5 we need to do this. Apr 3, 2018
build.rs Use `quote` instead of `syntex` for Rust code generation Sep 7, 2017
example-graphviz-ir.png Update the example graphviz image Feb 18, 2017
rustfmt.toml Remove unstable rustfmt-nightly features Dec 4, 2017

README.md

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);
}

Users Guide

📚 Read the bindgen users guide here! 📚

API Reference

API reference documentation is on docs.rs

Contributing

See CONTRIBUTING.md for hacking on bindgen!