aboutsummaryrefslogtreecommitdiff
path: root/unix/as.freebsd/zzdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/as.freebsd/zzdebug.c')
-rw-r--r--unix/as.freebsd/zzdebug.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/unix/as.freebsd/zzdebug.c b/unix/as.freebsd/zzdebug.c
new file mode 100644
index 00000000..81247e78
--- /dev/null
+++ b/unix/as.freebsd/zzdebug.c
@@ -0,0 +1,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);
+}