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