1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 
10 /* HISTORY COMMENTS:
11   1) change(86-09-27,ASmith), approve(87-07-13,MCR7580),
12      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
13      Created.
14                                                    END HISTORY COMMENTS */
15 
16 /* : PROCEDURE FUNCTION (suspend)
17 
18 Tells MOWSE to suspend the specified application.  The suspended application
19 is notified by the dedicated minor capability SUSPEND_APPLICATION and will
20 not be allowed to send or receive messages.
21 */
22 
23 /* : NOTES
24 
25 A call to the mowse library routine 'resume' by some other application is
26 required to allow the application suspended to send and receive messages.
27 */
28 
29 #include <stdio.h>
30 #include <ws.h>
31 #include <wsmincap.h>
32 #include <ws_mcb.h>
33 #include <ws_dcls.h>
34 #include <ws_func.h>
35 #include <ws_error.h>
36 
37 extern char local_system;
38 
39 suspend (major_number, mcb_ptr)
40 
41 int major_number;
42 mcb *mcb_ptr;
43 {
44 int code;                              /* return code */
45 int system;                            /* Temp system id */
46 int major;                             /* Temp major number */
47 struct xcap_struc suspend_message;     /* MOWSE parameters */
48 
49 /* : Verify the validity of the caller */
50 
51    if (mcb_ptr == NULL)
52       return (WSINVMCB);
53 
54    if (code = c_unpack (&system, &major, major_number))
55       return (code);
56 
57 
58 /* : Send the message */
59 
60    suspend_message.system        = system;
61    suspend_message.major         = major;
62    suspend_message.minor         = SUSPEND_APPLICATION;
63    suspend_message.source_system = mcb_ptr -> system_id;
64    suspend_message.source_major  = mcb_ptr -> major_capability;
65    return (call_mowse_int (I$SUSPEND, &suspend_message , sizeof (suspend_message)));
66 }
67 ^Z