1use core::ffi::c_void;
2#[cfg(any(doc, not(feature = "unstable-objfw")))]
3use std::os::raw::c_char;
4use std::os::raw::c_int;
5#[cfg(any(doc, target_vendor = "apple"))]
6use std::os::raw::c_uint;
7
8#[cfg(any(doc, not(feature = "unstable-objfw")))]
9use crate::{objc_AssociationPolicy, BOOL};
10use crate::{objc_object, OpaqueData};
11
12#[repr(C)]
14pub struct objc_ivar {
15 _priv: [u8; 0],
16 _p: OpaqueData,
17}
18
19#[cfg(not(feature = "unstable-c-unwind"))]
20type InnerImp = unsafe extern "C" fn();
21#[cfg(feature = "unstable-c-unwind")]
22type InnerImp = unsafe extern "C-unwind" fn();
23
24pub type IMP = Option<InnerImp>;
28
29extern_c_unwind! {
40 #[cfg(any(doc, target_vendor = "apple", feature = "unstable-objfw"))]
42 pub fn objc_enumerationMutation(obj: *mut objc_object);
43}
44
45extern_c! {
46 #[cfg(any(doc, not(feature = "unstable-objfw")))]
47 pub fn imp_getBlock(imp: IMP) -> *mut objc_object;
48 #[cfg(any(doc, not(feature = "unstable-objfw")))]
50 pub fn imp_implementationWithBlock(block: *mut objc_object) -> IMP;
51 #[cfg(any(doc, not(feature = "unstable-objfw")))]
52 pub fn imp_removeBlock(imp: IMP) -> BOOL;
53
54 #[cfg(any(doc, not(feature = "unstable-objfw")))]
55 pub fn ivar_getName(ivar: *const objc_ivar) -> *const c_char;
56 #[cfg(any(doc, not(feature = "unstable-objfw")))]
57 pub fn ivar_getOffset(ivar: *const objc_ivar) -> isize;
58 #[cfg(any(doc, not(feature = "unstable-objfw")))]
59 pub fn ivar_getTypeEncoding(ivar: *const objc_ivar) -> *const c_char;
60
61 #[cfg(any(doc, target_vendor = "apple"))]
62 pub fn objc_copyClassNamesForImage(
63 image: *const c_char,
64 out_len: *mut c_uint,
65 ) -> *mut *const c_char;
66 #[cfg(any(doc, target_vendor = "apple"))]
67 pub fn objc_copyImageNames(out_len: *mut c_uint) -> *mut *const c_char;
69
70 #[cfg(any(doc, target_vendor = "apple", feature = "unstable-objfw"))]
71 pub fn objc_setEnumerationMutationHandler(
72 handler: Option<unsafe extern "C" fn(obj: *mut objc_object)>,
73 );
74
75 #[cfg(any(doc, not(feature = "unstable-objfw")))]
76 pub fn objc_getAssociatedObject(
77 object: *const objc_object,
78 key: *const c_void,
79 ) -> *const objc_object;
80 #[cfg(any(doc, not(feature = "unstable-objfw")))]
81 pub fn objc_setAssociatedObject(
82 object: *mut objc_object,
83 key: *const c_void,
84 value: *mut objc_object,
85 policy: objc_AssociationPolicy,
86 );
87 #[cfg(any(doc, not(feature = "unstable-objfw")))]
88 pub fn objc_removeAssociatedObjects(object: *mut objc_object);
89
90 #[cfg(any(doc, target_vendor = "apple", feature = "unstable-objfw"))]
91 pub fn objc_setForwardHandler(fwd: *mut c_void, fwd_stret: *mut c_void);
92 pub fn objc_sync_enter(obj: *mut objc_object) -> c_int;
97 pub fn objc_sync_exit(obj: *mut objc_object) -> c_int;
98
99 }