Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

C Standard Library – <setjmp.h>


May 11, 2021 C


Table of contents


C Standard Library - slt;setjmp.h>

Brief introduction

The setjmp.h header file defines the macro setjmp(), function longjmp() and variable type jmp_buf, which bypasses normal function calls and return rules.

Library variables

The variables defined in the header file setjmp.h are listed below:

Serial number Variable & description
1 jmp_buf
This is a storage macro setjmp() And functions longjmp() Array type of related information.

Library macros

Here is the only macro defined in this library:

Serial number Macro & Description
1 int setjmp(jmp_buf environment)
This macro saves the current environment in variables environment Middle, so that functions longjmp() Subsequent use.If this macro returns directly from the macro, it will return zero, but if it from longjmp() The function call is returned, then it returns a non-zero value.

The library function

Here is the only function defined in the header file setjmp.h:

Serial number Function & Description
1 void longjmp(jmp_buf environment, int value)
This function recovers the last call setjmp() Macro-saving environment, jmp_buf The setting of the parameter is generated by previous call setjmp ().