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-06-13,Westcott), 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 (wssleep):
16 
17 Requests MOWSE to suspend the application for a fixed period of time. While
18 the application is sleeping, all messages received from other applications
19 (except MOWSE) will be ignored. Mowse will send a message to the remote
20 system(s) to inform them that the application is sleeping.  The sleeping
21 application will be awakened by the minor capability WAKE_UP when the time has
22 expired.
23 */
24 
25 /* : RETURNS:
26 
27      0, if message sent
28      WSINVNUM, if capability number is invalid
29      WSNOSPND, if capability is not currently suspended
30 */
31 
32 #include <stdio.h>
33 #include <ws.h>
34 #include <wsmincap.h>
35 #include <ws_mcb.h>
36 #include <ws_dcls.h>
37 #include <ws_func.h>
38 #include <ws_error.h>
39 
40 extern char local_system;
41 
42 wssleep (time, mcb_ptr)
43 int time;
44 mcb *mcb_ptr;
45 {
46 struct sleep_struc sleep_data; /* structure to hold sleep request */
47 
48 /* : Check that the sleep time is valid */
49    if (time <= 0)
50       return (WSINVTIM);
51 
52 /* :  Send sleep request to MOWSE */
53    sleep_data.time = time;
54    sleep_data.source_system = mcb_ptr -> system_id;
55    sleep_data.source_major  = mcb_ptr -> major_capability;
56    sleep_data.minor = WS_SET_SLEEP_FLAG;
57 
58    return (call_mowse_int (I$SLEEP, &sleep_data , sizeof (sleep_data)));
59 
60 /* : END */
61 }
62 ^@