1 | #ifndef _IPC_H
|
---|
2 | #define _IPC_H
|
---|
3 |
|
---|
4 | /*==========================================================================*
|
---|
5 | * Types relating to messages. *
|
---|
6 | *==========================================================================*/
|
---|
7 |
|
---|
8 | #define M1 1
|
---|
9 | #define M3 3
|
---|
10 | #define M4 4
|
---|
11 | #define M3_STRING 14
|
---|
12 |
|
---|
13 | typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
|
---|
14 | typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
|
---|
15 | typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
|
---|
16 | typedef struct {long m4l1, m4l2, m4l3, m4l4, m4l5;} mess_4;
|
---|
17 | typedef struct {short m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
|
---|
18 | typedef struct {int m7i1, m7i2, m7i3, m7i4; char *m7p1, *m7p2;} mess_7;
|
---|
19 | typedef struct {int m8i1, m8i2; char *m8p1, *m8p2, *m8p3, *m8p4;} mess_8;
|
---|
20 |
|
---|
21 | typedef struct {
|
---|
22 | int m_source; /* who sent the message */
|
---|
23 | int m_type; /* what kind of message is it */
|
---|
24 | union {
|
---|
25 | mess_1 m_m1;
|
---|
26 | mess_2 m_m2;
|
---|
27 | mess_3 m_m3;
|
---|
28 | mess_4 m_m4;
|
---|
29 | mess_5 m_m5;
|
---|
30 | mess_7 m_m7;
|
---|
31 | mess_8 m_m8;
|
---|
32 | } m_u;
|
---|
33 | } message;
|
---|
34 |
|
---|
35 | /* The following defines provide names for useful members. */
|
---|
36 | #define m1_i1 m_u.m_m1.m1i1
|
---|
37 | #define m1_i2 m_u.m_m1.m1i2
|
---|
38 | #define m1_i3 m_u.m_m1.m1i3
|
---|
39 | #define m1_p1 m_u.m_m1.m1p1
|
---|
40 | #define m1_p2 m_u.m_m1.m1p2
|
---|
41 | #define m1_p3 m_u.m_m1.m1p3
|
---|
42 |
|
---|
43 | #define m2_i1 m_u.m_m2.m2i1
|
---|
44 | #define m2_i2 m_u.m_m2.m2i2
|
---|
45 | #define m2_i3 m_u.m_m2.m2i3
|
---|
46 | #define m2_l1 m_u.m_m2.m2l1
|
---|
47 | #define m2_l2 m_u.m_m2.m2l2
|
---|
48 | #define m2_p1 m_u.m_m2.m2p1
|
---|
49 |
|
---|
50 | #define m3_i1 m_u.m_m3.m3i1
|
---|
51 | #define m3_i2 m_u.m_m3.m3i2
|
---|
52 | #define m3_p1 m_u.m_m3.m3p1
|
---|
53 | #define m3_ca1 m_u.m_m3.m3ca1
|
---|
54 |
|
---|
55 | #define m4_l1 m_u.m_m4.m4l1
|
---|
56 | #define m4_l2 m_u.m_m4.m4l2
|
---|
57 | #define m4_l3 m_u.m_m4.m4l3
|
---|
58 | #define m4_l4 m_u.m_m4.m4l4
|
---|
59 | #define m4_l5 m_u.m_m4.m4l5
|
---|
60 |
|
---|
61 | #define m5_c1 m_u.m_m5.m5c1
|
---|
62 | #define m5_c2 m_u.m_m5.m5c2
|
---|
63 | #define m5_i1 m_u.m_m5.m5i1
|
---|
64 | #define m5_i2 m_u.m_m5.m5i2
|
---|
65 | #define m5_l1 m_u.m_m5.m5l1
|
---|
66 | #define m5_l2 m_u.m_m5.m5l2
|
---|
67 | #define m5_l3 m_u.m_m5.m5l3
|
---|
68 |
|
---|
69 | #define m7_i1 m_u.m_m7.m7i1
|
---|
70 | #define m7_i2 m_u.m_m7.m7i2
|
---|
71 | #define m7_i3 m_u.m_m7.m7i3
|
---|
72 | #define m7_i4 m_u.m_m7.m7i4
|
---|
73 | #define m7_p1 m_u.m_m7.m7p1
|
---|
74 | #define m7_p2 m_u.m_m7.m7p2
|
---|
75 |
|
---|
76 | #define m8_i1 m_u.m_m8.m8i1
|
---|
77 | #define m8_i2 m_u.m_m8.m8i2
|
---|
78 | #define m8_p1 m_u.m_m8.m8p1
|
---|
79 | #define m8_p2 m_u.m_m8.m8p2
|
---|
80 | #define m8_p3 m_u.m_m8.m8p3
|
---|
81 | #define m8_p4 m_u.m_m8.m8p4
|
---|
82 |
|
---|
83 | /*==========================================================================*
|
---|
84 | * Minix run-time system (IPC). *
|
---|
85 | *==========================================================================*/
|
---|
86 |
|
---|
87 | /* Hide names to avoid name space pollution. */
|
---|
88 | #define echo _echo
|
---|
89 | #define notify _notify
|
---|
90 | #define sendrec _sendrec
|
---|
91 | #define receive _receive
|
---|
92 | #define send _send
|
---|
93 | #define nb_receive _nb_receive
|
---|
94 | #define nb_send _nb_send
|
---|
95 |
|
---|
96 | _PROTOTYPE( int echo, (message *m_ptr) );
|
---|
97 | _PROTOTYPE( int notify, (int dest) );
|
---|
98 | _PROTOTYPE( int sendrec, (int src_dest, message *m_ptr) );
|
---|
99 | _PROTOTYPE( int receive, (int src, message *m_ptr) );
|
---|
100 | _PROTOTYPE( int send, (int dest, message *m_ptr) );
|
---|
101 | _PROTOTYPE( int nb_receive, (int src, message *m_ptr) );
|
---|
102 | _PROTOTYPE( int nb_send, (int dest, message *m_ptr) );
|
---|
103 |
|
---|
104 | #endif /* _IPC_H */
|
---|