1 use std::ptr::NonNull;
2
3 struct Opaque;
4
5 #[repr(C)]
6 pub struct Pointers<T> {
7 a: NonNull<f32>,
8 b: NonNull<T>,
9 c: NonNull<Opaque>,
10 d: NonNull<NonNull<T>>,
11 e: NonNull<NonNull<f32>>,
12 f: NonNull<NonNull<Opaque>>,
13 g: Option<NonNull<T>>,
14 h: Option<NonNull<i32>>,
15 i: Option<NonNull<NonNull<i32>>>,
16 j: *const T,
17 k: *mut T,
18 }
19
20 #[repr(C)]
21 pub struct References<'a> {
22 a: &'a Opaque,
23 b: &'a mut Opaque,
24 c: Option<&'a Opaque>,
25 d: Option<&'a mut Opaque>,
26 }
27
28 #[no_mangle]
value_arg(arg: References<'static>)29 pub extern "C" fn value_arg(arg: References<'static>) {}
30
31 #[no_mangle]
mutltiple_args( arg: NonNull<i32>, foo: *mut Pointers<u64>, d: NonNull<NonNull<Opaque>>, )32 pub extern "C" fn mutltiple_args(
33 arg: NonNull<i32>,
34 foo: *mut Pointers<u64>,
35 d: NonNull<NonNull<Opaque>>,
36 ) {
37 }
38
39 #[no_mangle]
ref_arg(arg: &Pointers<u64>)40 pub extern "C" fn ref_arg(arg: &Pointers<u64>) {}
41
42 #[no_mangle]
mut_ref_arg(arg: &mut Pointers<u64>)43 pub extern "C" fn mut_ref_arg(arg: &mut Pointers<u64>) {}
44
45 #[no_mangle]
optional_ref_arg(arg: Option<&Pointers<u64>>)46 pub extern "C" fn optional_ref_arg(arg: Option<&Pointers<u64>>) {}
47
48 #[no_mangle]
optional_mut_ref_arg(arg: Option<&mut Pointers<u64>>)49 pub extern "C" fn optional_mut_ref_arg(arg: Option<&mut Pointers<u64>>) {}
50
51 #[no_mangle]
nullable_const_ptr(arg: *const Pointers<u64>)52 pub extern "C" fn nullable_const_ptr(arg: *const Pointers<u64>) {}
53
54 #[no_mangle]
nullable_mut_ptr(arg: *mut Pointers<u64>)55 pub extern "C" fn nullable_mut_ptr(arg: *mut Pointers<u64>) {}
56