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