VA_ARG(3) NEWLIB VA_ARG(3)NAME
15.1.2 Extract a value from argument list
-----------------------------------------
SYNOPSIS
#include <stdarg.h>
TYPE va_arg(va_list AP, TYPE);
DESCRIPTION
`va_arg' returns the next unprocessed value from a variable argument
list AP (which you must previously create with VA_START). Specify the
type for the value as the second parameter to the macro, TYPE.
You may pass a `va_list' object AP to a subfunction, and use
`va_arg' from the subfunction rather than from the function actually
declared with an ellipsis in the header; however, in that case you may
_only_ use `va_arg' from the subfunction. ANSI C does not permit
extracting successive values from a single variable-argument list from
different levels of the calling stack.
There is no mechanism for testing whether there is actually a next
argument available; you might instead pass an argument count (or some
other data that implies an argument count) as one of the fixed argu‐
ments in your function call.
RETURNS
`va_arg' returns the next argument, an object of type TYPE.
PORTABILITY
ANSI C requires `va_arg'.
SEE ALSOva_arg is part of the library. The full documentation for is main‐
tained as a Texinfo manual. If info and are properly installed at your
site, the command
info
will give you access to the complete manual.
NEWLIB April 2010 VA_ARG(3)