blob: 81247e78076ea50a5ff6523b134aa696134f8c05 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
*/
#include <stdio.h>
#define import_spp
#define import_kernel
#define import_knames
#include <iraf.h>
/*
* ZZDEBUG -- Test program for ZSVJMP/ZDOJMP. Will return "exit status 1"
* if it runs successfully.
*/
int jmpbuf[LEN_JUMPBUF];
int status;
main()
{
zsvjmp_((char *)jmpbuf, &status);
if (status) {
printf ("exit status %d\n", status);
exit (status);
}
a(1);
exit (0);
}
a(status)
int status;
{
ZDOJMP(jmpbuf, &status);
}
/* ZDOJMP -- Restore the saved processor context (non-local goto). See also
* as$zsvjmp.s, where most of the work is done.
*/
ZDOJMP (jmpbuf, status)
XINT *jmpbuf;
XINT *status;
{
*((int *)jmpbuf[0]) = *status;
longjmp (&jmpbuf[1], *status);
}
|