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:

d, i
The integer arg is converted to signed decimal format.
u
The unsigned arg is converted to unsigned decimal format.
o
The unsigned arg is converted to unsigned octal format.
x, h
The unsigned arg is converted to unsigned hexadecimal format.
c
The integer arg is converted to unsigned char format and printed.
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 be printed as (null).
p
The integer arg is converted to unsigned int hexadecimal (pointer). The %p conversion specification produces a fixed format string: 4 character for 16-bit system, 8 character for 32-bit system. The number is zero padded to 4/8 characters. For example, for 32-bit system the number 42 would be displayed as 0000002A.

SEE ALSO

xputchar(), xputs()

Home page (Kernel)


< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2018 >