aboutsummaryrefslogtreecommitdiff
path: root/unix/os/zfunc.c
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/os/zfunc.c
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/os/zfunc.c')
-rw-r--r--unix/os/zfunc.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/unix/os/zfunc.c b/unix/os/zfunc.c
new file mode 100644
index 00000000..e2ce0a15
--- /dev/null
+++ b/unix/os/zfunc.c
@@ -0,0 +1,80 @@
+/* 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>
+
+/* ZFUNC[0-10] -- Call the function whose entry point address is pointed to
+ * by the first argument, which is the integer valued entry point address of
+ * the procedure as returned by ZLOCPR. Up to ten arguments are passed by
+ * reference to the called subprocedure. The integer function value is
+ * returned as the function value of the ZFUNC procedure (only integer
+ * functions are supported).
+ */
+
+XINT ZFUNC0 (XINT *proc)
+{
+ return (*(PFI)(*proc))();
+}
+XINT ZFUNC1 (XINT *proc, void *arg1)
+{
+ return (*(PFI)(*proc)) (arg1);
+}
+
+XINT ZFUNC2 (XINT *proc, void *arg1, void *arg2)
+{
+ return (*(PFI)(*proc)) (arg1, arg2);
+}
+
+XINT ZFUNC3 (XINT *proc, void *arg1, void *arg2, void *arg3)
+{
+ return (*(PFI)(*proc)) (arg1, arg2, arg3);
+}
+
+XINT ZFUNC4 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4)
+{
+ return (*(PFI)(*proc)) (arg1, arg2, arg3, arg4);
+}
+
+XINT ZFUNC5 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5)
+{
+ return (*(PFI)(*proc)) (arg1, arg2, arg3, arg4, arg5);
+}
+
+XINT ZFUNC6 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5, void *arg6)
+{
+ return (*(PFI)(*proc)) (arg1, arg2, arg3, arg4, arg5, arg6);
+}
+
+XINT ZFUNC7 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5, void *arg6, void *arg7)
+{
+ return (*(PFI)(*proc)) (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+XINT ZFUNC8 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5, void *arg6, void *arg7, void *arg8)
+{
+ return (*(PFI)(*proc))(arg1, arg2, arg3, arg4, arg5, arg6, arg7,
+ arg8);
+}
+
+XINT ZFUNC9 (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5, void *arg6, void *arg7, void *arg8, void *arg9)
+{
+ return (*(PFI)(*proc))(arg1, arg2, arg3, arg4, arg5, arg6, arg7,
+ arg8, arg9);
+}
+
+XINT ZFUNCA (XINT *proc, void *arg1, void *arg2, void *arg3, void *arg4,
+ void *arg5, void *arg6, void *arg7, void *arg8, void *arg9,
+ void *arg10)
+{
+ return (*(PFI)(*proc))(arg1, arg2, arg3, arg4, arg5, arg6, arg7,
+ arg8, arg9, arg10);
+}