3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _SYS_INT_FMTIO_H
28 #define _SYS_INT_FMTIO_H
29
30 #pragma ident "%Z%%M% %I% %E% SMI"
31
32 /*
33 * This file, <sys/int_fmtio.h>, is part of the Sun Microsystems implementation
34 * of <inttypes.h> as defined by the ISO C Standard, ISO/IEC 9899:1999
35 * Programming language - C.
36 *
37 * ISO International Organization for Standardization.
38 *
39 * Programs/Modules should not directly include this file. Access to the
40 * types defined in this file should be through the inclusion of one of the
41 * following files:
42 *
43 * <sys/inttypes.h> Provides the Kernel and Driver appropriate
44 * components of <inttypes.h>.
45 *
46 * <inttypes.h> For use by applications.
47 *
48 * See these files for more details.
49 */
50
51 #include <sys/feature_tests.h>
77 */
78
79 /*
80 * fprintf macros for signed integers
81 */
82 #if defined(_KERNEL)
83 #define _MODF8 ""
84 #define _MODF16 ""
85 #else
86 #define _MODF8 "hh"
87 #define _MODF16 "h"
88 #endif
89
90 #define _PRId "d"
91 #define _PRIi "i"
92 #define _PRIo "o"
93 #define _PRIu "u"
94 #define _PRIx "x"
95 #define _PRIX "X"
96
97 #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
98 #define PRId8 _MODF8 _PRId
99 #define PRIdLEAST8 PRId8
100 #define PRIdFAST8 PRId8
101 #endif
102 #define PRId16 _MODF16 _PRId
103 #define PRIdLEAST16 PRId16
104 #define PRId32 "d"
105 #define PRIdFAST16 PRId32
106 #define PRIdLEAST32 PRId32
107 #define PRIdFAST32 PRId32
108 #ifdef _LP64
109 #define PRId64 "ld"
110 #else /* _ILP32 */
111 #if defined(_LONGLONG_TYPE)
112 #define PRId64 "lld"
113 #endif
114 #endif
115 #ifdef PRId64
116 #define PRIdLEAST64 PRId64
117 #define PRIdFAST64 PRId64
118 #endif
119
120 #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
121 #define PRIi8 _MODF8 _PRIi
122 #define PRIiLEAST8 PRIi8
123 #define PRIiFAST8 PRIi8
124 #endif
125 #define PRIi16 _MODF16 _PRIi
126 #define PRIiLEAST16 PRIi16
127 #define PRIi32 "i"
128 #define PRIiFAST16 PRIi32
129 #define PRIiLEAST32 PRIi32
130 #define PRIiFAST32 PRIi32
131 #ifdef _LP64
132 #define PRIi64 "li"
133 #else /* _ILP32 */
134 #if defined(_LONGLONG_TYPE)
135 #define PRIi64 "lli"
136 #endif
137 #endif
138 #ifdef PRIi64
139 #define PRIiLEAST64 PRIi64
140 #define PRIiFAST64 PRIi64
141 #endif
142
143 /*
144 * fprintf macros for unsigned integers
234
235 #if defined(_LP64) || defined(_I32LPx)
236 #define PRIdPTR "ld"
237 #define PRIiPTR "li"
238 #define PRIoPTR "lo"
239 #define PRIuPTR "lu"
240 #define PRIxPTR "lx"
241 #define PRIXPTR "lX"
242 #else
243 #define PRIdPTR "d"
244 #define PRIiPTR "i"
245 #define PRIoPTR "o"
246 #define PRIuPTR "u"
247 #define PRIxPTR "x"
248 #define PRIXPTR "X"
249 #endif /* defined(_LP64) || defined(_I32LPx) */
250
251 /*
252 * fscanf macros for signed integers
253 */
254 #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
255 #define SCNd8 "hhd"
256 #define SCNdLEAST8 SCNd8
257 #define SCNdFAST8 SCNd8
258 #endif
259 #define SCNd16 "hd"
260 #define SCNdLEAST16 SCNd16
261 #define SCNd32 "d"
262 #define SCNdFAST16 SCNd32
263 #define SCNdLEAST32 SCNd32
264 #define SCNdFAST32 SCNd32
265 #ifdef PRId64
266 #define SCNd64 PRId64
267 #define SCNdLEAST64 PRId64
268 #define SCNdFAST64 PRId64
269 #endif
270 #define SCNdPTR PRIdPTR
271
272 #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
273 #define SCNi8 "hhi"
274 #define SCNiLEAST8 SCNi8
275 #define SCNiFAST8 SCNi8
276 #endif
277 #define SCNi16 "hi"
278 #define SCNiLEAST16 SCNi16
279 #define SCNi32 "i"
280 #define SCNiFAST16 SCNi32
281 #define SCNiLEAST32 SCNi32
282 #define SCNiFAST32 SCNi32
283 #ifdef PRIi64
284 #define SCNi64 PRIi64
285 #define SCNiLEAST64 PRIi64
286 #define SCNiFAST64 PRIi64
287 #endif
288 #define SCNiPTR PRIiPTR
289
290 /*
291 * fscanf macros for unsigned integers
292 */
293 #define SCNo8 "hho"
294 #define SCNoLEAST8 SCNo8
295 #define SCNoFAST8 SCNo8
296 #define SCNo16 "ho"
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _SYS_INT_FMTIO_H
30 #define _SYS_INT_FMTIO_H
31
32 /*
33 * This file, <sys/int_fmtio.h>, is part of the Sun Microsystems implementation
34 * of <inttypes.h> as defined by the ISO C Standard, ISO/IEC 9899:1999
35 * Programming language - C.
36 *
37 * ISO International Organization for Standardization.
38 *
39 * Programs/Modules should not directly include this file. Access to the
40 * types defined in this file should be through the inclusion of one of the
41 * following files:
42 *
43 * <sys/inttypes.h> Provides the Kernel and Driver appropriate
44 * components of <inttypes.h>.
45 *
46 * <inttypes.h> For use by applications.
47 *
48 * See these files for more details.
49 */
50
51 #include <sys/feature_tests.h>
77 */
78
79 /*
80 * fprintf macros for signed integers
81 */
82 #if defined(_KERNEL)
83 #define _MODF8 ""
84 #define _MODF16 ""
85 #else
86 #define _MODF8 "hh"
87 #define _MODF16 "h"
88 #endif
89
90 #define _PRId "d"
91 #define _PRIi "i"
92 #define _PRIo "o"
93 #define _PRIu "u"
94 #define _PRIx "x"
95 #define _PRIX "X"
96
97 #define PRId8 _MODF8 _PRId
98 #define PRIdLEAST8 PRId8
99 #define PRIdFAST8 PRId8
100 #define PRId16 _MODF16 _PRId
101 #define PRIdLEAST16 PRId16
102 #define PRId32 "d"
103 #define PRIdFAST16 PRId32
104 #define PRIdLEAST32 PRId32
105 #define PRIdFAST32 PRId32
106 #ifdef _LP64
107 #define PRId64 "ld"
108 #else /* _ILP32 */
109 #if defined(_LONGLONG_TYPE)
110 #define PRId64 "lld"
111 #endif
112 #endif
113 #ifdef PRId64
114 #define PRIdLEAST64 PRId64
115 #define PRIdFAST64 PRId64
116 #endif
117
118 #define PRIi8 _MODF8 _PRIi
119 #define PRIiLEAST8 PRIi8
120 #define PRIiFAST8 PRIi8
121 #define PRIi16 _MODF16 _PRIi
122 #define PRIiLEAST16 PRIi16
123 #define PRIi32 "i"
124 #define PRIiFAST16 PRIi32
125 #define PRIiLEAST32 PRIi32
126 #define PRIiFAST32 PRIi32
127 #ifdef _LP64
128 #define PRIi64 "li"
129 #else /* _ILP32 */
130 #if defined(_LONGLONG_TYPE)
131 #define PRIi64 "lli"
132 #endif
133 #endif
134 #ifdef PRIi64
135 #define PRIiLEAST64 PRIi64
136 #define PRIiFAST64 PRIi64
137 #endif
138
139 /*
140 * fprintf macros for unsigned integers
230
231 #if defined(_LP64) || defined(_I32LPx)
232 #define PRIdPTR "ld"
233 #define PRIiPTR "li"
234 #define PRIoPTR "lo"
235 #define PRIuPTR "lu"
236 #define PRIxPTR "lx"
237 #define PRIXPTR "lX"
238 #else
239 #define PRIdPTR "d"
240 #define PRIiPTR "i"
241 #define PRIoPTR "o"
242 #define PRIuPTR "u"
243 #define PRIxPTR "x"
244 #define PRIXPTR "X"
245 #endif /* defined(_LP64) || defined(_I32LPx) */
246
247 /*
248 * fscanf macros for signed integers
249 */
250 #define SCNd8 "hhd"
251 #define SCNdLEAST8 SCNd8
252 #define SCNdFAST8 SCNd8
253 #define SCNd16 "hd"
254 #define SCNdLEAST16 SCNd16
255 #define SCNd32 "d"
256 #define SCNdFAST16 SCNd32
257 #define SCNdLEAST32 SCNd32
258 #define SCNdFAST32 SCNd32
259 #ifdef PRId64
260 #define SCNd64 PRId64
261 #define SCNdLEAST64 PRId64
262 #define SCNdFAST64 PRId64
263 #endif
264 #define SCNdPTR PRIdPTR
265
266 #define SCNi8 "hhi"
267 #define SCNiLEAST8 SCNi8
268 #define SCNiFAST8 SCNi8
269 #define SCNi16 "hi"
270 #define SCNiLEAST16 SCNi16
271 #define SCNi32 "i"
272 #define SCNiFAST16 SCNi32
273 #define SCNiLEAST32 SCNi32
274 #define SCNiFAST32 SCNi32
275 #ifdef PRIi64
276 #define SCNi64 PRIi64
277 #define SCNiLEAST64 PRIi64
278 #define SCNiFAST64 PRIi64
279 #endif
280 #define SCNiPTR PRIiPTR
281
282 /*
283 * fscanf macros for unsigned integers
284 */
285 #define SCNo8 "hho"
286 #define SCNoLEAST8 SCNo8
287 #define SCNoFAST8 SCNo8
288 #define SCNo16 "ho"
|