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