Guardian Native C Library Calls Reference Manual (G06.27+)

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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
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
specications.
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 dened 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 specied 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 specications, 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 specication 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
character % (percent sign) is replaced by %digit$, where digit is a decimal number in
527192-004 Hewlett-Packard Company 751