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
6 #pragma clang system_header
8 typedef unsigned int UInt32
;
9 typedef unsigned short UInt16
;
11 typedef signed long CFIndex
;
12 typedef signed char BOOL
;
16 typedef unsigned long NSUInteger
;
17 typedef unsigned short unichar
;
18 typedef UInt16 UniChar
;
21 #define __DARWIN_NULL ((void *)0)
22 #define NULL __DARWIN_NULL
28 NSASCIIStringEncoding
= 1,
29 NSNEXTSTEPStringEncoding
= 2,
30 NSJapaneseEUCStringEncoding
= 3,
31 NSUTF8StringEncoding
= 4,
32 NSISOLatin1StringEncoding
= 5,
33 NSSymbolStringEncoding
= 6,
34 NSNonLossyASCIIStringEncoding
= 7,
36 typedef const struct __CFString
* CFStringRef
;
37 typedef struct __CFString
* CFMutableStringRef
;
38 typedef NSUInteger NSStringEncoding
;
39 typedef UInt32 CFStringEncoding
;
41 typedef const void * CFTypeRef
;
43 typedef const struct __CFAllocator
* CFAllocatorRef
;
44 extern const CFAllocatorRef kCFAllocatorDefault
;
45 extern const CFAllocatorRef kCFAllocatorSystemDefault
;
46 extern const CFAllocatorRef kCFAllocatorMalloc
;
47 extern const CFAllocatorRef kCFAllocatorMallocZone
;
48 extern const CFAllocatorRef kCFAllocatorNull
;
50 @
class NSString
, Protocol
;
51 extern void NSLog(NSString
*format
, ...) __attribute__((format(__NSString__
, 1, 2)));
52 typedef struct _NSZone NSZone
;
53 @
class NSInvocation
, NSMethodSignature
, NSCoder
, NSString
, NSEnumerator
;
55 - (BOOL
)isEqual
:(id
)object
;
58 - (oneway
void)release
;
61 @
property (readonly
, copy
) NSString
*description
;
62 @end @protocol NSCopying
- (id
)copyWithZone
:(NSZone
*)zone
;
63 @end @protocol NSMutableCopying
- (id
)mutableCopyWithZone
:(NSZone
*)zone
;
64 @end @protocol NSCoding
- (void)encodeWithCoder
:(NSCoder
*)aCoder
;
66 @interface NSObject
<NSObject
> {}
67 + (id
)allocWithZone
:(NSZone
*)zone
;
71 @interface
NSObject (NSCoderMethods
)
72 - (id
)awakeAfterUsingCoder
:(NSCoder
*)aDecoder
;
74 extern id
NSAllocateObject(Class aClass
, NSUInteger extraBytes
, NSZone
*zone
);
77 NSFastEnumerationState
;
78 @protocol NSFastEnumeration
- (NSUInteger
)countByEnumeratingWithState
:(NSFastEnumerationState
*)state objects
:(id
*)stackbuf count
:(NSUInteger
)len
;
79 @end @
class NSString
, NSDictionary
;
80 @interface NSValue
: NSObject
<NSCopying
, NSCoding
>
81 + (NSValue
*)valueWithPointer
:(const void *)p
;
82 - (void)getValue
:(void *)value
;
84 @interface NSNumber
: NSValue
- (char)charValue
;
85 - (id
)initWithInt
:(int)value
;
88 @interface NSArray
: NSObject
<NSCopying
, NSMutableCopying
, NSCoding
, NSFastEnumeration
> - (NSUInteger
)count
;
89 @end @interface
NSArray (NSArrayCreation
) + (id
)array
;
90 @end @interface NSAutoreleasePool
: NSObject
{
93 @end
extern NSString
* const NSBundleDidLoadNotification
;
94 typedef double NSTimeInterval
;
95 @interface NSDate
: NSObject
<NSCopying
, NSCoding
> - (NSTimeInterval
)timeIntervalSinceReferenceDate
;
98 @interface NSString
: NSObject
<NSCopying
, NSMutableCopying
, NSCoding
>
100 - (NSString
*)stringByAppendingString
:(NSString
*)aString
;
101 - ( const char *)UTF8String
;
102 - (id
)initWithUTF8String
:(const char *)nullTerminatedCString
;
103 - (id
)initWithCharactersNoCopy
:(unichar
*)characters length
:(NSUInteger
)length freeWhenDone
:(BOOL
)freeBuffer
;
104 - (id
)initWithCharacters
:(const unichar
*)characters length
:(NSUInteger
)length
;
105 - (id
)initWithBytes
:(const void *)bytes length
:(NSUInteger
)len encoding
:(NSStringEncoding
)encoding
;
106 - (id
)initWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)len encoding
:(NSStringEncoding
)encoding freeWhenDone
:(BOOL
)freeBuffer
;
107 + (id
)stringWithUTF8String
:(const char *)nullTerminatedCString
;
108 + (id
)stringWithString
:(NSString
*)string
;
109 @end @
class NSString
, NSURL
, NSError
;
111 @interface NSMutableString
: NSString
112 - (void)appendFormat
:(NSString
*)format
, ... __attribute__((format(__NSString__
, 1, 2)));
115 @interface NSData
: NSObject
<NSCopying
, NSMutableCopying
, NSCoding
> - (NSUInteger
)length
;
116 + (id
)dataWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)length
;
117 + (id
)dataWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)length freeWhenDone
:(BOOL
)b
;
118 - (id
)initWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)length
;
119 - (id
)initWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)length freeWhenDone
:(BOOL
)b
;
120 - (id
)initWithBytesNoCopy
:(void *)bytes
121 length
:(NSUInteger
)length
122 deallocator
:(void (^)(void *bytes
, NSUInteger length
))deallocator
;
123 - (id
)initWithBytes
:(void *)bytes length
:(NSUInteger
)length
;
128 CFDictionaryKeyCallBacks
;
129 extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks
;
132 CFDictionaryValueCallBacks
;
133 extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks
;
134 typedef const struct __CFDictionary
* CFDictionaryRef
;
135 typedef struct __CFDictionary
* CFMutableDictionaryRef
;
136 extern CFMutableDictionaryRef
CFDictionaryCreateMutable(CFAllocatorRef allocator
, CFIndex capacity
, const CFDictionaryKeyCallBacks
*keyCallBacks
, const CFDictionaryValueCallBacks
*valueCallBacks
);
137 void CFDictionarySetValue(CFMutableDictionaryRef
, const void *, const void *);
140 extern void CFRelease(CFTypeRef cf
);
142 extern CFMutableStringRef
CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc
, UniChar
*chars
, CFIndex numChars
, CFIndex capacity
, CFAllocatorRef externalCharactersAllocator
);
143 extern CFStringRef
CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc
, const char *cStr
, CFStringEncoding encoding
, CFAllocatorRef contentsDeallocator
);
144 extern void CFStringAppend(CFMutableStringRef theString
, CFStringRef appendedString
);
146 void SystemHeaderFunctionWithBlockParam(void *, void (^block
)(void *), unsigned);
148 @interface NSPointerArray
: NSObject
<NSFastEnumeration
, NSCopying
, NSCoding
>
149 - (void)addPointer
:(void *)pointer
;
150 - (void)insertPointer
:(void *)item atIndex
:(NSUInteger
)index
;
151 - (void)replacePointerAtIndex
:(NSUInteger
)index withPointer
:(void *)item
;
152 - (void *)pointerAtIndex
:(NSUInteger
)index
;