aboutsummaryrefslogtreecommitdiff
path: root/unix/os/zfunc.c
blob: e2ce0a15b1cb7caa3296fcd3fe1e3b9213d09246 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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);
}