]> sourceware.org Git - glibc.git/blob - sysdeps/wordsize-32/inttypes.h
Update.
[glibc.git] / sysdeps / wordsize-32 / inttypes.h
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
18
19 /*
20 * ISO C 9X: 7.4 Integral types <inttypes.h>
21 */
22
23 #ifndef _INTTYPES_H
24 #define _INTTYPES_H 1
25
26 /* Exact integral types. */
27
28 /* Signed. */
29 typedef signed char int8_t;
30 typedef short int int16_t;
31 typedef int int32_t;
32 typedef long long int int64_t;
33
34 /* Unsigned. */
35 typedef unsigned char uint8_t;
36 typedef unsigned short int uint16_t;
37 typedef unsigned int uint32_t;
38 typedef unsigned long long int uint64_t;
39
40
41 /* Largest integral types. */
42 typedef long long int intmax_t;
43 typedef unsigned long long int uintmax_t;
44
45
46 /* Types for `void *' pointers. */
47 typedef int intptr_t;
48 typedef unsigned int uintptr_t;
49
50
51 /* Efficient types. */
52 typedef int intfast_t;
53 typedef unsigned int uintfast_t;
54
55
56 /* Small types. */
57
58 /* Signed. */
59 typedef signed char int_least8_t;
60 typedef short int int_least16_t;
61 typedef int int_least32_t;
62 typedef long long int int_least64_t;
63
64 /* Unsigned. */
65 typedef unsigned char uint_least8_t;
66 typedef unsigned short int uint_least16_t;
67 typedef unsigned int uint_least32_t;
68 typedef unsigned long long int uint_least64_t;
69
70
71 /* Fast types. */
72
73 /* Signed. */
74 typedef signed char int_fast8_t;
75 typedef int int_fast16_t;
76 typedef int int_fast32_t;
77 typedef long long int int_fast64_t;
78
79 /* Unsigned. */
80 typedef unsigned char uint_fast8_t;
81 typedef unsigned int uint_fast16_t;
82 typedef unsigned int uint_fast32_t;
83 typedef unsigned long long int uint_fast64_t;
84
85
86 /* Limits of integral types. */
87
88 /* Minimum of signed integral types. */
89 #define INT8_MIN (-128)
90 #define INT16_MIN (-32767-1)
91 #define INT32_MIN (-2147483647-1)
92 #define INT64_MIN (-9223372036854775807LL-1)
93 /* Maximum of signed integral types. */
94 #define INT8_MAX (127)
95 #define INT16_MAX (32767)
96 #define INT32_MAX (2147483647)
97 #define INT64_MAX (9223372036854775807LL)
98
99 /* Maximum of unsigned integral types. */
100 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
103 #define UINT64_MAX (18446744073709551615uLL)
104
105
106 /* Minimum of signed integral types having a minimum size. */
107 #define INT_LEAST8_MIN (-128)
108 #define INT_LEAST16_MIN (-32767-1)
109 #define INT_LEAST32_MIN (-2147483647-1)
110 #define INT_LEAST64_MIN (-9223372036854775807LL-1)
111 /* Maximum of signed integral types having a minimum size. */
112 #define INT_LEAST8_MAX (127)
113 #define INT_LEAST16_MAX (32767)
114 #define INT_LEAST32_MAX (2147483647)
115 #define INT_LEAST64_MAX (9223372036854775807LL)
116
117 /* Maximum of unsigned integral types having a minimum size. */
118 #define UINT_LEAST8_MAX (255U)
119 #define UINT_LEAST16_MAX (65535U)
120 #define UINT_LEAST32_MAX (4294967295U)
121 #define UINT_LEAST64_MAX (18446744073709551615uLL)
122
123
124 /* Minimum of fast signed integral types having a minimum size. */
125 #define INT_FAST8_MIN (-128)
126 #define INT_FAST16_MIN (-2147483647-1)
127 #define INT_FAST32_MIN (-2147483647-1)
128 #define INT_FAST64_MIN (-9223372036854775807LL-1)
129 /* Maximum of fast signed integral types having a minimum size. */
130 #define INT_FAST8_MAX (127)
131 #define INT_FAST16_MAX (2147483647)
132 #define INT_FAST32_MAX (2147483647)
133 #define INT_FAST64_MAX (9223372036854775807LL)
134
135 /* Maximum of fast unsigned integral types having a minimum size. */
136 #define UINT_FAST8_MAX (255U)
137 #define UINT_FAST16_MAX (4294967295U)
138 #define UINT_FAST32_MAX (4294967295U)
139 #define UINT_FAST64_MAX (18446744073709551615uLL)
140
141
142 /* Minimum for most efficient signed integral types. */
143 #define INTFAST_MIN (-128)
144 /* Maximum for most efficient signed integral types. */
145 #define INTFAST_MAX (127)
146
147 /* Maximum for most efficient unsigned integral types. */
148 #define UINTFAST_MAX (255)
149
150
151 /* Minimum for largest signed integral type. */
152 #define INTMAX_MIN (-9223372036854775807LL-1)
153 /* Maximum for largest signed integral type. */
154 #define INTMAX_MAX (9223372036854775807LL)
155
156 /* Maximum for largest unsigned integral type. */
157 #define UINTMAX_MAX (18446744073709551615uLL)
158
159
160 /* Values to test for integral types holding `void *' pointer. */
161 #define INTPTR_MAX (2147483647)
162 #define UINTPTR_MAX (4294967295U)
163
164
165 /* Macros for creating constants. */
166 #define __CONCAT__(A, B) A ## B
167
168 /* Signed. */
169 #define INT8_C(c) ((int8_t) c)
170 #define INT16_C(c) ((int16_t) c)
171 #define INT32_C(c) ((int32_t) c)
172 #define INT64_C(c) ((int64_t) __CONCAT__ (c,ll))
173
174 /* Unsigned. */
175 #define UINT8_C(c) ((uint8_t) __CONCAT__ (c,u))
176 #define UINT16_C(c) ((uint16_t) __CONCAT__ (c,u))
177 #define UINT32_C(c) ((uint32_t) __CONCAT__ (c,u))
178 #define UINT64_C(c) ((uint64_t) __CONCAT__ (c,ull))
179
180 /* Maximal type. */
181 #define INTMAX_C(c) ((intmax_t) __CONCAT__ (c,ll))
182 #define UINTMAX_C(c) ((uintmax_t) __CONCAT__ (c,ull))
183
184
185 /* Macros for printing format specifiers. */
186
187 /* Decimal notation. */
188 #define PRId8 "d"
189 #define PRId16 "d"
190 #define PRId32 "d"
191 #define PRId64 "lld"
192
193 #define PRIdLEAST8 "d"
194 #define PRIdLEAST16 "d"
195 #define PRIdLEAST32 "d"
196 #define PRIdLEAST64 "lld"
197
198 #define PRIdFAST8 "d"
199 #define PRIdFAST16 "d"
200 #define PRIdFAST32 "d"
201 #define PRIdFAST64 "lld"
202
203
204 #define PRIi8 "i"
205 #define PRIi16 "i"
206 #define PRIi32 "i"
207 #define PRIi64 "lli"
208
209 #define PRIiLEAST8 "i"
210 #define PRIiLEAST16 "i"
211 #define PRIiLEAST32 "i"
212 #define PRIiLEAST64 "lli"
213
214 #define PRIiFAST8 "i"
215 #define PRIiFAST16 "i"
216 #define PRIiFAST32 "i"
217 #define PRIiFAST64 "lli"
218
219 /* Octal notation. */
220 #define PRIo8 "o"
221 #define PRIo16 "o"
222 #define PRIo32 "o"
223 #define PRIo64 "llo"
224
225 #define PRIoLEAST8 "o"
226 #define PRIoLEAST16 "o"
227 #define PRIoLEAST32 "o"
228 #define PRIoLEAST64 "llo"
229
230 #define PRIoFAST8 "o"
231 #define PRIoFAST16 "o"
232 #define PRIoFAST32 "o"
233 #define PRIoFAST64 "llo"
234
235 /* lowercase hexadecimal notation. */
236 #define PRIx8 "x"
237 #define PRIx16 "x"
238 #define PRIx32 "x"
239 #define PRIx64 "llx"
240
241 #define PRIxLEAST8 "x"
242 #define PRIxLEAST16 "x"
243 #define PRIxLEAST32 "x"
244 #define PRIxLEAST64 "llx"
245
246 #define PRIxFAST8 "x"
247 #define PRIxFAST16 "x"
248 #define PRIxFAST32 "x"
249 #define PRIxFAST64 "llx"
250
251 /* UPPERCASE hexadecimal notation. */
252 #define PRIX8 "X"
253 #define PRIX16 "X"
254 #define PRIX32 "X"
255 #define PRIX64 "llX"
256
257 #define PRIXLEAST8 "X"
258 #define PRIXLEAST16 "X"
259 #define PRIXLEAST32 "X"
260 #define PRIXLEAST64 "llX"
261
262 #define PRIXFAST8 "X"
263 #define PRIXFAST16 "X"
264 #define PRIXFAST32 "X"
265 #define PRIXFAST64 "llX"
266
267
268 /* Unsigned integers. */
269 #define PRIu8 "u"
270 #define PRIu16 "u"
271 #define PRIu32 "u"
272 #define PRIu64 "llu"
273
274 #define PRIuLEAST8 "u"
275 #define PRIuLEAST16 "u"
276 #define PRIuLEAST32 "u"
277 #define PRIuLEAST64 "llu"
278
279 #define PRIuFAST8 "u"
280 #define PRIuFAST16 "u"
281 #define PRIuFAST32 "u"
282 #define PRIuFAST64 "llu"
283
284
285 /* Macros for printing `intmax_t' and `uintmax_t'. */
286 #define PRIdMAX "lld"
287 #define PRIoMAX "llo"
288 #define PRIxMAX "llx"
289 #define PRIuMAX "llu"
290
291
292 /* Macros for printing `intfast_t' and `uintfast_t'. */
293 #define PRIdFAST "d"
294 #define PRIoFAST "o"
295 #define PRIxFAST "x"
296 #define PRIuFAST "u"
297
298
299 /* Macros for printing `intptr_t' and `uintptr_t'. */
300 #define PRIdPTR "d"
301 #define PRIoPTR "o"
302 #define PRIxPTR "x"
303 #define PRIuPTR "u"
304
305
306 /* Macros for printing format specifiers. */
307
308 /* Decimal notation. */
309 #define SCNd16 "hd"
310 #define SCNd32 "d"
311 #define SCNd64 "lld"
312
313 #define SCNi16 "hi"
314 #define SCNi32 "i"
315 #define SCNi64 "lli"
316
317 /* Octal notation. */
318 #define SCNo16 "ho"
319 #define SCNo32 "o"
320 #define SCNo64 "llo"
321
322 /* Hexadecimal notation. */
323 #define SCNx16 "hx"
324 #define SCNx32 "x"
325 #define SCNx64 "llx"
326
327
328 /* Macros for scaning `intfast_t' and `uintfast_t'. */
329 #define SCNdFAST "d"
330 #define SCNiFAST "i"
331 #define SCNoFAST "o"
332 #define SCNxFAST "x"
333
334 /* Macros for scaning `intptr_t' and `uintptr_t'. */
335 #define SCNdPTR "d"
336 #define SCNiPTR "i"
337 #define SCNoPTR "o"
338 #define SCNxPTR "x"
339
340 #endif /* inttypes.h */
This page took 0.064651 seconds and 5 git commands to generate.