<setjmp.h> header file contains declarations that
provide a way to avoid the normal function call and return sequence,
typically to permit an intermediate return from a nested function
int setjmp(jmp_buf env)
jmp_bufbuffer and initializes it for the jump (the jump itself is performed with
longjmp.) This macro saves the program's calling environment in the environment buffer specified by the env argument for later use by the
longjmpfunction. If the return is from a direct invocation,
setjmpreturns 0. If the return is from a call to
setjmpreturns a nonzero value.
void longjmp(jmp_buf env, int value;)
setjmpfunction in the same invocation of the program. The
longjmpfunction does not work if called from a nested signal handler; the result is undefined.
The value specified by value is passed from
setjmp . After
longjmp is completed, program execution continues
as if the corresponding invocation of
just returned value. If value is passed to
setjmp as 0, it is converted to 1.