2 * setjmp() and longjmp() example usage
9 static jmp_buf jmpbuffer
;
13 longjmp(jmpbuffer
, 1);
16 static void f1(int i
, int j
, int k
)
18 printf("in f1(): count = %d, val = %d, sum = %d\n", i
, j
, k
);
28 count
= 2; val
= 3; sum
= 4;
29 if (setjmp(jmpbuffer
) != 0) {
30 printf("after longjmp: count = %d, val = %d, sum = %d\n",
35 count
= 97; val
= 98; sum
= 99;
36 f1(count
, val
, sum
); /* never returns */