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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#[cfg(not(objfw))]
use core::ffi::c_void;
use std::os::raw::c_char;
#[cfg(not(objfw))]
use crate::objc_ivar;
use crate::{objc_class, OpaqueData};
#[repr(C)]
pub struct objc_object {
_priv: [u8; 0],
_p: OpaqueData,
}
extern_c! {
pub fn object_getClass(obj: *const objc_object) -> *const objc_class;
pub fn object_getClassName(obj: *const objc_object) -> *const c_char;
pub fn object_setClass(obj: *mut objc_object, cls: *const objc_class) -> *const objc_class;
#[cfg(not(objfw))]
pub fn object_getIndexedIvars(obj: *const objc_object) -> *const c_void;
#[cfg(not(objfw))]
pub fn object_getIvar(obj: *const objc_object, ivar: *const objc_ivar) -> *const objc_object;
#[cfg(not(objfw))]
pub fn object_setIvar(obj: *mut objc_object, ivar: *const objc_ivar, value: *mut objc_object);
#[deprecated = "Not needed since ARC"]
#[cfg(apple)]
pub fn object_copy(obj: *const objc_object, size: usize) -> *mut objc_object;
#[deprecated = "Not needed since ARC"]
#[cfg(not(objfw))]
pub fn object_dispose(obj: *mut objc_object) -> *mut objc_object;
#[deprecated = "Not needed since ARC"]
#[cfg(not(objfw))]
pub fn object_setInstanceVariable(
obj: *mut objc_object,
name: *const c_char,
value: *mut c_void,
) -> *const objc_ivar;
#[deprecated = "Not needed since ARC"]
#[cfg(not(objfw))]
pub fn object_getInstanceVariable(
obj: *const objc_object,
name: *const c_char,
out_value: *mut *const c_void,
) -> *const objc_ivar;
#[deprecated = "Not needed since ARC"]
#[cfg(apple)]
pub fn objc_getFutureClass(name: *const c_char) -> *const objc_class;
#[deprecated = "Not needed since ARC"]
#[cfg(apple)]
pub fn objc_constructInstance(cls: *const objc_class, bytes: *mut c_void) -> *mut objc_object;
#[deprecated = "Not needed since ARC"]
#[cfg(apple)]
pub fn objc_destructInstance(obj: *mut objc_object) -> *mut c_void;
}