Atmel CAVR-4 Manual De Usuario
CAVR-4
Part 1. Using the compiler
The DLIB runtime environment
69
Configuration symbols for printf and scanf
When you set up your application project, you typically need to consider what
printf
and
scanf
formatting capabilities your application requires, see Choosing formatters
If the provided formatters do not meet your requirements, you can customize the full
formatters. However, that means you need to rebuild the runtime library.
formatters. However, that means you need to rebuild the runtime library.
The default behavior of the
printf
and
scanf
formatters are defined by configuration
symbols in the file
DLIB_Defaults.h
.
The following configuration symbols determine what capabilities the function
printf
should have:
When you build a library, the following configurations determine what capabilities the
function
function
scanf
should have:
Printf configuration symbols
Includes support for
_DLIB_PRINTF_MULTIBYTE
Multibyte characters
_DLIB_PRINTF_LONG_LONG
Long long (ll qualifier)
_DLIB_PRINTF_SPECIFIER_FLOAT
Floating-point numbers
_DLIB_PRINTF_SPECIFIER_A
Hexadecimal floats
_DLIB_PRINTF_SPECIFIER_N
Output count (%n)
_DLIB_PRINTF_QUALIFIERS
Qualifiers h, l, L, v, t, and z
_DLIB_PRINTF_FLAGS
Flags -, +, #, and 0
_DLIB_PRINTF_WIDTH_AND_PRECISION
Width and precision
_DLIB_PRINTF_CHAR_BY_CHAR
Output char by char or buffered
Table 19: Descriptions of printf configuration symbols
Scanf configuration symbols
Includes support for
_DLIB_SCANF_MULTIBYTE
Multibyte characters
_DLIB_SCANF_LONG_LONG
Long long (ll qualifier)
_DLIB_SCANF_SPECIFIER_FLOAT
Floating-point numbers
_DLIB_SCANF_SPECIFIER_N
Output count (%n)
_DLIB_SCANF_QUALIFIERS
Qualifiers h, j, l, t, z, and L
_DLIB_SCANF_SCANSET
Scanset ([*])
_DLIB_SCANF_WIDTH
Width
_DLIB_SCANF_ASSIGNMENT_SUPPRESSING
Assignment suppressing ([*])
Table 20: Descriptions of scanf configuration symbols