| Table of Contents | Previous | Next |
The declarations in <setjmp.h> provide a way to
avoid the normal function call and return sequence, typically to
permit an immediate return from a deeply nested function call.
setjmp saves state information in
env for use by longjmp. A call to
setjmp can occur only in certain contexts, basically the
test of if, switch, and loops, and only in simple
relational expressions.
setjmp, and
non-zero from a subsequent call of setjmp.
if (setjmp(env) == 0)
/* get here on direct call */
else
/* get here by calling longjmp */
longjmp restores the state saved by the most recent
call to setjmp, using the information saved in
env, and execution resumes as if the setjmp
had just executed and returned the non-zero value
val. The function containing the
setjmp must not have terminated. Accessible
objects have the values they had at the time
longjmp was called; values are not saved by
setjmp.
| Table of Contents | Previous | Next |
Last modified: Fri Feb 25 13:52:15 2000