Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
setjmp.h File Reference

Standard C Libraries -. More...

Go to the source code of this file.

Typedefs

typedef unsigned int jmp_buf [18]
 

Functions

int setjmp (jmp_buf env)
 
void longjmp (jmp_buf env, int val)
 

Detailed Description

Standard C Libraries -.

Compiler:
MPLAB XC16 compiler

Description

The header file, setjmp.h, consists of a type, a macro and a function that allow control transfers to occur that bypass the normal function call and return process.

Software License Agreement

The documentation in this header file has been copied from the documentation provided with the Microchip MPLAB XC16 compiler. The original license agreement included with the XC16 compiler applies!

Typedef Documentation

typedef unsigned int jmp_buf[18]

Description: A type that is an array used by setjmp and longjmp to save and restore the program environment.

Include: <setjmp.h>

Remarks:
_NSETJMP is defined as 16 + 2 that represents 16 registers and a 32-bit return address.

Function Documentation

void longjmp ( jmp_buf  env,
int  val 
)

Description: A function that restores the environment saved by setjmp.

Include: <setjmp.h>

Parameters
envvariable where environment is stored
valvalue to be returned to setjmp call.

Remarks:
The value parameter, val, should be non-zero. If longjmp is invoked from a nested signal handler (that is, invoked as a result of a signal raised during the handling of another signal), the behavior is undefined.

int setjmp ( jmp_buf  env)

Description: A macro that saves the current state of the program for later use by longjmp.

Include: <setjmp.h>

Parameters
envvariable where environment is stored
Returns
If the return is from a direct call, setjmp returns zero. If the return is from a call to longjmp, setjmp returns a non-zero value. Note: If the argument val from longjmp is 0, setjmp returns 1.

Example:
See longjmp.