Debian Codegraph @

types/c/types.ha

raw
1 // SPDX-License-Identifier: MPL-2.0
2 // (c) Hare authors <https://harelang.org>
3
4 use types;
5
6 // Integer type compatible with signed char, as specified by ISO/IEC 9899.
7 //
8 // This is an alias of i8 on all platforms.
9 export type schar = i8;
10
11 // Minimum value which can be stored in an [[schar]] type.
12 export def SCHAR_MIN: schar = types::I8_MIN;
13
14 // Maximum value which can be stored in an [[schar]] type.
15 export def SCHAR_MAX: schar = types::I8_MAX;
16
17 // Integer type compatible with unsigned char, as specified by ISO/IEC 9899.
18 //
19 // This is an alias of u8 on all platforms.
20 export type uchar = u8;
21
22 // Minimum value which can be stored in a [[uchar]] type.
23 export def UCHAR_MIN: uchar = types::U8_MIN;
24
25 // Maximum value which can be stored in a [[uchar]] type.
26 export def UCHAR_MAX: uchar = types::U8_MAX;
27
28 // Integer type compatible with char8_t, as defined in <uchar.h> and specified
29 // by ISO/IEC 9899.
30 //
31 // This is an alias of [[uchar]] (which aliases u8) on all platforms.
32 export type char8 = uchar;
33
34 // Minimum value which can be stored in a [[char8]] type.
35 export def CHAR8_MIN: char8 = UCHAR_MIN;
36
37 // Maximum value which can be stored in a [[char8]] type.
38 export def CHAR8_MAX: char8 = UCHAR_MAX;
39
40 // Integer type compatible with char16_t, as defined in <uchar.h> and specified
41 // by ISO/IEC 9899.
42 //
43 // This is an alias of [[uint_least16]] (which aliases u16) on all platforms.
44 export type char16 = uint_least16;
45
46 // Minimum value which can be stored in a [[char16]] type.
47 export def CHAR16_MIN: char16 = UINT_LEAST16_MIN;
48
49 // Maximum value which can be stored in a [[char16]] type.
50 export def CHAR16_MAX: char16 = UINT_LEAST16_MAX;
51
52 // Integer type compatible with char32_t, as defined in <uchar.h> and specified
53 // by ISO/IEC 9899.
54 //
55 // This is an alias of [[uint_least32]] (which aliases u32) on all platforms.
56 export type char32 = uint_least32;
57
58 // Minimum value which can be stored in a [[char32]] type.
59 export def CHAR32_MIN: char32 = UINT_LEAST32_MIN;
60
61 // Maximum value which can be stored in a [[char32]] type.
62 export def CHAR32_MAX: char32 = UINT_LEAST32_MAX;
63
64 // Integer type compatible with intmax_t, as defined in <stdint.h> and specified
65 // by ISO/IEC 9899.
66 //
67 // Note that this type isn't necessarily the actual maximum integer type. This
68 // type should only be used when required for C interop.
69 export type intmax = i64;
70
71 // Minimum value which can be stored in an [[intmax]] type.
72 export def INTMAX_MIN: intmax = types::I64_MIN;
73
74 // Maximum value which can be stored in an [[intmax]] type.
75 export def INTMAX_MAX: intmax = types::I64_MAX;
76
77 // Integer type compatible with uintmax_t, as defined in <stdint.h> and
78 // specified by ISO/IEC 9899.
79 //
80 // Note that this type isn't necessarily the actual maximum integer type. This
81 // type should only be used when required for C interop.
82 export type uintmax = u64;
83
84 // Minimum value which can be stored in a [[uintmax]] type.
85 export def UINTMAX_MIN: uintmax = types::U64_MIN;
86
87 // Maximum value which can be stored in a [[uintmax]] type.
88 export def UINTMAX_MAX: uintmax = types::U64_MAX;
89
90 // Integer type compatible with int_least8_t, as defined in <stdint.h> and
91 // specified by ISO/IEC 9899.
92 //
93 // This is an alias of i8 on all platforms.
94 export type int_least8 = i8;
95
96 // Minimum value which can be stored in an [[int_least8]] type.
97 export def INT_LEAST8_MIN: int_least8 = types::I8_MIN;
98
99 // Maximum value which can be stored in an [[int_least8]] type.
100 export def INT_LEAST8_MAX: int_least8 = types::I8_MAX;
101
102 // Integer type compatible with int_least16_t, as defined in <stdint.h> and
103 // specified by ISO/IEC 9899.
104 //
105 // This is an alias of i16 on all platforms.
106 export type int_least16 = i16;
107
108 // Minimum value which can be stored in an [[int_least16]] type.
109 export def INT_LEAST16_MIN: int_least16 = types::I16_MIN;
110
111 // Maximum value which can be stored in an [[int_least16]] type.
112 export def INT_LEAST16_MAX: int_least16 = types::I16_MAX;
113
114 // Integer type compatible with int_least32_t, as defined in <stdint.h> and
115 // specified by ISO/IEC 9899.
116 //
117 // This is an alias of i32 on all platforms.
118 export type int_least32 = i32;
119
120 // Minimum value which can be stored in an [[int_least32]] type.
121 export def INT_LEAST32_MIN: int_least32 = types::I32_MIN;
122
123 // Maximum value which can be stored in an [[int_least32]] type.
124 export def INT_LEAST32_MAX: int_least32 = types::I32_MAX;
125
126 // Integer type compatible with int_least64_t, as defined in <stdint.h> and
127 // specified by ISO/IEC 9899.
128 //
129 // This is an alias of i64 on all platforms.
130 export type int_least64 = i64;
131
132 // Minimum value which can be stored in an [[int_least64]] type.
133 export def INT_LEAST64_MIN: int_least64 = types::I64_MIN;
134
135 // Maximum value which can be stored in an [[int_least64]] type.
136 export def INT_LEAST64_MAX: int_least64 = types::I64_MAX;
137
138 // Integer type compatible with uint_least8_t, as defined in <stdint.h> and
139 // specified by ISO/IEC 9899.
140 //
141 // This is an alias of u8 on all platforms.
142 export type uint_least8 = u8;
143
144 // Minimum value which can be stored in a [[uint_least8]] type.
145 export def UINT_LEAST8_MIN: uint_least8 = types::U8_MIN;
146
147 // Maximum value which can be stored in a [[uint_least8]] type.
148 export def UINT_LEAST8_MAX: uint_least8 = types::U8_MAX;
149
150 // Integer type compatible with uint_least16_t, as defined in <stdint.h> and
151 // specified by ISO/IEC 9899.
152 //
153 // This is an alias of u16 on all platforms.
154 export type uint_least16 = u16;
155
156 // Minimum value which can be stored in a [[uint_least16]] type.
157 export def UINT_LEAST16_MIN: uint_least16 = types::U16_MIN;
158
159 // Maximum value which can be stored in a [[uint_least16]] type.
160 export def UINT_LEAST16_MAX: uint_least16 = types::U16_MAX;
161
162 // Integer type compatible with uint_least32_t, as defined in <stdint.h> and
163 // specified by ISO/IEC 9899.
164 //
165 // This is an alias of u32 on all platforms.
166 export type uint_least32 = u32;
167
168 // Minimum value which can be stored in a [[uint_least32]] type.
169 export def UINT_LEAST32_MIN: uint_least32 = types::U32_MIN;
170
171 // Maximum value which can be stored in a [[uint_least32]] type.
172 export def UINT_LEAST32_MAX: uint_least32 = types::U32_MAX;
173
174 // Integer type compatible with uint_least64_t, as defined in <stdint.h> and
175 // specified by ISO/IEC 9899.
176 //
177 // This is an alias of u64 on all platforms.
178 export type uint_least64 = u64;
179
180 // Minimum value which can be stored in a [[uint_least64]] type.
181 export def UINT_LEAST64_MIN: uint_least64 = types::U64_MIN;
182
183 // Maximum value which can be stored in a [[uint_least64]] type.
184 export def UINT_LEAST64_MAX: uint_least64 = types::U64_MAX;
185
186 // Integer type compatible with int_fast8_t, as defined in <stdint.h> and
187 // specified by ISO/IEC 9899.
188 export type int_fast8 = i8;
189
190 // Minimum value which can be stored in an [[int_fast8]] type.
191 export def INT_FAST8_MIN: int_fast8 = types::I8_MIN;
192
193 // Maximum value which can be stored in an [[int_fast8]] type.
194 export def INT_FAST8_MAX: int_fast8 = types::I8_MAX;
195
196 // Integer type compatible with int_fast16_t, as defined in <stdint.h> and
197 // specified by ISO/IEC 9899.
198 export type int_fast16 = i16;
199
200 // Minimum value which can be stored in an [[int_fast16]] type.
201 export def INT_FAST16_MIN: int_fast16 = types::I16_MIN;
202
203 // Maximum value which can be stored in an [[int_fast16]] type.
204 export def INT_FAST16_MAX: int_fast16 = types::I16_MAX;
205
206 // Integer type compatible with int_fast32_t, as defined in <stdint.h> and
207 // specified by ISO/IEC 9899.
208 export type int_fast32 = i32;
209
210 // Minimum value which can be stored in an [[int_fast32]] type.
211 export def INT_FAST32_MIN: int_fast32 = types::I32_MIN;
212
213 // Maximum value which can be stored in an [[int_fast32]] type.
214 export def INT_FAST32_MAX: int_fast32 = types::I32_MAX;
215
216 // Integer type compatible with int_fast64_t, as defined in <stdint.h> and
217 // specified by ISO/IEC 9899.
218 export type int_fast64 = i64;
219
220 // Minimum value which can be stored in an [[int_fast64]] type.
221 export def INT_FAST64_MIN: int_fast64 = types::I64_MIN;
222
223 // Maximum value which can be stored in an [[int_fast64]] type.
224 export def INT_FAST64_MAX: int_fast64 = types::I64_MAX;
225
226 // Integer type compatible with uint_fast8_t, as defined in <stdint.h> and
227 // specified by ISO/IEC 9899.
228 export type uint_fast8 = u8;
229
230 // Minimum value which can be stored in a [[uint_fast8]] type.
231 export def UINT_FAST8_MIN: uint_fast8 = types::U8_MIN;
232
233 // Maximum value which can be stored in a [[uint_fast8]] type.
234 export def UINT_FAST8_MAX: uint_fast8 = types::U8_MAX;
235
236 // Integer type compatible with uint_fast16_t, as defined in <stdint.h> and
237 // specified by ISO/IEC 9899.
238 export type uint_fast16 = u16;
239
240 // Minimum value which can be stored in a [[uint_fast16]] type.
241 export def UINT_FAST16_MIN: uint_fast16 = types::U16_MIN;
242
243 // Maximum value which can be stored in a [[uint_fast16]] type.
244 export def UINT_FAST16_MAX: uint_fast16 = types::U16_MAX;
245
246 // Integer type compatible with uint_fast32_t, as defined in <stdint.h> and
247 // specified by ISO/IEC 9899.
248 export type uint_fast32 = u32;
249
250 // Minimum value which can be stored in a [[uint_fast32]] type.
251 export def UINT_FAST32_MIN: uint_fast32 = types::U32_MIN;
252
253 // Maximum value which can be stored in a [[uint_fast32]] type.
254 export def UINT_FAST32_MAX: uint_fast32 = types::U32_MAX;
255
256 // Integer type compatible with uint_fast64_t, as defined in <stdint.h> and
257 // specified by ISO/IEC 9899.
258 export type uint_fast64 = u64;
259
260 // Minimum value which can be stored in a [[uint_fast64]] type.
261 export def UINT_FAST64_MIN: uint_fast64 = types::U64_MIN;
262
263 // Maximum value which can be stored in a [[uint_fast64]] type.
264 export def UINT_FAST64_MAX: uint_fast64 = types::U64_MAX;
265
266 // Integer type compatible with sig_atomic_t, as defined in <signal.h> and
267 // specified by ISO/IEC 9899.
268 export type sig_atomic = int;
269
270 // Minimum value which can be stored in a [[sig_atomic]] type.
271 export def SIG_ATOMIC_MIN: sig_atomic = types::INT_MIN;
272
273 // Maximum value which can be stored in a [[sig_atomic]] type.
274 export def SIG_ATOMIC_MAX: sig_atomic = types::INT_MAX;
275
276 // Integer type compatible with wchar_t, as defined in <stddef.h> and specified
277 // by ISO/IEC 9899.
278 export type wchar = i32;
279
280 // Minimum value which can be stored in a [[wchar]] type.
281 export def WCHAR_MIN: wchar = types::I32_MIN;
282
283 // Maximum value which can be stored in a [[wchar]] type.
284 export def WCHAR_MAX: wchar = types::I32_MAX;
285
286 // Integer type compatible with wint_t, as defined in <wchar.h> and specified
287 // by ISO/IEC 9899.
288 export type wint = u32;
289
290 // Minimum value which can be stored in a [[wint]] type.
291 export def WINT_MIN: wint = types::U32_MIN;
292
293 // Maximum value which can be stored in a [[wint]] type.
294 export def WINT_MAX: wint = types::U32_MAX;