HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man5/!!!intro.5
________________________________________________________________
___ ___
v
varargs(5) varargs(5)
if ((*fmt == ’%’) && (*(fmt + 1) == ’Y’))
{
FILE *other_fp;
fmt += 2;
other_fp = (FILE *) va_arg(ap, char *);
if (other_fp != (FILE *) NULL)
{
/*
* Print general message information to additional stream.
*/
(void) vfprintf(other_fp, fmt, ap);
(void) fflush(other_fp);
}
}
/*
* Now print it to the log file.
*/
(void) vfprintf(log_fp, fmt, ap);
}
WARNINGS
It is up to the calling routine to specify how many arguments there are, because it is not always possible to
determine this from the stack frame. For example, execl() is passed a zero pointer to signal the end of
the list. printf() can determine how many arguments are present by the format.
It is non-portable to specify a second argument of char, short,or float to va_arg, because argu-
ments seen by the called function are not
char, short,orfloat. C converts
char and short argu-
ments to
int, and converts float arguments to double, before passing them to a function.
SEE ALSO
exec(2), vprintf(3S).
STANDARDS CONFORMANCE
va_alist: AES, SVID2, SVID3, XPG2, XPG3, XPG4
va_arg: SVID2, SVID3, XPG2, XPG3, XPG4
va_dcl: SVID2, SVID3, XPG2, XPG3, XPG4
va_end: SVID2, SVID3, XPG2, XPG3, XPG4
va_list: SVID2, SVID3, XPG2, XPG3, XPG4
va_start: SVID2, SVID3, XPG2, XPG3, XPG4
<varargs.h> : AES, SVID3, XPG2, XPG3, XPG4
HP-UX Release 11i: December 2000 − 3 − Section 5−−365
___
___