annotate 3rdparty/packages/uemacs/uedisplay2.c @ 3027:32a23a8c3332

Fix for all ide rbsuper descripters being set for drive 0
author chawks4
date Fri, 12 Dec 2014 20:48:42 -0600
parents 48c646212b1c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
995
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
1 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
2 * The functions in this file handle redisplay. There are two halves, the
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
3 * ones that update the virtual display screen, and the ones that make the
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
4 * physical display screen the same as the virtual display screen. These
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
5 * functions use hints that are left in the windows by the commands.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
6 *
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
7 * REVISION HISTORY:
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
8 *
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
9 * ? Steve Wilhite, 1-Dec-85
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
10 * - massive cleanup on code.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
11 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
12
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
13 #include <stdio.h>
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
14 #include "ueed.h"
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
15 #include "uedisplay.h"
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
16
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
17 extern VIDEO **vscreen; /* Virtual screen. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
18
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
19 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
20 * Redisplay the mode line for the window pointed to by the "wp". This is the
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
21 * only routine that has any idea of how the modeline is formatted. You can
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
22 * change the modeline format by hacking at this routine. Called by "update"
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
23 * any time there is a dirty window.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
24 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
25 modeline(wp)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
26 WINDOW *wp;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
27 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
28 register char *cp;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
29 register int c;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
30 register int n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
31 register BUFFER *bp;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
32
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
33 n = wp->w_toprow+wp->w_ntrows; /* Location. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
34 vscreen[n]->v_flag |= VFCHG; /* Redraw next time. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
35 vtmove(n, 0); /* Seek to right line. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
36 vtputc('-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
37 bp = wp->w_bufp;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
38
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
39 if ((bp->b_flag&BFCHG) != 0) /* "*" if changed. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
40 vtputc('*');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
41 else
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
42 vtputc('-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
43
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
44 n = 2;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
45 cp = " MicroEMACS -"; /* Buffer name. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
46
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
47 while ((c = *cp++) != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
48 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
49 vtputc(c);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
50 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
51 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
52
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
53 #ifndef OS9
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
54 cp = &bp->b_bname[0];
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
55
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
56 while ((c = *cp++) != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
57 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
58 vtputc(c);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
59 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
60 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
61
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
62 vtputc(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
63 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
64 #endif
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
65
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
66 if (bp->b_fname[0] != 0) /* File name. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
67 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
68 cp = " File: ";
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
69
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
70 while ((c = *cp++) != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
71 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
72 vtputc(c);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
73 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
74 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
75
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
76 cp = &bp->b_fname[0];
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
77
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
78 while ((c = *cp++) != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
79 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
80 vtputc(c);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
81 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
82 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
83
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
84 vtputc(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
85 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
86 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
87
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
88 #ifdef WFDEBUG
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
89 vtputc('-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
90 vtputc((wp->w_flag&WFMODE)!=0 ? 'M' : '-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
91 vtputc((wp->w_flag&WFHARD)!=0 ? 'H' : '-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
92 vtputc((wp->w_flag&WFEDIT)!=0 ? 'E' : '-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
93 vtputc((wp->w_flag&WFMOVE)!=0 ? 'V' : '-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
94 vtputc((wp->w_flag&WFFORCE)!=0 ? 'F' : '-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
95 n += 6;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
96 #endif
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
97
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
98 while (n < term.t_ncol) /* Pad to full width. */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
99 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
100 vtputc('-');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
101 ++n;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
102 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
103 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
104
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
105 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
106 * Send a command to the terminal to move the hardware cursor to row "row"
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
107 * and column "col". The row and column arguments are origin 0. Optimize out
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
108 * random calls. Update "ttrow" and "ttcol".
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
109 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
110 movecursor(row, col)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
111 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
112 if (row!=ttrow || col!=ttcol)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
113 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
114 ttrow = row;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
115 ttcol = col;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
116 (*term.t_move)(row, col);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
117 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
118 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
119
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
120 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
121 * Erase the message line. This is a special routine because the message line
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
122 * is not considered to be part of the virtual screen. It always works
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
123 * immediately; the terminal buffer is flushed via a call to the flusher.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
124 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
125 mlerase()
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
126 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
127 movecursor(term.t_nrow, 0);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
128 (*term.t_eeol)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
129 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
130 mpresf = FALSE;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
131 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
132
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
133 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
134 * Ask a yes or no question in the message line. Return either TRUE, FALSE, or
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
135 * ABORT. The ABORT status is returned if the user bumps out of the question
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
136 * with a ^G. Used any time a confirmation is required.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
137 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
138 mlyesno(prompt)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
139 char *prompt;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
140 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
141 register int s;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
142 char buf[64];
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
143
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
144 for (;;)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
145 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
146 strcpy(buf, prompt);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
147 strcat(buf, " [y/n]? ");
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
148 s = mlreply(buf, buf, sizeof(buf));
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
149
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
150 if (s == ABORT)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
151 return (ABORT);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
152
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
153 if (s != FALSE)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
154 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
155 if (buf[0]=='y' || buf[0]=='Y')
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
156 return (TRUE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
157
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
158 if (buf[0]=='n' || buf[0]=='N')
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
159 return (FALSE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
160 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
161 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
162 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
163
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
164 /*
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
165 * Write a prompt into the message line, then read back a response. Keep
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
166 * track of the physical position of the cursor. If we are in a keyboard
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
167 * macro throw the prompt away, and return the remembered response. This
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
168 * lets macros run at full speed. The reply is always terminated by a carriage
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
169 * return. Handle erase, kill, and abort keys.
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
170 */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
171 mlreply(prompt, buf, nbuf)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
172 char *prompt;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
173 char *buf;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
174 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
175 register int cpos;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
176 register int i;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
177 register int c;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
178
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
179 cpos = 0;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
180
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
181 if (kbdmop != NULL)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
182 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
183 while ((c = *kbdmop++) != '\0')
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
184 buf[cpos++] = c;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
185
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
186 buf[cpos] = 0;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
187
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
188 if (buf[0] == 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
189 return (FALSE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
190
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
191 return (TRUE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
192 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
193
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
194 mlwrite(prompt);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
195
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
196 for (;;)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
197 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
198 c = (*term.t_getchar)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
199
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
200 switch (c)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
201 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
202 case 0x0D: /* Return, end of line */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
203 buf[cpos++] = 0;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
204
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
205 if (kbdmip != NULL)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
206 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
207 if (kbdmip+cpos > &kbdm[NKBDM-3])
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
208 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
209 ctrlg(FALSE, 0);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
210 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
211 return (ABORT);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
212 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
213
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
214 for (i=0; i<cpos; ++i)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
215 *kbdmip++ = buf[i];
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
216 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
217
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
218 (*term.t_putchar)('\r');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
219 ttcol = 0;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
220 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
221
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
222 if (buf[0] == 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
223 return (FALSE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
224
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
225 return (TRUE);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
226
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
227 case 0x07: /* Bell, abort */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
228 (*term.t_putchar)('^');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
229 (*term.t_putchar)('G');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
230 ttcol += 2;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
231 ctrlg(FALSE, 0);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
232 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
233 return (ABORT);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
234
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
235 case 0x7F: /* Rubout, erase */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
236 case 0x08: /* Backspace, erase */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
237 if (cpos != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
238 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
239 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
240 (*term.t_putchar)(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
241 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
242 --ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
243
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
244 if (buf[--cpos] < 0x20)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
245 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
246 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
247 (*term.t_putchar)(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
248 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
249 --ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
250 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
251
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
252 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
253 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
254
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
255 break;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
256
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
257 case 0x15: /* C-U, kill */
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
258 while (cpos != 0)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
259 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
260 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
261 (*term.t_putchar)(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
262 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
263 --ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
264
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
265 if (buf[--cpos] < 0x20)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
266 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
267 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
268 (*term.t_putchar)(' ');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
269 (*term.t_putchar)('\b');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
270 --ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
271 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
272 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
273
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
274 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
275 break;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
276
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
277 default:
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
278 if (cpos < nbuf-1)
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
279 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
280 buf[cpos++] = c;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
281
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
282 if (c < ' ')
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
283 {
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
284 (*term.t_putchar)('^');
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
285 ++ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
286 c ^= 0x40;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
287 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
288
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
289 (*term.t_putchar)(c);
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
290 ++ttcol;
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
291 (*term.t_flush)();
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
292 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
293 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
294 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
295 }
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
296
48c646212b1c 'microEMACS' for OS-9.
roug
parents:
diff changeset
297