1 #pragma clang system_header 2 3 typedef unsigned int UInt32; 4 typedef unsigned short UInt16; 5 6 typedef signed long CFIndex; 7 typedef signed char BOOL; 8 typedef unsigned long NSUInteger; 9 typedef unsigned short unichar; 10 typedef UInt16 UniChar; 11 12 enum { 13 NSASCIIStringEncoding = 1, 14 NSNEXTSTEPStringEncoding = 2, 15 NSJapaneseEUCStringEncoding = 3, 16 NSUTF8StringEncoding = 4, 17 NSISOLatin1StringEncoding = 5, 18 NSSymbolStringEncoding = 6, 19 NSNonLossyASCIIStringEncoding = 7, 20 }; 21 typedef const struct __CFString * CFStringRef; 22 typedef struct __CFString * CFMutableStringRef; 23 typedef NSUInteger NSStringEncoding; 24 typedef UInt32 CFStringEncoding; 25 26 typedef const void * CFTypeRef; 27 28 typedef const struct __CFAllocator * CFAllocatorRef; 29 extern const CFAllocatorRef kCFAllocatorDefault; 30 extern const CFAllocatorRef kCFAllocatorSystemDefault; 31 extern const CFAllocatorRef kCFAllocatorMalloc; 32 extern const CFAllocatorRef kCFAllocatorMallocZone; 33 extern const CFAllocatorRef kCFAllocatorNull; 34 35 @class NSString, Protocol; 36 extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); 37 typedef struct _NSZone NSZone; 38 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; 39 @protocol NSObject 40 - (BOOL)isEqual:(id)object; 41 - (id)retain; 42 - (id)copy; 43 - (oneway void)release; 44 - (id)autorelease; 45 - (id)init; 46 @end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; 47 @end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; 48 @end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; 49 @end 50 @interface NSObject <NSObject> {} 51 + (id)allocWithZone:(NSZone *)zone; 52 + (id)alloc; 53 - (void)dealloc; 54 @end 55 @interface NSObject (NSCoderMethods) 56 - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; 57 @end 58 extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); 59 typedef struct { 60 } 61 NSFastEnumerationState; 62 @protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; 63 @end @class NSString, NSDictionary; 64 @interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; 65 @end @interface NSNumber : NSValue - (char)charValue; 66 - (id)initWithInt:(int)value; 67 @end @class NSString; 68 @interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count; 69 @end @interface NSArray (NSArrayCreation) + (id)array; 70 @end @interface NSAutoreleasePool : NSObject { 71 } 72 - (void)drain; 73 @end extern NSString * const NSBundleDidLoadNotification; 74 typedef double NSTimeInterval; 75 @interface NSDate : NSObject <NSCopying, NSCoding> - (NSTimeInterval)timeIntervalSinceReferenceDate; 76 @end 77 78 @interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> 79 - (NSUInteger)length; 80 - (NSString *)stringByAppendingString:(NSString *)aString; 81 - ( const char *)UTF8String; 82 - (id)initWithUTF8String:(const char *)nullTerminatedCString; 83 - (id)initWithCharactersNoCopy:(unichar *)characters length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer; 84 - (id)initWithCharacters:(const unichar *)characters length:(NSUInteger)length; 85 - (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding; 86 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding freeWhenDone:(BOOL)freeBuffer; 87 + (id)stringWithUTF8String:(const char *)nullTerminatedCString; 88 + (id)stringWithString:(NSString *)string; 89 @end @class NSString, NSURL, NSError; 90 91 @interface NSMutableString : NSString 92 - (void)appendFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); 93 @end 94 95 @interface NSData : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; 96 + (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; 97 + (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; 98 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length; 99 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b; 100 @end 101 102 typedef struct { 103 } 104 CFDictionaryKeyCallBacks; 105 extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; 106 typedef struct { 107 } 108 CFDictionaryValueCallBacks; 109 extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; 110 typedef const struct __CFDictionary * CFDictionaryRef; 111 typedef struct __CFDictionary * CFMutableDictionaryRef; 112 extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); 113 void CFDictionarySetValue(CFMutableDictionaryRef, const void *, const void *); 114 115 116 extern void CFRelease(CFTypeRef cf); 117 118 extern CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator); 119 extern CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); 120 extern void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString); 121 122 void SystemHeaderFunctionWithBlockParam(void *, void (^block)(void *), unsigned); 123 124 @interface NSPointerArray : NSObject <NSFastEnumeration, NSCopying, NSCoding> 125 - (void)addPointer:(void *)pointer; 126 - (void)insertPointer:(void *)item atIndex:(NSUInteger)index; 127 - (void)replacePointerAtIndex:(NSUInteger)index withPointer:(void *)item; 128 - (void *)pointerAtIndex:(NSUInteger)index; 129 @end 130 131