📄 ansistdarg.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ansiStdarg.html - generated by refgen from ansiStdarg.c --> <title> ansiStdarg </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>ansiStdarg</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ansiStdarg</strong> - ANSI <b>stdarg</b> documentation </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> - initialize a <b>va_list</b> object for use by <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> and <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b><br><b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> - expand to an expression having the type and value of the call's next argument<br><b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b> - facilitate a normal return from a routine using a <b>va_list</b> object<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>The header <b>stdarg.h</b> declares a type and defines three macros for advancingthrough a list of arguments whose number and types are not known to thecalled function when it is translated.<p>A function may be called with a variable number of arguments of varying types.The rightmost parameter plays a special role in the access mechanism, andis designated <i>parmN</i> in this description.<p>The type declared is:<dl><dt><b>va_list</b><dd>a type suitable for holding information needed by the macros<b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b>, <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b>, and <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b>.</dl><p>To access the varying arguments, the called function shall declare an objecthaving type <b>va_list</b>. The object (referred to here as <i>ap</i>) may bepassed as an argument to another function; if that function invokes the<b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> macro with parameter <i>ap</i>, the value of <i>ap</i> in the callingfunction is indeterminate and is passed to the <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b> macro priorto any further reference to <i>ap</i>.<p><b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> and <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> have been implemented as macros, not asfunctions. The <b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> and <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b> macros should be invoked in thefunction accepting a varying number of arguments, if access to the varyingarguments is desired.<p>The use of these macros is documented here as if they were architecture-generic.However, depending on the compilation environment, different macro versions areincluded by <b>vxWorks.h</b>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p>American National Standard X3.159-1989<hr><a name="va_start"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>va_start( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>va_start( )</strong> - initialize a <b>va_list</b> object for use by <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> and <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void va_start ( ap, /* list of type va_list */ parmN /* rightmost parameter */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This macro initializes an object of type <b>va_list</b> (<i>ap</i>) for subsequentuse by <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> and <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b>. The parameter <i>parmN</i> is the identifier ofthe rightmost parameter in the variable parameter list in the functiondefinition (the one just before the , ...). If <i>parmN</i> is declared withthe register storage class with a function or array type, or with a typethat is not compatible with the type that results after application of thedefault argument promotions, the behavior is undefined.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdarg.html#top">ansiStdarg</a></b><hr><a name="va_arg"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>va_arg( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>va_arg( )</strong> - expand to an expression having the type and value of the call's next argument</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void va_arg ( ap, /* list of type va_list */ type /* type */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Each invocation of this macro modifies an object of type <b>va_list</b> (<i>ap</i>)so that the values of successive arguments are returned in turn. Theparameter <i>type</i> is a type name specified such that the type of a pointerto an object that has the specified type can be obtained simply bypostfixing a * to <i>type</i>. If there is no actual next argument, or if<i>type</i> is not compatible with the type of the actual next argument (aspromoted according to the default argument promotions), the behavior isundefined.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The first invocation of <b><a href="./ansiStdarg.html#va_arg">va_arg</a>( )</b> after <b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> returns the value of theargument after that specified by <i>parmN</i> (the rightmost parameter).Successive invocations return the value of the remaining arguments insuccession.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdarg.html#top">ansiStdarg</a></b><hr><a name="va_end"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>va_end( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>va_end( )</strong> - facilitate a normal return from a routine using a <b>va_list</b> object</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void va_end ( ap /* list of type va_list */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This macro facilitates a normal return from the function whose variableargument list was referred to by the expansion of <b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> thatinitialized the <b>va_list</b> object.<p><b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b> may modify the <b>va_list</b> object so that it is no longerusable (without an intervening invocation of <b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b>). If there is nocorresponding invocation of the <b><a href="./ansiStdarg.html#va_start">va_start</a>( )</b> macro, or if the <b><a href="./ansiStdarg.html#va_end">va_end</a>( )</b> macrois not invoked before the return, the behavior is undefined.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdarg.html#top">ansiStdarg</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -