📄 ansisetjmp.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ansiSetjmp.html - generated by refgen from ansiSetjmp.c --> <title> ansiSetjmp </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>ansiSetjmp</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ansiSetjmp</strong> - ANSI <b>setjmp</b> documentation </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> - save the calling environment in a <b>jmp_buf</b> argument (ANSI)<br><b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> - perform non-local goto by restoring saved environment (ANSI) <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>The header <b>setjmp.h</b> defines functions andone type for bypassing the normal function call and return discipline.<p>The type declared is:<dl><dt><b>jmp_buf</b><dd>an array type suitable for holding the information needed to restorea calling environment.</dl><p>The ANSI C standard does not specify whether <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> is a subroutineor a macro.<p></blockquote><h4>SEE ALSO</h4><blockquote><p>American National Standard X3.159-1989<hr><a name="setjmp"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>setjmp( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>setjmp( )</strong> - save the calling environment in a <b>jmp_buf</b> argument (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int setjmp ( jmp_buf env )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine saves the calling environment in <i>env</i>, in order to permita <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> call to restore that environment (thus performing anon-local goto).<p></blockQuote><h4>Constraints on Calling Environment</h4><blockQuote>The <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> routine may only be used in the followingcontexts:<ul><li>as the entire controlling expression of a selection or iteration statement;</li><li>as one operand of a relational or equality operator, in the</li>controlling expression of a selection or iteration statement;<li>as the operand of a single-argument <b>!</b> operator, in the controlling</li>expression of a selection or iteration statement; or<li>as a complete C statement statement containing nothing other than</li>the <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> call (though the result may be cast to <b>void</b>).<br> </ul><p></blockquote><h4>RETURNS</h4><blockquote><p>From a direct invocation, <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> returns zero. From a callto <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b>, it returns a non-zero value specified as an argumentto <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiSetjmp.html#top">ansiSetjmp</a></b>, <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b><hr><a name="longjmp"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>longjmp( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>longjmp( )</strong> - perform non-local goto by restoring saved environment (ANSI) </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void longjmp ( jmp_buf env, int val )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine restores the environment saved by the most recentinvocation of the <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> routine that used the same <b>jmp_buf</b>specified in the argument <i>env</i>. The restored environment includesthe program counter, thus transferring control to the <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b>caller.<p>If there was no corresponding <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> call, or if the functioncontaining the corresponding <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> routine call has alreadyreturned, the behavior of <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> is unpredictable.<p>All accessible objects in memory retain their values as of the time<b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> was called, with one exception: local objects on the Cstack that are not declared <b>volatile</b>, and have been changedbetween the <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> invocation and the <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> call, haveunpredictable values.<p>The <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> function executes correctly in contexts of signalhandlers and any of their associated functions (but not from interrupthandlers).<p></blockquote><h4>WARNING</h4><blockquote><p>Do not use <b><a href="./ansiSetjmp.html#longjmp">longjmp</a>( )</b> or <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> from an ISR.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>This routine does not return to its caller.Instead, it causes <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> to return <i>val</i>, unless <i>val</i> is 0; inthat case <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b> returns 1.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiSetjmp.html#top">ansiSetjmp</a></b>, <b><a href="./ansiSetjmp.html#setjmp">setjmp</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -