summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authoritojun <itojun@FreeBSD.org>1997-09-26 15:27:55 +0000
committeritojun <itojun@FreeBSD.org>1997-09-26 15:27:55 +0000
commit95dce19a99fbbb322691af840f4c3633d9408fee (patch)
treeb1d0a2516284d352b4e09c67c44e15b150f578f1 /sys/dev/syscons
parent2a21c9d1182fd8f7ca84cdde39bf6324f971b43e (diff)
downloadFreeBSD-src-95dce19a99fbbb322691af840f4c3633d9408fee.zip
FreeBSD-src-95dce19a99fbbb322691af840f4c3633d9408fee.tar.gz
tiny update of ESC sequence parser.
- some addition of comments (for readability) - iso-2022 G0 designation support. This does almost nothing. Just for avoiding garbled screen when got "ESC ( B". (how about G1/2/3 designation? I'm not sure)
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/syscons.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index d9fe634..fa0c28a 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.231 1997/09/04 23:01:03 yokota Exp $
+ * $Id: syscons.c,v 1.232 1997/09/14 03:19:27 peter Exp $
*/
#include "sc.h"
@@ -2007,7 +2007,7 @@ scan_esc(scr_stat *scp, u_char c)
int i, n;
u_short *src, *dst, count;
- if (scp->term.esc == 1) {
+ if (scp->term.esc == 1) { /* seen ESC */
switch (c) {
case '7': /* Save cursor position */
@@ -2042,14 +2042,18 @@ scan_esc(scr_stat *scp, u_char c)
#if notyet
case 'Q':
scp->term.esc = 4;
- break;
+ return;
#endif
case 'c': /* Clear screen & home */
clear_screen(scp);
break;
+
+ case '(': /* iso-2022: designate 94 character set to G0 */
+ scp->term.esc = 5;
+ return;
}
}
- else if (scp->term.esc == 2) {
+ else if (scp->term.esc == 2) { /* seen ESC [ */
if (c >= '0' && c <= '9') {
if (scp->term.num_param < MAX_ESC_PAR) {
if (scp->term.last_param != scp->term.num_param) {
@@ -2420,7 +2424,7 @@ scan_esc(scr_stat *scp, u_char c)
break;
}
}
- else if (scp->term.esc == 3) {
+ else if (scp->term.esc == 3) { /* seen ESC [0-9]+ = */
if (c >= '0' && c <= '9') {
if (scp->term.num_param < MAX_ESC_PAR) {
if (scp->term.last_param != scp->term.num_param) {
@@ -2522,6 +2526,20 @@ scan_esc(scr_stat *scp, u_char c)
break;
}
}
+#if notyet
+ else if (scp->term.esc == 4) { /* seen ESC Q */
+ /* to be filled */
+ }
+#endif
+ else if (scp->term.esc == 5) { /* seen ESC ( */
+ switch (c) {
+ case 'B': /* iso-2022: desginate ASCII into G0 */
+ break;
+ /* other items to be filled */
+ default:
+ break;
+ }
+ }
scp->term.esc = 0;
}
OpenPOWER on IntegriCloud