]> git.saurik.com Git - apple/objc4.git/blob - runtime/runtime.h
objc4-437.1.tar.gz
[apple/objc4.git] / runtime / runtime.h
1 /*
2 * Copyright (c) 1999-2007 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _OBJC_RUNTIME_H
25 #define _OBJC_RUNTIME_H
26
27 #include <objc/objc.h>
28 #include <stdarg.h>
29 #include <stdint.h>
30 #include <stddef.h>
31 #include <AvailabilityMacros.h>
32 #include <TargetConditionals.h>
33
34 #if TARGET_OS_MAC
35 #include <sys/types.h>
36 #endif
37
38
39 /* Types */
40
41 typedef struct objc_method *Method;
42 typedef struct objc_ivar *Ivar;
43 typedef struct objc_category *Category;
44 typedef struct objc_property *objc_property_t;
45
46 struct objc_class {
47 Class isa;
48
49 #if !__OBJC2__
50 Class super_class OBJC2_UNAVAILABLE;
51 const char *name OBJC2_UNAVAILABLE;
52 long version OBJC2_UNAVAILABLE;
53 long info OBJC2_UNAVAILABLE;
54 long instance_size OBJC2_UNAVAILABLE;
55 struct objc_ivar_list *ivars OBJC2_UNAVAILABLE;
56 struct objc_method_list **methodLists OBJC2_UNAVAILABLE;
57 struct objc_cache *cache OBJC2_UNAVAILABLE;
58 struct objc_protocol_list *protocols OBJC2_UNAVAILABLE;
59 #endif
60
61 } OBJC2_UNAVAILABLE;
62 /* Use `Class` instead of `struct objc_class *` */
63
64 #ifdef __OBJC__
65 @class Protocol;
66 #else
67 typedef struct objc_object Protocol;
68 #endif
69
70 struct objc_method_description {
71 SEL name;
72 char *types;
73 };
74
75
76 /* Functions */
77
78 OBJC_EXPORT id object_copy(id obj, size_t size);
79 OBJC_EXPORT id object_dispose(id obj);
80
81 OBJC_EXPORT Class object_getClass(id obj)
82 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
83 OBJC_EXPORT Class object_setClass(id obj, Class cls)
84 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
85
86 OBJC_EXPORT const char *object_getClassName(id obj);
87 OBJC_EXPORT void *object_getIndexedIvars(id obj);
88
89 OBJC_EXPORT id object_getIvar(id obj, Ivar ivar)
90 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
91 OBJC_EXPORT void object_setIvar(id obj, Ivar ivar, id value)
92 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
93
94 OBJC_EXPORT Ivar object_setInstanceVariable(id obj, const char *name, void *value);
95 OBJC_EXPORT Ivar object_getInstanceVariable(id obj, const char *name, void **outValue);
96
97 OBJC_EXPORT id objc_getClass(const char *name);
98 OBJC_EXPORT id objc_getMetaClass(const char *name);
99 OBJC_EXPORT id objc_lookUpClass(const char *name);
100 OBJC_EXPORT id objc_getRequiredClass(const char *name);
101 OBJC_EXPORT Class objc_getFutureClass(const char *name)
102 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
103 OBJC_EXPORT void objc_setFutureClass(Class cls, const char *name)
104 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
105 OBJC_EXPORT int objc_getClassList(Class *buffer, int bufferCount);
106
107 OBJC_EXPORT Protocol *objc_getProtocol(const char *name)
108 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
109 OBJC_EXPORT Protocol **objc_copyProtocolList(unsigned int *outCount)
110 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
111
112 OBJC_EXPORT const char *class_getName(Class cls)
113 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
114 OBJC_EXPORT BOOL class_isMetaClass(Class cls)
115 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
116 OBJC_EXPORT Class class_getSuperclass(Class cls)
117 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
118 OBJC_EXPORT Class class_setSuperclass(Class cls, Class newSuper)
119 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED;
120
121 OBJC_EXPORT int class_getVersion(Class cls);
122 OBJC_EXPORT void class_setVersion(Class cls, int version);
123
124 OBJC_EXPORT size_t class_getInstanceSize(Class cls)
125 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
126
127 OBJC_EXPORT Ivar class_getInstanceVariable(Class cls, const char *name);
128 OBJC_EXPORT Ivar class_getClassVariable(Class cls, const char *name)
129 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
130 OBJC_EXPORT Ivar *class_copyIvarList(Class cls, unsigned int *outCount)
131 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
132
133 OBJC_EXPORT Method class_getInstanceMethod(Class cls, SEL name);
134 OBJC_EXPORT Method class_getClassMethod(Class cls, SEL name);
135 OBJC_EXPORT IMP class_getMethodImplementation(Class cls, SEL name)
136 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
137 OBJC_EXPORT IMP class_getMethodImplementation_stret(Class cls, SEL name)
138 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
139 OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel)
140 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
141 OBJC_EXPORT Method *class_copyMethodList(Class cls, unsigned int *outCount)
142 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
143
144 OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol)
145 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
146 OBJC_EXPORT Protocol **class_copyProtocolList(Class cls, unsigned int *outCount)
147 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
148
149 OBJC_EXPORT objc_property_t class_getProperty(Class cls, const char *name)
150 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
151 OBJC_EXPORT objc_property_t *class_copyPropertyList(Class cls, unsigned int *outCount)
152 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
153
154 OBJC_EXPORT const char *class_getIvarLayout(Class cls)
155 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
156 OBJC_EXPORT const char *class_getWeakIvarLayout(Class cls)
157 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
158
159 OBJC_EXPORT id class_createInstance(Class cls, size_t extraBytes);
160
161 OBJC_EXPORT Class objc_allocateClassPair(Class superclass, const char *name,
162 size_t extraBytes)
163 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
164 OBJC_EXPORT void objc_registerClassPair(Class cls)
165 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
166 OBJC_EXPORT Class objc_duplicateClass(Class original, const char *name,
167 size_t extraBytes)
168 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
169 OBJC_EXPORT void objc_disposeClassPair(Class cls)
170 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
171
172 OBJC_EXPORT BOOL class_addMethod(Class cls, SEL name, IMP imp,
173 const char *types)
174 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
175 OBJC_EXPORT IMP class_replaceMethod(Class cls, SEL name, IMP imp,
176 const char *types)
177 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
178 OBJC_EXPORT BOOL class_addIvar(Class cls, const char *name, size_t size,
179 uint8_t alignment, const char *types)
180 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
181 OBJC_EXPORT BOOL class_addProtocol(Class cls, Protocol *protocol)
182 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
183 OBJC_EXPORT void class_setIvarLayout(Class cls, const char *layout)
184 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
185 OBJC_EXPORT void class_setWeakIvarLayout(Class cls, const char *layout)
186 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
187
188
189 OBJC_EXPORT SEL method_getName(Method m)
190 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
191 OBJC_EXPORT IMP method_getImplementation(Method m)
192 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
193 OBJC_EXPORT const char *method_getTypeEncoding(Method m)
194 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
195
196 OBJC_EXPORT unsigned int method_getNumberOfArguments(Method m);
197 OBJC_EXPORT char *method_copyReturnType(Method m)
198 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
199 OBJC_EXPORT char *method_copyArgumentType(Method m, unsigned int index)
200 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
201 OBJC_EXPORT void method_getReturnType(Method m, char *dst, size_t dst_len)
202 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
203 OBJC_EXPORT void method_getArgumentType(Method m, unsigned int index,
204 char *dst, size_t dst_len)
205 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
206 OBJC_EXPORT struct objc_method_description *method_getDescription(Method m)
207 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
208
209 OBJC_EXPORT IMP method_setImplementation(Method m, IMP imp)
210 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
211 OBJC_EXPORT void method_exchangeImplementations(Method m1, Method m2)
212 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
213
214 OBJC_EXPORT const char *ivar_getName(Ivar v)
215 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
216 OBJC_EXPORT const char *ivar_getTypeEncoding(Ivar v)
217 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
218 OBJC_EXPORT ptrdiff_t ivar_getOffset(Ivar v)
219 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
220
221 OBJC_EXPORT const char *property_getName(objc_property_t property)
222 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
223 OBJC_EXPORT const char *property_getAttributes(objc_property_t property)
224 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
225
226 OBJC_EXPORT BOOL protocol_conformsToProtocol(Protocol *proto, Protocol *other)
227 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
228 OBJC_EXPORT BOOL protocol_isEqual(Protocol *proto, Protocol *other)
229 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
230 OBJC_EXPORT const char *protocol_getName(Protocol *p)
231 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
232 OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protocol *p, SEL aSel, BOOL isRequiredMethod, BOOL isInstanceMethod)
233 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
234 OBJC_EXPORT struct objc_method_description *protocol_copyMethodDescriptionList(Protocol *p, BOOL isRequiredMethod, BOOL isInstanceMethod, unsigned int *outCount)
235 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
236 OBJC_EXPORT objc_property_t protocol_getProperty(Protocol *proto, const char *name, BOOL isRequiredProperty, BOOL isInstanceProperty)
237 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
238 OBJC_EXPORT objc_property_t *protocol_copyPropertyList(Protocol *proto, unsigned int *outCount)
239 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
240 OBJC_EXPORT Protocol **protocol_copyProtocolList(Protocol *proto, unsigned int *outCount)
241 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
242
243 OBJC_EXPORT const char **objc_copyImageNames(unsigned int *outCount)
244 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
245 OBJC_EXPORT const char *class_getImageName(Class cls)
246 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
247 OBJC_EXPORT const char **objc_copyClassNamesForImage(const char *image,
248 unsigned int *outCount)
249 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
250
251 OBJC_EXPORT const char *sel_getName(SEL sel);
252 OBJC_EXPORT SEL sel_getUid(const char *str);
253 OBJC_EXPORT SEL sel_registerName(const char *str);
254 OBJC_EXPORT BOOL sel_isEqual(SEL lhs, SEL rhs)
255 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
256
257 OBJC_EXPORT void objc_enumerationMutation(id)
258 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
259 OBJC_EXPORT void objc_setEnumerationMutationHandler(void (*handler)(id))
260 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
261
262 OBJC_EXPORT void objc_setForwardHandler(void *fwd, void *fwd_stret)
263 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
264
265
266 /* Associated Object support. */
267
268 /* objc_setAssociatedObject() options */
269 enum {
270 OBJC_ASSOCIATION_ASSIGN = 0,
271 OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1,
272 OBJC_ASSOCIATION_COPY_NONATOMIC = 3,
273 OBJC_ASSOCIATION_RETAIN = 01401,
274 OBJC_ASSOCIATION_COPY = 01403
275 };
276 typedef uintptr_t objc_AssociationPolicy;
277
278 OBJC_EXPORT void objc_setAssociatedObject(id object, void *key, id value, objc_AssociationPolicy policy)
279 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
280 OBJC_EXPORT id objc_getAssociatedObject(id object, void *key)
281 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
282 OBJC_EXPORT void objc_removeAssociatedObjects(id object)
283 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
284
285
286 #define _C_ID '@'
287 #define _C_CLASS '#'
288 #define _C_SEL ':'
289 #define _C_CHR 'c'
290 #define _C_UCHR 'C'
291 #define _C_SHT 's'
292 #define _C_USHT 'S'
293 #define _C_INT 'i'
294 #define _C_UINT 'I'
295 #define _C_LNG 'l'
296 #define _C_ULNG 'L'
297 #define _C_LNG_LNG 'q'
298 #define _C_ULNG_LNG 'Q'
299 #define _C_FLT 'f'
300 #define _C_DBL 'd'
301 #define _C_BFLD 'b'
302 #define _C_BOOL 'B'
303 #define _C_VOID 'v'
304 #define _C_UNDEF '?'
305 #define _C_PTR '^'
306 #define _C_CHARPTR '*'
307 #define _C_ATOM '%'
308 #define _C_ARY_B '['
309 #define _C_ARY_E ']'
310 #define _C_UNION_B '('
311 #define _C_UNION_E ')'
312 #define _C_STRUCT_B '{'
313 #define _C_STRUCT_E '}'
314 #define _C_VECTOR '!'
315 #define _C_CONST 'r'
316
317
318 /* Obsolete types */
319
320 #if !__OBJC2__
321
322 #define CLS_GETINFO(cls,infomask) ((cls)->info & (infomask))
323 #define CLS_SETINFO(cls,infomask) ((cls)->info |= (infomask))
324
325 // class is not a metaclass
326 #define CLS_CLASS 0x1
327 // class is a metaclass
328 #define CLS_META 0x2
329 // class's +initialize method has completed
330 #define CLS_INITIALIZED 0x4
331 // class is posing
332 #define CLS_POSING 0x8
333 // unused
334 #define CLS_MAPPED 0x10
335 // class and subclasses need cache flush during image loading
336 #define CLS_FLUSH_CACHE 0x20
337 // method cache should grow when full
338 #define CLS_GROW_CACHE 0x40
339 // unused
340 #define CLS_NEED_BIND 0x80
341 // methodLists is array of method lists
342 #define CLS_METHOD_ARRAY 0x100
343 // the JavaBridge constructs classes with these markers
344 #define CLS_JAVA_HYBRID 0x200
345 #define CLS_JAVA_CLASS 0x400
346 // thread-safe +initialize
347 #define CLS_INITIALIZING 0x800
348 // bundle unloading
349 #define CLS_FROM_BUNDLE 0x1000
350 // C++ ivar support
351 #define CLS_HAS_CXX_STRUCTORS 0x2000
352 // Lazy method list arrays
353 #define CLS_NO_METHOD_ARRAY 0x4000
354 // +load implementation
355 #define CLS_HAS_LOAD_METHOD 0x8000
356 // objc_allocateClassPair API
357 #define CLS_CONSTRUCTING 0x10000
358 // class compiled with bigger class structure
359 #define CLS_EXT 0x20000
360
361
362 struct objc_method_description_list {
363 int count;
364 struct objc_method_description list[1];
365 };
366
367
368 struct objc_protocol_list {
369 struct objc_protocol_list *next;
370 long count;
371 Protocol *list[1];
372 };
373
374
375 struct objc_category {
376 char *category_name OBJC2_UNAVAILABLE;
377 char *class_name OBJC2_UNAVAILABLE;
378 struct objc_method_list *instance_methods OBJC2_UNAVAILABLE;
379 struct objc_method_list *class_methods OBJC2_UNAVAILABLE;
380 struct objc_protocol_list *protocols OBJC2_UNAVAILABLE;
381 } OBJC2_UNAVAILABLE;
382
383
384 struct objc_ivar {
385 char *ivar_name OBJC2_UNAVAILABLE;
386 char *ivar_type OBJC2_UNAVAILABLE;
387 int ivar_offset OBJC2_UNAVAILABLE;
388 #ifdef __LP64__
389 int space OBJC2_UNAVAILABLE;
390 #endif
391 } OBJC2_UNAVAILABLE;
392
393 struct objc_ivar_list {
394 int ivar_count OBJC2_UNAVAILABLE;
395 #ifdef __LP64__
396 int space OBJC2_UNAVAILABLE;
397 #endif
398 /* variable length structure */
399 struct objc_ivar ivar_list[1] OBJC2_UNAVAILABLE;
400 } OBJC2_UNAVAILABLE;
401
402
403 struct objc_method {
404 SEL method_name OBJC2_UNAVAILABLE;
405 char *method_types OBJC2_UNAVAILABLE;
406 IMP method_imp OBJC2_UNAVAILABLE;
407 } OBJC2_UNAVAILABLE;
408
409 struct objc_method_list {
410 struct objc_method_list *obsolete OBJC2_UNAVAILABLE;
411
412 int method_count OBJC2_UNAVAILABLE;
413 #ifdef __LP64__
414 int space OBJC2_UNAVAILABLE;
415 #endif
416 /* variable length structure */
417 struct objc_method method_list[1] OBJC2_UNAVAILABLE;
418 } OBJC2_UNAVAILABLE;
419
420
421 typedef struct objc_symtab *Symtab OBJC2_UNAVAILABLE;
422
423 struct objc_symtab {
424 unsigned long sel_ref_cnt OBJC2_UNAVAILABLE;
425 SEL *refs OBJC2_UNAVAILABLE;
426 unsigned short cls_def_cnt OBJC2_UNAVAILABLE;
427 unsigned short cat_def_cnt OBJC2_UNAVAILABLE;
428 void *defs[1] /* variable size */ OBJC2_UNAVAILABLE;
429 } OBJC2_UNAVAILABLE;
430
431
432 typedef struct objc_cache *Cache OBJC2_UNAVAILABLE;
433
434 #define CACHE_BUCKET_NAME(B) ((B)->method_name)
435 #define CACHE_BUCKET_IMP(B) ((B)->method_imp)
436 #define CACHE_BUCKET_VALID(B) (B)
437 #ifndef __LP64__
438 #define CACHE_HASH(sel, mask) (((uintptr_t)(sel)>>2) & (mask))
439 #else
440 #define CACHE_HASH(sel, mask) (((unsigned int)((uintptr_t)(sel)>>3)) & (mask))
441 #endif
442 struct objc_cache {
443 unsigned int mask /* total = mask + 1 */ OBJC2_UNAVAILABLE;
444 unsigned int occupied OBJC2_UNAVAILABLE;
445 Method buckets[1] OBJC2_UNAVAILABLE;
446 } /* GrP fixme should be OBJC2_UNAVAILABLE, but isn't because of spurious warnings in [super ...] calls */;
447
448
449 typedef struct objc_module *Module OBJC2_UNAVAILABLE;
450
451 struct objc_module {
452 unsigned long version OBJC2_UNAVAILABLE;
453 unsigned long size OBJC2_UNAVAILABLE;
454 const char *name OBJC2_UNAVAILABLE;
455 Symtab symtab OBJC2_UNAVAILABLE;
456 } OBJC2_UNAVAILABLE;
457
458 #else
459
460 struct objc_method_list;
461
462 #endif
463
464
465 /* Obsolete functions */
466
467 OBJC_EXPORT BOOL sel_isMapped(SEL sel) OBJC2_UNAVAILABLE;
468
469 OBJC_EXPORT id object_copyFromZone(id anObject, size_t nBytes, void *z) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
470 OBJC_EXPORT id object_realloc(id anObject, size_t nBytes) OBJC2_UNAVAILABLE;
471 OBJC_EXPORT id object_reallocFromZone(id anObject, size_t nBytes, void *z) OBJC2_UNAVAILABLE;
472
473 #define OBSOLETE_OBJC_GETCLASSES 1
474 OBJC_EXPORT void *objc_getClasses(void) OBJC2_UNAVAILABLE;
475 OBJC_EXPORT void objc_addClass(Class myClass) OBJC2_UNAVAILABLE;
476 OBJC_EXPORT void objc_setClassHandler(int (*)(const char *)) OBJC2_UNAVAILABLE;
477 OBJC_EXPORT void objc_setMultithreaded (BOOL flag) OBJC2_UNAVAILABLE;
478
479 OBJC_EXPORT id class_createInstanceFromZone(Class, size_t idxIvars, void *z) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
480
481 OBJC_EXPORT void class_addMethods(Class, struct objc_method_list *) OBJC2_UNAVAILABLE;
482 OBJC_EXPORT void class_removeMethods(Class, struct objc_method_list *) OBJC2_UNAVAILABLE;
483
484 OBJC_EXPORT Class class_poseAs(Class imposter, Class original) OBJC2_UNAVAILABLE;
485
486 OBJC_EXPORT unsigned int method_getSizeOfArguments(Method m) OBJC2_UNAVAILABLE;
487 OBJC_EXPORT unsigned method_getArgumentInfo(struct objc_method *m, int arg, const char **type, int *offset) OBJC2_UNAVAILABLE;
488
489 OBJC_EXPORT BOOL class_respondsToMethod(Class, SEL) OBJC2_UNAVAILABLE;
490 OBJC_EXPORT IMP class_lookupMethod(Class, SEL) OBJC2_UNAVAILABLE;
491 OBJC_EXPORT Class objc_getOrigClass(const char *name) OBJC2_UNAVAILABLE;
492 #define OBJC_NEXT_METHOD_LIST 1
493 OBJC_EXPORT struct objc_method_list *class_nextMethodList(Class, void **) OBJC2_UNAVAILABLE;
494 // usage for nextMethodList
495 //
496 // void *iterator = 0;
497 // struct objc_method_list *mlist;
498 // while ( mlist = class_nextMethodList( cls, &iterator ) )
499 // ;
500
501 OBJC_EXPORT id (*_alloc)(Class, size_t) OBJC2_UNAVAILABLE;
502 OBJC_EXPORT id (*_copy)(id, size_t) OBJC2_UNAVAILABLE;
503 OBJC_EXPORT id (*_realloc)(id, size_t) OBJC2_UNAVAILABLE;
504 OBJC_EXPORT id (*_dealloc)(id) OBJC2_UNAVAILABLE;
505 OBJC_EXPORT id (*_zoneAlloc)(Class, size_t, void *) OBJC2_UNAVAILABLE;
506 OBJC_EXPORT id (*_zoneRealloc)(id, size_t, void *) OBJC2_UNAVAILABLE;
507 OBJC_EXPORT id (*_zoneCopy)(id, size_t, void *) OBJC2_UNAVAILABLE;
508 OBJC_EXPORT void (*_error)(id, const char *, va_list) OBJC2_UNAVAILABLE;
509
510 #endif