+termiototermios(tio, tios, bsdtios)
+ struct hpuxtermio *tio;
+ struct hpuxtermios *tios;
+ struct termios *bsdtios;
+{
+ int i;
+
+ bzero((char *)tios, sizeof *tios);
+ tios->c_iflag = tio->c_iflag;
+ tios->c_oflag = tio->c_oflag;
+ tios->c_cflag = tio->c_cflag;
+ tios->c_lflag = tio->c_lflag;
+ tios->c_reserved = tio->c_line;
+ for (i = 0; i <= HPUXVSWTCH; i++)
+ tios->c_cc[i] = tio->c_cc[i];
+ if (tios->c_lflag & TIO_ICANON) {
+ tios->c_cc[HPUXVEOF] = tio->c_cc[HPUXVEOF];
+ tios->c_cc[HPUXVEOL] = tio->c_cc[HPUXVEOL];
+ tios->c_cc[HPUXVMINS] = tios->c_cc[HPUXVTIMES] = 0;
+ } else {
+ tios->c_cc[HPUXVEOF] = tios->c_cc[HPUXVEOL] = 0;
+ tios->c_cc[HPUXVMINS] = tio->c_cc[HPUXVMIN];
+ tios->c_cc[HPUXVTIMES] = tio->c_cc[HPUXVTIME];
+ }
+ tios->c_cc[HPUXVMINS] = bsdtios->c_cc[VMIN];
+ tios->c_cc[HPUXVTIMES] = bsdtios->c_cc[VTIME];
+ tios->c_cc[HPUXVSUSP] = bsdtios->c_cc[VSUSP];
+ tios->c_cc[HPUXVSTART] = bsdtios->c_cc[VSTART];
+ tios->c_cc[HPUXVSTOP] = bsdtios->c_cc[VSTOP];
+}
+
+termiostotermio(tios, tio)
+ struct hpuxtermios *tios;
+ struct hpuxtermio *tio;
+{
+ int i;
+
+ tio->c_iflag = tios->c_iflag;
+ tio->c_oflag = tios->c_oflag;
+ tio->c_cflag = tios->c_cflag;
+ tio->c_lflag = tios->c_lflag;
+ tio->c_line = tios->c_reserved;
+ for (i = 0; i <= HPUXVSWTCH; i++)
+ tio->c_cc[i] = tios->c_cc[i];
+ if (tios->c_lflag & TIO_ICANON) {
+ tio->c_cc[HPUXVEOF] = tios->c_cc[HPUXVEOF];
+ tio->c_cc[HPUXVEOL] = tios->c_cc[HPUXVEOL];
+ } else {
+ tio->c_cc[HPUXVMIN] = tios->c_cc[HPUXVMINS];
+ tio->c_cc[HPUXVTIME] = tios->c_cc[HPUXVTIMES];
+ }
+}
+