NAME
xprintf - formatted output conversion
SYNOPSIS
#include <sys.h>
- void xprintf( const char
*format , ... );
DESCRIPTION
xprintf() formats its arg s and calls xputchar()
to output the results. It is a simplified version of printf()
ment mainly for debugging or logging purposes.
The format is a character string which contains two types
of objects: plain characters, which are simply passed to xputchar(),
and conversion specifications, each of which causes conversion and
printing of zero or more arg s. The results are undefined if
there are insufficient arg s for the format. If the format is
exhausted while arg s remain, the excess arg s are
simply ignored.
Each conversion specification is introduced by the % character.
After the % the following may appear:
- c
-
The character arg is printed.
-
d
-
The integer arg is converted to signed decimal.
-
s
-
The arg is taken to be a string (character pointer) and
characters from the string are printed until a NULL character (0) is
encountered. A NULL value for arg will yield undefined
results.
-
u
-
The integer arg is converted to unsigned decimal.
-
x
-
The integer arg is converted to unsigned hexadecimal. The %x
conversion specification produces a fixed format 10 character
string. The string is always prefixed by 0x and the number is
zero padded to 8 characters. For example, 42 would be display
as 0x0000002A.
SEE ALSO
xputchar(), xputs()
<
Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc.
1987-2011 >