Skip to main content

apple_cf/ffi/
dispatch_extras.rs

1#![allow(missing_docs)]
2
3use core::ffi::c_void;
4
5extern "C" {
6/// Swift bridge function `acf_dispatch_async_f` for the corresponding Apple API.
7    pub fn acf_dispatch_async_f(
8        queue: *mut c_void,
9        context: *mut c_void,
10        work: extern "C" fn(*mut c_void),
11    );
12/// Swift bridge function `acf_dispatch_async_and_wait_f` for the corresponding Apple API.
13    pub fn acf_dispatch_async_and_wait_f(
14        queue: *mut c_void,
15        context: *mut c_void,
16        work: extern "C" fn(*mut c_void),
17    );
18/// Swift bridge function `acf_dispatch_apply_f` for the corresponding Apple API.
19    pub fn acf_dispatch_apply_f(
20        iterations: usize,
21        queue: *mut c_void,
22        context: *mut c_void,
23        work: extern "C" fn(usize, *mut c_void),
24    );
25
26/// Swift bridge function `acf_dispatch_group_create` for the corresponding Apple API.
27    pub fn acf_dispatch_group_create() -> *mut c_void;
28/// Swift bridge function `acf_dispatch_group_enter` for the corresponding Apple API.
29    pub fn acf_dispatch_group_enter(group: *mut c_void);
30/// Swift bridge function `acf_dispatch_group_leave` for the corresponding Apple API.
31    pub fn acf_dispatch_group_leave(group: *mut c_void);
32/// Swift bridge function `acf_dispatch_group_wait` for the corresponding Apple API.
33    pub fn acf_dispatch_group_wait(group: *mut c_void, timeout_ms: i64) -> bool;
34
35/// Swift bridge function `acf_dispatch_semaphore_create` for the corresponding Apple API.
36    pub fn acf_dispatch_semaphore_create(value: i64) -> *mut c_void;
37/// Swift bridge function `acf_dispatch_semaphore_signal` for the corresponding Apple API.
38    pub fn acf_dispatch_semaphore_signal(semaphore: *mut c_void) -> i64;
39/// Swift bridge function `acf_dispatch_semaphore_wait` for the corresponding Apple API.
40    pub fn acf_dispatch_semaphore_wait(semaphore: *mut c_void, timeout_ms: i64) -> bool;
41
42/// Swift bridge function `acf_dispatch_source_timer_create` for the corresponding Apple API.
43    pub fn acf_dispatch_source_timer_create(interval_ms: u64, leeway_ms: u64) -> *mut c_void;
44/// Swift bridge function `acf_dispatch_source_timer_resume` for the corresponding Apple API.
45    pub fn acf_dispatch_source_timer_resume(source: *mut c_void);
46/// Swift bridge function `acf_dispatch_source_timer_cancel` for the corresponding Apple API.
47    pub fn acf_dispatch_source_timer_cancel(source: *mut c_void);
48/// Swift bridge function `acf_dispatch_source_timer_fire_count` for the corresponding Apple API.
49    pub fn acf_dispatch_source_timer_fire_count(source: *mut c_void) -> u64;
50}