1# Introduction
2
3**[`bindgen`](https://github.com/rust-lang/rust-bindgen) automatically generates Rust
4FFI bindings to C and C++ libraries.**
5
6For example, given the C header `cool.h`:
7
8```c
9typedef struct CoolStruct {
10    int x;
11    int y;
12} CoolStruct;
13
14void cool_function(int i, char c, CoolStruct* cs);
15```
16
17`bindgen` produces Rust FFI code allowing you to call into the `cool` library's
18functions and use its types:
19
20```rust
21/* automatically generated by rust-bindgen 0.99.9 */
22
23#[repr(C)]
24pub struct CoolStruct {
25    pub x: ::std::os::raw::c_int,
26    pub y: ::std::os::raw::c_int,
27}
28
29extern "C" {
30    pub fn cool_function(i: ::std::os::raw::c_int,
31                         c: ::std::os::raw::c_char,
32                         cs: *mut CoolStruct);
33}
34```
35