Go to file
2019-10-14 14:15:46 +02:00
.github Update broken links: Rust-lang-nursery => Rust-lang (#1447) 2018-11-24 15:36:57 +01:00
bindgen-integration integration: Fix integration tests with rust 1.33. 2019-03-04 03:54:18 +01:00
book Add ParseCallbacks handler for included files 2019-10-08 01:31:49 +02:00
ci Improve the script to enforce rustfmt on automation. 2019-09-17 11:53:23 +09:00
csmith-fuzzing Update Links 2019-05-21 13:41:42 +02:00
releases Update Links 2019-05-21 13:41:42 +02:00
src function: Fix #[must_use] support in libclang 9+. 2019-10-14 14:15:46 +02:00
tests Fix BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit. 2019-10-08 14:38:35 +02:00
.gitattributes Always check out test headers and expectations as LF 2017-09-22 19:02:42 -07:00
.gitignore Fix gitignore so ripgrep works 2019-01-25 12:03:22 -05:00
.travis.yml Test bindgen with no default features 2019-09-17 09:35:52 +09:00
appveyor.yml Now that we have stuff that depends on libclang-5 we need to do this. 2018-04-03 11:27:46 +02:00
build.rs Rustfmt. 2019-09-17 11:53:23 +09:00
Cargo.lock Cache the result of Item::path_for_whitelisting. 2019-10-08 01:40:07 +02:00
Cargo.toml Cache the result of Item::path_for_whitelisting. 2019-10-08 01:40:07 +02:00
CHANGELOG.md Mention v0.51.1-oldsyn. 2019-09-24 20:06:31 +02:00
CONTRIBUTING.md Update Links 2019-05-21 13:41:42 +02:00
example-graphviz-ir.png Update the example graphviz image 2017-02-17 17:45:49 -08:00
LICENSE Regenerates the BSD3 License so GitHub recognises it 2018-07-05 14:16:28 +01:00
README.md Readme badges 2019-05-06 19:53:30 +02:00
rustfmt.toml Rustfmt. 2019-09-17 11:53:23 +09:00

crates.io docs.rs

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

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!