C setjmp.h Library Function

C <setjmp.h> library function: The setjmp.h header defines the macro setjmp(), and one function longjmp(), and one variable type jmp_buf, for bypassing the normal function call and return discipline.

C setjmp.h library function

Library Variables

And there is only one library variable is present in the C setjmp.h library function.

jmp_buf: It is an array type used for holding information for macro setjmp() and function longjmp().

Library Macros

int setjmp(jmp_buf environment): It saves the current environment into the variable environment for later use by the function longjmp(). If this macro returns directly from the macro invocation, then it returns zero but if it returns from a longjmp() function call, then a non-zero value is returned.

Library Functions

void longjmp(jmp_buf environment, int value): It restores the environment saved by the most recent call to setjmp() macro in the same invocation of the program with the corresponding jmp_buf argument.