1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include <dos.h>
25 #include <cat.h>
26 #include <ws_dcls.h>
27 #include <ws_error.h>
28 #include <ws_msg.h>
29 #include <wsmincap.h>
30
31 #define NULL 0
32
33 extern local_cat l_CAT[];
34 extern char mysystem;
35 extern local_cat *sleepq;
36
37 i_desins (param)
38
39 struct destinst_param_struct *param;
40 {
41 int cap_index;
42 struct alter_cat_msg alter_cat;
43 local_cat *catp;
44 int code;
45
46
47
48
49 cap_index = param -> cap_index;
50 if ((cap_index < 0) || (cap_index >= NUMBER_OF_CAT_ENTRIES))
51 return(WSINVMCB);
52 if (l_CAT[cap_index].mcb_ptr == NULL)
53 return(WSINVMCB);
54 if (l_CAT[cap_index].mcb_ptr != param -> mcb_ptr)
55 return(WSINVMCB);
56
57
58
59
60 l_CAT[cap_index].mcb_ptr = NULL;
61
62 for (catp = sleepq; catp != NULL; catp = catp -> next_cat)
63 { if (catp -> next_cat == &(l_CAT[cap_index]))
64 { catp -> next_cat = catp -> next_cat -> next_cat;
65 break;
66 }
67 }
68
69
70
71 alter_cat.system = WSMULTICS;
72 alter_cat.major = WSMAJCAP;
73 alter_cat.minor = WS_DELETE_FROM_RAT;
74 alter_cat.source_system = mysystem;
75 alter_cat.source_major = WSMAJCAP;
76 alter_cat.rat_major = cap_index + MIN_CAPABILITY_NUMBER;
77
78 code = send_i_mess (&alter_cat, sizeof(alter_cat) - 2,NULL,0);
79
80
81
82 if (!(l_CAT[cap_index].flags & NULL_BIT))
83 free_cat_program (&l_CAT[cap_index]);
84
85 return (code);
86 }