diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-12-16 20:04:57 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-12-16 20:04:57 +0000 |
commit | 5a09a67a00e664c638ec75e42527b7be43e106e9 (patch) | |
tree | bdbaf1bcb1add1dcbe2614ec0bcd2eb2d63324dd /sys/compat | |
parent | 296c12c4b0ff928c16b41811ddd1edaddfb093e1 (diff) |
Implement more tty flags for better portability from other systems:
XCASE - canonical input/output processing
IUCLC - translate uppercase to lowercase on input
OLCUC - translate lowercase to uppercase on output
OCRNL - translate carriage return to newline on output
ONOCR - do not output carriage return at column 0
ONLRET - newline performs carriage return function
In addition the tty compatibility interface supports LCASE properly.
Look at termios(4) for a more complete description of the above flags.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/common/tty_43.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/sys/compat/common/tty_43.c b/sys/compat/common/tty_43.c index fd60b69c74d..765a63a236d 100644 --- a/sys/compat/common/tty_43.c +++ b/sys/compat/common/tty_43.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_43.c,v 1.4 1996/05/23 08:32:23 deraadt Exp $ */ +/* $OpenBSD: tty_43.c,v 1.5 1996/12/16 20:04:52 tholo Exp $ */ /* $NetBSD: tty_43.c,v 1.5 1996/05/20 14:29:17 mark Exp $ */ /*- @@ -307,6 +307,8 @@ ttcompatgetflags(tp) SET(flags, MDMBUF); if (!ISSET(cflag, HUPCL)) SET(flags, NOHANG); + if (ISSET(cflag, XCASE) && ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC)) + SET(flags, LCASE); if (ISSET(oflag, OXTABS)) SET(flags, XTABS); if (ISSET(lflag, ECHOE)) @@ -355,10 +357,20 @@ ttcompatsetflags(tp, t) SET(oflag, OXTABS); else CLR(oflag, OXTABS); + if (ISSET(flags, LCASE)) { + SET(iflag, IUCLC); + SET(oflag, OLCUC); + SET(cflag, XCASE); + } + else { + CLR(iflag, IUCLC); + CLR(oflag, OLCUC); + CLR(cflag, XCASE); + } if (ISSET(flags, RAW)) { - iflag &= IXOFF; + iflag &= IXOFF|IXANY; CLR(lflag, ISIG|ICANON|IEXTEN); CLR(cflag, PARENB); } else { @@ -390,7 +402,7 @@ ttcompatsetflags(tp, t) } if (ISSET(flags, RAW|LITOUT|PASS8)) { - CLR(cflag, CSIZE); + CLR(cflag, CSIZE|XCASE); SET(cflag, CS8); if (!ISSET(flags, RAW|PASS8)) SET(iflag, ISTRIP); @@ -403,6 +415,8 @@ ttcompatsetflags(tp, t) } else { CLR(cflag, CSIZE); SET(cflag, CS7); + if (ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC)) + SET(cflag, XCASE); SET(iflag, ISTRIP); SET(oflag, OPOST); } @@ -454,6 +468,11 @@ ttcompatsetlflags(tp, t) SET(iflag, IXANY); else CLR(iflag, IXANY); + if (ISSET(flags, LCASE)) { + SET(oflag, OLCUC); + SET(iflag, IUCLC); + SET(cflag, XCASE); + } CLR(lflag, TOSTOP|FLUSHO|PENDIN|NOFLSH); SET(lflag, ISSET(flags, TOSTOP|FLUSHO|PENDIN|NOFLSH)); @@ -466,13 +485,17 @@ ttcompatsetlflags(tp, t) CLR(iflag, ISTRIP); if (!ISSET(flags, RAW|LITOUT)) SET(oflag, OPOST); - else + else { CLR(oflag, OPOST); + CLR(cflag, XCASE); + } } else { CLR(cflag, CSIZE); SET(cflag, CS7); SET(iflag, ISTRIP); SET(oflag, OPOST); + if (ISSET(oflag, OLCUC) && ISSET(iflag, IUCLC)) + SET(cflag, XCASE); } t->c_iflag = iflag; |