Home | History | Annotate | Download | only in Inputs
      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>  - (void)getValue:(void *)value;
     70 @end  @interface NSNumber : NSValue  - (char)charValue;
     71 - (id)initWithInt:(int)value;
     72 @end   @class NSString;
     73 @interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>  - (NSUInteger)count;
     74 @end  @interface NSArray (NSArrayCreation)  + (id)array;
     75 @end       @interface NSAutoreleasePool : NSObject {
     76 }
     77 - (void)drain;
     78 @end extern NSString * const NSBundleDidLoadNotification;
     79 typedef double NSTimeInterval;
     80 @interface NSDate : NSObject <NSCopying, NSCoding>  - (NSTimeInterval)timeIntervalSinceReferenceDate;
     81 @end
     82 
     83 @interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
     84 - (NSUInteger)length;
     85 - (NSString *)stringByAppendingString:(NSString *)aString;
     86 - ( const char *)UTF8String;
     87 - (id)initWithUTF8String:(const char *)nullTerminatedCString;
     88 - (id)initWithCharactersNoCopy:(unichar *)characters length:(NSUInteger)length freeWhenDone:(BOOL)freeBuffer;
     89 - (id)initWithCharacters:(const unichar *)characters length:(NSUInteger)length;
     90 - (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding;
     91 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding freeWhenDone:(BOOL)freeBuffer;
     92 + (id)stringWithUTF8String:(const char *)nullTerminatedCString;
     93 + (id)stringWithString:(NSString *)string;
     94 @end        @class NSString, NSURL, NSError;
     95 
     96 @interface NSMutableString : NSString
     97 - (void)appendFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2)));
     98 @end
     99 
    100 @interface NSData : NSObject <NSCopying, NSMutableCopying, NSCoding>  - (NSUInteger)length;
    101 + (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
    102 + (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
    103 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
    104 - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
    105 - (id)initWithBytes:(void *)bytes length:(NSUInteger) length;
    106 @end
    107 
    108 typedef struct {
    109 }
    110 CFDictionaryKeyCallBacks;
    111 extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
    112 typedef struct {
    113 }
    114 CFDictionaryValueCallBacks;
    115 extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
    116 typedef const struct __CFDictionary * CFDictionaryRef;
    117 typedef struct __CFDictionary * CFMutableDictionaryRef;
    118 extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
    119 void CFDictionarySetValue(CFMutableDictionaryRef, const void *, const void *);
    120 
    121 
    122 extern void CFRelease(CFTypeRef cf);
    123 
    124 extern CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator);
    125 extern CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator);
    126 extern void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString);
    127 
    128 void SystemHeaderFunctionWithBlockParam(void *, void (^block)(void *), unsigned);
    129 
    130 @interface NSPointerArray : NSObject <NSFastEnumeration, NSCopying, NSCoding>
    131 - (void)addPointer:(void *)pointer;
    132 - (void)insertPointer:(void *)item atIndex:(NSUInteger)index;
    133 - (void)replacePointerAtIndex:(NSUInteger)index withPointer:(void *)item;
    134 - (void *)pointerAtIndex:(NSUInteger)index;
    135 @end
    136 
    137