00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _OBJC_RUNTIME_H_
00030 #define _OBJC_RUNTIME_H_
00031
00032
00033 #include "objc/objc.h"
00034 #include "objc/objc-class.h"
00035
00036 typedef struct objc_symtab *Symtab;
00037
00038 struct objc_symtab {
00039 unsigned long sel_ref_cnt;
00040 SEL *refs;
00041 unsigned short cls_def_cnt;
00042 unsigned short cat_def_cnt;
00043 void *defs[1];
00044 };
00045
00046 typedef struct objc_module *Module;
00047
00048 struct objc_module {
00049 unsigned long version;
00050 unsigned long size;
00051 const char *name;
00052 Symtab symtab;
00053 };
00054
00055 struct objc_super {
00056 id receiver;
00057
00058 Class pclass;
00059 };
00060
00061
00062
00063 OBJC_EXPORT id objc_getClass(const char *name);
00064 OBJC_EXPORT id objc_getMetaClass(const char *name);
00065 OBJC_EXPORT id objc_msgSend(id self, SEL op, ...);
00066 #if defined(WINNT) || defined(__cplusplus)
00067
00068
00069 OBJC_EXPORT id objc_msgSend_stret(id self, SEL op, ...);
00070 #else
00071 OBJC_EXPORT void objc_msgSend_stret(void * stretAddr, id self, SEL op, ...);
00072 #endif
00073 OBJC_EXPORT id objc_msgSendSuper(struct objc_super *super, SEL op, ...);
00074 #if defined(WINNT) || defined(__cplusplus)
00075
00076
00077 OBJC_EXPORT id objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...);
00078 #else
00079 OBJC_EXPORT void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super, SEL op, ...);
00080 #endif
00081
00082
00083
00084 OBJC_EXPORT id objc_msgSendv(id self, SEL op, unsigned arg_size, marg_list arg_frame);
00085 OBJC_EXPORT void objc_msgSendv_stret(void * stretAddr, id self, SEL op, unsigned arg_size, marg_list arg_frame);
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 OBJC_EXPORT int objc_getClassList(Class *buffer, int bufferLen);
00117
00118 #define OBSOLETE_OBJC_GETCLASSES 1
00119 #if OBSOLETE_OBJC_GETCLASSES
00120 OBJC_EXPORT void *objc_getClasses(void);
00121 #endif
00122
00123 OBJC_EXPORT id objc_lookUpClass(const char *name);
00124 OBJC_EXPORT void objc_addClass(Class myClass);
00125
00126
00127
00128 OBJC_EXPORT void objc_setClassHandler(int (*)(const char *));
00129
00130
00131 OBJC_EXPORT void objc_setMultithreaded (BOOL flag);
00132
00133
00134
00135 OBJC_EXPORT id (*_alloc)(Class, unsigned int);
00136 OBJC_EXPORT id (*_copy)(id, unsigned int);
00137 OBJC_EXPORT id (*_realloc)(id, unsigned int);
00138 OBJC_EXPORT id (*_dealloc)(id);
00139 OBJC_EXPORT id (*_zoneAlloc)(Class, unsigned int, void *);
00140 OBJC_EXPORT id (*_zoneRealloc)(id, unsigned int, void *);
00141 OBJC_EXPORT id (*_zoneCopy)(id, unsigned int, void *);
00142
00143 OBJC_EXPORT void (*_error)(id, const char *, va_list);
00144
00145
00146 #endif