User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
647
Longjmp
Prototype
void Longjmp(jmp_buf env, int val);
Description Restores calling environment saved in env buffer by the most recent invocation of Setjmp. If there
has been no such invocation, or the function containing the invocation of Setjmp has terminated in the
interim, the behavior is undened.
Parameters - env: buffer holding the information saved by the corresponding Setjmp invocation
- val: value to be returned by the corresponding Setjmp function
Returns Nothing.
Requires Invocation of Longjmp must occur before return from the function in which Setjmp was called
encounters.
Example
jmp_buf buf;
...
Longjmp(buf, 2);
Notes None.
Library Example
This example demonstrates function cross calling using the Setjmp and Longjmp functions. When called, Setjmp
saves its calling environment in its jmp_buf argument for a later use by Longjmp. Longjmp, on the other hand,
restores the environment saved by the most recent invocation of Setjmp with the corresponding jmp_buf argument.