| 1 |
/// cbindgen:derive-lt=true |
| 2 |
/// cbindgen:derive-lte=true |
| 3 |
/// cbindgen:derive-constructor=true |
| 4 |
/// cbindgen:rename-all=GeckoCase |
| 5 |
#[repr(C)] |
| 6 |
struct A(i32); |
| 7 |
|
| 8 |
/// cbindgen:field-names=[x, y] |
| 9 |
#[repr(C)] |
| 10 |
struct B(i32, f32); |
| 11 |
|
| 12 |
/// cbindgen:trailing-values=[Z, W] |
| 13 |
#[repr(u32)] |
| 14 |
enum C { |
| 15 |
X = 2, |
| 16 |
Y, |
| 17 |
} |
| 18 |
|
| 19 |
/// cbindgen:derive-helper-methods=true |
| 20 |
#[repr(u8)] |
| 21 |
enum F { |
| 22 |
Foo(i16), |
| 23 |
Bar { x: u8, y: i16 }, |
| 24 |
Baz |
| 25 |
} |
| 26 |
|
| 27 |
/// cbindgen:derive-helper-methods |
| 28 |
#[repr(C, u8)] |
| 29 |
enum H { |
| 30 |
Hello(i16), |
| 31 |
There { x: u8, y: i16 }, |
| 32 |
Everyone |
| 33 |
} |
| 34 |
|
| 35 |
#[no_mangle] |
| 36 |
pub extern "C" fn root( |
| 37 |
x: A, |
| 38 |
y: B, |
| 39 |
z: C, |
| 40 |
f: F, |
| 41 |
h: H, |
| 42 |
) { } |
| 43 |
|