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 #include <dos.h>
29 #include <stdio.h>
30 #include <ws.h>
31 #include <ws_error.h>
32 #include <ws_msg.h>
33 #include <ws_dcls.h>
34 #include <ws_fgb.h>
35 #include <cat.h>
36 #include <wsmincap.h>
37
38 #define HEADER_LENGTH 5
39
40 extern local_cat l_CAT[];
41 extern remote_cat r_CAT[];
42 extern char mysystem;
43
44 i_suspnd (p_suspend_message)
45
46 struct xcap_struc *p_suspend_message;
47 {
48 char *flags;
49 int cap_num;
50 int code;
51 struct input_msg message;
52
53
54
55 cap_num = p_suspend_message -> major - MIN_CAPABILITY_NUMBER;
56 if ((cap_num < 0) || (cap_num > NUMBER_OF_CAT_ENTRIES))
57 return(WSINVNUM);
58
59
60
61
62 if (p_suspend_message -> system == mysystem)
63 { if (l_CAT[cap_num].mcb_ptr == NULL)
64 return (WSINVNUM);
65 flags = &(l_CAT[cap_num].flags);
66 }
67 else
68 { if (r_CAT[cap_num].major_capability == 0)
69 return (WSINVNUM);
70 flags = &(r_CAT[cap_num].flags);
71 }
72
73
74
75 if (*flags & SUSPENDED_BIT)
76 return (WSSUSPND);
77
78
79
80 *flags |= SUSPENDED_BIT;
81 if (code = send_i_mess (p_suspend_message, HEADER_LENGTH, NULL, 0))
82 return (code);
83
84
85
86
87 if (p_suspend_message -> system == mysystem)
88 { message.system = WSMULTICS;
89 message.major = WSMAJCAP;
90 message.minor = SET_SUSPEND;
91 message.source_system = mysystem;
92 message.source_major = p_suspend_message -> major;
93 message.msg_data[0] = 0;
94 code = send_i_mess (&message, HEADER_LENGTH, NULL, 0);
95 }
96
97 return (code);
98 }