1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 /* HISTORY COMMENTS:
10   1) change(86-10-29,Flegel), approve(87-07-13,MCR7580),
11      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
12      Created.
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (termcap)
16 
17 Send a TERMINATE_APPLICATION minor cap to the specified capability.
18 */
19 
20 #include <stdio.h>
21 #include <ws.h>
22 #include <wsmincap.h>
23 #include <ws_mcb.h>
24 #include <ws_error.h>
25 
26 #define BYTE_SHIFT 8
27 
28 termcap (cap_num,mcb_ptr)
29 
30 int cap_num;                           /* Capability to terminate */
31 mcb *mcb_ptr;                          /* MCB of caller */
32 {
33 int sysid;
34 int major;
35 
36 /* : call execap to send message to application */
37 
38    sysid = ((cap_num & 0xff00) >> BYTE_SHIFT);
39    major = (cap_num & 0xff);
40 
41    if (mcb_ptr == NULL)
42       return (WSINVMCB);
43 
44    if ((sysid != WSMULTICS) && (sysid != WSIBMPC))
45       return(WSINVSYS);
46 
47    if ((major < WSMAJCAP) && (major > MAX_CAPABILITY_NUMBER))
48       return(WSINVNUM);
49 
50    return (execap (cap_num, TERMINATE_APPLICATION, NULL, 0, mcb_ptr));
51 }