5 /* defined by the blocks */
6 typedef struct _local_states *LocalState;
8 /* process functions */
9 struct _DOLProcess_struct;
10 typedef void (*ProcessInit)(struct _DOLProcess_struct*);
11 typedef int (*ProcessFire)(struct _DOLProcess_struct*);
18 typedef struct _DOL_wptr *WPTR;
21 typedef struct _DOLProcess_struct {
28 /* DOL-specific functions */
29 int DOL_read (void*, void*, int, DOLProcess*);
30 int DOL_write(void*, void*, int, DOLProcess*);
31 int DOL_rtest(void*, int, DOLProcess*);
32 int DOL_wtest(void*, int, DOLProcess*);
33 void DOL_detach(DOLProcess*);
34 #define GETINDEX(dim) DOL_get_index(dim, p)
35 int DOL_get_index(int, DOLProcess*);
38 #define PORTNAME_MAXLEN 64
39 #define CREATEPORTVAR(name) char name[PORTNAME_MAXLEN]
41 #define CREATEPORT_FUNCTION(_1, _2, _3, _4, _5, \
42 _6, _7, _8, _9, _10, _11, NAME, ...) NAME
43 #define CREATEPORT(...) CREATEPORT_FUNCTION(__VA_ARGS__, \
44 CREATEPORT_4, CREATEPORT_BAD_PARAMETERS, \
45 CREATEPORT_3, CREATEPORT_BAD_PARAMETERS, \
46 CREATEPORT_2, CREATEPORT_BAD_PARAMETERS, \
47 CREATEPORT_1, CREATEPORT_BAD_PARAMETERS, \
48 CREATEPORT_BAD_PARAMETERS, CREATEPORT_BAD_PARAMETERS, \
49 CREATEPORT_BAD_PARAMETERS, CREATEPORT_BAD_PARAMETERS)(__VA_ARGS__)
51 #define CREATEPORT_1(port, base, ndim, i0, r0) \
52 DOL_create_port(port, base, ndim, i0, r0, 0, 0, 0, 0, 0, 0)
54 #define CREATEPORT_2(port, base, ndim, i0, r0, i1, r1) \
55 DOL_create_port(port, base, ndim, i0, r0, i1, r1, 0, 0, 0, 0)
57 #define CREATEPORT_3(port, base, ndim, i0, r0, i1, r1, i2, r2) \
58 DOL_create_port(port, base, ndim, i0, r0, i1, r1, i2, r2, 0, 0)
60 #define CREATEPORT_4(port, base, ndim, i0, r0, i1, r1, i2, r2, i3, r3) \
61 DOL_create_port(port, base, ndim, i0, r0, i1, r1, i2, r2, i3, r3)
63 char* DOL_create_port(char*, char*, int,
64 int, int, int, int, int, int, int, int);