AVR Libc Home Page | AVR Libc Development Pages | ||||
Main Page | User Manual | Library Reference | FAQ | Alphabetical Index | Example Projects |
#include <inttypes.h>
This header file includes the exact-width integer definitions from <stdint.h>
, and extends them with additional facilities provided by the implementation.
Currently, the extensions include two additional integer types that could hold a "far" pointer (i.e. a code pointer that can address more than 64 KB), as well as standard names for all printf and scanf formatting options that are supported by the <stdio.h>: Standard IO facilities. As the library does not support the full range of conversion specifiers from ISO 9899:1999, only those conversions that are actually implemented will be listed here.
The idea behind these conversion macros is that, for each of the types defined by <stdint.h>, a macro will be supplied that portably allows formatting an object of that type in printf() or scanf() operations. Example:
#include <inttypes.h> uint8_t smallval; int32_t longval; ... printf("The hexadecimal value of smallval is %" PRIx8 ", the decimal value of longval is %" PRId32 ".\n", smallval, longval);
#define PRId16 "d" |
decimal printf format for int16_t
#define PRId32 "ld" |
decimal printf format for int32_t
#define PRId8 "d" |
decimal printf format for int8_t
#define PRIdFAST16 "d" |
decimal printf format for int_fast16_t
#define PRIdFAST32 "ld" |
decimal printf format for int_fast32_t
#define PRIdFAST8 "d" |
decimal printf format for int_fast8_t
#define PRIdLEAST16 "d" |
decimal printf format for int_least16_t
#define PRIdLEAST32 "ld" |
decimal printf format for int_least32_t
#define PRIdLEAST8 "d" |
decimal printf format for int_least8_t
#define PRIdPTR PRId16 |
decimal printf format for intptr_t
#define PRIi16 "i" |
integer printf format for int16_t
#define PRIi32 "li" |
integer printf format for int32_t
#define PRIi8 "i" |
integer printf format for int8_t
#define PRIiFAST16 "i" |
integer printf format for int_fast16_t
#define PRIiFAST32 "li" |
integer printf format for int_fast32_t
#define PRIiFAST8 "i" |
integer printf format for int_fast8_t
#define PRIiLEAST16 "i" |
integer printf format for int_least16_t
#define PRIiLEAST32 "li" |
integer printf format for int_least32_t
#define PRIiLEAST8 "i" |
integer printf format for int_least8_t
#define PRIiPTR PRIi16 |
integer printf format for intptr_t
#define PRIo16 "o" |
octal printf format for uint16_t
#define PRIo32 "lo" |
octal printf format for uint32_t
#define PRIo8 "o" |
octal printf format for uint8_t
#define PRIoFAST16 "o" |
octal printf format for uint_fast16_t
#define PRIoFAST32 "lo" |
octal printf format for uint_fast32_t
#define PRIoFAST8 "o" |
octal printf format for uint_fast8_t
#define PRIoLEAST16 "o" |
octal printf format for uint_least16_t
#define PRIoLEAST32 "lo" |
octal printf format for uint_least32_t
#define PRIoLEAST8 "o" |
octal printf format for uint_least8_t
#define PRIoPTR PRIo16 |
octal printf format for uintptr_t
#define PRIu16 "u" |
decimal printf format for uint16_t
#define PRIu32 "lu" |
decimal printf format for uint32_t
#define PRIu8 "u" |
decimal printf format for uint8_t
#define PRIuFAST16 "u" |
decimal printf format for uint_fast16_t
#define PRIuFAST32 "lu" |
decimal printf format for uint_fast32_t
#define PRIuFAST8 "u" |
decimal printf format for uint_fast8_t
#define PRIuLEAST16 "u" |
decimal printf format for uint_least16_t
#define PRIuLEAST32 "lu" |
decimal printf format for uint_least32_t
#define PRIuLEAST8 "u" |
decimal printf format for uint_least8_t
#define PRIuPTR PRIu16 |
decimal printf format for uintptr_t
#define PRIX16 "X" |
uppercase hexadecimal printf format for uint16_t
#define PRIx16 "x" |
hexadecimal printf format for uint16_t
#define PRIX32 "lX" |
uppercase hexadecimal printf format for uint32_t
#define PRIx32 "lx" |
hexadecimal printf format for uint32_t
#define PRIX8 "X" |
uppercase hexadecimal printf format for uint8_t
#define PRIx8 "x" |
hexadecimal printf format for uint8_t
#define PRIXFAST16 "X" |
uppercase hexadecimal printf format for uint_fast16_t
#define PRIxFAST16 "x" |
hexadecimal printf format for uint_fast16_t
#define PRIXFAST32 "lX" |
uppercase hexadecimal printf format for uint_fast32_t
#define PRIxFAST32 "lx" |
hexadecimal printf format for uint_fast32_t
#define PRIXFAST8 "X" |
uppercase hexadecimal printf format for uint_fast8_t
#define PRIxFAST8 "x" |
hexadecimal printf format for uint_fast8_t
#define PRIXLEAST16 "X" |
uppercase hexadecimal printf format for uint_least16_t
#define PRIxLEAST16 "x" |
hexadecimal printf format for uint_least16_t
#define PRIXLEAST32 "lX" |
uppercase hexadecimal printf format for uint_least32_t
#define PRIxLEAST32 "lx" |
hexadecimal printf format for uint_least32_t
#define PRIXLEAST8 "X" |
uppercase hexadecimal printf format for uint_least8_t
#define PRIxLEAST8 "x" |
hexadecimal printf format for uint_least8_t
#define PRIXPTR PRIX16 |
uppercase hexadecimal printf format for uintptr_t
#define PRIxPTR PRIx16 |
hexadecimal printf format for uintptr_t
#define SCNd16 "d" |
decimal scanf format for int16_t
#define SCNd32 "ld" |
decimal scanf format for int32_t
#define SCNdFAST16 "d" |
decimal scanf format for int_fast16_t
#define SCNdFAST32 "ld" |
decimal scanf format for int_fast32_t
#define SCNdLEAST16 "d" |
decimal scanf format for int_least16_t
#define SCNdLEAST32 "ld" |
decimal scanf format for int_least32_t
#define SCNdPTR SCNd16 |
decimal scanf format for intptr_t
#define SCNi16 "i" |
generic-integer scanf format for int16_t
#define SCNi32 "li" |
generic-integer scanf format for int32_t
#define SCNiFAST16 "i" |
generic-integer scanf format for int_fast16_t
#define SCNiFAST32 "li" |
generic-integer scanf format for int_fast32_t
#define SCNiLEAST16 "i" |
generic-integer scanf format for int_least16_t
#define SCNiLEAST32 "li" |
generic-integer scanf format for int_least32_t
#define SCNiPTR SCNi16 |
generic-integer scanf format for intptr_t
#define SCNo16 "o" |
octal scanf format for uint16_t
#define SCNo32 "lo" |
octal scanf format for uint32_t
#define SCNoFAST16 "o" |
octal scanf format for uint_fast16_t
#define SCNoFAST32 "lo" |
octal scanf format for uint_fast32_t
#define SCNoLEAST16 "o" |
octal scanf format for uint_least16_t
#define SCNoLEAST32 "lo" |
octal scanf format for uint_least32_t
#define SCNoPTR SCNo16 |
octal scanf format for uintptr_t
#define SCNu16 "u" |
decimal scanf format for uint16_t
#define SCNu32 "lu" |
decimal scanf format for uint32_t
#define SCNuFAST16 "u" |
decimal scanf format for uint_fast16_t
#define SCNuFAST32 "lu" |
decimal scanf format for uint_fast32_t
#define SCNuLEAST16 "u" |
decimal scanf format for uint_least16_t
#define SCNuLEAST32 "lu" |
decimal scanf format for uint_least32_t
#define SCNuPTR SCNu16 |
decimal scanf format for uintptr_t
#define SCNx16 "x" |
hexadecimal scanf format for uint16_t
#define SCNx32 "lx" |
hexadecimal scanf format for uint32_t
#define SCNxFAST16 "x" |
hexadecimal scanf format for uint_fast16_t
#define SCNxFAST32 "lx" |
hexadecimal scanf format for uint_fast32_t
#define SCNxLEAST16 "x" |
hexadecimal scanf format for uint_least16_t
#define SCNxLEAST32 "lx" |
hexadecimal scanf format for uint_least32_t
#define SCNxPTR SCNx16 |
hexadecimal scanf format for uintptr_t
typedef int32_t int_farptr_t |
signed integer type that can hold a pointer > 64 KB
typedef uint32_t uint_farptr_t |
unsigned integer type that can hold a pointer > 64 KB