- termEofChar = ntc.t_eofc;
- termEraseChar = nttyb.sg_erase;
- termFlushChar = nltc.t_flushc;
- termIntChar = ntc.t_intrc;
- termKillChar = nttyb.sg_kill;
- termQuitChar = ntc.t_quitc;
+#else /* USE_TERMIO */
+ ioctl(0, TCGETA, &old_tc);
+
+ new_tc = old_tc;
+
+ termFlushChar = 'O'&0x37;
+ termWerasChar = 'W'&0x37;
+ termRprntChar = 'R'&0x37;
+ termLiteralNextChar = 'V'&0x37;
+ termStartChar = 'Q'&0x37;
+ termStopChar = 'S'&0x37;
+#endif /* USE_TERMIO */
+}
+
+char *
+tcval(func)
+register int func;
+{
+ switch(func) {
+ case SLC_IP: return(&termIntChar);
+ case SLC_ABORT: return(&termQuitChar);
+ case SLC_EOF: return(&termEofChar);
+ case SLC_EC: return(&termEraseChar);
+ case SLC_EL: return(&termKillChar);
+ case SLC_XON: return(&termStartChar);
+ case SLC_XOFF: return(&termStopChar);
+#ifndef CRAY
+ case SLC_AO: return(&termFlushChar);
+ case SLC_SUSP: return(&termSuspChar);
+ case SLC_EW: return(&termWerasChar);
+ case SLC_RP: return(&termRprntChar);
+ case SLC_LNEXT: return(&termLiteralNextChar);
+#endif /* CRAY */
+
+ case SLC_SYNCH:
+ case SLC_BRK:
+ case SLC_AYT:
+ case SLC_EOR:
+ case SLC_FORW1:
+ case SLC_FORW2:
+ default:
+ return((char *)0);
+ }
+}
+
+void
+TerminalDefaultChars()
+{
+#ifndef USE_TERMIO
+ ntc = otc;
+ nltc = oltc;
+ nttyb.sg_kill = ottyb.sg_kill;
+ nttyb.sg_erase = ottyb.sg_erase;
+#else /* USE_TERMIO */
+ memcpy(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
+ termFlushChar = 'O'&0x37;
+ termWerasChar = 'W'&0x37;
+ termRprntChar = 'R'&0x37;
+ termLiteralNextChar = 'V'&0x37;
+ termStartChar = 'Q'&0x37;
+ termStopChar = 'S'&0x37;
+#endif /* USE_TERMIO */