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
9 #define restrict /*restrict*/
12 typedef struct _FILE FILE;
16 // Include a variant of standard streams that occur in the pre-processed file.
17 extern FILE *__stdinp;
18 extern FILE *__stdoutp;
19 extern FILE *__stderrp;
21 int scanf(const char *restrict format, ...);
22 int fscanf(FILE *restrict, const char *restrict, ...);
23 int printf(const char *restrict format, ...);
24 int fprintf(FILE *restrict, const char *restrict, ...);
27 // Note, on some platforms errno macro gets replaced with a function call.
30 typedef __typeof(sizeof(int)) size_t;
32 size_t strlen(const char *);
34 char *strcpy(char *restrict, const char *restrict);
36 typedef unsigned long __darwin_pthread_key_t;
37 typedef __darwin_pthread_key_t pthread_key_t;
38 int pthread_setspecific(pthread_key_t, const void *);
40 typedef long long __int64_t;
41 typedef __int64_t __darwin_off_t;
42 typedef __darwin_off_t fpos_t;
44 void setbuf(FILE * restrict, char * restrict);
45 int setvbuf(FILE * restrict, char * restrict, int, size_t);
47 FILE *fopen(const char * restrict, const char * restrict);
49 FILE *funopen(const void *,
50 int (*)(void *, char *, int),
51 int (*)(void *, const char *, int),
52 fpos_t (*)(void *, fpos_t, int),
55 int sqlite3_bind_text_my(int, const char*, int n, void(*)(void*));
57 typedef void (*freeCallback) (void*);
63 int dealocateMemWhenDoneByVal(void*, StWithCallback);
64 int dealocateMemWhenDoneByRef(StWithCallback*, const void*);
66 typedef struct CGContext *CGContextRef;
67 CGContextRef CGBitmapContextCreate(void *data/*, size_t width, size_t height,
68 size_t bitsPerComponent, size_t bytesPerRow,
69 CGColorSpaceRef space,
70 CGBitmapInfo bitmapInfo*/);
71 void *CGBitmapContextGetData(CGContextRef context);
74 typedef struct _xpc_connection_s * xpc_connection_t;
75 typedef void (*xpc_finalizer_t)(void *value);
76 void xpc_connection_set_context(xpc_connection_t connection, void *context);
77 void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer);
78 void xpc_connection_resume(xpc_connection_t connection);
80 //The following is a fake system header function
81 void fakeSystemHeaderCallInt(int *);
83 typedef struct __SomeStruct {
86 void fakeSystemHeaderCall(SomeStruct *);