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
use std::os::raw::{c_char, c_uint};
use crate::{objc_selector, OpaqueData, IMP};
#[repr(C)]
pub struct objc_method {
    _priv: [u8; 0],
    _p: OpaqueData,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct objc_method_description {
    
    pub name: *const objc_selector,
    
    pub types: *const c_char,
}
extern "C" {
    pub fn method_copyArgumentType(method: *const objc_method, index: c_uint) -> *mut c_char;
    pub fn method_copyReturnType(method: *const objc_method) -> *mut c_char;
    pub fn method_exchangeImplementations(method1: *mut objc_method, method2: *mut objc_method);
    pub fn method_getArgumentType(
        method: *const objc_method,
        index: c_uint,
        dst: *mut c_char,
        dst_len: usize,
    );
    #[cfg(apple)]
    pub fn method_getDescription(m: *const objc_method) -> *const objc_method_description;
    pub fn method_getImplementation(method: *const objc_method) -> IMP;
    pub fn method_getName(method: *const objc_method) -> *const objc_selector;
    pub fn method_getNumberOfArguments(method: *const objc_method) -> c_uint;
    pub fn method_getReturnType(method: *const objc_method, dst: *mut c_char, dst_len: usize);
    pub fn method_getTypeEncoding(method: *const objc_method) -> *const c_char;
    pub fn method_setImplementation(method: *const objc_method, imp: IMP) -> IMP;
}