[NFC][Py Reformat] Added more commits to .git-blame-ignore-revs
[llvm-project.git] / libc / spec / gnu_ext.td
blobd02733511464ea7ffbc3c209e942752bc2893d13
1 def CpuSetT : NamedType<"cpu_set_t">;
2 def CpuSetPtr : PtrType<CpuSetT>;
3 def ConstCpuSetPtr : ConstType<CpuSetPtr>;
5 def GnuExtensions : StandardSpec<"GNUExtensions"> {
6   NamedType CookieIOFunctionsT = NamedType<"cookie_io_functions_t">;
7   HeaderSpec CType = HeaderSpec<
8     "ctype.h",
9     [], // Macros
10     [], // Types
11     [], // Enumerations
12     [
13         FunctionSpec<
14             "toascii",
15             RetValSpec<IntType>,
16             [ArgSpec<IntType>]
17         >,
18     ]
19   >;
21   HeaderSpec Math = HeaderSpec<
22       "math.h",
23       [], // Macros
24       [], // Types
25       [], // Enumerations
26       [
27         FunctionSpec<
28             "sincosf",
29             RetValSpec<VoidType>,
30             [ArgSpec<FloatType>, ArgSpec<FloatPtr>, ArgSpec<FloatPtr>]
31         >,
32         FunctionSpec<"exp10f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
33       ]
34   >;
36   HeaderSpec Sched = HeaderSpec<
37       "sched.h",
38       [], // Macros
39       [PidT, SizeTType, CpuSetT], // Types
40       [], // Enumerations
41       [
42         FunctionSpec<
43             "sched_getaffinity",
44             RetValSpec<IntType>,
45             [ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<CpuSetPtr>]
46         >,
47         FunctionSpec<
48             "sched_setaffinity",
49             RetValSpec<IntType>,
50             [ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<ConstCpuSetPtr>]
51         >,
52       ]
53   >;
55   HeaderSpec String = HeaderSpec<
56       "string.h",
57       [], // Macros
58       [], // Types
59       [], // Enumerations
60       [
61          FunctionSpec<
62             "memmem",
63             RetValSpec<VoidPtr>,
64             [ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
65         >,
66         FunctionSpec<
67             "memrchr",
68             RetValSpec<VoidPtr>,
69             [ArgSpec<VoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
70         >,
71         FunctionSpec<
72             "strerror_r",
73             RetValSpec<CharPtr>,
74             [ArgSpec<IntType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
75         >,
76         FunctionSpec<
77             "strcasestr",
78             RetValSpec<CharPtr>,
79             [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
80         >,
81         FunctionSpec<
82             "strchrnul",
83             RetValSpec<CharPtr>,
84             [ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
85         >,
86       ]
87   >;
89   HeaderSpec FEnv = HeaderSpec<
90       "fenv.h",
91       [], // Macros
92       [], // Types
93       [], // Enumerations
94       [
95         FunctionSpec<
96             "fedisableexcept",
97             RetValSpec<IntType>,
98             [ArgSpec<IntType>]
99         >,
100         FunctionSpec<
101             "feenableexcept",
102             RetValSpec<IntType>,
103             [ArgSpec<IntType>]
104         >,
105         FunctionSpec<
106             "fegetexcept",
107             RetValSpec<IntType>,
108             []
109         >
110       ]
111   >;
113   HeaderSpec StdIO = HeaderSpec<
114       "stdio.h",
115       [], // Macros
116       [CookieIOFunctionsT], // Types
117       [], // Enumerations
118       [
119           FunctionSpec<
120               "clearerr_unlocked",
121               RetValSpec<VoidType>,
122               [ArgSpec<FILEPtr>]
123           >,
124           FunctionSpec<
125               "feof_unlocked",
126               RetValSpec<IntType>,
127               [ArgSpec<FILEPtr>]
128           >,
129           FunctionSpec<
130               "ferror_unlocked",
131               RetValSpec<IntType>,
132               [ArgSpec<FILEPtr>]
133           >,
134           FunctionSpec<
135               "fopencookie",
136               RetValSpec<FILEPtr>,
137               [ArgSpec<VoidPtr>, ArgSpec<ConstCharPtr>, ArgSpec<CookieIOFunctionsT>]
138           >,
139           FunctionSpec<
140               "fread_unlocked",
141               RetValSpec<SizeTType>,
142               [ArgSpec<VoidRestrictedPtr>,
143                ArgSpec<SizeTType>,
144                ArgSpec<SizeTType>,
145                ArgSpec<FILERestrictedPtr>]
146           >,
147           FunctionSpec<
148               "fwrite_unlocked",
149               RetValSpec<SizeTType>,
150               [ArgSpec<ConstVoidRestrictedPtr>,
151                ArgSpec<SizeTType>,
152                ArgSpec<SizeTType>,
153                ArgSpec<FILERestrictedPtr>]
154           >,
155           FunctionSpec<
156               "fgetc_unlocked",
157               RetValSpec<IntType>,
158               [ArgSpec<FILEPtr>]
159           >,
160       ]
161   >;
163   HeaderSpec PThread = HeaderSpec<
164       "pthread.h",
165       [], // Macros
166       [], // Types
167       [], // Enumerations
168       [
169           FunctionSpec<
170               "pthread_setname_np",
171               RetValSpec<IntType>,
172               [ArgSpec<PThreadTType>, ArgSpec<ConstCharPtr>]
173           >,
174           FunctionSpec<
175               "pthread_getname_np",
176               RetValSpec<IntType>,
177               [ArgSpec<PThreadTType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
178           >,
179       ]
180   >;
182   HeaderSpec SysAuxv = HeaderSpec<
183       "sys/auxv.h",
184       [], // Macros
185       [], // Types
186       [], // Enumerations
187       []  // Functions
188   >;
190   HeaderSpec SendFile = HeaderSpec<
191       "sys/sendfile.h",
192       [], // Macros
193       [OffTType, SizeTType, SSizeTType,], // Types
194       [], // Enumerations
195       [
196           FunctionSpec<
197               "sendfile",
198               RetValSpec<SSizeTType>,
199               [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<OffTPtr>, ArgSpec<SizeTType>]
200           >,
201       ]
202   >;
204   HeaderSpec UniStd = HeaderSpec<
205     "unistd.h",
206     [], // Macros
207     [], // Types
208     [], // Enumerations
209     [
210         FunctionSpec<
211             "dup2",
212             RetValSpec<IntType>,
213             [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
214         >,
215     ]
216   >;
218   let Headers = [
219     CType,
220     FEnv,
221     Math,
222     PThread,
223     Sched,
224     SendFile,
225     SysAuxv,
226     StdIO,
227     String,
228     UniStd,
229   ];