diff options
author | Mike Barcroft <mike@FreeBSD.org> | 2002-09-18 07:33:16 +0000 |
---|---|---|
committer | Mike Barcroft <mike@FreeBSD.org> | 2002-09-18 07:33:16 +0000 |
commit | 86954511d26c1e6cc6d3f386e055458947f4baae (patch) | |
tree | d9550a771c43d65b540d4e46a2dadaefba483323 /share | |
parent | 530bb9225d7a47f3fdf6193dff2eab8b87b51712 (diff) | |
download | src-86954511d26c1e6cc6d3f386e055458947f4baae.tar.gz src-86954511d26c1e6cc6d3f386e055458947f4baae.zip |
Implement C99's va_copy() macro.
Notes
Notes:
svn path=/head/; revision=103526
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man3/Makefile | 2 | ||||
-rw-r--r-- | share/man/man3/stdarg.3 | 25 |
2 files changed, 25 insertions, 2 deletions
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 196cda1759bf..bea9924fc677 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -71,7 +71,7 @@ MLINKS+=queue.3 TAILQ_PREV.3 MLINKS+=queue.3 TAILQ_REMOVE.3 MLINKS+=stdarg.3 varargs.3 stdarg.3 va_arg.3 stdarg.3 va_end.3 -MLINKS+=stdarg.3 va_start.3 +MLINKS+=stdarg.3 va_copy.3 stdarg.3 va_start.3 MLINKS+=timeradd.3 timersub.3 timeradd.3 timerclear.3 timeradd.3 timerisset.3 MLINKS+=timeradd.3 timercmp.3 diff --git a/share/man/man3/stdarg.3 b/share/man/man3/stdarg.3 index 354fc0ae9fd2..e3f28e81913c 100644 --- a/share/man/man3/stdarg.3 +++ b/share/man/man3/stdarg.3 @@ -36,7 +36,7 @@ .\" @(#)stdarg.3 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd September 18, 2002 .Dt STDARG 3 .Os .Sh NAME @@ -49,6 +49,8 @@ .Ft type .Fn va_arg "va_list ap" type .Ft void +.Fn va_copy "va_list dest" "va_list src" +.Ft void .Fn va_end "va_list ap" .Sh DESCRIPTION A function may be called with a varying number of arguments of varying @@ -132,6 +134,27 @@ Successive invocations return the values of the remaining arguments. .Pp The +.Fn va_copy +macro copies a variable argument list, previously initialized by +.Fn va_start , +from +.Va src +to +.Va dest . +The state is preserved such that it is equivalent to calling +.Fn va_start +with the same second argument used with +.Va src , +and calling +.Fn va_arg +the same number of times as called with +.Va src . +.Pp +The +.Fn va_copy +macro returns no value. +.Pp +The .Fn va_end macro handles a normal return from the function whose variable argument list was initialized by |