The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* $OpenBSD: inttypes.h,v 1.9 2006/01/15 00:47:51 millert Exp $ */ |
| 2 | |
| 3 | /* |
| 4 | * Copyright (c) 1997, 2005 Todd C. Miller <Todd.Miller@courtesan.com> |
| 5 | * |
| 6 | * Permission to use, copy, modify, and distribute this software for any |
| 7 | * purpose with or without fee is hereby granted, provided that the above |
| 8 | * copyright notice and this permission notice appear in all copies. |
| 9 | * |
| 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | #ifndef _INTTYPES_H_ |
| 20 | #define _INTTYPES_H_ |
| 21 | |
| 22 | #include <stdint.h> |
| 23 | #include <sys/cdefs.h> |
| 24 | |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 25 | #ifdef __LP64__ |
| 26 | #define __PRI_64_prefix "l" |
| 27 | #define __PRI_PTR_prefix "l" |
| 28 | #else |
| 29 | #define __PRI_64_prefix "ll" |
| 30 | #define __PRI_PTR_prefix |
| 31 | #endif |
| 32 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 33 | /* |
| 34 | * 7.8.1 Macros for format specifiers |
| 35 | * |
| 36 | * Each of the following object-like macros expands to a string |
| 37 | * literal containing a conversion specifier, possibly modified by |
| 38 | * a prefix such as hh, h, l, or ll, suitable for use within the |
| 39 | * format argument of a formatted input/output function when |
| 40 | * converting the corresponding integer type. These macro names |
| 41 | * have the general form of PRI (character string literals for the |
| 42 | * fprintf family) or SCN (character string literals for the fscanf |
| 43 | * family), followed by the conversion specifier, followed by a |
| 44 | * name corresponding to a similar typedef name. For example, |
| 45 | * PRIdFAST32 can be used in a format string to print the value of |
| 46 | * an integer of type int_fast32_t. |
| 47 | */ |
| 48 | |
| 49 | /* fprintf macros for signed integers */ |
| 50 | #define PRId8 "d" /* int8_t */ |
| 51 | #define PRId16 "d" /* int16_t */ |
| 52 | #define PRId32 "d" /* int32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 53 | #define PRId64 __PRI_64_prefix"d" /* int64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | |
| 55 | #define PRIdLEAST8 "d" /* int_least8_t */ |
| 56 | #define PRIdLEAST16 "d" /* int_least16_t */ |
| 57 | #define PRIdLEAST32 "d" /* int_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 58 | #define PRIdLEAST64 __PRI_64_prefix"d" /* int_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 59 | |
| 60 | #define PRIdFAST8 "d" /* int_fast8_t */ |
| 61 | #define PRIdFAST16 "d" /* int_fast16_t */ |
| 62 | #define PRIdFAST32 "d" /* int_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 63 | #define PRIdFAST64 __PRI_64_prefix"d" /* int_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 64 | |
| 65 | #define PRIdMAX "jd" /* intmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 66 | #define PRIdPTR __PRI_PTR_prefix"d" /* intptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 67 | |
| 68 | #define PRIi8 "i" /* int8_t */ |
| 69 | #define PRIi16 "i" /* int16_t */ |
| 70 | #define PRIi32 "i" /* int32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 71 | #define PRIi64 __PRI_64_prefix"i" /* int64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 72 | |
| 73 | #define PRIiLEAST8 "i" /* int_least8_t */ |
| 74 | #define PRIiLEAST16 "i" /* int_least16_t */ |
| 75 | #define PRIiLEAST32 "i" /* int_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 76 | #define PRIiLEAST64 __PRI_64_prefix"i" /* int_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 77 | |
| 78 | #define PRIiFAST8 "i" /* int_fast8_t */ |
| 79 | #define PRIiFAST16 "i" /* int_fast16_t */ |
| 80 | #define PRIiFAST32 "i" /* int_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 81 | #define PRIiFAST64 __PRI_64_prefix"i" /* int_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 82 | |
| 83 | #define PRIiMAX "ji" /* intmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 84 | #define PRIiPTR __PRI_PTR_prefix"i" /* intptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 85 | |
| 86 | /* fprintf macros for unsigned integers */ |
| 87 | #define PRIo8 "o" /* int8_t */ |
| 88 | #define PRIo16 "o" /* int16_t */ |
| 89 | #define PRIo32 "o" /* int32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 90 | #define PRIo64 __PRI_64_prefix"o" /* int64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 91 | |
| 92 | #define PRIoLEAST8 "o" /* int_least8_t */ |
| 93 | #define PRIoLEAST16 "o" /* int_least16_t */ |
| 94 | #define PRIoLEAST32 "o" /* int_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 95 | #define PRIoLEAST64 __PRI_64_prefix"o" /* int_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 96 | |
| 97 | #define PRIoFAST8 "o" /* int_fast8_t */ |
| 98 | #define PRIoFAST16 "o" /* int_fast16_t */ |
| 99 | #define PRIoFAST32 "o" /* int_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 100 | #define PRIoFAST64 __PRI_64_prefix"o" /* int_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 101 | |
| 102 | #define PRIoMAX "jo" /* intmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 103 | #define PRIoPTR __PRI_PTR_prefix"o" /* intptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | |
| 105 | #define PRIu8 "u" /* uint8_t */ |
| 106 | #define PRIu16 "u" /* uint16_t */ |
| 107 | #define PRIu32 "u" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 108 | #define PRIu64 __PRI_64_prefix"u" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 109 | |
| 110 | #define PRIuLEAST8 "u" /* uint_least8_t */ |
| 111 | #define PRIuLEAST16 "u" /* uint_least16_t */ |
| 112 | #define PRIuLEAST32 "u" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 113 | #define PRIuLEAST64 __PRI_64_prefix"u" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 114 | |
| 115 | #define PRIuFAST8 "u" /* uint_fast8_t */ |
| 116 | #define PRIuFAST16 "u" /* uint_fast16_t */ |
| 117 | #define PRIuFAST32 "u" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 118 | #define PRIuFAST64 __PRI_64_prefix"u" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 119 | |
| 120 | #define PRIuMAX "ju" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 121 | #define PRIuPTR __PRI_PTR_prefix"u" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 122 | |
| 123 | #define PRIx8 "x" /* uint8_t */ |
| 124 | #define PRIx16 "x" /* uint16_t */ |
| 125 | #define PRIx32 "x" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 126 | #define PRIx64 __PRI_64_prefix"x" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 127 | |
| 128 | #define PRIxLEAST8 "x" /* uint_least8_t */ |
| 129 | #define PRIxLEAST16 "x" /* uint_least16_t */ |
| 130 | #define PRIxLEAST32 "x" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 131 | #define PRIxLEAST64 __PRI_64_prefix"x" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 132 | |
| 133 | #define PRIxFAST8 "x" /* uint_fast8_t */ |
| 134 | #define PRIxFAST16 "x" /* uint_fast16_t */ |
| 135 | #define PRIxFAST32 "x" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 136 | #define PRIxFAST64 __PRI_64_prefix"x" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 137 | |
| 138 | #define PRIxMAX "jx" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 139 | #define PRIxPTR __PRI_PTR_prefix"x" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 140 | |
| 141 | #define PRIX8 "X" /* uint8_t */ |
| 142 | #define PRIX16 "X" /* uint16_t */ |
| 143 | #define PRIX32 "X" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 144 | #define PRIX64 __PRI_64_prefix"X" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 145 | |
| 146 | #define PRIXLEAST8 "X" /* uint_least8_t */ |
| 147 | #define PRIXLEAST16 "X" /* uint_least16_t */ |
| 148 | #define PRIXLEAST32 "X" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 149 | #define PRIXLEAST64 __PRI_64_prefix"X" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 150 | |
| 151 | #define PRIXFAST8 "X" /* uint_fast8_t */ |
| 152 | #define PRIXFAST16 "X" /* uint_fast16_t */ |
| 153 | #define PRIXFAST32 "X" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 154 | #define PRIXFAST64 __PRI_64_prefix"X" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 155 | |
| 156 | #define PRIXMAX "jX" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 157 | #define PRIXPTR __PRI_PTR_prefix"X" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 158 | |
| 159 | /* fscanf macros for signed integers */ |
| 160 | #define SCNd8 "hhd" /* int8_t */ |
| 161 | #define SCNd16 "hd" /* int16_t */ |
| 162 | #define SCNd32 "d" /* int32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 163 | #define SCNd64 __PRI_64_prefix"d" /* int64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 164 | |
| 165 | #define SCNdLEAST8 "hhd" /* int_least8_t */ |
| 166 | #define SCNdLEAST16 "hd" /* int_least16_t */ |
| 167 | #define SCNdLEAST32 "d" /* int_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 168 | #define SCNdLEAST64 __PRI_64_prefix"d" /* int_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 169 | |
| 170 | #define SCNdFAST8 "hhd" /* int_fast8_t */ |
| 171 | #define SCNdFAST16 "hd" /* int_fast16_t */ |
| 172 | #define SCNdFAST32 "d" /* int_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 173 | #define SCNdFAST64 __PRI_64_prefix"d" /* int_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 174 | |
| 175 | #define SCNdMAX "jd" /* intmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 176 | #define SCNdPTR __PRI_PTR_prefix"d" /* intptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 177 | |
| 178 | #define SCNi8 "hhi" /* int8_t */ |
| 179 | #define SCNi16 "hi" /* int16_t */ |
| 180 | #define SCNi32 "i" /* int32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 181 | #define SCNi64 __PRI_64_prefix"i" /* int64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 182 | |
| 183 | #define SCNiLEAST8 "hhi" /* int_least8_t */ |
| 184 | #define SCNiLEAST16 "hi" /* int_least16_t */ |
| 185 | #define SCNiLEAST32 "i" /* int_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 186 | #define SCNiLEAST64 __PRI_64_prefix"i" /* int_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 187 | |
| 188 | #define SCNiFAST8 "hhi" /* int_fast8_t */ |
| 189 | #define SCNiFAST16 "hi" /* int_fast16_t */ |
| 190 | #define SCNiFAST32 "i" /* int_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 191 | #define SCNiFAST64 __PRI_64_prefix"i" /* int_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 192 | |
| 193 | #define SCNiMAX "ji" /* intmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 194 | #define SCNiPTR __PRI_PTR_prefix"i" /* intptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 195 | |
| 196 | /* fscanf macros for unsigned integers */ |
| 197 | #define SCNo8 "hho" /* uint8_t */ |
| 198 | #define SCNo16 "ho" /* uint16_t */ |
| 199 | #define SCNo32 "o" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 200 | #define SCNo64 __PRI_64_prefix"o" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 201 | |
| 202 | #define SCNoLEAST8 "hho" /* uint_least8_t */ |
| 203 | #define SCNoLEAST16 "ho" /* uint_least16_t */ |
| 204 | #define SCNoLEAST32 "o" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 205 | #define SCNoLEAST64 __PRI_64_prefix"o" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 206 | |
| 207 | #define SCNoFAST8 "hho" /* uint_fast8_t */ |
| 208 | #define SCNoFAST16 "ho" /* uint_fast16_t */ |
| 209 | #define SCNoFAST32 "o" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 210 | #define SCNoFAST64 __PRI_64_prefix"o" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 211 | |
| 212 | #define SCNoMAX "jo" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 213 | #define SCNoPTR __PRI_PTR_prefix"o" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 214 | |
| 215 | #define SCNu8 "hhu" /* uint8_t */ |
| 216 | #define SCNu16 "hu" /* uint16_t */ |
| 217 | #define SCNu32 "u" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 218 | #define SCNu64 __PRI_64_prefix"u" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 219 | |
| 220 | #define SCNuLEAST8 "hhu" /* uint_least8_t */ |
| 221 | #define SCNuLEAST16 "hu" /* uint_least16_t */ |
| 222 | #define SCNuLEAST32 "u" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 223 | #define SCNuLEAST64 __PRI_64_prefix"u" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 224 | |
| 225 | #define SCNuFAST8 "hhu" /* uint_fast8_t */ |
| 226 | #define SCNuFAST16 "hu" /* uint_fast16_t */ |
| 227 | #define SCNuFAST32 "u" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 228 | #define SCNuFAST64 __PRI_64_prefix"u" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 229 | |
| 230 | #define SCNuMAX "ju" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 231 | #define SCNuPTR __PRI_PTR_prefix"u" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 232 | |
| 233 | #define SCNx8 "hhx" /* uint8_t */ |
| 234 | #define SCNx16 "hx" /* uint16_t */ |
| 235 | #define SCNx32 "x" /* uint32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 236 | #define SCNx64 __PRI_64_prefix"x" /* uint64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 237 | |
| 238 | #define SCNxLEAST8 "hhx" /* uint_least8_t */ |
| 239 | #define SCNxLEAST16 "hx" /* uint_least16_t */ |
| 240 | #define SCNxLEAST32 "x" /* uint_least32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 241 | #define SCNxLEAST64 __PRI_64_prefix"x" /* uint_least64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 242 | |
| 243 | #define SCNxFAST8 "hhx" /* uint_fast8_t */ |
| 244 | #define SCNxFAST16 "hx" /* uint_fast16_t */ |
| 245 | #define SCNxFAST32 "x" /* uint_fast32_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 246 | #define SCNxFAST64 __PRI_64_prefix"x" /* uint_fast64_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 247 | |
| 248 | #define SCNxMAX "jx" /* uintmax_t */ |
Elliott Hughes | a9a02ac | 2013-09-30 14:46:47 -0700 | [diff] [blame] | 249 | #define SCNxPTR __PRI_PTR_prefix"x" /* uintptr_t */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 250 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 251 | typedef struct { |
| 252 | intmax_t quot; /* quotient */ |
| 253 | intmax_t rem; /* remainder */ |
| 254 | } imaxdiv_t; |
| 255 | |
| 256 | __BEGIN_DECLS |
Elliott Hughes | aec2ffb | 2013-08-12 12:07:05 -0700 | [diff] [blame] | 257 | intmax_t imaxabs(intmax_t) __pure2; |
| 258 | imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 259 | intmax_t strtoimax(const char *, char **, int); |
| 260 | uintmax_t strtoumax(const char *, char **, int); |
Elliott Hughes | 01ae00f | 2014-04-29 16:28:56 -0700 | [diff] [blame] | 261 | intmax_t wcstoimax(const wchar_t * __restrict, |
| 262 | wchar_t ** __restrict, int); |
| 263 | uintmax_t wcstoumax(const wchar_t * __restrict, |
| 264 | wchar_t ** __restrict, int); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 265 | __END_DECLS |
| 266 | |
| 267 | #endif /* _INTTYPES_H_ */ |