picofuse-objc

runtime.h
Go to the documentation of this file.
1 
10 #pragma once
11 #include <stdbool.h>
12 #include <stddef.h>
13 #include <stdint.h>
14 
18 typedef struct objc_object *id;
19 
23 typedef const struct objc_selector *SEL;
24 
28 typedef struct objc_class *Class;
29 
33 typedef id (*IMP)(id, SEL, ...);
34 
38 typedef struct objc_method *Method;
39 
43 typedef struct objc_protocol objc_protocol_t;
44 
48 #define nil ((id)0)
49 
53 #define Nil ((Class)0)
54 
55 // Booleans
56 
60 typedef bool BOOL;
61 
65 #define YES true
66 
70 #define NO false
71 
80 #if __has_attribute(objc_root_class)
81 #define OBJC_ROOT_CLASS __attribute__((objc_root_class))
82 #else
83 #define OBJC_ROOT_CLASS
84 #endif
85 
94 #if __has_attribute(unused)
95 #define OBJC_UNUSED __attribute__((unused))
96 #else
97 #define OBJC_UNUSED
98 #endif
99 
109 #define OBJC_REQUIRES_NIL_TERMINATION
110 
117 Class objc_lookupClass(const char *name);
118 
128 size_t objc_getClassList(Class *classes, size_t count);
129 
137 const char *class_getName(Class cls);
138 
146 const char *object_getClassName(id obj);
147 
154 Class object_getClass(id object);
155 
162 void object_setClass(id object, Class cls);
163 
172 BOOL object_respondsToSelector(id object, SEL sel);
173 
181 const char *object_getMethodTypes(id object, SEL sel);
182 
190 
198 
207 BOOL object_isKindOfClass(id object, Class cls);
208 
216 size_t class_getInstanceSize(Class cls);
217 
226 
235 BOOL class_respondsToSelector(Class cls, SEL sel);
236 
245 IMP objc_msg_lookup(id receiver, SEL selector);
246 
255 void objc_enumerationMutation(id object);
256 
263 const char *sel_getName(SEL sel);
264 
272 const char *proto_getName(objc_protocol_t *protocol);
273 
282  objc_protocol_t *otherProtocol);
283 
292 BOOL class_conformsTo(Class cls, objc_protocol_t *otherProtocol);
size_t class_getInstanceSize(Class cls)
Returns the size of an instance of a class.
BOOL class_metaclassRespondsToSelector(Class cls, SEL sel)
Checks if a class object responds to a selector.
BOOL proto_conformsTo(objc_protocol_t *protocol, objc_protocol_t *otherProtocol)
Checks if a protocol conforms to another protocol.
Class object_getSuperclass(id obj)
Returns the superclass of an object.
id(* IMP)(id, SEL,...)
A pointer to a method implementation.
Definition: runtime.h:33
const char * object_getClassName(id obj)
Returns the name of an object&#39;s class.
BOOL object_isKindOfClass(id object, Class cls)
Checks if an instance class matches, or subclass of another class.
void object_setClass(id object, Class cls)
Sets the class of an object.
BOOL object_respondsToSelector(id object, SEL sel)
Checks if an instance&#39;s class responds to a selector.
struct objc_protocol objc_protocol_t
An instance of a protocol.
Definition: runtime.h:43
void objc_enumerationMutation(id object)
Panics, as a collection changed while a for...in loop went through it.
Class class_getSuperclass(Class cls)
Returns the superclass of a class.
Class object_getClass(id object)
Returns the class of an object.
BOOL class_respondsToSelector(Class cls, SEL sel)
Checks if an instance of a class responds to a selector.
Class objc_lookupClass(const char *name)
Looks up a class by name.
IMP objc_msg_lookup(id receiver, SEL selector)
Finds the implementation of a method, as when a message is sent.
const char * proto_getName(objc_protocol_t *protocol)
Returns the name of a protocol.
const char * sel_getName(SEL sel)
Returns the name of a selector.
bool BOOL
A Boolean value.
Definition: runtime.h:60
struct objc_method * Method
A pointer to a method.
Definition: runtime.h:38
BOOL class_conformsTo(Class cls, objc_protocol_t *otherProtocol)
Checks if a class conforms to a protocol.
struct objc_class * Class
A pointer to a class definition.
Definition: runtime.h:28
const struct objc_selector * SEL
A pointer to a method selector.
Definition: runtime.h:23
size_t objc_getClassList(Class *classes, size_t count)
Returns the classes which are registered.
const char * class_getName(Class cls)
Returns the name of a class.
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
const char * object_getMethodTypes(id object, SEL sel)
Returns the types of a method&#39;s result and arguments.