| 126 | */ |
| 127 | |
| 128 | void |
| 129 | CloseShWindow(struct Window *win) |
| 130 | { |
| 131 | struct IntuiMessage *msg; |
| 132 | |
| 133 | if (!HackPort) |
| 134 | panic("HackPort NULL in CloseShWindow"); |
| 135 | if (!win) |
| 136 | return; |
| 137 | |
| 138 | Forbid(); |
| 139 | /* Flush all messages for all windows to avoid typeahead and other |
| 140 | * similar problems... |
| 141 | */ |
| 142 | while (msg = (struct IntuiMessage *) GetMsg(win->UserPort)) |
| 143 | ReplyMsg((struct Message *) msg); |
| 144 | KbdBuffered = 0; |
| 145 | win->UserPort = (struct MsgPort *) 0; |
| 146 | ModifyIDCMP(win, 0L); |
| 147 | Permit(); |
| 148 | CloseWindow(win); |
| 149 | } |
| 150 | |
| 151 | static int |
| 152 | BufferGetchar(void) |
no test coverage detected