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 struct _FILE FILE; 9 extern FILE *stdin; 10 extern FILE *stdout; 11 extern FILE *stderr; 12 // Include a variant of standard streams that occur in the pre-processed file. 13 extern FILE *__stdinp; 14 extern FILE *__stdoutp; 15 extern FILE *__stderrp; 16 17 18 int fscanf(FILE *restrict, const char *restrict, ...); 19 20 // Note, on some platforms errno macro gets replaced with a function call. 21 extern int errno; 22 23 typedef __typeof(sizeof(int)) size_t; 24 25 size_t strlen(const char *); 26 27 char *strcpy(char *restrict, const char *restrict); 28 29 typedef unsigned long __darwin_pthread_key_t; 30 typedef __darwin_pthread_key_t pthread_key_t; 31 int pthread_setspecific(pthread_key_t, const void *); 32 33 typedef long long __int64_t; 34 typedef __int64_t __darwin_off_t; 35 typedef __darwin_off_t fpos_t; 36 37 void setbuf(FILE * restrict, char * restrict); 38 int setvbuf(FILE * restrict, char * restrict, int, size_t); 39 40 FILE *funopen(const void *, 41 int (*)(void *, char *, int), 42 int (*)(void *, const char *, int), 43 fpos_t (*)(void *, fpos_t, int), 44 int (*)(void *)); 45 46 int sqlite3_bind_text_my(int, const char*, int n, void(*)(void*)); 47 48 typedef void (*freeCallback) (void*); 49 typedef struct { 50 int i; 51 freeCallback fc; 52 } StWithCallback; 53 54 int dealocateMemWhenDoneByVal(void*, StWithCallback); 55 int dealocateMemWhenDoneByRef(StWithCallback*, const void*); 56 57 typedef struct CGContext *CGContextRef; 58 CGContextRef CGBitmapContextCreate(void *data/*, size_t width, size_t height, 59 size_t bitsPerComponent, size_t bytesPerRow, 60 CGColorSpaceRef space, 61 CGBitmapInfo bitmapInfo*/); 62 void *CGBitmapContextGetData(CGContextRef context); 63 64 // Include xpc. 65 typedef struct _xpc_connection_s * xpc_connection_t; 66 typedef void (*xpc_finalizer_t)(void *value); 67 void xpc_connection_set_context(xpc_connection_t connection, void *context); 68 void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer); 69 void xpc_connection_resume(xpc_connection_t connection); 70 71 //The following is a fake system header function 72 void fakeSystemHeaderCallInt(int *); 73 74 typedef struct __SomeStruct { 75 char * p; 76 } SomeStruct; 77 void fakeSystemHeaderCall(SomeStruct *); 78