2 #import <objc/objc-class.h>
5 typedef struct objc_method
*Method
;
6 typedef struct objc_ivar
*Ivar
;
7 typedef struct objc_category
*Category
;
8 typedef struct objc_property
*objc_property_t
;
10 OBJC_EXPORT id
objc_lookUpClass(const char *name
);
11 OBJC_EXPORT id
objc_getClass(const char *name
);
12 OBJC_EXPORT
int objc_getClassList(Class
*list
, int listCapacity
);
13 OBJC_EXPORT Class
objc_getFutureClass(const char *name
);
14 OBJC_EXPORT id
objc_getMetaClass(const char *name
);
15 OBJC_EXPORT id
objc_getRequiredClass(const char *name
);
16 OBJC_EXPORT Protocol
*objc_getProtocol(const char *name
);
17 OBJC_EXPORT Protocol
**objc_copyProtocolList(unsigned int *countp
);
18 OBJC_EXPORT
void objc_addClass(Class cls
);
19 OBJC_EXPORT
void objc_registerClassPair(Class cls
);
20 OBJC_EXPORT
void objc_setFutureClass(Class cls
, const char *name
);
21 OBJC_EXPORT Class
objc_allocateClassPair(Class parent
, const char *name
, size_t extraBytes
);
22 OBJC_EXPORT
void objc_setForwardHandler(void *handler
, void *handler_stret
);
23 OBJC_EXPORT
const char **objc_copyImageNames(unsigned *count
); // free the ptr but not the strings
25 OBJC_EXPORT
const char *class_getName(Class cls
);
26 OBJC_EXPORT BOOL
class_isMetaClass(Class cls
);
27 OBJC_EXPORT Class
class_getSuperclass(Class cls
);
28 OBJC_EXPORT
int class_getVersion(Class cls
);
29 OBJC_EXPORT Method
class_getClassMethod(Class cls
, SEL selector
);
30 OBJC_EXPORT Ivar
class_getClassVariable(Class cls
, const char *name
);
31 OBJC_EXPORT Method
class_getInstanceMethod(Class cls
, SEL selector
);
32 OBJC_EXPORT
size_t class_getInstanceSize(Class cls
);
33 OBJC_EXPORT Ivar
class_getInstanceVariable(Class cls
, const char *name
);
34 OBJC_EXPORT
const char *class_getIvarLayout(Class cls
);
35 OBJC_EXPORT IMP
class_getMethodImplementation(Class cls
, SEL selector
);
36 OBJC_EXPORT IMP
class_getMethodImplementation_stret(Class cls
, SEL selector
);
37 OBJC_EXPORT objc_property_t
class_getProperty(Class cls
, const char *name
);
38 OBJC_EXPORT
const char *class_getWeakIvarLayout(Class cls
);
39 OBJC_EXPORT Ivar
*class_copyIvarList(Class cls
, unsigned int *countp
);
40 OBJC_EXPORT Method
*class_copyMethodList(Class cls
, unsigned int *countp
);
41 OBJC_EXPORT objc_property_t
*class_copyPropertyList(Class cls
, unsigned int *countp
);
42 OBJC_EXPORT Protocol
**class_copyProtocolList(Class cls
, unsigned int *countp
);
44 OBJC_EXPORT Class
class_setSuperclass(Class cls
, Class parent
);
45 OBJC_EXPORT
void class_setVersion(Class cls
, int version
);
46 OBJC_EXPORT
void class_setIvarLayout(Class cls
, const char *layout
);
47 OBJC_EXPORT
void class_setWeakIvarLayout(Class cls
, const char *layout
);
49 OBJC_EXPORT BOOL
class_addIvar(Class cls
, const char *name
, size_t size
, uint8_t alignment
, const char *type
);
50 OBJC_EXPORT BOOL
class_addMethod(Class cls
, SEL selector
, IMP imp
, const char *types
);
51 OBJC_EXPORT BOOL
class_addProtocol(Class cls
, Protocol
*protocol
);
52 OBJC_EXPORT BOOL
class_conformsToProtocol(Class cls
, Protocol
*protocol
);
53 OBJC_EXPORT id
class_createInstance(Class cls
, size_t extraBytes
);
54 OBJC_EXPORT IMP
class_replaceMethod(Class cls
, SEL selector
, IMP imp
, const char *types
);
55 OBJC_EXPORT BOOL
class_respondsToSelector(Class cls
, SEL selector
);
56 OBJC_EXPORT
const char *class_getImageName(Class cls
);
58 OBJC_EXPORT
const char *protocol_getName(Protocol
*protocol
);
59 OBJC_EXPORT objc_property_t
protocol_getProperty(Protocol
*protocol
, const char *name
, BOOL isRequired
, BOOL isInstance
);
60 OBJC_EXPORT objc_property_t
*protocol_copyPropertyList(Protocol
*protocol
, unsigned int *countp
);
61 OBJC_EXPORT Protocol
**protocol_copyProtocolList(Protocol
*protocol
, unsigned int *countp
);
62 OBJC_EXPORT
struct objc_method_description
*protocol_copyMethodDescriptionList(Protocol
*protocol
, BOOL isRequired
, BOOL isInstance
, unsigned int *countp
);
63 OBJC_EXPORT
struct objc_method_description
protocol_getMethodDescription(Protocol
*protocol
, SEL selector
, BOOL isRequired
, BOOL isInstance
);
64 OBJC_EXPORT BOOL
protocol_conformsToProtocol(Protocol
*protocol
, Protocol
*other
);
65 OBJC_EXPORT BOOL
protocol_isEqual(Protocol
*protocol
, Protocol
*other
);
67 OBJC_EXPORT
const char *sel_getName(SEL selector
);
68 OBJC_EXPORT SEL
sel_getUid(const char *name
);
69 OBJC_EXPORT BOOL
sel_isEqual(SEL selector
, SEL other
);
70 OBJC_EXPORT SEL
sel_registerName(const char *name
);
72 OBJC_EXPORT
const char *property_getAttributes(objc_property_t property
);
73 OBJC_EXPORT
const char *property_getName(objc_property_t property
);
75 OBJC_EXPORT
const char *ivar_getName(Ivar ivar
);
76 OBJC_EXPORT
size_t ivar_getOffset(Ivar ivar
);
77 OBJC_EXPORT
const char *ivar_getTypeEncoding(Ivar ivar
);
79 OBJC_EXPORT IMP
method_getImplementation(Method method
);
80 OBJC_EXPORT SEL
method_getName(Method method
);
81 OBJC_EXPORT
unsigned method_getNumberOfArguments(Method method
);
82 OBJC_EXPORT
void method_getReturnType(Method method
, char *type
, size_t typeCapacity
);
83 OBJC_EXPORT
void method_getArgumentType(Method method
, unsigned int index
, char *type
, size_t typeCapacity
);
84 OBJC_EXPORT
char *method_copyReturnType(Method method
);
85 OBJC_EXPORT
char *method_copyArgumentType(Method method
, unsigned int index
);
86 OBJC_EXPORT
const char *method_getTypeEncoding(Method method
);
87 OBJC_EXPORT IMP
method_setImplementation(Method method
, IMP imp
);
88 OBJC_EXPORT
void method_exchangeImplementations(Method method
, Method other
);
90 OBJC_EXPORT Class
object_getClass(id object
);
91 OBJC_EXPORT
const char *object_getClassName(id object
);
92 OBJC_EXPORT Ivar
object_getInstanceVariable(id object
, const char *name
, void **ptrToValuep
);
93 OBJC_EXPORT id
object_getIvar(id object
, Ivar ivar
);
94 OBJC_EXPORT
void *object_getIndexedIvars(id object
);
95 OBJC_EXPORT Class
object_setClass(id object
, Class cls
);
96 OBJC_EXPORT Ivar
object_setInstanceVariable(id object
, const char *name
, void *ptrToValue
);
97 OBJC_EXPORT
void object_setIvar(id object
, Ivar ivar
, id value
);
99 OBJC_EXPORT id
object_copy(id object
, size_t size
);
100 OBJC_EXPORT id
object_dispose(id object
);
103 OBJC_ASSOCIATION_ASSIGN
= 0,
104 OBJC_ASSOCIATION_RETAIN_NONATOMIC
= 1,
105 OBJC_ASSOCIATION_COPY_NONATOMIC
= 3,
106 OBJC_ASSOCIATION_RETAIN
= 01401,
107 OBJC_ASSOCIATION_COPY
= 01403
108 } objc_AssociationPolicy
;
110 OBJC_EXPORT
void objc_setAssociatedObject(id object
, const void *key
, id value
, objc_AssociationPolicy policy
);
111 OBJC_EXPORT id
objc_getAssociatedObject(id object
, const void *key
);
112 OBJC_EXPORT
void objc_removeAssociatedObjects(id object
);
114 // FIXME. Non-compliant API. TO BE CLEANED UP.
116 OBJC_EXPORT
const char *objc_mainImageName();
117 OBJC_EXPORT
void OBJCResetModuleQueue(void);
118 OBJC_EXPORT
void OBJCLinkQueuedModulesToObjectFileWithPath(const char *path
);
120 OBJC_EXPORT
void objc_enableMessageLoggingWithCount(int count
);
121 OBJC_EXPORT
void OBJCEnableMsgTracing();
122 OBJC_EXPORT
void OBJCDisableMsgTracing();
124 OBJC_EXPORT
void OBJCInitializeProcess();
126 OBJC_EXPORT BOOL
object_cxxConstruct(id self
, Class c
);
127 OBJC_EXPORT BOOL
object_cxxDestruct(id self
, Class c
);