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 <stdio.h>
30 #include <dos.h>
31 #include <ws.h>
32 #include <alloc.h>
33 #include <ws_mcb.h>
34 #include <cat.h>
35 #include <ws_fgb.h>
36 #include <ws_msg.h>
37 #include <wsmincap.h>
38
39 extern local_cat *sleepq;
40 extern local_cat l_CAT[];
41 extern char mysystem;
42 extern struct allocstr *lcaptr;
43
44 wakeup ()
45 {
46 struct null_msg exerep;
47 struct input_msg *msg_ptr;
48 struct fgbstr *bufp;
49 local_cat *catp;
50 char *p1;
51 int i;
52 char major;
53
54
55 unsigned int wstime();
56 char *wsalloc();
57
58
59
60
61
62
63 catp = sleepq;
64 while (catp != NULL)
65
66
67
68 { if (catp -> sleep_time > wstime())
69 return (0);
70
71
72
73
74 major = (char)((((int)catp - (int)l_CAT) / sizeof (local_cat)) + MIN_CAPABILITY_NUMBER);
75
76
77
78 bufp = (struct fgbstr *) wsalloc (lcaptr,sizeof(struct fgbstr)+sizeof(struct input_msg)-1);
79 if (bufp == NULL)
80 return (0);
81
82
83
84 exerep.system = WSMULTICS;
85 exerep.major = WSMAJCAP;
86 exerep.source_major = major;
87 exerep.source_system = mysystem;
88 exerep.minor = WS_RESET_SLEEP_FLAG;
89 send_i_mess(&exerep, sizeof(struct null_msg) - 1, NULL, 0);
90
91
92
93 bufp -> fgb_length = sizeof (struct input_msg);
94 bufp -> fgb_next = NULL;
95
96 msg_ptr = (struct input_msg *) &bufp -> fgb_char[0];
97 msg_ptr -> system = mysystem;
98 msg_ptr -> major = major;
99 msg_ptr -> minor = WAKE_UP;
100 msg_ptr -> source_system = mysystem;
101 msg_ptr -> source_major = WSMAJCAP;
102
103
104
105 catp -> flags &= ~SLEEPING_BIT;
106 catp -> sleep_time = 0;
107 sleepq = catp -> next_cat;
108 catp -> next_cat = NULL;
109
110
111
112 external_mowse (catp, msg_ptr, sizeof(struct input_msg)-1);
113 wsfree (lcaptr, bufp);
114
115
116
117 catp = sleepq;
118 }
119 return (0);
120 }
121 ^Z