| T X T _ P S N P R I N T F ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English INDEP - TXT_#?
----------------------------------------------------------------------------
NAME
txt_psnprintf() - Produces output according to the format.
SYNOPSIS
length = txt_psnprintf(buffer, size, fmt, ...);
LONG txt_psnprintf(UBYTE *, LONG, const UBYTE *, ...);
FUNCTION
This func. wraps 'txt_vpsnprintf()' to act like any other
'snprintf()' implementation.
INPUTS
buffer - Output buffer(will be NULL terminated).
size - Output buffer size.
fmt - Formatting string.
... - Additional arguments.
RETURNS
Returns length of newly formatted string or negative value
if string had to be truncated.
BASES
None.
NOTES
When going to output 64bit values from 32bit ones always
remeber to typecast such a var. with '(QUAD)' or '(UQUAD)'.
Truncation can be detected by adding buffer size to the
output of the function. If it is 1 then the last call did
truncate the output.
See 'txt_vpsnprintf()' for available formatting options.
Beware! Using '%b' with BCPL data on stack may result in
address mess! All addresses to be BCPLed must be multiple
of 4! See 'testsuite/textfuncs-test.c' for more details.
SEE ALSO
txt_vpsnprintf()
EXAMPLE
...
UBYTE buf[256];
txt_psnprintf(buf, 256, "I have %ld apples and im %s!", 3,
"happy");
txt_psnprintf(buf, 256, "This = %qd is wrong! And this = %qd"
"is right ;-) .", 0x7FFFFFFF,
(QUAD)0x7FFFFFFF);
BUGS
None known.
----------------------------------------------------------------------------
| |
| |