| 1 |
/* Copyright (c) 2004 Joerg Wunsch |
/* Copyright (c) 2004,2005 Joerg Wunsch |
| 2 |
|
Copyright (c) 2005, Carlos Lamas |
| 3 |
All rights reserved. |
All rights reserved. |
| 4 |
|
|
| 5 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 44 |
provided by the implementation. |
provided by the implementation. |
| 45 |
*/ |
*/ |
| 46 |
|
|
| 47 |
|
/** \name Far pointers for memory access >64K */ |
| 48 |
|
|
| 49 |
|
/*@{*/ |
| 50 |
|
/** \ingroup avr_inttypes |
| 51 |
|
signed integer type that can hold a pointer > 64 KB */ |
| 52 |
|
typedef int32_t int_farptr_t; |
| 53 |
|
|
| 54 |
|
/** \ingroup avr_inttypes |
| 55 |
|
unsigned integer type that can hold a pointer > 64 KB */ |
| 56 |
|
typedef uint32_t uint_farptr_t; |
| 57 |
|
/*@}*/ |
| 58 |
|
|
| 59 |
|
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
/** \name macros for printf and scanf format specifiers |
| 63 |
|
|
| 64 |
|
For C++, these are only included if __STDC_LIMIT_MACROS |
| 65 |
|
is defined before including <inttypes.h>. |
| 66 |
|
*/ |
| 67 |
|
|
| 68 |
|
/*@{*/ |
| 69 |
|
/** \ingroup avr_inttypes |
| 70 |
|
decimal printf format for int8_t */ |
| 71 |
|
#define PRId8 "d" |
| 72 |
|
/** \ingroup avr_inttypes |
| 73 |
|
decimal printf format for int_least8_t */ |
| 74 |
|
#define PRIdLEAST8 "d" |
| 75 |
|
/** \ingroup avr_inttypes |
| 76 |
|
decimal printf format for int_fast8_t */ |
| 77 |
|
#define PRIdFAST8 "d" |
| 78 |
|
|
| 79 |
|
/** \ingroup avr_inttypes |
| 80 |
|
integer printf format for int8_t */ |
| 81 |
|
#define PRIi8 "i" |
| 82 |
|
/** \ingroup avr_inttypes |
| 83 |
|
integer printf format for int_least8_t */ |
| 84 |
|
#define PRIiLEAST8 "i" |
| 85 |
|
/** \ingroup avr_inttypes |
| 86 |
|
integer printf format for int_fast8_t */ |
| 87 |
|
#define PRIiFAST8 "i" |
| 88 |
|
|
| 89 |
|
|
| 90 |
|
/** \ingroup avr_inttypes |
| 91 |
|
decimal printf format for int16_t */ |
| 92 |
|
#define PRId16 "d" |
| 93 |
|
/** \ingroup avr_inttypes |
| 94 |
|
decimal printf format for int_least16_t */ |
| 95 |
|
#define PRIdLEAST16 "d" |
| 96 |
|
/** \ingroup avr_inttypes |
| 97 |
|
decimal printf format for int_fast16_t */ |
| 98 |
|
#define PRIdFAST16 "d" |
| 99 |
|
|
| 100 |
|
/** \ingroup avr_inttypes |
| 101 |
|
integer printf format for int16_t */ |
| 102 |
|
#define PRIi16 "i" |
| 103 |
|
/** \ingroup avr_inttypes |
| 104 |
|
integer printf format for int_least16_t */ |
| 105 |
|
#define PRIiLEAST16 "i" |
| 106 |
|
/** \ingroup avr_inttypes |
| 107 |
|
integer printf format for int_fast16_t */ |
| 108 |
|
#define PRIiFAST16 "i" |
| 109 |
|
|
| 110 |
|
|
| 111 |
|
/** \ingroup avr_inttypes |
| 112 |
|
decimal printf format for int32_t */ |
| 113 |
|
#define PRId32 "ld" |
| 114 |
|
/** \ingroup avr_inttypes |
| 115 |
|
decimal printf format for int_least32_t */ |
| 116 |
|
#define PRIdLEAST32 "ld" |
| 117 |
|
/** \ingroup avr_inttypes |
| 118 |
|
decimal printf format for int_fast32_t */ |
| 119 |
|
#define PRIdFAST32 "ld" |
| 120 |
|
|
| 121 |
|
/** \ingroup avr_inttypes |
| 122 |
|
integer printf format for int32_t */ |
| 123 |
|
#define PRIi32 "li" |
| 124 |
|
/** \ingroup avr_inttypes |
| 125 |
|
integer printf format for int_least32_t */ |
| 126 |
|
#define PRIiLEAST32 "li" |
| 127 |
|
/** \ingroup avr_inttypes |
| 128 |
|
integer printf format for int_fast32_t */ |
| 129 |
|
#define PRIiFAST32 "li" |
| 130 |
|
|
| 131 |
|
|
| 132 |
|
#ifdef __avr_libc_does_not_implement_long_long_in_printf_or_scanf |
| 133 |
|
|
| 134 |
|
#define PRId64 "lld" |
| 135 |
|
#define PRIdLEAST64 "lld" |
| 136 |
|
#define PRIdFAST64 "lld" |
| 137 |
|
|
| 138 |
|
#define PRIi64 "lli" |
| 139 |
|
#define PRIiLEAST64 "lli" |
| 140 |
|
#define PRIiFAST64 "lli" |
| 141 |
|
|
| 142 |
|
|
| 143 |
|
#define PRIdMAX "lld" |
| 144 |
|
#define PRIiMAX "lli" |
| 145 |
|
|
| 146 |
|
#endif |
| 147 |
|
|
| 148 |
|
/** \ingroup avr_inttypes |
| 149 |
|
decimal printf format for int */ |
| 150 |
|
#define PRIdPTR PRId16 |
| 151 |
|
/** \ingroup avr_inttypes |
| 152 |
|
integer printf format for int */ |
| 153 |
|
#define PRIiPTR PRIi16 |
| 154 |
|
|
| 155 |
|
/** \ingroup avr_inttypes |
| 156 |
|
octal printf format for uint8_t */ |
| 157 |
|
#define PRIo8 "o" |
| 158 |
|
/** \ingroup avr_inttypes |
| 159 |
|
octal printf format for uint_least8_t */ |
| 160 |
|
#define PRIoLEAST8 "o" |
| 161 |
|
/** \ingroup avr_inttypes |
| 162 |
|
octal printf format for uint_fast8_t */ |
| 163 |
|
#define PRIoFAST8 "o" |
| 164 |
|
|
| 165 |
|
/** \ingroup avr_inttypes |
| 166 |
|
decimal printf format for uint8_t */ |
| 167 |
|
#define PRIu8 "u" |
| 168 |
|
/** \ingroup avr_inttypes |
| 169 |
|
decimal printf format for uint_least8_t */ |
| 170 |
|
#define PRIuLEAST8 "u" |
| 171 |
|
/** \ingroup avr_inttypes |
| 172 |
|
decimal printf format for uint_fast8_t */ |
| 173 |
|
#define PRIuFAST8 "u" |
| 174 |
|
|
| 175 |
|
/** \ingroup avr_inttypes |
| 176 |
|
hexadecimal printf format for uint8_t */ |
| 177 |
|
#define PRIx8 "x" |
| 178 |
|
/** \ingroup avr_inttypes |
| 179 |
|
hexadecimal printf format for uint_least8_t */ |
| 180 |
|
#define PRIxLEAST8 "x" |
| 181 |
|
/** \ingroup avr_inttypes |
| 182 |
|
hexadecimal printf format for uint_fast8_t */ |
| 183 |
|
#define PRIxFAST8 "x" |
| 184 |
|
|
| 185 |
|
/** \ingroup avr_inttypes |
| 186 |
|
uppercase hexadecimal printf format for uint8_t */ |
| 187 |
|
#define PRIX8 "X" |
| 188 |
|
/** \ingroup avr_inttypes |
| 189 |
|
uppercase hexadecimal printf format for uint_least8_t */ |
| 190 |
|
#define PRIXLEAST8 "X" |
| 191 |
|
/** \ingroup avr_inttypes |
| 192 |
|
uppercase hexadecimal printf format for uint_fast8_t */ |
| 193 |
|
#define PRIXFAST8 "X" |
| 194 |
|
|
| 195 |
|
|
| 196 |
|
/** \ingroup avr_inttypes |
| 197 |
|
octal printf format for uint8_t */ |
| 198 |
|
#define PRIo16 "o" |
| 199 |
|
/** \ingroup avr_inttypes |
| 200 |
|
octal printf format for uint_least8_t */ |
| 201 |
|
#define PRIoLEAST16 "o" |
| 202 |
|
/** \ingroup avr_inttypes |
| 203 |
|
octal printf format for uint_fast8_t */ |
| 204 |
|
#define PRIoFAST16 "o" |
| 205 |
|
|
| 206 |
|
#define PRIu16 "u" |
| 207 |
|
#define PRIuLEAST16 "u" |
| 208 |
|
#define PRIuFAST16 "u" |
| 209 |
|
|
| 210 |
|
#define PRIx16 "x" |
| 211 |
|
#define PRIxLEAST16 "x" |
| 212 |
|
#define PRIxFAST16 "x" |
| 213 |
|
|
| 214 |
|
#define PRIX16 "X" |
| 215 |
|
#define PRIXLEAST16 "X" |
| 216 |
|
#define PRIXFAST16 "X" |
| 217 |
|
|
| 218 |
|
|
| 219 |
|
#define PRIo32 "lo" |
| 220 |
|
#define PRIoLEAST32 "lo" |
| 221 |
|
#define PRIoFAST32 "lo" |
| 222 |
|
|
| 223 |
|
#define PRIu32 "lu" |
| 224 |
|
#define PRIuLEAST32 "lu" |
| 225 |
|
#define PRIuFAST32 "lu" |
| 226 |
|
|
| 227 |
|
#define PRIx32 "lx" |
| 228 |
|
#define PRIxLEAST32 "lx" |
| 229 |
|
#define PRIxFAST32 "lx" |
| 230 |
|
|
| 231 |
|
#define PRIX32 "lX" |
| 232 |
|
#define PRIXLEAST32 "lX" |
| 233 |
|
#define PRIXFAST32 "lX" |
| 234 |
|
|
| 235 |
|
|
| 236 |
|
#if __avr_libc_does_not_implement_long_long_in_printf_or_scanf |
| 237 |
|
|
| 238 |
|
#define PRIo64 "llo" |
| 239 |
|
#define PRIoLEAST64 "llo" |
| 240 |
|
#define PRIoFAST64 "llo" |
| 241 |
|
|
| 242 |
|
#define PRIu64 "llu" |
| 243 |
|
#define PRIuLEAST64 "llu" |
| 244 |
|
#define PRIuFAST64 "llu" |
| 245 |
|
|
| 246 |
|
#define PRIx64 "llx" |
| 247 |
|
#define PRIxLEAST64 "llx" |
| 248 |
|
#define PRIxFAST64 "llx" |
| 249 |
|
|
| 250 |
|
#define PRIX64 "llX" |
| 251 |
|
#define PRIXLEAST64 "llX" |
| 252 |
|
#define PRIXFAST64 "llX" |
| 253 |
|
|
| 254 |
|
#define PRIoMAX "llo" |
| 255 |
|
#define PRIuMAX "llu" |
| 256 |
|
#define PRIxMAX "llx" |
| 257 |
|
#define PRIXMAX "llX" |
| 258 |
|
|
| 259 |
|
#endif |
| 260 |
|
|
| 261 |
|
#define PRIoPTR PRIo16 |
| 262 |
|
#define PRIuPTR PRIu16 |
| 263 |
|
#define PRIxPTR PRIx16 |
| 264 |
|
#define PRIXPTR PRIX16 |
| 265 |
|
|
| 266 |
|
|
| 267 |
|
|
| 268 |
|
/* The fscanf macros for signed integers */ |
| 269 |
|
|
| 270 |
|
|
| 271 |
|
#define SCNd8 "hhd" |
| 272 |
|
#define SCNdLEAST8 "hhd" |
| 273 |
|
#define SCNdFAST8 "hhd" |
| 274 |
|
|
| 275 |
|
#define SCNi8 "hhi" |
| 276 |
|
#define SCNiLEAST8 "hhi" |
| 277 |
|
#define SCNiFAST8 "hhi" |
| 278 |
|
|
| 279 |
|
|
| 280 |
|
#define SCNd16 "d" |
| 281 |
|
#define SCNdLEAST16 "d" |
| 282 |
|
#define SCNdFAST16 "d" |
| 283 |
|
|
| 284 |
|
#define SCNi16 "i" |
| 285 |
|
#define SCNiLEAST16 "i" |
| 286 |
|
#define SCNiFAST16 "i" |
| 287 |
|
|
| 288 |
|
|
| 289 |
|
#define SCNd32 "ld" |
| 290 |
|
#define SCNdLEAST32 "ld" |
| 291 |
|
#define SCNdFAST32 "ld" |
| 292 |
|
|
| 293 |
|
#define SCNi32 "li" |
| 294 |
|
#define SCNiLEAST32 "li" |
| 295 |
|
#define SCNiFAST32 "li" |
| 296 |
|
|
| 297 |
|
|
| 298 |
|
#if __avr_libc_does_not_implement_long_long_in_printf_or_scanf |
| 299 |
|
|
| 300 |
|
#define SCNd64 "lld" |
| 301 |
|
#define SCNdLEAST64 "lld" |
| 302 |
|
#define SCNdFAST64 "lld" |
| 303 |
|
|
| 304 |
|
#define SCNi64 "lli" |
| 305 |
|
#define SCNiLEAST64 "lli" |
| 306 |
|
#define SCNiFAST64 "lli" |
| 307 |
|
|
| 308 |
|
#define SCNdMAX "lld" |
| 309 |
|
#define SCNiMAX "lli" |
| 310 |
|
|
| 311 |
|
#endif |
| 312 |
|
|
| 313 |
|
#define SCNdPTR SCNd16 |
| 314 |
|
#define SCNiPTR SCNi16 |
| 315 |
|
|
| 316 |
|
|
| 317 |
|
/* The fscanf macros for unsigned integers */ |
| 318 |
|
|
| 319 |
|
|
| 320 |
|
#define SCNo8 "hho" |
| 321 |
|
#define SCNoLEAST8 "hho" |
| 322 |
|
#define SCNoFAST8 "hho" |
| 323 |
|
|
| 324 |
|
#define SCNu8 "hhu" |
| 325 |
|
#define SCNuLEAST8 "hhu" |
| 326 |
|
#define SCNuFAST8 "hhu" |
| 327 |
|
|
| 328 |
|
#define SCNx8 "hhx" |
| 329 |
|
#define SCNxLEAST8 "hhx" |
| 330 |
|
#define SCNxFAST8 "hhx" |
| 331 |
|
|
| 332 |
|
|
| 333 |
|
#define SCNo16 "o" |
| 334 |
|
#define SCNoLEAST16 "o" |
| 335 |
|
#define SCNoFAST16 "o" |
| 336 |
|
|
| 337 |
|
#define SCNu16 "u" |
| 338 |
|
#define SCNuLEAST16 "u" |
| 339 |
|
#define SCNuFAST16 "u" |
| 340 |
|
|
| 341 |
|
#define SCNx16 "x" |
| 342 |
|
#define SCNxLEAST16 "x" |
| 343 |
|
#define SCNxFAST16 "x" |
| 344 |
|
|
| 345 |
|
|
| 346 |
|
#define SCNo32 "lo" |
| 347 |
|
#define SCNoLEAST32 "lo" |
| 348 |
|
#define SCNoFAST32 "lo" |
| 349 |
|
|
| 350 |
|
#define SCNu32 "lu" |
| 351 |
|
#define SCNuLEAST32 "lu" |
| 352 |
|
#define SCNuFAST32 "lu" |
| 353 |
|
|
| 354 |
|
#define SCNx32 "lx" |
| 355 |
|
#define SCNxLEAST32 "lx" |
| 356 |
|
#define SCNxFAST32 "lx" |
| 357 |
|
|
| 358 |
|
|
| 359 |
|
#if __avr_libc_does_not_implement_long_long_in_printf_or_scanf |
| 360 |
|
|
| 361 |
|
#define SCNo64 "llo" |
| 362 |
|
#define SCNoLEAST64 "llo" |
| 363 |
|
#define SCNoFAST64 "llo" |
| 364 |
|
|
| 365 |
|
#define SCNu64 "llu" |
| 366 |
|
#define SCNuLEAST64 "llu" |
| 367 |
|
#define SCNuFAST64 "llu" |
| 368 |
|
|
| 369 |
|
#define SCNx64 "llx" |
| 370 |
|
#define SCNxLEAST64 "llx" |
| 371 |
|
#define SCNxFAST64 "llx" |
| 372 |
|
|
| 373 |
|
#define SCNoMAX "llo" |
| 374 |
|
#define SCNuMAX "llu" |
| 375 |
|
#define SCNxMAX "llx" |
| 376 |
|
|
| 377 |
|
|
| 378 |
|
#define SCNoPTR SCNo16 |
| 379 |
|
#define SCNuPTR SCNu16 |
| 380 |
|
#define SCNxPTR SCNx16 |
| 381 |
|
|
| 382 |
#endif |
#endif |
| 383 |
|
/*@{*/ |
| 384 |
|
|
| 385 |
|
|
| 386 |
|
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ |
| 387 |
|
|
| 388 |
|
|
| 389 |
|
#endif /* __INTTYPES_H_ */ |