TODO: really early version... doesn't match quite well... much to do
This commit is contained in:
parent
989096c9d4
commit
6c214e73e5
|
|
@ -1,6 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/state.h>
|
#include <sys/state.h>
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
|
|
@ -18,97 +15,219 @@
|
||||||
|
|
||||||
extern putcb();
|
extern putcb();
|
||||||
|
|
||||||
ttioctl(tp, com, arg)
|
ttin(tp, c, count)
|
||||||
|
|
||||||
register struct tty *tp;
|
register struct tty *tp;
|
||||||
int com;
|
long c;
|
||||||
long arg;
|
int count;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
ushort ldmode;
|
register ushort ch;
|
||||||
|
register ushort mode;
|
||||||
|
register char *cp;
|
||||||
|
char *csp;
|
||||||
|
|
||||||
if (com !=(short) LDCHG) return;
|
extern tttimeo();
|
||||||
ldmode = tp->t_lflag ^ arg;
|
|
||||||
if (!(ldmode & ICANON)) return;
|
|
||||||
dvi();
|
|
||||||
if (tp->t_canq.c_cc){
|
|
||||||
if (tp->t_rawq.c_cc){
|
|
||||||
tp->t_canq.c_cc += tp->t_rawq.c_cc;
|
|
||||||
tp->t_canq.c_cl->c_next = tp->t_rawq.c_cf;
|
|
||||||
tp->t_outq.c_cf = tp->t_rawq.c_cl;
|
|
||||||
}
|
|
||||||
tp->t_rawq = tp->t_canq;
|
|
||||||
tp->t_canq = ttnulq;
|
|
||||||
}
|
|
||||||
tp->t_delct = tp->t_rawq.c_cc;
|
|
||||||
evi();
|
|
||||||
}
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/state.h>
|
|
||||||
#include <sys/conf.h>
|
|
||||||
#include <sys/dir.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/tty.h>
|
|
||||||
#include <sys/ttold.h>
|
|
||||||
#include <sys/sysinfo.h>
|
|
||||||
#include <sys/proc.h>
|
|
||||||
#include <sys/inode.h>
|
|
||||||
#include <sys/mmu.h>
|
|
||||||
#include <sys/s.out.h>
|
|
||||||
#include <sys/user.h>
|
|
||||||
|
|
||||||
|
mode = tp->t_iflag;
|
||||||
ttout(tp)
|
if (count){
|
||||||
|
if (count == 1)
|
||||||
register struct tty *tp;
|
goto L214;
|
||||||
{
|
putcb(c, tp);
|
||||||
return;
|
sysinfo.rawch += count;
|
||||||
}
|
cp = &c->c_data[c->c_first];
|
||||||
|
L5a:
|
||||||
|
if (tp->t_rawq.c_cc <= TTXOHI) { /* 3 */
|
||||||
extern timeout();
|
L62:
|
||||||
tttimeout(tp)
|
mode = tp->t_lflag;
|
||||||
|
if ((tp->t_state & IEXTPROC) ||
|
||||||
register struct tty *tp;
|
(mode == 0)){ /* 4,5 */
|
||||||
|
if (!(mode & ICANON)){/* 6 */
|
||||||
{
|
tp->t_state &= ~RTO;
|
||||||
|
if (tp->t_cc[VMIN] <= tp->t_rawq.c_cc) /* 7 */
|
||||||
tp->t_state &= ~TACT; /* timeout waiting on rawq */
|
|
||||||
if (tp->t_lflag & ICANON) return; /* enable canonicalization */
|
|
||||||
if (tp->t_cc[VTIME] == 0) return; /* time out */
|
|
||||||
if (( tp->t_rawq.c_cc == 0) && (tp->t_cc[VMIN])) return;
|
|
||||||
if (tp->t_state & RTO){ /* timeout waiting on rawq */
|
|
||||||
tp->t_delct = 1;
|
tp->t_delct = 1;
|
||||||
if (!(tp->t_state & IASLP)) return; /* wakeup when input done */
|
else
|
||||||
|
if ((tp->t_cc[VTIME]) &&
|
||||||
|
((tp->t_state & TACT) == 0)) /* 72,73 */
|
||||||
|
ttimeout(tp);
|
||||||
|
if ((tp->t_delct) == 0) return; /* 74 */
|
||||||
|
}
|
||||||
|
if (tp->t_state & IASLP) { /* 75 */
|
||||||
tp->t_state &= ~IASLP;
|
tp->t_state &= ~IASLP;
|
||||||
wakeup(tp);
|
wakeup(tp);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tp->t_state |= (RTO | TACT);
|
if (count--){ /* 67 */
|
||||||
timeout(tttimeout, tp, tp->t_cc[VTIME] * 6);
|
ch = *cp++;
|
||||||
|
mode = tp->t_lflag;
|
||||||
|
if (!(mode & ISIG)){ /* 68 */
|
||||||
|
L494:
|
||||||
|
if (mode & ICANON){ /* 69 */
|
||||||
|
if (ch == '\n'){ /* 70 */
|
||||||
|
if (mode & ECHONL)
|
||||||
|
mode |= ECHO;
|
||||||
|
tp->t_delct++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (ch == tp->t_cc[VEOL])
|
||||||
|
tp->t_delct++;
|
||||||
|
if ((tp->t_state & ESC) == 0){ /* 50 */
|
||||||
|
if (ch == '\\')
|
||||||
|
tp->t_state |= ESC;
|
||||||
|
if ((ch == tp->t_cc[VERASE]) &&
|
||||||
|
(mode & INPCK)){ /* 52,53 */
|
||||||
|
if (mode & ECHO) /* 54 */
|
||||||
|
ttxput(tp, (long) CERASE, 0);
|
||||||
|
mode |= ECHO;
|
||||||
|
ttxput(tp, (long) ' ', 0);
|
||||||
|
ch = CERASE;
|
||||||
|
} /* von 52,53 */
|
||||||
|
else if ((ch == tp->t_cc[VKILL]) &&
|
||||||
|
(mode & ISTRIP)){ /* 55,56 */
|
||||||
|
if ((mode & ECHO) &&
|
||||||
|
(mode & ISPCI)){ /* 57,58 */
|
||||||
|
for ( csp = &"???"; (*csp);)
|
||||||
|
ttxput(tp, (long) *csp++, 0);
|
||||||
|
(*tp->t_proc)(tp, T_OUTPUT);
|
||||||
|
}
|
||||||
|
ttxput(tp, (long) ch, 0);
|
||||||
|
mode |= ECHO;
|
||||||
|
ch = '\n';
|
||||||
|
}
|
||||||
|
else if (ch != tp->t_cc[VEOF]) /* 60 */
|
||||||
|
if ((mode & ECHO) &&
|
||||||
|
(mode & ISPCI)){ /* 61,62 */
|
||||||
|
for ( csp = &"(eof)"; (*csp);)
|
||||||
|
ttxput(tp, (long) *csp++, 0);
|
||||||
|
(*tp->t_proc)(tp, T_OUTPUT);
|
||||||
|
}
|
||||||
|
mode &= ~ECHO;
|
||||||
|
tp->t_delct++;
|
||||||
|
}
|
||||||
|
else if ((ch == '\\') ||
|
||||||
|
(mode & XCASE)) /* 64,65 */
|
||||||
|
tp->t_state &= ~RTO;
|
||||||
|
}
|
||||||
|
if (mode & ECHO) /* 66 */
|
||||||
|
ttxput(tp, (long) ch, 0);
|
||||||
|
(*tp->t_proc)(tp, T_OUTPUT);
|
||||||
|
} /* von 68 */
|
||||||
|
else {
|
||||||
|
if (ch != tp->t_cc[VINTR]){ /* 43 */
|
||||||
|
if (ch == tp->t_cc[VQUIT]) /* 44 */
|
||||||
|
goto L494;
|
||||||
|
if (!(mode & NOFLSH))
|
||||||
|
ttyflush(tp, T_RESUME);
|
||||||
|
if ((mode & ECHO) ||
|
||||||
|
(mode & ISPCI)){ /* 46,47 */
|
||||||
|
for ( csp = &"(quit)"; (*csp); csp++)
|
||||||
|
ttxput(tp,(long) *csp, 0);
|
||||||
|
(*tp->t_proc)(tp, T_OUTPUT);
|
||||||
|
} /* von 43 */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!(mode & NOFLSH))
|
||||||
|
ttyflush(tp, T_RESUME);
|
||||||
|
if ((mode & ECHO) &&
|
||||||
|
(mode & ISPCI)) /* 40,41 */{
|
||||||
|
for ( csp = &"(intr)"; (*csp); csp++)
|
||||||
|
ttxput(tp, (long) *csp, 0);
|
||||||
|
(*tp->t_proc)(tp, T_OUTPUT);
|
||||||
|
} /* von 40,41 */
|
||||||
|
}
|
||||||
|
} /* von 68 else */
|
||||||
|
} /* von 67 */
|
||||||
|
if (!(mode & ICANON)){ /* 6 */
|
||||||
|
if (tp->t_cc[VMIN] <= tp->t_rawq.c_cc)
|
||||||
|
tp->t_delct = 1;
|
||||||
|
if ((tp->t_cc[VTIME]) &&
|
||||||
|
((tp->t_state & TACT) == 0))
|
||||||
|
meout(tp);
|
||||||
|
} /* von 6 */
|
||||||
|
if ((tp->t_delct) &&
|
||||||
|
(tp->t_state & IASLP)){ /* 74,75 */
|
||||||
|
tp->t_state &= ~IASLP;
|
||||||
|
wakeup(tp);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} /* von 3 */
|
||||||
|
else {
|
||||||
|
if ((mode & IXOFF)&&
|
||||||
|
(tp->t_state & TBLOCK)) /* 8,9 */
|
||||||
|
(*tp->t_proc)(tp, T_BLOCK);
|
||||||
|
if (tp->t_rawq.c_cc <= TTYHOG) /* 10 */
|
||||||
|
goto L62;
|
||||||
|
else
|
||||||
|
ttyflush(tp, T_TIME);
|
||||||
|
return;
|
||||||
|
} /* 3 von else */
|
||||||
|
} /* von 1 */
|
||||||
|
else {
|
||||||
|
count++;
|
||||||
|
ch = c.half.left;
|
||||||
|
if ((ch & IXOFF) &&
|
||||||
|
(!(mode & INPCK))) /* 13,14 */
|
||||||
|
ch &= ~PERROR;
|
||||||
|
if (ch & (OVERRUN | FRERROR | PERROR)){ /* 15 */
|
||||||
|
if (ch & 0xff){ /* 16 */
|
||||||
|
if (mode & IGNPAR) return;
|
||||||
|
if (mode & IGNBRK) return;
|
||||||
|
if (mode & BRKINT){ /* 12 */
|
||||||
|
signal(tp->t_pgrp, SIGINT);
|
||||||
|
ttyflush(tp, T_RESUME);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} /* von 16 */
|
||||||
|
if (mode & PARMRK){ /* 18 */
|
||||||
|
ttin(tp, (long) 0xff, 1);
|
||||||
|
ttin(tp, (long) 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ch = 0;
|
||||||
|
ch |= ICRNL;
|
||||||
|
} /* von 15 */
|
||||||
|
else {
|
||||||
|
if (mode & ISTRIP) /* 23 */
|
||||||
|
ch &= 0x7f;
|
||||||
|
else
|
||||||
|
if (((ch & 0xff)== 0xff) &&
|
||||||
|
(mode & PARMRK) &&
|
||||||
|
(putc( 0xff, tp))) /* 24,25,26 */ return;
|
||||||
|
}
|
||||||
|
if (mode & IXON){ /* 19 */
|
||||||
|
if (tp->t_state & TTSTOP)
|
||||||
|
if ((ch == CSTART) ||
|
||||||
|
(mode & IXANY)) /* 21,22 */
|
||||||
|
(*tp->t_proc)(tp, T_RESUME);
|
||||||
|
if (ch == CSTART) return;
|
||||||
|
if (ch == CSTOP) return;
|
||||||
|
}
|
||||||
|
if ((ch == '\n')&&
|
||||||
|
(mode & INLCR)) /* 30,31 */
|
||||||
|
c = '\r';
|
||||||
|
else {
|
||||||
|
if (c == 0xd){ /* 32 */
|
||||||
|
if (mode & IGNCR) return;
|
||||||
|
if (mode & ICRNL)
|
||||||
|
c = '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mode & IUCLC) /* 35 */
|
||||||
|
c = toupper(c);
|
||||||
|
L214:
|
||||||
|
if (putc(c, tp)){/* 38 */
|
||||||
|
sysinfo.rawch++;
|
||||||
|
cp = &lobyte(c.half.right);
|
||||||
|
goto L5a;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/state.h>
|
|
||||||
#include <sys/conf.h>
|
|
||||||
#include <sys/dir.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/tty.h>
|
|
||||||
#include <sys/ttold.h>
|
|
||||||
#include <sys/sysinfo.h>
|
|
||||||
#include <sys/proc.h>
|
|
||||||
#include <sys/inode.h>
|
|
||||||
#include <sys/mmu.h>
|
|
||||||
#include <sys/s.out.h>
|
|
||||||
#include <sys/user.h>
|
|
||||||
|
|
||||||
extern char partab[];
|
extern char partab[];
|
||||||
|
|
||||||
ttxput(tp, arg, count)
|
ttxput(tp, arg, count)
|
||||||
|
|
||||||
register struct tty *tp;
|
register struct tty *tp;
|
||||||
union {
|
union {
|
||||||
long c;
|
long c;
|
||||||
|
|
@ -307,228 +426,62 @@ crdly:
|
||||||
putcf(cbp);
|
putcf(cbp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ttout(tp)
|
||||||
|
register struct tty *tp;
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/state.h>
|
extern timeout();
|
||||||
#include <sys/conf.h>
|
tttimeout(tp)
|
||||||
#include <sys/dir.h>
|
register struct tty *tp;
|
||||||
#include <sys/file.h>
|
{
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/tty.h>
|
tp->t_state &= ~TACT; /* timeout waiting on rawq */
|
||||||
#include <sys/ttold.h>
|
if (tp->t_lflag & ICANON) return; /* enable canonicalization */
|
||||||
#include <sys/sysinfo.h>
|
if (tp->t_cc[VTIME] == 0) return; /* time out */
|
||||||
#include <sys/proc.h>
|
if (( tp->t_rawq.c_cc == 0) && (tp->t_cc[VMIN])) return;
|
||||||
#include <sys/inode.h>
|
if (tp->t_state & RTO){ /* timeout waiting on rawq */
|
||||||
#include <sys/mmu.h>
|
tp->t_delct = 1;
|
||||||
#include <sys/s.out.h>
|
if (!(tp->t_state & IASLP)) return; /* wakeup when input done */
|
||||||
#include <sys/user.h>
|
tp->t_state &= ~IASLP;
|
||||||
|
wakeup(tp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tp->t_state |= (RTO | TACT);
|
||||||
|
timeout(tttimeout, tp, tp->t_cc[VTIME] * 6);
|
||||||
|
}
|
||||||
|
|
||||||
extern putcb();
|
extern putcb();
|
||||||
|
|
||||||
ttin(tp, c, count)
|
ttioctl(tp, com, arg)
|
||||||
|
|
||||||
register struct tty *tp;
|
register struct tty *tp;
|
||||||
long c;
|
int com;
|
||||||
int count;
|
long arg;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
register ushort ch;
|
ushort ldmode;
|
||||||
register ushort mode;
|
|
||||||
register char *cp;
|
|
||||||
char *csp;
|
|
||||||
|
|
||||||
mode = tp->t_iflag;
|
switch(com) {
|
||||||
if (count){
|
case LDCHG:
|
||||||
if (count == 1)
|
ldmode = tp->t_lflag ^ arg;
|
||||||
goto L214;
|
if (!(ldmode & ICANON))
|
||||||
putcb(c, tp);
|
break;
|
||||||
sysinfo.rawch += count;
|
dvi();
|
||||||
cp = &c->c_data[c->c_first];
|
if (tp->t_canq.c_cc){
|
||||||
L5a:
|
if (tp->t_rawq.c_cc){
|
||||||
if (tp->t_rawq.c_cc <= TTXOHI) { /* 3 */
|
tp->t_canq.c_cc += tp->t_rawq.c_cc;
|
||||||
L62:
|
tp->t_canq.c_cl->c_next = tp->t_rawq.c_cf;
|
||||||
mode = tp->t_lflag;
|
tp->t_outq.c_cf = tp->t_rawq.c_cl;
|
||||||
if ((tp->t_state & IEXTPROC) ||
|
|
||||||
(mode == 0)){ /* 4,5 */
|
|
||||||
if (!(mode & ICANON)){/* 6 */
|
|
||||||
tp->t_state &= ~RTO;
|
|
||||||
if (tp->t_cc[VMIN] <= tp->t_rawq.c_cc) /* 7 */
|
|
||||||
tp->t_delct = 1;
|
|
||||||
else
|
|
||||||
if ((tp->t_cc[VTIME]) &&
|
|
||||||
((tp->t_state & TACT) == 0)) /* 72,73 */
|
|
||||||
ttimeout(tp);
|
|
||||||
if ((tp->t_delct) == 0) return; /* 74 */
|
|
||||||
}
|
}
|
||||||
if (tp->t_state & IASLP) { /* 75 */
|
tp->t_rawq = tp->t_canq;
|
||||||
tp->t_state &= ~IASLP;
|
tp->t_canq = ttnulq;
|
||||||
wakeup(tp);
|
|
||||||
}
|
}
|
||||||
return;
|
tp->t_delct = tp->t_rawq.c_cc;
|
||||||
}
|
evi();
|
||||||
if (count--){ /* 67 */
|
break;
|
||||||
ch = *cp++;
|
default:
|
||||||
mode = tp->t_lflag;
|
break;
|
||||||
if (!(mode & ISIG)){ /* 68 */
|
|
||||||
L494:
|
|
||||||
if (mode & ICANON){ /* 69 */
|
|
||||||
if (ch == '\n'){ /* 70 */
|
|
||||||
if (mode & ECHONL)
|
|
||||||
mode |= ECHO;
|
|
||||||
tp->t_delct++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (ch == tp->t_cc[VEOL])
|
|
||||||
tp->t_delct++;
|
|
||||||
if ((tp->t_state & ESC) == 0){ /* 50 */
|
|
||||||
if (ch == '\\')
|
|
||||||
tp->t_state |= ESC;
|
|
||||||
if ((ch == tp->t_cc[VERASE]) &&
|
|
||||||
(mode & INPCK)){ /* 52,53 */
|
|
||||||
if (mode & ECHO) /* 54 */
|
|
||||||
ttxput(tp, (long) CERASE, 0);
|
|
||||||
mode |= ECHO;
|
|
||||||
ttxput(tp, (long) ' ', 0);
|
|
||||||
ch = CERASE;
|
|
||||||
} /* von 52,53 */
|
|
||||||
else if ((ch == tp->t_cc[VKILL]) &&
|
|
||||||
(mode & ISTRIP)){ /* 55,56 */
|
|
||||||
if ((mode & ECHO) &&
|
|
||||||
(mode & ISPCI)){ /* 57,58 */
|
|
||||||
for ( csp = &"???"; (*csp);)
|
|
||||||
ttxput(tp, (long) *csp++, 0);
|
|
||||||
(*tp->t_proc)(tp, T_OUTPUT);
|
|
||||||
}
|
|
||||||
ttxput(tp, (long) ch, 0);
|
|
||||||
mode |= ECHO;
|
|
||||||
ch = '\n';
|
|
||||||
}
|
|
||||||
else if (ch != tp->t_cc[VEOF]) /* 60 */
|
|
||||||
if ((mode & ECHO) &&
|
|
||||||
(mode & ISPCI)){ /* 61,62 */
|
|
||||||
for ( csp = &"(eof)"; (*csp);)
|
|
||||||
ttxput(tp, (long) *csp++, 0);
|
|
||||||
(*tp->t_proc)(tp, T_OUTPUT);
|
|
||||||
}
|
|
||||||
mode &= ~ECHO;
|
|
||||||
tp->t_delct++;
|
|
||||||
}
|
|
||||||
else if ((ch == '\\') ||
|
|
||||||
(mode & XCASE)) /* 64,65 */
|
|
||||||
tp->t_state &= ~RTO;
|
|
||||||
}
|
|
||||||
if (mode & ECHO) /* 66 */
|
|
||||||
ttxput(tp, (long) ch, 0);
|
|
||||||
(*tp->t_proc)(tp, T_OUTPUT);
|
|
||||||
} /* von 68 */
|
|
||||||
else {
|
|
||||||
if (ch != tp->t_cc[VINTR]){ /* 43 */
|
|
||||||
if (ch == tp->t_cc[VQUIT]) /* 44 */
|
|
||||||
goto L494;
|
|
||||||
if (!(mode & NOFLSH))
|
|
||||||
ttyflush(tp, T_RESUME);
|
|
||||||
if ((mode & ECHO) ||
|
|
||||||
(mode & ISPCI)){ /* 46,47 */
|
|
||||||
for ( csp = &"(quit)"; (*csp); csp++)
|
|
||||||
ttxput(tp,(long) *csp, 0);
|
|
||||||
(*tp->t_proc)(tp, T_OUTPUT);
|
|
||||||
} /* von 43 */
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!(mode & NOFLSH))
|
|
||||||
ttyflush(tp, T_RESUME);
|
|
||||||
if ((mode & ECHO) &&
|
|
||||||
(mode & ISPCI)) /* 40,41 */{
|
|
||||||
for ( csp = &"(intr)"; (*csp); csp++)
|
|
||||||
ttxput(tp, (long) *csp, 0);
|
|
||||||
(*tp->t_proc)(tp, T_OUTPUT);
|
|
||||||
} /* von 40,41 */
|
|
||||||
}
|
|
||||||
} /* von 68 else */
|
|
||||||
} /* von 67 */
|
|
||||||
if (!(mode & ICANON)){ /* 6 */
|
|
||||||
if (tp->t_cc[VMIN] <= tp->t_rawq.c_cc)
|
|
||||||
tp->t_delct = 1;
|
|
||||||
if ((tp->t_cc[VTIME]) &&
|
|
||||||
((tp->t_state & TACT) == 0))
|
|
||||||
tttimeout(tp);
|
|
||||||
} /* von 6 */
|
|
||||||
if ((tp->t_delct) &&
|
|
||||||
(tp->t_state & IASLP)){ /* 74,75 */
|
|
||||||
tp->t_state &= ~IASLP;
|
|
||||||
wakeup(tp);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} /* von 3 */
|
|
||||||
else {
|
|
||||||
if ((mode & IXOFF)&&
|
|
||||||
(tp->t_state & TBLOCK)) /* 8,9 */
|
|
||||||
(*tp->t_proc)(tp, T_BLOCK);
|
|
||||||
if (tp->t_rawq.c_cc <= TTYHOG) /* 10 */
|
|
||||||
goto L62;
|
|
||||||
else
|
|
||||||
ttyflush(tp, T_TIME);
|
|
||||||
return;
|
|
||||||
} /* 3 von else */
|
|
||||||
} /* von 1 */
|
|
||||||
else {
|
|
||||||
count++;
|
|
||||||
ch = c.half.left;
|
|
||||||
if ((ch & IXOFF) &&
|
|
||||||
(!(mode & INPCK))) /* 13,14 */
|
|
||||||
ch &= ~PERROR;
|
|
||||||
if (ch & (OVERRUN | FRERROR | PERROR)){ /* 15 */
|
|
||||||
if (ch & 0xff){ /* 16 */
|
|
||||||
if (mode & IGNPAR) return;
|
|
||||||
if (mode & IGNBRK) return;
|
|
||||||
if (mode & BRKINT){ /* 12 */
|
|
||||||
signal(tp->t_pgrp, SIGINT);
|
|
||||||
ttyflush(tp, T_RESUME);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} /* von 16 */
|
|
||||||
if (mode & PARMRK){ /* 18 */
|
|
||||||
ttin(tp, (long) 0xff, 1);
|
|
||||||
ttin(tp, (long) 0, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ch = 0;
|
|
||||||
ch |= ICRNL;
|
|
||||||
} /* von 15 */
|
|
||||||
else {
|
|
||||||
if (mode & ISTRIP) /* 23 */
|
|
||||||
ch &= 0x7f;
|
|
||||||
else
|
|
||||||
if (((ch & 0xff)== 0xff) &&
|
|
||||||
(mode & PARMRK) &&
|
|
||||||
(putc( 0xff, tp))) /* 24,25,26 */ return;
|
|
||||||
}
|
|
||||||
if (mode & IXON){ /* 19 */
|
|
||||||
if (tp->t_state & TTSTOP)
|
|
||||||
if ((ch == CSTART) ||
|
|
||||||
(mode & IXANY)) /* 21,22 */
|
|
||||||
(*tp->t_proc)(tp, T_RESUME);
|
|
||||||
if (ch == CSTART) return;
|
|
||||||
if (ch == CSTOP) return;
|
|
||||||
}
|
|
||||||
if ((ch == '\n')&&
|
|
||||||
(mode & INLCR)) /* 30,31 */
|
|
||||||
c = '\r';
|
|
||||||
else {
|
|
||||||
if (c == 0xd){ /* 32 */
|
|
||||||
if (mode & IGNCR) return;
|
|
||||||
if (mode & ICRNL)
|
|
||||||
c = '\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mode & IUCLC) /* 35 */
|
|
||||||
c = toupper(c);
|
|
||||||
L214:
|
|
||||||
if (putc(c, tp)){/* 38 */
|
|
||||||
sysinfo.rawch++;
|
|
||||||
cp = &lobyte(c.half.right);
|
|
||||||
goto L5a;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue