Lines Matching defs:mc
109 struct Console *mc;
113 mc = consptr; /* Use existing console */
117 mc = &myConsole;
122 mc->s = OpenScreenTagList(0, screentags);
123 if (!mc->s)
126 windowtags[1] = (u_int32_t)mc->s;
127 mc->w = OpenWindowTagList(0, windowtags);
128 if (!mc->w)
131 mc->cnmp = CreateMsgPort();
133 if (!mc->cnmp)
136 mc->cnior = (struct AmigaIO *)CreateIORequest(mc->cnmp, sizeof(struct AmigaIO));
137 if (!mc->cnior)
140 mc->cnior->buf = (void *)mc->w;
141 mc->cnior->length = 136; /* sizeof(struct Window) */
142 if (OpenDevice("console.device", 0, mc->cnior, 0)) {
152 if (OpenDevice("console.device", 0, mc->cnior, 0))
156 mc->tmior = (struct TimerIO *)CreateIORequest(mc->cnmp, sizeof(struct TimerIO));
157 if (!mc->tmior)
160 if (OpenDevice("timer.device", 0, (struct AmigaIO*)mc->tmior, 0))
171 ConsoleBase = mc;
176 if (mc->tmior)
177 DeleteIORequest(mc->tmior);
179 if (mc->cnior)
180 DeleteIORequest(mc->cnior);
182 if (mc->cnmp)
183 DeleteMsgPort(mc->cnmp);
185 if (mc->w)
186 CloseWindow(mc->w);
188 if (mc->s)
189 CloseScreen(mc->s);
201 struct Console *mc = ConsoleBase;
203 if (mc == NULL)
205 if (mc->tmior) {
206 CloseDevice((struct AmigaIO *)mc->tmior);
207 DeleteIORequest(mc->tmior);
210 if (mc->cnior) {
211 CloseDevice(mc->cnior);
212 DeleteIORequest(mc->cnior);
215 if (mc->cnmp)
216 DeleteMsgPort(mc->cnmp);
218 if (mc->w)
219 CloseWindow(mc->w);
221 if (mc->s)
222 CloseScreen(mc->s);
233 struct Console *mc = ConsoleBase;
236 mc->cnior->length = 1;
237 mc->cnior->buf = &buf;
238 mc->cnior->cmd = Cmd_Wr;
245 (void)DoIO(mc->cnior);
251 struct Console *mc = ConsoleBase;
253 mc->cnior->length = -1;
254 mc->cnior->buf = s;
255 mc->cnior->cmd = Cmd_Wr;
264 (void)DoIO(mc->cnior);
272 struct Console *mc = ConsoleBase;
278 mc->cnior->length = 1;
279 mc->cnior->buf = &c;
280 mc->cnior->cmd = Cmd_Rd;
282 SendIO(mc->cnior);
289 mc->tmior->cmd = Cmd_Addtimereq;
290 mc->tmior->secs = 0;
291 mc->tmior->usec = 100000;
292 SendIO((struct AmigaIO *)mc->tmior);
294 ior = WaitPort(mc->cnmp);
295 if (ior == mc->cnior) {
296 AbortIO((struct AmigaIO *)mc->tmior);
298 } else /* if (ior == mc->tmior) */ {
309 AbortIO((struct AmigaIO *)mc->cnior);
311 WaitIO((struct AmigaIO *)mc->tmior);
317 (void)WaitIO(mc->cnior);