Skip to content

Commit cfdcda6

Browse files
committed
11/10 MAJESTIC AF
1 parent f0b3432 commit cfdcda6

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,31 @@
22

33
**`bindgen` automatically generates Rust FFI bindings to C and C++ libraries.**
44

5-
For example, given the C header `cool.h`:
5+
For example, given the C header `doggo.h`:
66

77
```c
8-
typedef struct CoolStruct {
9-
int x;
10-
int y;
11-
} CoolStruct;
8+
typedef struct Doggo {
9+
int many;
10+
char wow;
11+
} Doggo;
1212

13-
void cool_function(int i, char c, CoolStruct* cs);
13+
void eleven_out_of_ten_majestic_af(Doggo* pupper);
1414
```
1515
16-
`bindgen` produces Rust FFI code allowing you to call into the `cool` library's
16+
`bindgen` produces Rust FFI code allowing you to call into the `doggo` library's
1717
functions and use its types:
1818
1919
```rust
2020
/* automatically generated by rust-bindgen */
2121
2222
#[repr(C)]
23-
pub struct CoolStruct {
24-
pub x: ::std::os::raw::c_int,
25-
pub y: ::std::os::raw::c_int,
23+
pub struct Doggo {
24+
pub many: ::std::os::raw::c_int,
25+
pub wow: ::std::os::raw::c_char,
2626
}
2727
2828
extern "C" {
29-
pub fn cool_function(i: ::std::os::raw::c_int,
30-
c: ::std::os::raw::c_char,
31-
cs: *mut CoolStruct);
29+
pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo);
3230
}
3331
```
3432

0 commit comments

Comments
 (0)