blob: 1ddfef942d18a66490f02b41b7a03e8c8103f6d9 [file] [log] [blame]
John McCalld70fb982011-06-15 23:25:17 +00001#if __has_feature(objc_arr)
2#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
3#else
4#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
5#endif
6
7typedef struct _NSZone NSZone;
8typedef int BOOL;
9typedef unsigned NSUInteger;
10typedef int int32_t;
11typedef unsigned char uint8_t;
12typedef int32_t UChar32;
13typedef unsigned char UChar;
14
15@protocol NSObject
16- (BOOL)isEqual:(id)object;
17- (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
18- (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
19- (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
20- (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
21
22- (NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
23@end
24
25@protocol NSCopying
26- (id)copyWithZone:(NSZone *)zone;
27@end
28
29@protocol NSMutableCopying
30- (id)mutableCopyWithZone:(NSZone *)zone;
31@end
32
33@interface NSObject <NSObject> {}
34- (id)init;
35
36+ (id)new;
37+ (id)allocWithZone:(NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
38+ (id)alloc;
39- (void)dealloc;
40
41- (void)finalize;
42
43- (id)copy;
44- (id)mutableCopy;
45
46+ (id)copyWithZone:(NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
47+ (id)mutableCopyWithZone:(NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
48@end
49
50extern void NSRecycleZone(NSZone *zone);
51
52NS_AUTOMATED_REFCOUNT_UNAVAILABLE
53@interface NSAutoreleasePool : NSObject {
54@private
55 void *_token;
56 void *_reserved3;
57 void *_reserved2;
58 void *_reserved;
59}
60
61+ (void)addObject:(id)anObject;
62
63- (void)addObject:(id)anObject;
64
65- (void)drain;
66
67@end
68
69typedef const void* objc_objectptr_t;
70extern __attribute__((ns_returns_retained)) id objc_retainedObject(objc_objectptr_t __attribute__((cf_consumed)) pointer);
71extern __attribute__((ns_returns_not_retained)) id objc_unretainedObject(objc_objectptr_t pointer);
72extern objc_objectptr_t objc_unretainedPointer(id object);