xref: /llvm-project-15.0.7/libc/spec/gnu_ext.td (revision bbffece3)
1def GnuExtensions : StandardSpec<"GNUExtensions"> {
2  NamedType CookieIOFunctionsT = NamedType<"cookie_io_functions_t">;
3  HeaderSpec CType = HeaderSpec<
4    "ctype.h",
5    [], // Macros
6    [], // Types
7    [], // Enumerations
8    [
9        FunctionSpec<
10            "toascii",
11            RetValSpec<IntType>,
12            [ArgSpec<IntType>]
13        >,
14    ]
15  >;
16
17  HeaderSpec Math = HeaderSpec<
18      "math.h",
19      [], // Macros
20      [], // Types
21      [], // Enumerations
22      [
23        FunctionSpec<
24            "sincosf",
25            RetValSpec<VoidType>,
26            [ArgSpec<FloatType>, ArgSpec<FloatPtr>, ArgSpec<FloatPtr>]
27        >,
28      ]
29  >;
30
31  HeaderSpec String = HeaderSpec<
32      "string.h",
33      [], // Macros
34      [], // Types
35      [], // Enumerations
36      [
37        FunctionSpec<
38            "memrchr",
39            RetValSpec<VoidPtr>,
40            [ArgSpec<VoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
41        >,
42      ]
43  >;
44
45  HeaderSpec FEnv = HeaderSpec<
46      "fenv.h",
47      [], // Macros
48      [], // Types
49      [], // Enumerations
50      [
51        FunctionSpec<
52            "fedisableexcept",
53            RetValSpec<IntType>,
54            [ArgSpec<IntType>]
55        >,
56        FunctionSpec<
57            "feenableexcept",
58            RetValSpec<IntType>,
59            [ArgSpec<IntType>]
60        >,
61        FunctionSpec<
62            "fegetexcept",
63            RetValSpec<IntType>,
64            []
65        >
66      ]
67  >;
68
69  HeaderSpec StdIO = HeaderSpec<
70      "stdio.h",
71      [], // Macros
72      [CookieIOFunctionsT], // Types
73      [], // Enumerations
74      [
75          FunctionSpec<
76              "fopencookie",
77              RetValSpec<FILEPtr>,
78              [ArgSpec<VoidPtr>, ArgSpec<ConstCharPtr>, ArgSpec<CookieIOFunctionsT>]
79          >,
80          FunctionSpec<
81              "fread_unlocked",
82              RetValSpec<SizeTType>,
83              [ArgSpec<VoidRestrictedPtr>,
84               ArgSpec<SizeTType>,
85               ArgSpec<SizeTType>,
86               ArgSpec<FILERestrictedPtr>]
87          >,
88          FunctionSpec<
89              "fwrite_unlocked",
90              RetValSpec<SizeTType>,
91              [ArgSpec<ConstVoidRestrictedPtr>,
92               ArgSpec<SizeTType>,
93               ArgSpec<SizeTType>,
94               ArgSpec<FILERestrictedPtr>]
95          >,
96      ]
97  >;
98
99  let Headers = [
100    CType,
101    FEnv,
102    Math,
103    StdIO,
104    String,
105  ];
106}
107