[][src]Function avr_libc::vfprintf

pub unsafe extern "C" fn vfprintf(
    __stream: *mut FILE,
    __fmt: *const i8,
    __ap: va_list
) -> i16

\c vfprintf is the central facility of the \c printf family of functions. It outputs values to \c stream under control of a format string passed in \c fmt. The actual values to print are passed as a variable argument list \c ap.

\c vfprintf returns the number of characters written to \c stream, or \c EOF in case of an error. Currently, this will only happen if \c stream has not been opened with write intent.

The format string is composed of zero or more directives: ordinary characters (not \c %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments. Each conversion specification is introduced by the \c % character. The arguments must properly correspond (after type promotion) with the conversion specifier. After the \c %, the following appear in sequence:

The conversion specifiers and their meanings are:

In no case does a non-existent or small field width cause truncation of a numeric field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result.

Since the full implementation of all the mentioned features becomes fairly large, three different flavours of vfprintf() can be selected using linker options. The default vfprintf() implements all the mentioned functionality except floating point conversions. A minimized version of vfprintf() is available that only implements the very basic integer and string conversion facilities, but only the \c # additional option can be specified using conversion flags (these flags are parsed correctly from the format specification, but then simply ignored). This version can be requested using the following \ref gcc_minusW "compiler options":

\code -Wl,-u,vfprintf -lprintf_min \endcode

If the full functionality including the floating point conversions is required, the following options should be used:

\code -Wl,-u,vfprintf -lprintf_flt -lm \endcode

\par Limitations:

\par Notes: