00001 /*- 00002 * Copyright (c) 2001 The NetBSD Foundation, Inc. 00003 * All rights reserved. 00004 * 00005 * This code is derived from software contributed to The NetBSD Foundation 00006 * by Klaus Klein. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. All advertising materials mentioning features or use of this software 00017 * must display the following acknowledgement: 00018 * This product includes software developed by the NetBSD 00019 * Foundation, Inc. and its contributors. 00020 * 4. Neither the name of The NetBSD Foundation nor the names of its 00021 * contributors may be used to endorse or promote products derived 00022 * from this software without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 00025 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00026 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00027 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 00028 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00029 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00030 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00031 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00032 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00033 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00034 * POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 * From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $ 00037 * $FreeBSD: src/sys/i386/include/_inttypes.h,v 1.2 2002/06/30 05:48:02 mike Exp $ 00038 */ 00039 00040 #ifndef _MACHINE_INTTYPES_H_ 00041 #define _MACHINE_INTTYPES_H_ 00042 00043 /* 00044 * Macros for format specifiers. 00045 */ 00046 00047 /* fprintf(3) macros for signed integers. */ 00048 00049 #define PRId8 "d" /* int8_t */ 00050 #define PRId16 "d" /* int16_t */ 00051 #define PRId32 "d" /* int32_t */ 00052 #define PRId64 "lld" /* int64_t */ 00053 #define PRIdLEAST8 "d" /* int_least8_t */ 00054 #define PRIdLEAST16 "d" /* int_least16_t */ 00055 #define PRIdLEAST32 "d" /* int_least32_t */ 00056 #define PRIdLEAST64 "lld" /* int_least64_t */ 00057 #define PRIdFAST8 "d" /* int_fast8_t */ 00058 #define PRIdFAST16 "d" /* int_fast16_t */ 00059 #define PRIdFAST32 "d" /* int_fast32_t */ 00060 #define PRIdFAST64 "lld" /* int_fast64_t */ 00061 #define PRIdMAX "jd" /* intmax_t */ 00062 #define PRIdPTR "d" /* intptr_t */ 00063 00064 #define PRIi8 "i" /* int8_t */ 00065 #define PRIi16 "i" /* int16_t */ 00066 #define PRIi32 "i" /* int32_t */ 00067 #define PRIi64 "lli" /* int64_t */ 00068 #define PRIiLEAST8 "i" /* int_least8_t */ 00069 #define PRIiLEAST16 "i" /* int_least16_t */ 00070 #define PRIiLEAST32 "i" /* int_least32_t */ 00071 #define PRIiLEAST64 "lli" /* int_least64_t */ 00072 #define PRIiFAST8 "i" /* int_fast8_t */ 00073 #define PRIiFAST16 "i" /* int_fast16_t */ 00074 #define PRIiFAST32 "i" /* int_fast32_t */ 00075 #define PRIiFAST64 "lli" /* int_fast64_t */ 00076 #define PRIiMAX "ji" /* intmax_t */ 00077 #define PRIiPTR "i" /* intptr_t */ 00078 00079 /* fprintf(3) macros for unsigned integers. */ 00080 00081 #define PRIo8 "o" /* uint8_t */ 00082 #define PRIo16 "o" /* uint16_t */ 00083 #define PRIo32 "o" /* uint32_t */ 00084 #define PRIo64 "llo" /* uint64_t */ 00085 #define PRIoLEAST8 "o" /* uint_least8_t */ 00086 #define PRIoLEAST16 "o" /* uint_least16_t */ 00087 #define PRIoLEAST32 "o" /* uint_least32_t */ 00088 #define PRIoLEAST64 "llo" /* uint_least64_t */ 00089 #define PRIoFAST8 "o" /* uint_fast8_t */ 00090 #define PRIoFAST16 "o" /* uint_fast16_t */ 00091 #define PRIoFAST32 "o" /* uint_fast32_t */ 00092 #define PRIoFAST64 "llo" /* uint_fast64_t */ 00093 #define PRIoMAX "jo" /* uintmax_t */ 00094 #define PRIoPTR "o" /* uintptr_t */ 00095 00096 #define PRIu8 "u" /* uint8_t */ 00097 #define PRIu16 "u" /* uint16_t */ 00098 #define PRIu32 "u" /* uint32_t */ 00099 #define PRIu64 "llu" /* uint64_t */ 00100 #define PRIuLEAST8 "u" /* uint_least8_t */ 00101 #define PRIuLEAST16 "u" /* uint_least16_t */ 00102 #define PRIuLEAST32 "u" /* uint_least32_t */ 00103 #define PRIuLEAST64 "llu" /* uint_least64_t */ 00104 #define PRIuFAST8 "u" /* uint_fast8_t */ 00105 #define PRIuFAST16 "u" /* uint_fast16_t */ 00106 #define PRIuFAST32 "u" /* uint_fast32_t */ 00107 #define PRIuFAST64 "llu" /* uint_fast64_t */ 00108 #define PRIuMAX "ju" /* uintmax_t */ 00109 #define PRIuPTR "u" /* uintptr_t */ 00110 00111 #define PRIx8 "x" /* uint8_t */ 00112 #define PRIx16 "x" /* uint16_t */ 00113 #define PRIx32 "x" /* uint32_t */ 00114 #define PRIx64 "llx" /* uint64_t */ 00115 #define PRIxLEAST8 "x" /* uint_least8_t */ 00116 #define PRIxLEAST16 "x" /* uint_least16_t */ 00117 #define PRIxLEAST32 "x" /* uint_least32_t */ 00118 #define PRIxLEAST64 "llx" /* uint_least64_t */ 00119 #define PRIxFAST8 "x" /* uint_fast8_t */ 00120 #define PRIxFAST16 "x" /* uint_fast16_t */ 00121 #define PRIxFAST32 "x" /* uint_fast32_t */ 00122 #define PRIxFAST64 "llx" /* uint_fast64_t */ 00123 #define PRIxMAX "jx" /* uintmax_t */ 00124 #define PRIxPTR "x" /* uintptr_t */ 00125 00126 #define PRIX8 "X" /* uint8_t */ 00127 #define PRIX16 "X" /* uint16_t */ 00128 #define PRIX32 "X" /* uint32_t */ 00129 #define PRIX64 "llX" /* uint64_t */ 00130 #define PRIXLEAST8 "X" /* uint_least8_t */ 00131 #define PRIXLEAST16 "X" /* uint_least16_t */ 00132 #define PRIXLEAST32 "X" /* uint_least32_t */ 00133 #define PRIXLEAST64 "llX" /* uint_least64_t */ 00134 #define PRIXFAST8 "X" /* uint_fast8_t */ 00135 #define PRIXFAST16 "X" /* uint_fast16_t */ 00136 #define PRIXFAST32 "X" /* uint_fast32_t */ 00137 #define PRIXFAST64 "llX" /* uint_fast64_t */ 00138 #define PRIXMAX "jX" /* uintmax_t */ 00139 #define PRIXPTR "X" /* uintptr_t */ 00140 00141 /* fscanf(3) macros for signed integers. */ 00142 00143 #define SCNd8 "hhd" /* int8_t */ 00144 #define SCNd16 "hd" /* int16_t */ 00145 #define SCNd32 "d" /* int32_t */ 00146 #define SCNd64 "lld" /* int64_t */ 00147 #define SCNdLEAST8 "hhd" /* int_least8_t */ 00148 #define SCNdLEAST16 "hd" /* int_least16_t */ 00149 #define SCNdLEAST32 "d" /* int_least32_t */ 00150 #define SCNdLEAST64 "lld" /* int_least64_t */ 00151 #define SCNdFAST8 "d" /* int_fast8_t */ 00152 #define SCNdFAST16 "d" /* int_fast16_t */ 00153 #define SCNdFAST32 "d" /* int_fast32_t */ 00154 #define SCNdFAST64 "lld" /* int_fast64_t */ 00155 #define SCNdMAX "jd" /* intmax_t */ 00156 #define SCNdPTR "d" /* intptr_t */ 00157 00158 #define SCNi8 "hhi" /* int8_t */ 00159 #define SCNi16 "hi" /* int16_t */ 00160 #define SCNi32 "i" /* int32_t */ 00161 #define SCNi64 "lli" /* int64_t */ 00162 #define SCNiLEAST8 "hhi" /* int_least8_t */ 00163 #define SCNiLEAST16 "hi" /* int_least16_t */ 00164 #define SCNiLEAST32 "i" /* int_least32_t */ 00165 #define SCNiLEAST64 "lli" /* int_least64_t */ 00166 #define SCNiFAST8 "i" /* int_fast8_t */ 00167 #define SCNiFAST16 "i" /* int_fast16_t */ 00168 #define SCNiFAST32 "i" /* int_fast32_t */ 00169 #define SCNiFAST64 "lli" /* int_fast64_t */ 00170 #define SCNiMAX "ji" /* intmax_t */ 00171 #define SCNiPTR "i" /* intptr_t */ 00172 00173 /* fscanf(3) macros for unsigned integers. */ 00174 00175 #define SCNo8 "hho" /* uint8_t */ 00176 #define SCNo16 "ho" /* uint16_t */ 00177 #define SCNo32 "o" /* uint32_t */ 00178 #define SCNo64 "llo" /* uint64_t */ 00179 #define SCNoLEAST8 "hho" /* uint_least8_t */ 00180 #define SCNoLEAST16 "ho" /* uint_least16_t */ 00181 #define SCNoLEAST32 "o" /* uint_least32_t */ 00182 #define SCNoLEAST64 "llo" /* uint_least64_t */ 00183 #define SCNoFAST8 "o" /* uint_fast8_t */ 00184 #define SCNoFAST16 "o" /* uint_fast16_t */ 00185 #define SCNoFAST32 "o" /* uint_fast32_t */ 00186 #define SCNoFAST64 "llo" /* uint_fast64_t */ 00187 #define SCNoMAX "jo" /* uintmax_t */ 00188 #define SCNoPTR "o" /* uintptr_t */ 00189 00190 #define SCNu8 "hhu" /* uint8_t */ 00191 #define SCNu16 "hu" /* uint16_t */ 00192 #define SCNu32 "u" /* uint32_t */ 00193 #define SCNu64 "llu" /* uint64_t */ 00194 #define SCNuLEAST8 "hhu" /* uint_least8_t */ 00195 #define SCNuLEAST16 "hu" /* uint_least16_t */ 00196 #define SCNuLEAST32 "u" /* uint_least32_t */ 00197 #define SCNuLEAST64 "llu" /* uint_least64_t */ 00198 #define SCNuFAST8 "u" /* uint_fast8_t */ 00199 #define SCNuFAST16 "u" /* uint_fast16_t */ 00200 #define SCNuFAST32 "u" /* uint_fast32_t */ 00201 #define SCNuFAST64 "llu" /* uint_fast64_t */ 00202 #define SCNuMAX "ju" /* uintmax_t */ 00203 #define SCNuPTR "u" /* uintptr_t */ 00204 00205 #define SCNx8 "hhx" /* uint8_t */ 00206 #define SCNx16 "hx" /* uint16_t */ 00207 #define SCNx32 "x" /* uint32_t */ 00208 #define SCNx64 "llx" /* uint64_t */ 00209 #define SCNxLEAST8 "hhx" /* uint_least8_t */ 00210 #define SCNxLEAST16 "hx" /* uint_least16_t */ 00211 #define SCNxLEAST32 "x" /* uint_least32_t */ 00212 #define SCNxLEAST64 "llx" /* uint_least64_t */ 00213 #define SCNxFAST8 "x" /* uint_fast8_t */ 00214 #define SCNxFAST16 "x" /* uint_fast16_t */ 00215 #define SCNxFAST32 "x" /* uint_fast32_t */ 00216 #define SCNxFAST64 "llx" /* uint_fast64_t */ 00217 #define SCNxMAX "jx" /* uintmax_t */ 00218 #define SCNxPTR "x" /* uintptr_t */ 00219 00220 #endif /* !_MACHINE_INTTYPES_H_ */