<setjmp.h>typedef a-type jmp_buf; void longjmp(jmp_buf env, int val); #define setjmp(jmp_buf env) <int rvalue>
Include the standard header <setjmp.h>
to perform control transfers that bypass the normal function call
and return protocol.
jmp_buftypedef a-type jmp_buf;
The type is the array type a-type of an
object that you declare to hold the context information stored by
setjmp
and accessed by longjmp.
longjmpvoid longjmp(jmp_buf env, int val);
The function causes a second return from the execution of setjmp
that stored the current context value in env. If val
is nonzero, the return value is val; otherwise, it
is 1.
The function that was active when setjmp stored the
current context value must not have returned control to its
caller. An object with dynamic duration that does not have a volatile
type and whose stored value has changed since the current context
value was stored will have a stored value that is indeterminate.
setjmp#define setjmp(jmp_buf env) <int rvalue>
The macro stores the current context value in the array
designated by env and returns zero. A later call to longjmp
that accesses the same context value causes setjmp
to again return, this time with a nonzero value. You can use the
macro setjmp only in an expression that:
! ==,
!=, <, <=, >,
or >=) with the other operand an integer
constant expression You can write such an expression only as the expression part of a do, expression, for, if, if-else, switch,, or while statement.
See also the Table of Contents .
Copyright © 1989-1996 by P.J. Plauger and Jim Brodie. All rights reserved.