llvm-project
290 строк · 6.9 Кб
1def CpuSetT : NamedType<"cpu_set_t">;
2def CpuSetPtr : PtrType<CpuSetT>;
3def ConstCpuSetPtr : ConstType<CpuSetPtr>;
4
5def QSortRCompareT : NamedType<"__qsortrcompare_t">;
6def StructHsearchData : NamedType<"struct hsearch_data">;
7def StructHsearchDataPtr : PtrType<StructHsearchData>;
8
9def GnuExtensions : StandardSpec<"GNUExtensions"> {
10NamedType CookieIOFunctionsT = NamedType<"cookie_io_functions_t">;
11HeaderSpec CType = HeaderSpec<
12"ctype.h",
13[], // Macros
14[], // Types
15[], // Enumerations
16[
17FunctionSpec<
18"toascii",
19RetValSpec<IntType>,
20[ArgSpec<IntType>]
21>,
22]
23>;
24
25HeaderSpec Math = HeaderSpec<
26"math.h",
27[], // Macros
28[], // Types
29[], // Enumerations
30[
31FunctionSpec<
32"sincosf",
33RetValSpec<VoidType>,
34[ArgSpec<FloatType>, ArgSpec<FloatPtr>, ArgSpec<FloatPtr>]
35>,
36]
37>;
38
39HeaderSpec Sched = HeaderSpec<
40"sched.h",
41[], // Macros
42[PidT, SizeTType, CpuSetT], // Types
43[], // Enumerations
44[
45FunctionSpec<
46"sched_getaffinity",
47RetValSpec<IntType>,
48[ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<CpuSetPtr>]
49>,
50FunctionSpec<
51"sched_setaffinity",
52RetValSpec<IntType>,
53[ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<ConstCpuSetPtr>]
54>,
55]
56>;
57HeaderSpec String = HeaderSpec<
58"string.h",
59[], // Macros
60[], // Types
61[], // Enumerations
62[
63FunctionSpec<
64"memmem",
65RetValSpec<VoidPtr>,
66[ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
67>,
68FunctionSpec<
69"memrchr",
70RetValSpec<VoidPtr>,
71[ArgSpec<ConstVoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
72>,
73FunctionSpec<
74"strerror_r",
75RetValSpec<CharPtr>,
76[ArgSpec<IntType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
77>,
78FunctionSpec<
79"strcasestr",
80RetValSpec<CharPtr>,
81[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
82>,
83FunctionSpec<
84"strchrnul",
85RetValSpec<CharPtr>,
86[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
87>,
88]
89>;
90
91HeaderSpec Search = HeaderSpec<
92"search.h",
93[], // Macros
94[
95StructHsearchData
96],
97[], // Enumerations
98[
99FunctionSpec<
100"hcreate_r",
101RetValSpec<IntType>,
102[
103ArgSpec<SizeTType>,
104ArgSpec<StructHsearchDataPtr>
105]
106>,
107FunctionSpec<
108"hdestroy_r",
109RetValSpec<VoidType>,
110[
111ArgSpec<StructHsearchDataPtr>
112]
113>,
114FunctionSpec<
115"hsearch_r",
116RetValSpec<IntType>,
117[
118ArgSpec<EntryType>,
119ArgSpec<ActionType>,
120ArgSpec<EntryTypePtrPtr>,
121ArgSpec<StructHsearchDataPtr>
122]
123>,
124]
125>;
126
127HeaderSpec FEnv = HeaderSpec<
128"fenv.h",
129[], // Macros
130[], // Types
131[], // Enumerations
132[
133FunctionSpec<
134"fedisableexcept",
135RetValSpec<IntType>,
136[ArgSpec<IntType>]
137>,
138FunctionSpec<
139"feenableexcept",
140RetValSpec<IntType>,
141[ArgSpec<IntType>]
142>,
143FunctionSpec<
144"fegetexcept",
145RetValSpec<IntType>,
146[]
147>
148]
149>;
150
151HeaderSpec StdIO = HeaderSpec<
152"stdio.h",
153[], // Macros
154[CookieIOFunctionsT], // Types
155[], // Enumerations
156[
157FunctionSpec<
158"clearerr_unlocked",
159RetValSpec<VoidType>,
160[ArgSpec<FILEPtr>]
161>,
162FunctionSpec<
163"feof_unlocked",
164RetValSpec<IntType>,
165[ArgSpec<FILEPtr>]
166>,
167FunctionSpec<
168"ferror_unlocked",
169RetValSpec<IntType>,
170[ArgSpec<FILEPtr>]
171>,
172FunctionSpec<
173"fopencookie",
174RetValSpec<FILEPtr>,
175[ArgSpec<VoidPtr>, ArgSpec<ConstCharPtr>, ArgSpec<CookieIOFunctionsT>]
176>,
177FunctionSpec<
178"fread_unlocked",
179RetValSpec<SizeTType>,
180[ArgSpec<VoidRestrictedPtr>,
181ArgSpec<SizeTType>,
182ArgSpec<SizeTType>,
183ArgSpec<FILERestrictedPtr>]
184>,
185FunctionSpec<
186"fwrite_unlocked",
187RetValSpec<SizeTType>,
188[ArgSpec<ConstVoidRestrictedPtr>,
189ArgSpec<SizeTType>,
190ArgSpec<SizeTType>,
191ArgSpec<FILERestrictedPtr>]
192>,
193FunctionSpec<
194"fgetc_unlocked",
195RetValSpec<IntType>,
196[ArgSpec<FILEPtr>]
197>,
198]
199>;
200
201HeaderSpec StdLib = HeaderSpec<
202"stdlib.h",
203[], // Macros
204[QSortRCompareT], // Types
205[], // Enumerations
206[
207FunctionSpec<
208"qsort_r",
209RetValSpec<VoidType>,
210[ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<SizeTType>, ArgSpec<QSortRCompareT>, ArgSpec<VoidPtr>]
211>,
212]
213>;
214
215HeaderSpec PThread = HeaderSpec<
216"pthread.h",
217[], // Macros
218[], // Types
219[], // Enumerations
220[
221FunctionSpec<
222"pthread_setname_np",
223RetValSpec<IntType>,
224[ArgSpec<PThreadTType>, ArgSpec<ConstCharPtr>]
225>,
226FunctionSpec<
227"pthread_getname_np",
228RetValSpec<IntType>,
229[ArgSpec<PThreadTType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
230>,
231]
232>;
233
234HeaderSpec SysAuxv = HeaderSpec<
235"sys/auxv.h",
236[], // Macros
237[], // Types
238[], // Enumerations
239[
240FunctionSpec<
241"getauxval",
242RetValSpec<UnsignedLongType>,
243[ArgSpec<UnsignedLongType>]
244>,
245] // Functions
246>;
247
248HeaderSpec SendFile = HeaderSpec<
249"sys/sendfile.h",
250[], // Macros
251[OffTType, SizeTType, SSizeTType,], // Types
252[], // Enumerations
253[
254FunctionSpec<
255"sendfile",
256RetValSpec<SSizeTType>,
257[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<OffTPtr>, ArgSpec<SizeTType>]
258>,
259]
260>;
261
262HeaderSpec UniStd = HeaderSpec<
263"unistd.h",
264[], // Macros
265[], // Types
266[], // Enumerations
267[
268FunctionSpec<
269"dup2",
270RetValSpec<IntType>,
271[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
272>,
273]
274>;
275
276let Headers = [
277CType,
278FEnv,
279Math,
280PThread,
281Sched,
282SendFile,
283SysAuxv,
284StdIO,
285StdLib,
286String,
287Search,
288UniStd,
289];
290}
291