| 1 |
/// cbindgen:derive-ostream |
| 2 |
#[repr(C)] |
| 3 |
pub struct A(i32); |
| 4 |
|
| 5 |
/// cbindgen:field-names=[x, y] |
| 6 |
/// cbindgen:derive-ostream |
| 7 |
#[repr(C)] |
| 8 |
pub struct B(i32, f32); |
| 9 |
|
| 10 |
/// cbindgen:derive-ostream |
| 11 |
#[repr(u32)] |
| 12 |
pub enum C { |
| 13 |
X = 2, |
| 14 |
Y, |
| 15 |
} |
| 16 |
|
| 17 |
/// cbindgen:derive-ostream |
| 18 |
#[repr(C)] |
| 19 |
pub struct D { |
| 20 |
List: u8, |
| 21 |
Of: usize, |
| 22 |
Things: B, |
| 23 |
} |
| 24 |
|
| 25 |
/// cbindgen:derive-ostream |
| 26 |
#[repr(u8)] |
| 27 |
pub enum F { |
| 28 |
Foo(i16), |
| 29 |
Bar { x: u8, y: i16 }, |
| 30 |
Baz |
| 31 |
} |
| 32 |
|
| 33 |
/// cbindgen:derive-ostream |
| 34 |
#[repr(C, u8)] |
| 35 |
pub enum H { |
| 36 |
Hello(i16), |
| 37 |
There { x: u8, y: i16 }, |
| 38 |
Everyone |
| 39 |
} |
| 40 |
|
| 41 |
/// cbindgen:derive-ostream=false |
| 42 |
#[repr(C, u8)] |
| 43 |
pub enum I { |
| 44 |
/// cbindgen:derive-ostream=true |
| 45 |
ThereAgain { x: u8, y: i16 }, |
| 46 |
SomethingElse |
| 47 |
} |
| 48 |
|
| 49 |
#[no_mangle] |
| 50 |
pub extern "C" fn root( |
| 51 |
a: A, |
| 52 |
b: B, |
| 53 |
c: C, |
| 54 |
d: D, |
| 55 |
f: F, |
| 56 |
h: H, |
| 57 |
i: I, |
| 58 |
) { } |
| 59 |
|