xprintf d727b10
|
The xsnprintf
() and xvsnprintf
() functions are equivalent to ISO C99's snprintf()
and vsnprintf()
.
More...
Functions | |
int | xsnprintf (char *restrict str, size_t size, const char *restrict format,...) __attribute__((format(printf |
The xsnprintf() function is equivalent to ISO C99's snprintf() . | |
int int | xvsnprintf (char *restrict str, size_t size, const char *restrict format, va_list ap) |
The xvsnprintf() function is equivalent to ISO C99's vsnprintf() . |
The xsnprintf
() and xvsnprintf
() functions are equivalent to ISO C99's snprintf()
and vsnprintf()
.
The functions behave as xprintf(), except that the output is written into an array (specified by argument str
) rather than to a channel.
If size
is zero, nothing is written, and str
may be a null
pointer. Otherwise, output characters beyond the size-1st
are discarded rather than being written to the array, and a null
character is written at the end of the characters actually written into the array.
Thus, the null
terminated output has been completely written if and only if the returned value is nonnegative and less than size
.
int xsnprintf | ( | char *restrict | str, |
size_t | size, | ||
const char *restrict | format, | ||
... | |||
) |
The xsnprintf() function is equivalent to ISO C99's snprintf()
.
str | pointer to destination buffer |
size | sizeof str |
format | a printf() compatible format string |
... | variable argument list for format |
size
been sufficiently large, not counting the terminating null character int int xvsnprintf | ( | char *restrict | str, |
size_t | size, | ||
const char *restrict | format, | ||
va_list | ap | ||
) |
The xvsnprintf() function is equivalent to ISO C99's vsnprintf()
.
str | pointer to destination buffer |
size | sizeof str |
format | a printf() compatible format string |
ap | va_list to the arguments for format |
size
been sufficiently large, not counting the terminating null character