Document va_copy.

This commit is contained in:
kleink 2000-02-03 16:17:50 +00:00
parent 82464e46d6
commit 72592c10cf
2 changed files with 33 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.17 1999/06/28 18:22:22 ad Exp $
# $NetBSD: Makefile,v 1.18 2000/02/03 16:17:50 kleink Exp $
# @(#)Makefile 8.2 (Berkeley) 12/13/93
MAN= assert.3 bitstring.3 dlfcn.3 end.3 intro.3 queue.3 stdarg.3
@ -23,8 +23,8 @@ MLINKS+=queue.3 circleq_insert_after.3 queue.3 circleq_insert_before.3
MLINKS+=queue.3 circleq_insert_head.3 queue.3 circleq_insert_tail.3
MLINKS+=queue.3 circleq_last.3 queue.3 circleq_next.3 queue.3 circleq_prev.3
MLINKS+=queue.3 circleq_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 varargs.3 stdarg.3 va_arg.3 stdarg.3 va_copy.3
MLINKS+=stdarg.3 va_end.3 stdarg.3 va_start.3
MLINKS+=dlfcn.3 dlopen.3 dlfcn.3 dlclose.3 dlfcn.3 dlsym.3 dlfcn.3 dlctl.3 \
dlfcn.3 dlerror.3 dlfcn.3 dladdr.3

View File

@ -1,4 +1,4 @@
.\" $NetBSD: stdarg.3,v 1.5 1999/03/16 19:46:38 kleink Exp $
.\" $NetBSD: stdarg.3,v 1.6 2000/02/03 16:17:50 kleink Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -37,13 +37,14 @@
.\"
.\" @(#)stdarg.3 8.1 (Berkeley) 6/5/93
.\"
.Dd June 5, 1993
.Dd January 18, 2000
.Dt STDARG 3
.Os
.Sh NAME
.Nm stdarg ,
.Nm varargs ,
.Nm va_arg ,
.Nm va_copy ,
.Nm va_end ,
.Nm va_start
.Nd variable argument lists
@ -54,6 +55,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
@ -71,15 +74,17 @@ The called function must declare an object of type
which is used by the macros
.Fn va_start ,
.Fn va_arg ,
and
.Fn va_end .
.Fn va_end ,
and, optionally,
.Fn va_copy .
.Pp
The
.Fn va_start
macro initializes
.Fa ap
for subsequent use by
.Fn va_arg
.Fn va_arg ,
.Fn va_copy
and
.Fn va_end ,
and must be called first.
@ -137,10 +142,29 @@ Successive invocations return the values of the remaining
arguments.
.Pp
The
.Fn va_copy
macro makes
.Fa dest
a copy of
.Fa src
as if the
.Fn va_start
macro had been applied to it followed by the same sequence of uses of the
.Fn va_arg
macro as had previously been used to reache the present state of
.Fa 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
.Fn va_start .
.Fn va_start
or
.Fn va_copy .
.Pp
The
.Fn va_end