1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include <stdio.h>
22 #include <dos.h>
23 #include <wsmincap.h>
24 #include <cat.h>
25 #include <ws_msg.h>
26 #include <ws_error.h>
27
28 #define MESSAGE_HEADER_LENGTH 5
29
30 extern char mysystem;
31 extern local_cat l_cat[];
32 extern remote_cat r_cat[];
33
34 external_mowse (p_cat, p_message, p_message_len)
35
36 local_cat *p_cat;
37 char *p_message;
38 int p_message_len;
39 {
40 struct input_msg *message;
41
42 message = (struct input_msg *) p_message;
43
44
45
46 switch (message -> minor)
47 {
48 case TERMINATE_APPLICATION:
49
50 return (extern_terminate (p_cat, message, p_message_len));
51
52 case RESET_APPLICATION:
53
54 return (extern_reset (p_cat, p_message, p_message_len));
55
56 case SUSPEND_APPLICATION:
57
58 return (extern_suspend (p_cat, p_message, p_message_len));
59
60 case RESUME_APPLICATION:
61
62 return (extern_resume (p_cat, p_message, p_message_len));
63
64 default:
65
66 return (wsexecap (p_cat, p_message, p_message_len));
67 }
68 }
69
70
71
72
73
74
75 extern_reset (p_cat, p_message, p_message_len)
76
77 local_cat *p_cat;
78 struct input_msg *p_message;
79 int p_message_len;
80 {
81 struct input_msg message;
82
83
84
85 wsexecap (p_cat, p_message, p_message_len);
86
87
88
89 if (p_message -> source_system == mysystem)
90 { p_cat -> flags &= ~RESET_BIT;
91 return (0);
92 }
93
94 message.system = WSMULTICS;
95 message.major = WSMAJCAP;
96 message.minor = RESET_REPLY;
97 message.source_system = mysystem;
98 message.source_major = p_message -> major;
99 message.msg_data[0] = 0;
100
101 return (send_i_mess (&message, MESSAGE_HEADER_LENGTH, NULL, 0));
102 }
103
104
105
106
107
108
109
110
111
112
113
114
115
116 extern_suspend (p_cat, p_message, p_message_len)
117
118 local_cat *p_cat;
119 struct input_msg *p_message;
120 int p_message_len;
121 {
122 int major_sender;
123
124
125
126 p_cat -> flags |= SUSPENDED_BIT;
127
128
129
130 return (wsexecap (p_cat, p_message, p_message_len));
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145 extern_resume (p_cat, p_message, p_message_len)
146
147 local_cat *p_cat;
148 struct input_msg *p_message;
149 int p_message_len;
150 {
151 int major_sender;
152
153
154
155 p_cat -> flags &= ~SUSPENDED_BIT;
156
157
158
159 return (wsexecap (p_cat, p_message, p_message_len));
160 }
161
162
163
164
165
166
167 extern_terminate (p_cat, p_message, p_message_len)
168
169 local_cat *p_cat;
170 struct input_msg *p_message;
171 int p_message_len;
172 {
173
174 p_cat -> flags |= MCB_TERMINATE;
175 p_cat -> flags &= ~MCB_SUSPEND;
176
177 return (wsexecap (p_cat, p_message, p_message_len));
178 }