1 include "config/public_api.td"
3 include "spec/bsd_ext.td"
4 include "spec/gnu_ext.td"
5 include "spec/linux.td"
6 include "spec/llvm_libc_ext.td"
7 include "spec/posix.td"
10 def AssertMacro : MacroDef<"assert"> {
15 #define assert(e) (void)0
21 _Noreturn void __assert_fail(const char *, const char *, unsigned, const char *) __NOEXCEPT;
24 ((e) ? (void)0 : __assert_fail(#e, __FILE__, __LINE__, __PRETTY_FUNCTION__))
30 def StaticAssertMacro : MacroDef<"static_assert"> {
34 #define static_assert _Static_assert
39 def AssertAPI : PublicAPI<"assert.h"> {
46 def CTypeAPI : PublicAPI<"ctype.h"> {
49 def FCntlAPI : PublicAPI<"fcntl.h"> {
50 let Types = ["mode_t"];
53 def IntTypesAPI : PublicAPI<"inttypes.h"> {
54 let Types = ["imaxdiv_t"];
57 def MathAPI : PublicAPI<"math.h"> {
58 let Types = ["double_t", "float_t"];
61 def FenvAPI: PublicAPI<"fenv.h"> {
62 let Types = ["fenv_t", "fexcept_t"];
65 def StringAPI : PublicAPI<"string.h"> {
66 let Types = ["size_t"];
69 def StdIOAPI : PublicAPI<"stdio.h"> {
71 SimpleMacroDef<"stderr", "stderr">,
72 SimpleMacroDef<"stdin", "stdin">,
73 SimpleMacroDef<"stdout", "stdout">,
74 SimpleMacroDef<"_IOFBF", "0">,
75 SimpleMacroDef<"_IOLBF", "1">,
76 SimpleMacroDef<"_IONBF", "2">,
77 SimpleMacroDef<"EOF", "-1">,
79 let Types = ["size_t", "FILE", "cookie_io_functions_t"];
82 def StdlibAPI : PublicAPI<"stdlib.h"> {
95 def TimeAPI : PublicAPI<"time.h"> {
106 def SchedAPI : PublicAPI<"sched.h"> {
111 "struct sched_param",
112 // Needed according to posix standard
118 def SysMManAPI : PublicAPI<"sys/mman.h"> {
119 let Types = ["off_t", "size_t"];
122 def SignalAPI : PublicAPI<"signal.h"> {
134 def ThreadsAPI : PublicAPI<"threads.h"> {
136 SimpleMacroDef<"ONCE_FLAG_INIT", "{0}">,
140 "__call_once_func_t",
162 def PThreadAPI : PublicAPI<"pthread.h"> {
164 "__atfork_callback_t",
165 "__pthread_once_func_t",
167 "__pthread_tss_dtor_t",
170 "pthread_mutexattr_t",
177 def DirentAPI : PublicAPI<"dirent.h"> {
185 def UniStdAPI : PublicAPI<"unistd.h"> {
186 let Types = ["__exec_argv_t", "__exec_envp_t", "off_t", "pid_t", "size_t",
187 "ssize_t", "uid_t", "__getoptargv_t"];
190 def WCharAPI : PublicAPI<"wchar.h"> {
198 def SysRandomAPI : PublicAPI<"sys/random.h"> {
199 let Types = ["size_t", "ssize_t"];
202 def SysSelectAPI : PublicAPI<"sys/select.h"> {
203 let Types = ["fd_set", "sigset_t", "suseconds_t", "time_t", "struct timespec",
207 def SysSocketAPI : PublicAPI<"sys/socket.h"> {
208 let Types = ["struct sockaddr", "sa_family_t"];
211 def SysResourceAPI : PublicAPI<"sys/resource.h"> {
212 let Types = ["rlim_t", "struct rlimit"];
215 def SysStatAPI : PublicAPI<"sys/stat.h"> {
216 let Types = ["mode_t", "dev_t", "ino_t", "nlink_t", "uid_t", "gid_t", "off_t",
217 "struct timespec", "struct timeval", "blksize_t", "blkcnt_t",
221 def SysWaitAPI : PublicAPI<"sys/wait.h"> {
222 let Types = ["pid_t", "struct rusage", "siginfo_t"];
225 def SysSendfileAPI : PublicAPI<"sys/sendfile.h"> {
226 let Types = ["off_t", "size_t", "ssize_t"];
229 def SysTypesAPI : PublicAPI<"sys/types.h"> {
230 let Types = ["blkcnt_t", "blksize_t", "clockid_t", "dev_t", "gid_t", "ino_t",
231 "mode_t", "nlink_t", "off_t", "pid_t", "pthread_attr_t", "pthread_key_t",
232 "pthread_mutex_t", "pthread_mutexattr_t", "pthread_once_t", "pthread_t",
233 "size_t", "ssize_t", "suseconds_t", "time_t", "uid_t"];
236 def SysUtsNameAPI : PublicAPI<"sys/utsname.h"> {
237 let Types = ["struct utsname"];
240 def SpawnAPI : PublicAPI<"spawn.h"> {
241 let Types = ["mode_t", "pid_t", "posix_spawnattr_t", "posix_spawn_file_actions_t"];
244 def TermiosAPI : PublicAPI<"termios.h"> {
245 let Types = ["cc_t", "pid_t", "speed_t", "struct termios", "tcflag_t"];
248 def SetJmpAPI : PublicAPI<"setjmp.h"> {
249 let Types = ["jmp_buf"];