[clang][RISCV] Fix the condition of checking signature in getIndex (#67403)
[llvm-project.git] / libc / spec / stdc.td
blob1e9043b841ff1d8505f3c5faec8175674d572471
1 def StdC : StandardSpec<"stdc"> {
3   NamedType StructTmType = NamedType<"struct tm">;
4   PtrType StructTmPtr = PtrType<StructTmType>;
5   PtrType TimeTTypePtr = PtrType<TimeTType>;
6   NamedType ClockT = NamedType<"clock_t">;
8   NamedType DivTType = NamedType<"div_t">;
9   NamedType LDivTType = NamedType<"ldiv_t">;
10   NamedType LLDivTType = NamedType<"lldiv_t">;
12   NamedType JmpBuf = NamedType<"jmp_buf">;
14   NamedType TssTType = NamedType<"tss_t">;
15   PtrType TssTPtr = PtrType<TssTType>;
16   NamedType TssDtorTType = NamedType<"tss_dtor_t">;
18   HeaderSpec Assert = HeaderSpec<
19       "assert.h",
20       [
21           Macro<"static_assert">,
22           Macro<"assert">,
23       ],
24       [], // Types
25       [], // Enumerations
26       []
27   >;
29   HeaderSpec CType = HeaderSpec<
30       "ctype.h",
31       [], // Macros
32       [], // Types
33       [], // Enumerations
34       [
35           FunctionSpec<
36               "isalnum",
37               RetValSpec<IntType>,
38               [ArgSpec<IntType>]
39           >,
40           FunctionSpec<
41               "isalpha",
42               RetValSpec<IntType>,
43               [ArgSpec<IntType>]
44           >,
45           FunctionSpec<
46               "isblank",
47               RetValSpec<IntType>,
48               [ArgSpec<IntType>]
49           >,
50           FunctionSpec<
51               "iscntrl",
52               RetValSpec<IntType>,
53               [ArgSpec<IntType>]
54           >,
55           FunctionSpec<
56               "isdigit",
57               RetValSpec<IntType>,
58               [ArgSpec<IntType>]
59           >,
60           FunctionSpec<
61               "isgraph",
62               RetValSpec<IntType>,
63               [ArgSpec<IntType>]
64           >,
65           FunctionSpec<
66               "islower",
67               RetValSpec<IntType>,
68               [ArgSpec<IntType>]
69           >,
70           FunctionSpec<
71               "isprint",
72               RetValSpec<IntType>,
73               [ArgSpec<IntType>]
74           >,
75           FunctionSpec<
76               "ispunct",
77               RetValSpec<IntType>,
78               [ArgSpec<IntType>]
79           >,
80           FunctionSpec<
81               "isspace",
82               RetValSpec<IntType>,
83               [ArgSpec<IntType>]
84           >,
85           FunctionSpec<
86               "isupper",
87               RetValSpec<IntType>,
88               [ArgSpec<IntType>]
89           >,
90           FunctionSpec<
91               "isxdigit",
92               RetValSpec<IntType>,
93               [ArgSpec<IntType>]
94           >,
95           FunctionSpec<
96               "tolower",
97               RetValSpec<IntType>,
98               [ArgSpec<IntType>]
99           >,
100           FunctionSpec<
101               "toupper",
102               RetValSpec<IntType>,
103               [ArgSpec<IntType>]
104           >,
105       ]
106   >;
108   NamedType FEnvT = NamedType<"fenv_t">;
109   PtrType FEnvTPtr = PtrType<FEnvT>;
110   ConstType ConstFEnvTPtr = ConstType<FEnvTPtr>;
111   NamedType FExceptT = NamedType<"fexcept_t">;
112   PtrType FExceptTPtr = PtrType<FExceptT>;
113   ConstType ConstFExceptTPtr = ConstType<FExceptTPtr>;
114   HeaderSpec Fenv = HeaderSpec<
115       "fenv.h",
116       [
117           Macro<"FE_DIVBYZERO">,
118           Macro<"FE_INEXACT">,
119           Macro<"FE_INVALID">,
120           Macro<"FE_OVERFLOW">,
121           Macro<"FE_UNDERFLOW">,
122           Macro<"FE_ALL_EXCEPT">,
124           Macro<"FE_DOWNWARD">,
125           Macro<"FE_TONEAREST">,
126           Macro<"FE_TOWARDZERO">,
127           Macro<"FE_UPWARD">,
129           Macro<"FE_DFL_ENV">
130       ],
131       [
132           NamedType<"fenv_t">,
133           NamedType<"fexcept_t">,
134       ], // Types
135       [], // Enumerations
136       [
137           FunctionSpec<
138               "feclearexcept",
139               RetValSpec<IntType>,
140               [ArgSpec<IntType>]
141           >,
142           FunctionSpec<
143               "fetestexcept",
144               RetValSpec<IntType>,
145               [ArgSpec<IntType>]
146           >,
147           FunctionSpec<
148               "feraiseexcept",
149               RetValSpec<IntType>,
150               [ArgSpec<IntType>]
151           >,
152           FunctionSpec<
153               "fesetround",
154               RetValSpec<IntType>,
155               [ArgSpec<IntType>]
156           >,
157           FunctionSpec<
158               "fegetround",
159               RetValSpec<IntType>,
160               []
161           >,
162           FunctionSpec<
163               "fegetenv",
164               RetValSpec<IntType>,
165               [ArgSpec<FEnvTPtr>]
166           >,
167           FunctionSpec<
168               "fesetenv",
169               RetValSpec<IntType>,
170               [ArgSpec<ConstFEnvTPtr>]
171           >,
172           FunctionSpec<
173               "fegetexceptflag",
174               RetValSpec<IntType>,
175               [ArgSpec<FExceptTPtr>, ArgSpec<IntType>]
176           >,
177           FunctionSpec<
178               "fesetexceptflag",
179               RetValSpec<IntType>,
180               [ArgSpec<ConstFExceptTPtr>, ArgSpec<IntType>]
181           >,
182           FunctionSpec<
183               "feholdexcept",
184               RetValSpec<IntType>,
185               [ArgSpec<FEnvTPtr>]
186           >,
187           FunctionSpec<
188               "feupdateenv",
189               RetValSpec<IntType>,
190               [ArgSpec<ConstFEnvTPtr>]
191           >,
192       ]
193   >;
195   HeaderSpec String = HeaderSpec<
196       "string.h",
197       [
198           Macro<"NULL">,
199       ],
200       [
201           SizeTType,
202       ],
203       [], // Enumerations
204       [
205           FunctionSpec<
206               "memcpy",
207               RetValSpec<VoidPtr>,
208               [ArgSpec<VoidRestrictedPtr>,
209                ArgSpec<ConstVoidRestrictedPtr>,
210                ArgSpec<SizeTType>]
211           >,
212           FunctionSpec<
213               "memmove",
214               RetValSpec<VoidPtr>,
215               [ArgSpec<VoidPtr>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
216           >,
217           FunctionSpec<
218               "memcmp",
219               RetValSpec<IntType>,
220               [ArgSpec<ConstVoidPtr>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
221           >,
222           FunctionSpec<
223               "memchr",
224               RetValSpec<VoidPtr>,
225               [ArgSpec<ConstVoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
226           >,
227           FunctionSpec<
228               "memset",
229               RetValSpec<VoidPtr>,
230               [ArgSpec<VoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
231           >,
232           FunctionSpec<
233               "strcpy",
234               RetValSpec<CharPtr>,
235               [ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>]
236           >,
237           FunctionSpec<
238               "strncpy",
239               RetValSpec<CharPtr>,
240               [ArgSpec<CharRestrictedPtr>,
241                ArgSpec<ConstCharRestrictedPtr>,
242                ArgSpec<SizeTType>]
243           >,
244           FunctionSpec<
245               "strcat",
246               RetValSpec<CharPtr>,
247               [ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>]
248           >,
249           FunctionSpec<
250               "strncat",
251               RetValSpec<CharPtr>,
252               [ArgSpec<CharPtr>, ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
253           >,
254           FunctionSpec<
255               "strcmp",
256               RetValSpec<IntType>,
257               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
258           >,
259           FunctionSpec<
260               "strcoll",
261               RetValSpec<IntType>,
262               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
263           >,
264           FunctionSpec<
265               "strncmp",
266               RetValSpec<IntType>,
267               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
268           >,
269           FunctionSpec<
270               "strxfrm",
271               RetValSpec<SizeTType>,
272               [ArgSpec<CharRestrictedPtr>,
273                ArgSpec<ConstCharRestrictedPtr>,
274                ArgSpec<SizeTType>]
275           >,
276           FunctionSpec<
277               "strchr",
278               RetValSpec<CharPtr>,
279               [ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
280           >,
281           FunctionSpec<
282               "strcspn",
283               RetValSpec<SizeTType>,
284               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
285           >,
286           FunctionSpec<
287               "strdup",
288               RetValSpec<CharPtr>,
289               [ArgSpec<ConstCharPtr>]
290           >,
291           FunctionSpec<
292               "strndup",
293               RetValSpec<CharPtr>,
294               [ArgSpec<ConstCharPtr>,ArgSpec<SizeTType>]
295           >,
296           FunctionSpec<
297               "strpbrk",
298               RetValSpec<CharPtr>,
299               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
300           >,
301           FunctionSpec<
302               "strrchr",
303               RetValSpec<CharPtr>,
304               [ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
305           >,
306           FunctionSpec<
307               "strspn",
308               RetValSpec<SizeTType>,
309               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
310           >,
311           FunctionSpec<
312               "strstr",
313               RetValSpec<CharPtr>,
314               [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
315           >,
316           FunctionSpec<
317               "strtok",
318               RetValSpec<CharPtr>,
319               [ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>]
320           >,
321           FunctionSpec<
322               "strerror",
323               RetValSpec<CharPtr>,
324               [ArgSpec<IntType>]
325           >,
326           FunctionSpec<
327               "strlen",
328               RetValSpec<SizeTType>,
329               [ArgSpec<ConstCharPtr>]
330           >,
331       ]
332   >;
334   HeaderSpec Math = HeaderSpec<
335       "math.h",
336       [
337           Macro<"MATH_ERRNO">,
338           Macro<"MATH_ERREXCEPT">,
339           Macro<"math_errhandling">,
341           Macro<"HUGE_VAL">,
342           Macro<"INFINITY">,
343           Macro<"NAN">,
345           Macro<"FP_ILOGB0">,
346           Macro<"FP_ILOGBNAN">,
348           Macro<"isfinite">,
349           Macro<"isinf">,
350           Macro<"isnan">,
351       ],
352       [
353           NamedType<"float_t">,
354           NamedType<"double_t">,
355       ],
356       [], // Enumerations
357       [
358           FunctionSpec<"copysign", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
359           FunctionSpec<"copysignf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
360           FunctionSpec<"copysignl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
362           FunctionSpec<"ceil", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
363           FunctionSpec<"ceilf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
364           FunctionSpec<"ceill", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
366           FunctionSpec<"fabs", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
367           FunctionSpec<"fabsf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
368           FunctionSpec<"fabsl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
370           FunctionSpec<"fdim", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
371           FunctionSpec<"fdimf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
372           FunctionSpec<"fdiml", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
374           FunctionSpec<"floor", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
375           FunctionSpec<"floorf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
376           FunctionSpec<"floorl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
378           FunctionSpec<"fmin", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
379           FunctionSpec<"fminf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
380           FunctionSpec<"fminl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
382           FunctionSpec<"fmax", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
383           FunctionSpec<"fmaxf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
384           FunctionSpec<"fmaxl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
386           FunctionSpec<"fma", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
387           FunctionSpec<"fmaf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>, ArgSpec<FloatType>]>,
389           FunctionSpec<"fmod", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
391           FunctionSpec<"fmodf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
393           FunctionSpec<"frexp", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<IntPtr>]>,
394           FunctionSpec<"frexpf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<IntPtr>]>,
395           FunctionSpec<"frexpl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<IntPtr>]>,
397           FunctionSpec<"hypot", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
398           FunctionSpec<"hypotf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
400           FunctionSpec<"ilogb", RetValSpec<IntType>, [ArgSpec<DoubleType>]>,
401           FunctionSpec<"ilogbf", RetValSpec<IntType>, [ArgSpec<FloatType>]>,
402           FunctionSpec<"ilogbl", RetValSpec<IntType>, [ArgSpec<LongDoubleType>]>,
404           FunctionSpec<"ldexp", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<IntType>]>,
405           FunctionSpec<"ldexpf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<IntType>]>,
406           FunctionSpec<"ldexpl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<IntType>]>,
408           FunctionSpec<"log10", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
409           FunctionSpec<"log10f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
411           FunctionSpec<"log1p", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
412           FunctionSpec<"log1pf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
414           FunctionSpec<"log2", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
415           FunctionSpec<"log2f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
417           FunctionSpec<"log", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
418           FunctionSpec<"logf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
420           FunctionSpec<"logb", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
421           FunctionSpec<"logbf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
422           FunctionSpec<"logbl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
424           FunctionSpec<"modf", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoublePtr>]>,
425           FunctionSpec<"modff", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatPtr>]>,
426           FunctionSpec<"modfl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoublePtr>]>,
428           FunctionSpec<"cos", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
429           FunctionSpec<"cosf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
430           FunctionSpec<"sin", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
431           FunctionSpec<"sinf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
432           FunctionSpec<"tan", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
433           FunctionSpec<"tanf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
435           FunctionSpec<"erff", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
437           FunctionSpec<"exp", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
438           FunctionSpec<"expf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
440           FunctionSpec<"exp2", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
441           FunctionSpec<"exp2f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
443           FunctionSpec<"expm1", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
444           FunctionSpec<"expm1f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
446           FunctionSpec<"remainderf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
447           FunctionSpec<"remainder", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
448           FunctionSpec<"remainderl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
450           FunctionSpec<"remquof", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>, ArgSpec<IntPtr>]>,
451           FunctionSpec<"remquo", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>, ArgSpec<IntPtr>]>,
452           FunctionSpec<"remquol", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>, ArgSpec<IntPtr>]>,
454           FunctionSpec<"round", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
455           FunctionSpec<"roundf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
456           FunctionSpec<"roundl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
458           FunctionSpec<"lround", RetValSpec<LongType>, [ArgSpec<DoubleType>]>,
459           FunctionSpec<"lroundf", RetValSpec<LongType>, [ArgSpec<FloatType>]>,
460           FunctionSpec<"lroundl", RetValSpec<LongType>, [ArgSpec<LongDoubleType>]>,
462           FunctionSpec<"llround", RetValSpec<LongLongType>, [ArgSpec<DoubleType>]>,
463           FunctionSpec<"llroundf", RetValSpec<LongLongType>, [ArgSpec<FloatType>]>,
464           FunctionSpec<"llroundl", RetValSpec<LongLongType>, [ArgSpec<LongDoubleType>]>,
466           FunctionSpec<"rint", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
467           FunctionSpec<"rintf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
468           FunctionSpec<"rintl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
470           FunctionSpec<"lrint", RetValSpec<LongType>, [ArgSpec<DoubleType>]>,
471           FunctionSpec<"lrintf", RetValSpec<LongType>, [ArgSpec<FloatType>]>,
472           FunctionSpec<"lrintl", RetValSpec<LongType>, [ArgSpec<LongDoubleType>]>,
474           FunctionSpec<"llrint", RetValSpec<LongLongType>, [ArgSpec<DoubleType>]>,
475           FunctionSpec<"llrintf", RetValSpec<LongLongType>, [ArgSpec<FloatType>]>,
476           FunctionSpec<"llrintl", RetValSpec<LongLongType>, [ArgSpec<LongDoubleType>]>,
478           FunctionSpec<"sqrt", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
479           FunctionSpec<"sqrtf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
480           FunctionSpec<"sqrtl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
482           FunctionSpec<"trunc", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
483           FunctionSpec<"truncf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
484           FunctionSpec<"truncl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
486           FunctionSpec<"nearbyint", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
487           FunctionSpec<"nearbyintf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
488           FunctionSpec<"nearbyintl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
490           FunctionSpec<"nextafterf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
491           FunctionSpec<"nextafter", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
492           FunctionSpec<"nextafterl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
494           FunctionSpec<"pow", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
496           FunctionSpec<"coshf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
497           FunctionSpec<"sinhf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
498           FunctionSpec<"tanhf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
500           FunctionSpec<"acosf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
501           FunctionSpec<"asinf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
502           FunctionSpec<"asin", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
503           FunctionSpec<"atanf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
505           FunctionSpec<"acoshf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
506           FunctionSpec<"asinhf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
507           FunctionSpec<"atanhf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
509           FunctionSpec<"scalbn", RetValSpec<DoubleType>, [ArgSpec<DoubleType>, ArgSpec<IntType>]>,
510           FunctionSpec<"scalbnf", RetValSpec<FloatType>, [ArgSpec<FloatType>, ArgSpec<IntType>]>,
511           FunctionSpec<"scalbnl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<IntType>]>,
512       ]
513   >;
515   HeaderSpec StdIO = HeaderSpec<
516       "stdio.h",
517       [
518           Macro<"stdin">,
519           Macro<"stderr">,
520           Macro<"stdout">,
521           Macro<"_IOFBF">,
522           Macro<"_IOLBF">,
523           Macro<"_IONBF">,
524           Macro<"EOF">,
525       ], // Macros
526       [ // Types
527           SizeTType,
528           FILE,
529       ],
530       [], // Enumerations
531       [
532           FunctionSpec<
533               "clearerr",
534               RetValSpec<VoidType>,
535               [ArgSpec<FILEPtr>]
536           >,
537           FunctionSpec<
538               "fclose",
539               RetValSpec<IntType>,
540               [ArgSpec<FILEPtr>]
541           >,
542           FunctionSpec<
543               "feof",
544               RetValSpec<IntType>,
545               [ArgSpec<FILEPtr>]
546           >,
547           FunctionSpec<
548               "ferror",
549               RetValSpec<IntType>,
550               [ArgSpec<FILEPtr>]
551           >,
552           FunctionSpec<
553               "fgetc",
554               RetValSpec<IntType>,
555               [ArgSpec<FILEPtr>]
556           >,
557           FunctionSpec<
558               "fgets",
559               RetValSpec<CharPtr>,
560               [
561                 ArgSpec<CharRestrictedPtr>,
562                 ArgSpec<IntType>,
563                 ArgSpec<FILERestrictedPtr>,
564               ]
565           >,
566           FunctionSpec<
567               "fflush",
568               RetValSpec<IntType>,
569               [ArgSpec<FILEPtr>]
570           >,
571           FunctionSpec<
572               "fopen",
573               RetValSpec<FILEPtr>,
574               [ArgSpec<ConstCharPtr>,
575                ArgSpec<ConstCharPtr>]
576           >,
577           FunctionSpec<
578               "fputc",
579               RetValSpec<IntType>,
580               [ArgSpec<IntType>,
581                ArgSpec<FILEPtr>]
582           >,
583           FunctionSpec<
584               "ftell",
585               RetValSpec<LongType>,
586               [ArgSpec<FILEPtr>]
587           >,
588           FunctionSpec<
589               "getc",
590               RetValSpec<IntType>,
591               [ArgSpec<FILEPtr>]
592           >,
593           FunctionSpec<
594               "getchar",
595               RetValSpec<IntType>,
596               [ArgSpec<VoidType>]
597           >,
598           FunctionSpec<
599               "putc",
600               RetValSpec<IntType>,
601               [ArgSpec<IntType>,
602                ArgSpec<FILEPtr>]
603           >,
604           FunctionSpec<
605               "putchar",
606               RetValSpec<IntType>,
607               [ArgSpec<IntType>]
608           >,
609           FunctionSpec<
610               "fputs",
611               RetValSpec<IntType>,
612               [ArgSpec<ConstCharRestrictedPtr>,
613                ArgSpec<FILERestrictedPtr>]
614           >,
615           FunctionSpec<
616               "puts",
617               RetValSpec<IntType>,
618               [ArgSpec<ConstCharRestrictedPtr>]
619           >,
620           FunctionSpec<
621               "fread",
622               RetValSpec<SizeTType>,
623               [ArgSpec<VoidRestrictedPtr>,
624                ArgSpec<SizeTType>,
625                ArgSpec<SizeTType>,
626                ArgSpec<FILERestrictedPtr>]
627           >,
628           FunctionSpec<
629               "fseek",
630               RetValSpec<IntType>,
631               [ArgSpec<FILEPtr>,
632                ArgSpec<LongType>,
633                ArgSpec<IntType>]
634           >,
635           FunctionSpec<
636               "fwrite",
637               RetValSpec<SizeTType>,
638               [ArgSpec<ConstVoidRestrictedPtr>,
639                ArgSpec<SizeTType>,
640                ArgSpec<SizeTType>,
641                ArgSpec<FILERestrictedPtr>]
642           >,
643           FunctionSpec<
644               "remove",
645               RetValSpec<IntType>,
646               [ArgSpec<ConstCharPtr>]
647           >,
648           FunctionSpec<
649               "setbuf",
650               RetValSpec<VoidType>,
651               [ArgSpec<FILERestrictedPtr>, ArgSpec<CharRestrictedPtr>]
652           >,
653           FunctionSpec<
654               "setvbuf",
655               RetValSpec<IntType>,
656               [ArgSpec<FILERestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
657           >,
658           FunctionSpec<
659               "sscanf",
660               RetValSpec<IntType>,
661               [ArgSpec<ConstCharRestrictedPtr>,
662                ArgSpec<ConstCharRestrictedPtr>,
663                ArgSpec<VarArgType>]
664           >,
665           FunctionSpec<
666               "scanf",
667               RetValSpec<IntType>,
668               [ArgSpec<ConstCharRestrictedPtr>,
669                ArgSpec<VarArgType>]
670           >,
671           FunctionSpec<
672               "fscanf",
673               RetValSpec<IntType>,
674               [ArgSpec<FILERestrictedPtr>,
675                ArgSpec<ConstCharRestrictedPtr>,
676                ArgSpec<VarArgType>]
677           >,
678           FunctionSpec<
679               "sprintf",
680               RetValSpec<IntType>,
681               [ArgSpec<CharRestrictedPtr>,
682                ArgSpec<ConstCharRestrictedPtr>,
683                ArgSpec<VarArgType>]
684           >,
685           FunctionSpec<
686               "snprintf",
687               RetValSpec<IntType>,
688               [ArgSpec<CharRestrictedPtr>,
689                ArgSpec<SizeTType>,
690                ArgSpec<ConstCharRestrictedPtr>,
691                ArgSpec<VarArgType>]
692           >,
693           FunctionSpec<
694               "printf",
695               RetValSpec<IntType>,
696               [ArgSpec<ConstCharRestrictedPtr>,
697                ArgSpec<VarArgType>]
698           >,
699           FunctionSpec<
700               "fprintf",
701               RetValSpec<IntType>,
702               [ArgSpec<FILERestrictedPtr>,
703                ArgSpec<ConstCharRestrictedPtr>,
704                ArgSpec<VarArgType>]
705           >,
706           FunctionSpec<
707               "vsprintf",
708               RetValSpec<IntType>,
709               [ArgSpec<CharRestrictedPtr>,
710                ArgSpec<ConstCharRestrictedPtr>,
711                ArgSpec<VaListType>]
712           >,
713           FunctionSpec<
714               "vsnprintf",
715               RetValSpec<IntType>,
716               [ArgSpec<CharRestrictedPtr>,
717                ArgSpec<SizeTType>,
718                ArgSpec<ConstCharRestrictedPtr>,
719                ArgSpec<VaListType>]
720           >,
721           FunctionSpec<
722               "vprintf",
723               RetValSpec<IntType>,
724               [ArgSpec<ConstCharRestrictedPtr>,
725                ArgSpec<VaListType>]
726           >,
727           FunctionSpec<
728               "vfprintf",
729               RetValSpec<IntType>,
730               [ArgSpec<FILERestrictedPtr>,
731                ArgSpec<ConstCharRestrictedPtr>,
732                ArgSpec<VaListType>]
733           >,
734           FunctionSpec<
735               "ungetc",
736               RetValSpec<IntType>,
737               [ArgSpec<IntType>, ArgSpec<FILEPtr>]
738           >,
739       ],
740       [
741           ObjectSpec<
742               "stdin",
743               "FILE *"
744           >,
745           ObjectSpec<
746               "stdout",
747               "FILE *"
748           >,
749           ObjectSpec<
750               "stderr",
751               "FILE *"
752           >,
753       ]
754   >;
756   HeaderSpec StdLib = HeaderSpec<
757       "stdlib.h",
758       [], // Macros
759       [
760           DivTType,
761           LDivTType,
762           LLDivTType,
763           SizeTType,
764           BSearchCompareT,
765           QSortCompareT,
766           AtexitHandlerT,
767       ], // Types
768       [], // Enumerations
769       [
770           FunctionSpec<"abort", RetValSpec<NoReturn>, [ArgSpec<VoidType>]>,
772           FunctionSpec<"bsearch", RetValSpec<VoidPtr>, [ArgSpec<ConstVoidPtr>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<SizeTType>, ArgSpec<BSearchCompareT>]>,
774           FunctionSpec<"abs", RetValSpec<IntType>, [ArgSpec<IntType>]>,
775           FunctionSpec<"labs", RetValSpec<LongType>, [ArgSpec<LongType>]>,
776           FunctionSpec<"llabs", RetValSpec<LongLongType>, [ArgSpec<LongLongType>]>,
778           FunctionSpec<"atof", RetValSpec<DoubleType>, [ArgSpec<ConstCharRestrictedPtr>]>,
779           FunctionSpec<"atoi", RetValSpec<IntType>, [ArgSpec<ConstCharPtr>]>,
780           FunctionSpec<"atol", RetValSpec<LongType>, [ArgSpec<ConstCharPtr>]>,
781           FunctionSpec<"atoll", RetValSpec<LongLongType>, [ArgSpec<ConstCharPtr>]>,
783           FunctionSpec<"div", RetValSpec<DivTType>, [ArgSpec<IntType>, ArgSpec<IntType>]>,
784           FunctionSpec<"ldiv", RetValSpec<LDivTType>, [ArgSpec<LongType>, ArgSpec<LongType>]>,
785           FunctionSpec<"lldiv", RetValSpec<LLDivTType>, [ArgSpec<LongLongType>, ArgSpec<LongLongType>]>,
787           FunctionSpec<"qsort", RetValSpec<VoidType>, [ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<SizeTType>, ArgSpec<QSortCompareT>]>,
789           FunctionSpec<"rand", RetValSpec<IntType>, [ArgSpec<VoidType>]>,
790           FunctionSpec<"srand", RetValSpec<VoidType>, [ArgSpec<UnsignedIntType>]>,
792           FunctionSpec<"strtof", RetValSpec<FloatType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>]>,
793           FunctionSpec<"strtod", RetValSpec<DoubleType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>]>,
794           FunctionSpec<"strtold", RetValSpec<LongDoubleType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>]>,
795           FunctionSpec<"strtol", RetValSpec<LongType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
796           FunctionSpec<"strtoll", RetValSpec<LongLongType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
797           FunctionSpec<"strtoul", RetValSpec<UnsignedLongType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
798           FunctionSpec<"strtoull", RetValSpec<UnsignedLongLongType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
800           FunctionSpec<"malloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>]>,
801           FunctionSpec<"calloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>, ArgSpec<SizeTType>]>,
802           FunctionSpec<"realloc", RetValSpec<VoidPtr>, [ArgSpec<VoidPtr>, ArgSpec<SizeTType>]>,
803           FunctionSpec<"aligned_alloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>, ArgSpec<SizeTType>]>,
804           FunctionSpec<"free", RetValSpec<VoidType>, [ArgSpec<VoidPtr>]>,
806           FunctionSpec<"_Exit", RetValSpec<NoReturn>, [ArgSpec<IntType>]>,
807           FunctionSpec<"exit", RetValSpec<NoReturn>, [ArgSpec<IntType>]>,
808           FunctionSpec<"atexit", RetValSpec<IntType>, [ArgSpec<AtexitHandlerT>]>,
809       ]
810   >;
812   NamedType IMaxDivTType = NamedType<"imaxdiv_t">;
814   HeaderSpec IntTypes = HeaderSpec<
815       "inttypes.h",
816       [], // Macros
817       [
818         IMaxDivTType,
819       ], // Types
820       [], // Enumerations
821       [
822           FunctionSpec<"imaxabs", RetValSpec<IntMaxTType>, [ArgSpec<IntMaxTType>]>,
823           FunctionSpec<"imaxdiv", RetValSpec<IMaxDivTType>, [ArgSpec<IntMaxTType>, ArgSpec<IntMaxTType>]>,
824           FunctionSpec<"strtoimax", RetValSpec<IntMaxTType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
825           FunctionSpec<"strtoumax", RetValSpec<UIntMaxTType>, [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtrPtr>, ArgSpec<IntType>]>,
826       ]
827   >;
829   HeaderSpec Errno = HeaderSpec<
830       "errno.h",
831       [
832         Macro<"errno">,
833         Macro<"EDOM">,
834         Macro<"EILSEQ">,
835         Macro<"ERANGE">,
836       ]
837   >;
839   NamedType SigAtomicT = NamedType<"sig_atomic_t">;
840   HeaderSpec Signal = HeaderSpec<
841       "signal.h",
842       [
843         Macro<"SIG_BLOCK">,
844         Macro<"SIG_UNBLOCK">,
845         Macro<"SIG_SETMASK">,
847         Macro<"SIGABRT">,
848         Macro<"SIGFPE">,
849         Macro<"SIGILL">,
850         Macro<"SIGINT">,
851         Macro<"SIGSEGV">,
852         Macro<"SIGTERM">
853       ],
854       [
855         SizeTType,
856         SigAtomicT,
857         SigHandlerT,
858       ],
859       [], // Enumerations
860       [
861         FunctionSpec<"raise", RetValSpec<IntType>, [ArgSpec<IntType>]>,
862         FunctionSpec<
863           "signal",
864           RetValSpec<SigHandlerT>,
865           [ArgSpec<IntType>, ArgSpec<SigHandlerT>]
866         >,
867       ]
868   >;
870   HeaderSpec Threads = HeaderSpec<
871       "threads.h",
872       [
873           Macro<"ONCE_FLAG_INIT">,
874       ],
875       [
876           OnceFlagType,
877           CallOnceFuncType,
878           CndTType,
879           MtxTType,
880           ThrdStartTType,
881           ThrdTType,
882           TssTType,
883           TssDtorTType,
884       ],
885       [
886           EnumeratedNameValue<"mtx_plain">,
887           EnumeratedNameValue<"mtx_recursive">,
888           EnumeratedNameValue<"mtx_timed">,
889           EnumeratedNameValue<"thrd_timedout">,
890           EnumeratedNameValue<"thrd_success">,
891           EnumeratedNameValue<"thrd_busy">,
892           EnumeratedNameValue<"thrd_error">,
893           EnumeratedNameValue<"thrd_nomem">,
894       ],
895       [
896           FunctionSpec<
897               "call_once",
898               RetValSpec<VoidType>,
899               [
900                   ArgSpec<OnceFlagTypePtr>,
901                   ArgSpec<CallOnceFuncType>,
902               ]
903           >,
904           FunctionSpec<
905               "cnd_broadcast",
906               RetValSpec<IntType>,
907               [
908                   ArgSpec<CndTTypePtr>,
909               ]
910           >,
911           FunctionSpec<
912               "cnd_destroy",
913               RetValSpec<VoidType>,
914               [
915                   ArgSpec<CndTTypePtr>,
916               ]
917           >,
918           FunctionSpec<
919               "cnd_init",
920               RetValSpec<IntType>,
921               [
922                   ArgSpec<CndTTypePtr>,
923               ]
924           >,
925           FunctionSpec<
926               "cnd_signal",
927               RetValSpec<IntType>,
928               [
929                   ArgSpec<CndTTypePtr>,
930               ]
931           >,
932           FunctionSpec<
933               "cnd_wait",
934               RetValSpec<IntType>,
935               [
936                   ArgSpec<CndTTypePtr>,
937                   ArgSpec<MtxTTypePtr>,
938               ]
939           >,
940           FunctionSpec<
941               "mtx_init",
942               RetValSpec<IntType>,
943               [
944                   ArgSpec<MtxTTypePtr>,
945                   ArgSpec<IntType>,
946               ]
947           >,
948           FunctionSpec<
949               "mtx_destroy",
950               RetValSpec<IntType>,
951               [
952                   ArgSpec<VoidType>,
953               ]
954           >,
955           FunctionSpec<
956               "mtx_lock",
957               RetValSpec<IntType>,
958               [
959                   ArgSpec<MtxTTypePtr>,
960               ]
961           >,
962           FunctionSpec<
963               "mtx_unlock",
964               RetValSpec<IntType>,
965               [
966                   ArgSpec<MtxTTypePtr>,
967               ]
968           >,
969           FunctionSpec<
970               "thrd_create",
971               RetValSpec<IntType>,
972               [
973                   ArgSpec<ThrdTTypePtr>,
974                   ArgSpec<ThrdStartTType>,
975                   ArgSpec<VoidPtr>,
976               ]
977           >,
978           FunctionSpec<
979               "thrd_join",
980               RetValSpec<IntType>,
981               [
982                   ArgSpec<ThrdTType>,
983                   ArgSpec<IntPtr>,
984               ]
985           >,
986           FunctionSpec<
987               "thrd_detach",
988               RetValSpec<IntType>,
989               [ArgSpec<ThrdTType>]
990           >,
991           FunctionSpec<
992               "thrd_current",
993               RetValSpec<ThrdTType>,
994               [ArgSpec<VoidType>]
995           >,
996           FunctionSpec<
997               "thrd_equal",
998               RetValSpec<IntType>,
999               [ArgSpec<ThrdTType>, ArgSpec<ThrdTType>]
1000           >,
1001           FunctionSpec<
1002               "thrd_exit",
1003               RetValSpec<VoidType>,
1004               [ArgSpec<IntType>]
1005           >,
1006           FunctionSpec<
1007               "tss_create",
1008               RetValSpec<IntType>,
1009               [ArgSpec<TssTPtr>, ArgSpec<TssDtorTType>]
1010           >,
1011           FunctionSpec<
1012               "tss_delete",
1013               RetValSpec<IntType>,
1014               [ArgSpec<TssTType>]
1015           >,
1016           FunctionSpec<
1017               "tss_get",
1018               RetValSpec<VoidPtr>,
1019               [ArgSpec<TssTType>]
1020           >,
1021           FunctionSpec<
1022               "tss_set",
1023               RetValSpec<IntType>,
1024               [ArgSpec<TssTType>, ArgSpec<VoidPtr>]
1025           >,
1026       ]
1027   >;
1029   HeaderSpec Time = HeaderSpec<
1030       "time.h",
1031       [], // Macros
1032       [ // Types
1033          ClockT,
1034          StructTmType,
1035          TimeTType,
1036       ],
1037       [], // Enumerations
1038       [
1039           FunctionSpec<
1040               "asctime",
1041               RetValSpec<CharPtr>,
1042               [ArgSpec<StructTmPtr>]
1043           >,
1044           FunctionSpec<
1045               "asctime_r",
1046               RetValSpec<CharPtr>,
1047               [
1048                   ArgSpec<StructTmPtr>,
1049                   ArgSpec<CharPtr>,
1050               ]
1051           >,
1052           FunctionSpec<
1053               "clock",
1054               RetValSpec<ClockT>,
1055               [ArgSpec<VoidType>]
1056           >,
1057           FunctionSpec<
1058               "difftime",
1059               RetValSpec<DoubleType>,
1060               [
1061                   ArgSpec<TimeTType>,
1062                   ArgSpec<TimeTType>,
1063               ]
1064           >,
1065           FunctionSpec<
1066               "gmtime",
1067               RetValSpec<StructTmPtr>,
1068               [ArgSpec<TimeTTypePtr>]
1069           >,
1070           FunctionSpec<
1071               "gmtime_r",
1072               RetValSpec<StructTmPtr>,
1073               [
1074                   ArgSpec<TimeTTypePtr>,
1075                   ArgSpec<StructTmPtr>,
1076               ]
1077           >,
1078           FunctionSpec<
1079               "mktime",
1080               RetValSpec<TimeTType>,
1081               [ArgSpec<StructTmPtr>]
1082           >,
1083           FunctionSpec<
1084               "time",
1085               RetValSpec<TimeTType>,
1086               [ArgSpec<TimeTTypePtr>]
1087           >,
1088       ]
1089   >;
1091   HeaderSpec SetJmp = HeaderSpec<
1092       "setjmp.h",
1093       [], // Macros
1094       [JmpBuf],
1095       [], // Enumerations
1096       [
1097           FunctionSpec<
1098               "longjmp",
1099               RetValSpec<NoReturn>,
1100               [ArgSpec<JmpBuf>, ArgSpec<IntType>]
1101           >,
1102           FunctionSpec<
1103               "setjmp",
1104               RetValSpec<IntType>,
1105               [ArgSpec<JmpBuf>]
1106           >,
1107           FunctionSpec<
1108               "longjmp",
1109               RetValSpec<VoidType>,
1110               [ArgSpec<JmpBuf>, ArgSpec<IntType>]
1111           >,
1112       ]
1113   >;
1115   HeaderSpec WChar = HeaderSpec<
1116       "wchar.h",
1117       [ // Macros
1118         Macro<"WEOF">,
1119       ], 
1120       [ //Types
1121         SizeTType,
1122         WIntType,
1123         WCharType,
1124       ],
1125       [], // Enumerations
1126       [
1127           FunctionSpec<
1128               "wctob",
1129               RetValSpec<IntType>,
1130               [ArgSpec<WIntType>]
1131           >,
1132       ]
1133   >;
1136   let Headers = [
1137     Assert,
1138     CType,
1139     Errno,
1140     Fenv,
1141     Math,
1142     String,
1143     StdIO,
1144     StdLib,
1145     IntTypes,
1146     SetJmp,
1147     Signal,
1148     Threads,
1149     Time,
1150     WChar,
1151   ];