[net.micro.pc] need longjmp for microsoft c

grayson@uiucuxc.UUCP (01/10/85)

Does anyone have longjmp/setjmp written for microsoft lattice C?
I'd sure appreciate geting a version - there doesn't appear to 
be one provided with the package.

{ihnp4,pur-ee}!uiucdcs!uiucuxc!grayson

geller@rlgvax.UUCP (David Geller) (01/23/85)

> Does anyone have longjmp/setjmp written for microsoft lattice C?
> I'd sure appreciate geting a version - there doesn't appear to 
> be one provided with the package.
> 
> {ihnp4,pur-ee}!uiucdcs!uiucuxc!grayson

LATTICE C release 2.13 has the function setjmp and longjmp.

ret = setjmp (save);
longjmp (save,value);

int	ret;		return code
int	value;		return value
jmp_buf	save;

The setjmp function saves the current stack mark in the buffer area specified
by save and returns a value of 0. Then a later call to longjmp will return to
the next statement after the original setjmp call with value as the return
code. If value is 0, it is forced to 1 by longjmp.

The jmp_buf descriptor is defined in the header file called setjmp.h.

This mechanism is useful for quickly popping back up through multiple layers
of function calls under exceptional circumstances.

(All text taken from page 33 of Lattice's supplement for version 2.10)

I'd recommend you pick up the latest release (2.14) so you can take
advantage of their new features.

						David P. Geller
						{seismo}!rlgvax!geller