xprintf d727b10
|
Documentation for the xprintf project at github
ISO C99 fprintf
() formatting implementation aimed at embedded SW. Your output stream is easily connected. Small code and stack footprint, no malloc
(). Full ISO C99 implementation, floating point support can be disabled.
Xprintf is an independent implementation of the printf
() formatting facility. It is written from the ground up by Markus van Dijk, while employed by Technologies88.
The xprintf code was used for several years for all string formatting in an embedded project, including debug output to a PC, writing to an embedded display and writing to files.
In august 2011 Technologies88 kindly gave permission to enter the code into the public domain and transferred all rights to Markus van Dijk.
The code now lives as xprintf project at github.
This implementation of printf
formatting claims to be compliant with the ISO C99 standard with corrigenda TC1, TC2, and TC3 included.
"%1$d"
are not supported. man 3 printf
All flags are implemented: [#0- +]
.
The minimum field width is implemented, including the '*'
specifier.
The precision is implemented, including the '*'
specifier.
%d %i %o %u %x %X
with length modifiers hh h l ll j z t
are fully implemented. %f %F %e %E %g %G
with optional length modifier l
are fully implemented, but no inf/nan output. L
(long double
) is supported, but only produces the accuracy of a double. %a %A
are not implemented. %c %s
without length modifiers are fully implemented. l
for types wint_t
and wchar_t
) are not implemented. %#s
: an extra #
flag is implemented that will print the string "visually", using "\n", "\r", "\t" and "\ooo" (octal) for non-printable chars and "\\" for '\'. %p
is implementation dependent and formatted as %#x
%n
without length modifiers (argument type int*
) is fully implemented. %n
with length modifiers (argument type other than int*
) is not implemented. %%
is fully implemented :-)NOTE: these functions have to be reentrant, so: