File: va_list.rs

package info (click to toggle)
rust-cbindgen 0.27.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: ansic: 15; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 871 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::ffi::VaList;

#[no_mangle]
pub unsafe extern "C" fn va_list_test(count: int32_t, mut ap: VaList) -> int32_t {
    ap.arg()
}

#[no_mangle]
pub unsafe extern "C" fn va_list_test2(count: int32_t, mut ap: ...) -> int32_t {
    ap.arg()
}

type VaListFnPtr = Option<unsafe extern "C" fn(count: int32_t, VaList) -> int32_t>;
type VaListFnPtr2 = Option<unsafe extern "C" fn(count: int32_t, ...) -> int32_t>;

#[repr(C)]
struct Interface<T> {
    fn1: T,
}

#[no_mangle]
pub extern "C" fn va_list_fn_ptrs(
    fn1: Option<unsafe extern "C" fn(count: int32_t, VaList) -> int32_t>,
    fn2: Option<unsafe extern "C" fn(count: int32_t, ...) -> int32_t>,
    fn3: VaListFnPtr,
    fn4: VaListFnPtr2,
    fn5: Interface<Option<unsafe extern "C" fn(count: int32_t, VaList) -> int32_t>>,
    fn6: Interface<Option<unsafe extern "C" fn(count: int32_t, ...) -> int32_t>>,
) {
}