3 (cffi:defctype BOOL
(:boolean
:char
))
4 (cffi:defctype id
:pointer
)
5 (cffi:defctype Ivar
:pointer
)
6 (cffi:defctype Method
:pointer
)
7 (cffi:defctype Class
:pointer
)
8 (cffi:defctype SEL
:pointer
)
10 ;; warning needs pitstop each pipe.
11 ;; then a lot of touching up at the end
12 ;; grep -h "OBJC_EXPORT" /usr/include/objc/objc(|-(|class|runtime)).h | grep -v ")(" | tr "\t" " " | sed -e 's/ *OBJC_EXPORT *\(.*\)/\1/' | sed -e 's/ (/(/' | sed -e 's/\(.*\) \(.*\)[ ]*(\(.*\));/(cffi:defcfun ("\2" %\2) :\1 (\3))/' -e 's/\.\.\./\&rest/' | sed -e 's/\, /\) \(/g' | sed -e 's/(\([^ ]*\) \([^ )]*\))/(\2 \1)/g' | sed -e 's/(\([^ ]*\) \([^ )]*\))/(\2 \1)/'
14 (cffi:defcfun
("objc_collect_if_needed" %objc_collect_if_needed
)
15 :void
(options :unsigned-long
))
17 (cffi:defcfun
("objc_numberAllocated" %objc_numberAllocated
)
20 (cffi:defcfun
("objc_collecting_enabled" %objc_collecting_enabled
)
23 (cffi:defcfun
("objc_allocate_object" %objc_allocate_object
)
24 id
(cls Class
) (extra :int
))
26 (cffi:defcfun
("objc_assign_strongCast" %objc_assign_strongCast
)
27 id
(val id
) (dest :pointer
)) ;; dest is type id *
29 (cffi:defcfun
("objc_assign_global" %objc_assign_global
)
30 id
(val id
) (dest :pointer
)) ;; dest is type id *
32 (cffi:defcfun
("objc_assign_ivar" %objc_assign_ivar
)
33 id
(value id
) (dest id
) (offset :unsigned-int
))
35 ;;(cffi:defcfun ("objc_memmove_collectable" %objc_memmove_collectable)
36 ;; :pointer (dst :pointer) (src :pointer) (size :int)) ;; size is type size_t
38 (cffi:defcfun
("objc_is_finalized" %objc_is_finalized
)
41 (cffi:defcfun
("object_setInstanceVariable" %object_setInstanceVariable
)
42 Ivar
(id id
) (name :string
) (variable :pointer
))
44 (cffi:defcfun
("object_getInstanceVariable" %object_getInstanceVariable
)
45 Ivar
(id id
) (name :string
) (variable :pointer
)) ;; varible is type void **
47 (cffi:defcfun
("class_createInstance" %class_createInstance
)
48 id
(class Class
) (idxIvars :unsigned-int
))
50 (cffi:defcfun
("class_createInstanceFromZone" %class_createInstanceFromZone
)
51 id
(class Class
) (idxIvars :unsigned-int
) (z :pointer
))
53 (cffi:defcfun
("class_setVersion" %class_setVersion
)
54 :void
(class Class
) (version :int
))
56 (cffi:defcfun
("class_getVersion" %class_getVersion
)
59 (cffi:defcfun
("class_getInstanceVariable" %class_getInstanceVariable
)
60 Ivar
(class Class
) (variable :string
))
62 (cffi:defcfun
("class_getInstanceMethod" %class_getInstanceMethod
)
63 Method
(class Class
) (selector SEL
))
65 (cffi:defcfun
("class_getClassMethod" %class_getClassMethod
)
66 Method
(class Class
) (selector SEL
))
68 (cffi:defcfun
("class_addMethods" %class_addMethods
)
69 :void
(class Class
) (method-list :pointer
)) ;; method-list is type struct objc_method_list *
71 (cffi:defcfun
("class_removeMethods" %class_removeMethods
)
72 :void
(class Class
) (method-list :pointer
)) ;; method-list is type struct objc_method_list *
74 (cffi:defcfun
("class_poseAs" %class_poseAs
)
75 Class
(imposter Class
) (original Class
))
77 (cffi:defcfun
("method_getNumberOfArguments" %method_getNumberOfArguments
)
78 :unsigned-int
(method Method
))
80 (cffi:defcfun
("method_getSizeOfArguments" %method_getSizeOfArguments
)
81 :unsigned-int
(method Method
))
83 (cffi:defcfun
("method_getArgumentInfo" %method_getArgumentInfo
)
84 :unsigned-int
(m Method
) (arg :int
) (type :pointer
) (offset :pointer
)) ;; type is type const char **, offset is type int *
86 (cffi:defcfun
("class_nextMethodList" %class_nextMethodList
)
87 :pointer
(class Class
) (method-list :pointer
)) ;; void **, return type is struct objc_method_list *
89 (cffi:defcfun
("objc_exception_throw" %objc_exception_throw
)
92 (cffi:defcfun
("objc_exception_try_enter" %objc_exception_try_enter
)
93 :void
(localExceptionData :pointer
))
95 (cffi:defcfun
("objc_exception_try_exit" %objc_exception_try_exit
)
96 :void
(localExceptionData :pointer
))
98 (cffi:defcfun
("objc_exception_extract" %objc_exception_extract
)
99 id
(localExceptionData :pointer
))
101 (cffi:defcfun
("objc_exception_match" %objc_exception_match
)
102 :int
(exceptionClass Class
) (exception id
))
104 (cffi:defcfun
("objc_exception_get_functions" %objc_exception_get_functions
)
105 :void
(table :pointer
)) ;; table is type objc_exception_functions_t *
107 (cffi:defcfun
("objc_exception_set_functions" %objc_exception_set_functions
)
108 :void
(table :pointer
)) ;; table is type objc_exception_functions_t *
110 (cffi:defcfun
("objc_getClass" %objc_getClass
)
113 (cffi:defcfun
("objc_getMetaClass" %objc_getMetaClass
)
116 (cffi:defcfun
("objc_msgSend" %objc_msgSend
)
117 id
(self id
) (op SEL
) &rest
)
119 (cffi:defcfun
("objc_msgSendSuper" %objc_msgSendSuper
)
120 id
(super :pointer
) (op SEL
) &rest
) ;; super is type struct objc_super *
122 (cffi:defcfun
("objc_msgSend_fpret" %objc_msgSend_fpret
)
123 :double
(self id
) (op SEL
) &rest
)
125 (cffi:defcfun
("objc_msgSend_stret" %objc_msgSend_stret
)
126 id
(self id
) (op SEL
) &rest
)
128 (cffi:defcfun
("objc_msgSendSuper_stret" %objc_msgSendSuper_stret
)
129 id
(super :pointer
) (op SEL
) &rest
) ;; super is type struct objc_super *
131 (cffi:defcfun
("objc_msgSend_stret" %objc_msgSend_stret
)
132 :void
(stretAddr :pointer
) (self id
) (op SEL
) &rest
)
134 (cffi:defcfun
("objc_msgSendSuper_stret" %objc_msgSendSuper_stret
)
135 :void
(stretAddr :pointer
) (super :pointer
) (op SEL
) &rest
) ;; super is type struct objc_super *
137 ;;(cffi:defcfun ("objc_msgSendv" %objc_msgSendv)
138 ;; id (self id) (op SEL) (arg_size :unsigned-int) (arg_frame marg_list))
140 ;;(cffi:defcfun ("objc_msgSendv_stret" %objc_msgSendv_stret)
141 ;; :void (stretAddr :pointer) (self id) (op SEL) (arg_size :unsigned-int) (arg_frame marg_list))
143 ;;(cffi:defcfun ("objc_msgSendv_fpret" %objc_msgSendv_fpret)
144 ;; :double (self id) (op SEL) (arg_size :unsigned-int) (arg_frame marg_list))
146 (cffi:defcfun
("objc_getClassList" %objc_getClassList
)
147 :int
(buffer :pointer
) (bufferLen :int
)) ;; buffer is type Class *
149 (cffi:defcfun
("objc_getClasses" %objc_getClasses
)
152 (cffi:defcfun
("objc_lookUpClass" %objc_lookUpClass
)
155 (cffi:defcfun
("objc_getRequiredClass" %objc_getRequiredClass
)
158 (cffi:defcfun
("objc_addClass" %objc_addClass
)
159 :void
(myClass Class
))
161 (cffi:defcfun
("objc_setMultithreaded" %objc_setMultithreaded
)
164 (cffi:defcfun
("objc_sync_enter" %objc_sync_enter
)
167 (cffi:defcfun
("objc_sync_exit" %objc_sync_exit
)
170 (cffi:defcfun
("objc_sync_wait" %objc_sync_wait
)
171 :int
(obj id
) (milliSecondsMaxWait :long-long
))
173 (cffi:defcfun
("objc_sync_notify" %objc_sync_notify
)
176 (cffi:defcfun
("objc_sync_notifyAll" %objc_sync_notifyAll
)
179 (cffi:defcfun
("sel_isMapped" %sel_isMapped
)
182 (cffi:defcfun
("sel_getName" %sel_getName
)
185 (cffi:defcfun
("sel_getUid" %sel_getUid
)
188 (cffi:defcfun
("sel_registerName" %sel_registerName
)
191 (cffi:defcfun
("object_getClassName" %object_getClassName
)
194 (cffi:defcfun
("object_getIndexedIvars" %object_getIndexedIvars
)