SilverScreen Solid Modeler



Previous topic Next topic  


Previous topic Next topic JavaScript is required for the print function  



void longjmp( jmp_buf env, int val )


jmp_buf env;      /* saved environment buffer */

int     val;      /* "return" value for setjmp */




#include "setjmp.h"


The longjmp function restores the execution context stored in env by a previous call to setjmp . Execution returns as if setjmp had returned val , with the exception that any global variables and variables local to the function containing the setjmp call retain the values that they had when longjmp was called. longjmp must be called before the function that called setjmp returns; otherwise, the state of the executing program is undefined (and will probably crash).




env is the address of a "jump buffer" that has been previously initialized by a call to setjmp. val is is an integer signifying the "return" value for setjmp.



Return Value





Since a true call to setjmp always returns 0, it would not be wise to use a value of 0 for val , since the setjmp caller could not then distinguish between returns via longjmp and setjmp returns. Standard C explicitly forbids longjmp to cause setjmp to return 0; SilverC does not yet have that restriction.



See Also