Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (t - z) vsnprintf(3)
NAME
vsnprintf - Formats a variable number of parameters for output to a buffer
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdarg.h>
#include <stdio.h>
int vsnprintf (
char *string,
size_t n,
const char *format,
va_list printarg
);
PARAMETERS
string Species the buffer to which output is printed.
n Species the size of the character array referred to by string.
format Species a character string combining literal characters with conversion
specifications.
printarg Species the parameters to be converted according to the format parameter.
DESCRIPTION
The vsnprintf( ) function formats and writes stdarg parameter lists. This function is the same as
the snprintf( ) function, except that it is called with a parameter list pointer, as defined by stdarg,
instead of with a variable number of parameters.
The vsnprintf( ) function converts, formats, and stores its value parameters, under control of the
format parameter, into consecutive bytes starting at the address specified by the string parameter.
The vsnprintf( ) function places a null character \0 at the end.
If n is zero, no characters are stored and string may be a null pointer. Otherwise, any generated
characters beyond the n-1st are discarded, rather than being stored, and a null character is
appended after the last character that was actually stored.
The format parameter is a character string that contains two types of objects:
Literal characters, which are copied to the output stream.
Conversion specifications, each of which causes zero or more items to be fetched from
the value parameter list.
If there are not enough items for format in the value parameter list, the results are unpredictable.
If more values remain after the entire format has been processed, they are ignored.
Conversion Specications
Each conversion specification in the format parameter has the following syntax:
A % (percent sign).
The vsnprintf( ) function can handle a format string that enables the system to process
elements of the parameter list in variable order. In such a case, the normal conversion
527192-018 Hewlett-Packard Company 795