From ec73bc8d013280783527ada6f0b9aba9d2a2c952 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 1 Nov 1990 04:33:46 +0000 Subject: [PATCH] * New primitives `terminal-get-state' and `terminal-set-state' allow Scheme programs to get an object representing a terminal's state structure, and to restore the terminal's state from such an object. * When Scheme is terminated, restore the control terminal state. Previously this was done only when suspending Scheme. * On machines that have it, disable `t_dsuspc' (the delayed suspend character). Save this and any other TIOCGLTC state in the terminal state structure. Previously POSIX machines ignored this state even if it was present. --- v7/src/microcode/osterm.h | 5 ++- v7/src/microcode/prosterm.c | 27 ++++++++++++- v7/src/microcode/term.c | 4 +- v7/src/microcode/ux.c | 80 +++++++++++++++++++------------------ v7/src/microcode/ux.h | 23 +++++++---- v7/src/microcode/uxctty.c | 52 +++++++++++++++++------- v7/src/microcode/uxterm.c | 59 +++++++++++++++++---------- v7/src/microcode/version.h | 4 +- v8/src/microcode/version.h | 4 +- 9 files changed, 169 insertions(+), 89 deletions(-) diff --git a/v7/src/microcode/osterm.h b/v7/src/microcode/osterm.h index 97fa86af9..5a75a0be3 100644 --- a/v7/src/microcode/osterm.h +++ b/v7/src/microcode/osterm.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osterm.h,v 1.2 1990/10/16 20:53:21 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osterm.h,v 1.3 1990/11/01 04:33:05 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -44,6 +44,9 @@ extern unsigned int EXFUN (OS_terminal_get_ospeed, (Tchannel channel)); extern unsigned int EXFUN (arg_baud_index, (unsigned int argument)); extern unsigned int EXFUN (OS_baud_index_to_rate, (unsigned int index)); extern int EXFUN (OS_baud_rate_to_index, (unsigned int rate)); +extern unsigned int EXFUN (OS_terminal_state_size, (void)); +extern void EXFUN (OS_terminal_get_state, (Tchannel channel, PTR statep)); +extern void EXFUN (OS_terminal_set_state, (Tchannel channel, PTR statep)); extern int EXFUN (OS_terminal_cooked_output_p, (Tchannel channel)); extern void EXFUN (OS_terminal_raw_output, (Tchannel channel)); extern void EXFUN (OS_terminal_cooked_output, (Tchannel channel)); diff --git a/v7/src/microcode/prosterm.c b/v7/src/microcode/prosterm.c index 3fbbc25c3..9622519b0 100644 --- a/v7/src/microcode/prosterm.c +++ b/v7/src/microcode/prosterm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosterm.c,v 1.2 1990/10/16 20:53:32 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosterm.c,v 1.3 1990/11/01 04:33:11 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -102,6 +102,29 @@ DEFINE_PRIMITIVE ("BAUD-RATE->INDEX", Prim_baud_rate_to_index, 1, 1, 0) } } +DEFINE_PRIMITIVE ("TERMINAL-GET-STATE", Prim_terminal_get_state, 1, 1, 0) +{ + PRIMITIVE_HEADER (1); + { + SCHEME_OBJECT result = (allocate_string (OS_terminal_state_size ())); + OS_terminal_get_state ((arg_terminal (1)), (STRING_LOC (result, 0))); + PRIMITIVE_RETURN (result); + } +} + +DEFINE_PRIMITIVE ("TERMINAL-SET-STATE", Prim_terminal_set_state, 2, 2, 0) +{ + PRIMITIVE_HEADER (2); + CHECK_ARG (2, STRING_P); + { + SCHEME_OBJECT state = (ARG_REF (2)); + if ((STRING_LENGTH (state)) != (OS_terminal_state_size ())) + error_bad_range_arg (2); + OS_terminal_get_state ((arg_terminal (1)), (STRING_LOC (state, 0))); + } + PRIMITIVE_RETURN (UNSPECIFIC); +} + DEFINE_PRIMITIVE ("TERMINAL-COOKED-OUTPUT?", Prim_terminal_cooked_output_p, 1, 1, "Return #F iff TERMINAL is not in cooked output mode.") { @@ -125,7 +148,7 @@ DEFINE_PRIMITIVE ("TERMINAL-COOKED-OUTPUT", Prim_terminal_cooked_output, 1, 1, OS_terminal_cooked_output (arg_terminal (1)); PRIMITIVE_RETURN (UNSPECIFIC); } - + DEFINE_PRIMITIVE ("TERMINAL-BUFFERED?", Prim_terminal_buffered_p, 1, 1, "Return #F iff TERMINAL is not in buffered mode.") { diff --git a/v7/src/microcode/term.c b/v7/src/microcode/term.c index f05a679c3..7497a5475 100644 --- a/v7/src/microcode/term.c +++ b/v7/src/microcode/term.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/term.c,v 1.2 1990/09/08 00:10:44 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/term.c,v 1.3 1990/11/01 04:33:17 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -33,6 +33,7 @@ promotional, or sales literature without prior written consent from MIT in each case. */ #include "scheme.h" +#include "ostop.h" extern long death_blow; extern char * Term_Messages []; @@ -86,6 +87,7 @@ static void DEFUN (termination_prefix, (code), int code) { attempt_termination_backout (code); + OS_restore_external_state (); putc ('\n', stdout); if ((code < 0) || (code > MAX_TERMINATION)) fprintf (stdout, "Unknown termination code 0x%x", code); diff --git a/v7/src/microcode/ux.c b/v7/src/microcode/ux.c index 83ffa0b71..93c675142 100644 --- a/v7/src/microcode/ux.c +++ b/v7/src/microcode/ux.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.c,v 1.3 1990/10/16 20:53:43 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.c,v 1.4 1990/11/01 04:33:22 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -42,55 +42,29 @@ DEFUN (UX_prim_check_errno, (name), CONST char * name) deliver_pending_interrupts (); } -#ifndef HAVE_TERMIOS -#ifdef HAVE_TERMIO - -int -DEFUN (UX_tcdrain, (fd), int fd) -{ - return (UX_ioctl (fd, TCSBRK, 1)); -} -int -DEFUN (UX_tcflush, (fd, queue_selector), int fd AND int queue_selector) -{ - return (UX_ioctl (fd, TCFLSH, queue_selector)); -} - -#else /* not HAVE_TERMIO */ -#ifdef HAVE_BSD_TTY_DRIVER - -int -DEFUN (UX_tcdrain, (fd), int fd) -{ - /* BSD provides no such feature -- pretend it worked. */ - return (0); -} - -int -DEFUN (UX_tcflush, (fd, queue_selector), int fd AND int queue_selector) -{ - /* Losing BSD always flushes input and output together. */ - int zero = 0; - return (UX_ioctl (fd, TIOCFLUSH, (&zero))); -} - -#endif /* HAVE_BSD_TTY_DRIVER */ -#endif /* HAVE_TERMIO */ -#endif /* HAVE_TERMIOS */ - #ifdef HAVE_TERMIOS int DEFUN (UX_terminal_get_state, (fd, s), int fd AND Ttty_state * s) { - return (tcgetattr (fd, s)); + return + ((((tcgetattr (fd, (& (s -> tio)))) < 0) +#ifdef HAVE_BSD_JOB_CONTROL + || ((UX_ioctl (fd, TIOCGLTC, (& (s -> ltc)))) < 0) +#endif + ) ? (-1) : 0); } int DEFUN (UX_terminal_set_state, (fd, s), int fd AND Ttty_state * s) { - return (tcsetattr (fd, TCSANOW, s)); + return + ((((tcsetattr (fd, TCSANOW, (& (s -> tio)))) < 0) +#ifdef HAVE_BSD_JOB_CONTROL + || ((UX_ioctl (fd, TIOCSLTC, (& (s -> ltc)))) < 0) +#endif + ) ? (-1) : 0); } #else /* not HAVE_TERMIOS */ @@ -118,7 +92,20 @@ DEFUN (UX_terminal_set_state, (fd, s), int fd AND Ttty_state * s) ) ? (-1) : 0); } +int +DEFUN (UX_tcdrain, (fd), int fd) +{ + return (UX_ioctl (fd, TCSBRK, 1)); +} + +int +DEFUN (UX_tcflush, (fd, queue_selector), int fd AND int queue_selector) +{ + return (UX_ioctl (fd, TCFLSH, queue_selector)); +} + #else /* not HAVE_TERMIO */ + #ifdef HAVE_BSD_TTY_DRIVER int @@ -147,6 +134,21 @@ DEFUN (UX_terminal_set_state, (fd, s), int fd AND Ttty_state * s) ? (-1) : 0); } +int +DEFUN (UX_tcdrain, (fd), int fd) +{ + /* BSD provides no such feature -- pretend it worked. */ + return (0); +} + +int +DEFUN (UX_tcflush, (fd, queue_selector), int fd AND int queue_selector) +{ + /* Losing BSD always flushes input and output together. */ + int zero = 0; + return (UX_ioctl (fd, TIOCFLUSH, (&zero))); +} + #endif /* HAVE_BSD_TTY_DRIVER */ #endif /* HAVE_TERMIO */ #endif /* HAVE_TERMIOS */ diff --git a/v7/src/microcode/ux.h b/v7/src/microcode/ux.h index 23ed3969c..a5759b5ed 100644 --- a/v7/src/microcode/ux.h +++ b/v7/src/microcode/ux.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.11 1990/10/16 20:53:48 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.12 1990/11/01 04:33:27 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -103,7 +103,6 @@ extern void EXFUN (error_system_call, (int code, CONST char * name)); #include #define HAVE_APPEND -#define HAVE_BSD_JOB_CONTROL #define HAVE_BSD_SIGNALS #define HAVE_BSD_TTY_DRIVER #define HAVE_DIR @@ -181,11 +180,6 @@ extern void EXFUN (error_system_call, (int code, CONST char * name)); #endif /* _HPUX_VERSION */ -#if (_HPUX_VERSION >= 65) || defined(hp9000s800) -#include -#define HAVE_BSD_JOB_CONTROL -#endif - #endif /* _HPUX */ #endif /* _SYSV3 */ #else /* not _SYSV */ @@ -208,6 +202,7 @@ extern void EXFUN (error_system_call, (int code, CONST char * name)); #ifdef _BSD +#define HAVE_BSD_JOB_CONTROL #define HAVE_FIONREAD #define HAVE_GETTIMEOFDAY #define HAVE_ITIMER @@ -269,6 +264,11 @@ extern void EXFUN (error_system_call, (int code, CONST char * name)); #define HAVE_UNIX_SOCKETS #endif +#if (_HPUX_VERSION >= 65) || defined(hp9000s800) +#include +#define HAVE_BSD_JOB_CONTROL +#endif + #if (_HPUX_VERSION >= 70) || defined(hp9000s800) #define HAVE_FIONREAD #endif @@ -536,7 +536,14 @@ extern void EXFUN (UX_prim_check_errno, (CONST char * name)); #ifdef HAVE_TERMIOS -typedef struct termios Ttty_state; +typedef struct +{ + struct termios tio; +#ifdef HAVE_BSD_JOB_CONTROL + struct ltchars ltc; +#endif +} Ttty_state; + #define UX_tcflush tcflush #define UX_tcdrain tcdrain #define UX_tcgetattr tcgetattr diff --git a/v7/src/microcode/uxctty.c b/v7/src/microcode/uxctty.c index 3897e8831..eba651bea 100644 --- a/v7/src/microcode/uxctty.c +++ b/v7/src/microcode/uxctty.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxctty.c,v 1.1 1990/06/20 19:37:03 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxctty.c,v 1.2 1990/11/01 04:33:33 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -132,6 +132,7 @@ typedef struct cc_t quit; cc_t intrpt; cc_t tstp; + cc_t dtstp; } Tinterrupt_chars; static Tinterrupt_enables current_interrupt_enables; @@ -179,17 +180,27 @@ DEFUN (ctty_get_interrupt_chars, (ic), Tinterrupt_chars * ic) if ((UX_terminal_get_state (ctty_fildes, (&s))) == 0) { #ifdef HAVE_TERMIOS - (ic -> quit) = ((s . c_cc) [VQUIT]); - (ic -> intrpt) = ((s . c_cc) [VINTR]); - (ic -> tstp) = ((s . c_cc) [VSUSP]); + (ic -> quit) = ((s . tio . c_cc) [VQUIT]); + (ic -> intrpt) = ((s . tio . c_cc) [VINTR]); + (ic -> tstp) = ((s . tio . c_cc) [VSUSP]); +#ifdef HAVE_BSD_JOB_CONTROL + (ic -> dtstp) = (s . ltc . t_dsuspc); +#else + (ic -> dtstp) = (UX_PC_VDISABLE (ctty_fildes)); +#endif #else /* not HAVE_TERMIOS */ #ifdef HAVE_TERMIO (ic -> quit) = ((s . tio . c_cc) [VQUIT]); (ic -> intrpt) = ((s . tio . c_cc) [VINTR]); #ifdef HAVE_BSD_JOB_CONTROL - (ic -> tstp) = ((s . ltc . c_cc) [VSUSP]); + (ic -> tstp) = (s . ltc . t_suspc); + (ic -> dtstp) = (s . ltc . t_dsuspc); #else - (ic -> tstp) = (UX_PC_VDISABLE (ctty_fildes)); + { + cc_t disabled_char = (UX_PC_VDISABLE (ctty_fildes)); + (ic -> tstp) = disabled_char; + (ic -> dtstp) = disabled_char; + } #endif #else /* not HAVE_TERMIO */ #ifdef HAVE_BSD_TTY_DRIVER @@ -197,8 +208,13 @@ DEFUN (ctty_get_interrupt_chars, (ic), Tinterrupt_chars * ic) (ic -> intrpt) = (s . tc . t_intrc); #ifdef HAVE_BSD_JOB_CONTROL (ic -> tstp) = (s . ltc . t_suspc); + (ic -> dtstp) = (s . ltc . t_dsuspc); #else - (ic -> tstp) = (UX_PC_VDISABLE (ctty_fildes)); + { + cc_t disabled_char = (UX_PC_VDISABLE (ctty_fildes)); + (ic -> tstp) = disabled_char; + (ic -> dtstp) = disabled_char; + } #endif #endif /* HAVE_BSD_TTY_DRIVER */ #endif /* HAVE_TERMIO */ @@ -210,10 +226,11 @@ DEFUN (ctty_get_interrupt_chars, (ic), Tinterrupt_chars * ic) (ic -> quit) = disabled_char; (ic -> intrpt) = disabled_char; (ic -> tstp) = disabled_char; + (ic -> dtstp) = disabled_char; } } #endif /* 0 */ - + static void DEFUN (ctty_set_interrupt_chars, (ic), Tinterrupt_chars * ic) { @@ -221,15 +238,19 @@ DEFUN (ctty_set_interrupt_chars, (ic), Tinterrupt_chars * ic) if ((UX_terminal_get_state (ctty_fildes, (&s))) == 0) { #ifdef HAVE_TERMIOS - ((s . c_cc) [VQUIT]) = (ic -> quit); - ((s . c_cc) [VINTR]) = (ic -> intrpt); - ((s . c_cc) [VSUSP]) = (ic -> tstp); + ((s . tio . c_cc) [VQUIT]) = (ic -> quit); + ((s . tio . c_cc) [VINTR]) = (ic -> intrpt); + ((s . tio . c_cc) [VSUSP]) = (ic -> tstp); +#ifdef HAVE_BSD_JOB_CONTROL + (s . ltc . t_dsuspc) = (ic -> dtstp); +#endif #else /* not HAVE_TERMIOS */ #ifdef HAVE_TERMIO ((s . tio . c_cc) [VQUIT]) = (ic -> quit); ((s . tio . c_cc) [VINTR]) = (ic -> intrpt); #ifdef HAVE_BSD_JOB_CONTROL (s . ltc . t_suspc) = (ic -> tstp); + (s . ltc . t_dsuspc) = (ic -> dtstp); #endif #else /* not HAVE_TERMIO */ #ifdef HAVE_BSD_TTY_DRIVER @@ -237,6 +258,7 @@ DEFUN (ctty_set_interrupt_chars, (ic), Tinterrupt_chars * ic) (s . tc . t_intrc) = (ic -> intrpt); #ifdef HAVE_BSD_JOB_CONTROL (s . ltc . t_suspc) = (ic -> tstp); + (s . ltc . t_dsuspc) = (ic -> dtstp); #endif #endif /* HAVE_BSD_TTY_DRIVER */ #endif /* HAVE_TERMIO */ @@ -244,7 +266,7 @@ DEFUN (ctty_set_interrupt_chars, (ic), Tinterrupt_chars * ic) UX_terminal_set_state (ctty_fildes, (&s)); } } - + static void DEFUN_VOID (ctty_update_interrupt_chars) { @@ -261,10 +283,11 @@ DEFUN_VOID (ctty_update_interrupt_chars) (active_interrupt_chars . intrpt) = disabled_char; if ((current_interrupt_enables & KEYBOARD_TSTP_INTERRUPT) == 0) (active_interrupt_chars . tstp) = disabled_char; + (active_interrupt_chars . dtstp) = disabled_char; ctty_set_interrupt_chars (&active_interrupt_chars); } } - + void DEFUN (OS_ctty_get_interrupt_enables, (mask), Tinterrupt_enables * mask) { @@ -289,7 +312,7 @@ DEFUN (OS_ctty_set_interrupt_chars, (quit_char, int_char, tstp_char), (current_interrupt_chars . tstp) = tstp_char; ctty_update_interrupt_chars (); } - + void DEFUN (UX_initialize_ctty, (interactive), int interactive) { @@ -305,6 +328,7 @@ DEFUN (UX_initialize_ctty, (interactive), int interactive) (current_interrupt_chars . quit) = DEFAULT_SIGQUIT_CHAR; (current_interrupt_chars . intrpt) = DEFAULT_SIGINT_CHAR; (current_interrupt_chars . tstp) = DEFAULT_SIGTSTP_CHAR; + (current_interrupt_chars . dtstp) = (UX_PC_VDISABLE (ctty_fildes)); current_interrupt_enables = KEYBOARD_ALL_INTERRUPTS; if (outside_ctty_state_recorded) ctty_set_interrupt_chars (¤t_interrupt_chars); diff --git a/v7/src/microcode/uxterm.c b/v7/src/microcode/uxterm.c index 55dbf0b25..04d9eaa6c 100644 --- a/v7/src/microcode/uxterm.c +++ b/v7/src/microcode/uxterm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.4 1990/10/16 20:53:55 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.5 1990/11/01 04:33:40 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -69,13 +69,9 @@ static struct terminal_state * terminal_table; #define TERMINAL_BUFFER(channel) ((terminal_table[(channel)]) . buffer) #define TERMINAL_ORIGINAL_STATE(channel) ((terminal_table[(channel)]) . state) -#ifdef HAVE_TERMIOS -#define TIO(s) (s) -#else -#ifdef HAVE_TERMIO +#if defined(HAVE_TERMIOS) || defined(HAVE_TERMIO) #define TIO(s) (& ((s) -> tio)) #endif -#endif void DEFUN_VOID (UX_initialize_terminals) @@ -127,7 +123,7 @@ unsigned int DEFUN (terminal_state_get_ospeed, (s), Ttty_state * s) { #ifdef HAVE_TERMIOS - return (cfgetospeed (s)); + return (cfgetospeed (TIO (s))); #else #ifdef HAVE_TERMIO return (((TIO (s)) -> c_cflag) & CBAUD); @@ -143,7 +139,7 @@ unsigned int DEFUN (terminal_state_get_ispeed, (s), Ttty_state * s) { #ifdef HAVE_TERMIOS - return (cfgetispeed (s)); + return (cfgetispeed (TIO (s))); #else #ifdef HAVE_TERMIO return (((TIO (s)) -> c_cflag) & CBAUD); @@ -184,14 +180,14 @@ void DEFUN (terminal_state_cooked_output, (s, channel), Ttty_state * s AND Tchannel channel) { - Ttty_state * os = (& (TERMINAL_ORIGINAL_STATE (channel))); #if defined(HAVE_TERMIOS) || defined(HAVE_TERMIO) - ((TIO (s)) -> c_oflag) = ((TIO (os)) -> c_oflag); + ((TIO (s)) -> c_oflag) |= OPOST; #else /* not HAVE_TERMIOS nor HAVE_TERMIO */ #ifdef HAVE_BSD_TTY_DRIVER + Ttty_state * os = (& (TERMINAL_ORIGINAL_STATE (channel))); (s -> sg . sg_flags) = (((s -> sg . sg_flags) &~ ALLDELAY) | ((os -> sg . sg_flags) & ALLDELAY)); - (s -> lmode) = (((s -> lmode) &~ LLITOUT) | ((os -> lmode) & LLITOUT)); + (s -> lmode) &=~ LLITOUT; #endif /* HAVE_BSD_TTY_DRIVER */ #endif /* HAVE_TERMIOS or HAVE_TERMIO */ } @@ -237,6 +233,8 @@ DEFUN (terminal_state_raw, (s), Ttty_state * s) ((TIO (s)) -> c_lflag) &=~ (ICANON | ECHO | ISIG); ((TIO (s)) -> c_iflag) |= IGNBRK; ((TIO (s)) -> c_iflag) &=~ (ICRNL | IXON | ISTRIP); + ((TIO (s)) -> c_cflag) |= CS8; + ((TIO (s)) -> c_cflag) &=~ PARENB; (((TIO (s)) -> c_cc) [VMIN]) = 1; (((TIO (s)) -> c_cc) [VTIME]) = 0; #else /* not HAVE_TERMIOS nor HAVE_TERMIO */ @@ -253,21 +251,20 @@ DEFUN (terminal_state_buffered, (s, channel), Ttty_state * s AND Tchannel channel) { - Ttty_state * os = (& (TERMINAL_ORIGINAL_STATE (channel))); #if defined(HAVE_TERMIOS) || defined(HAVE_TERMIO) - ((TIO (s)) -> c_lflag) = ((TIO (os)) -> c_lflag); + Ttty_state * os = (& (TERMINAL_ORIGINAL_STATE (channel))); + ((TIO (s)) -> c_lflag) |= (ICANON | ECHO | ISIG); ((TIO (s)) -> c_iflag) = ((TIO (os)) -> c_iflag); - ((TIO (s)) -> c_cflag) = ((TIO (os)) -> c_cflag); + ((TIO (s)) -> c_cflag) |= CS8; + ((TIO (s)) -> c_cflag) &=~ PARENB; (((TIO (s)) -> c_cc) [VMIN]) = (((TIO (os)) -> c_cc) [VMIN]); (((TIO (s)) -> c_cc) [VTIME]) = (((TIO (os)) -> c_cc) [VTIME]); #else /* not HAVE_TERMIOS nor HAVE_TERMIO */ #ifdef HAVE_BSD_TTY_DRIVER - (s -> sg . sg_flags) = - (((s -> sg . sg_flags) &~ (ECHO | CRMOD | ANYP | CBREAK | RAW)) - | ((os -> sg . sg_flags) & (ECHO | CRMOD | ANYP | CBREAK | RAW))); - (s -> lmode) = - (((s -> lmode) &~ (LPASS8 | LNOFLSH)) - | ((os -> lmode) & (LPASS8 | LNOFLSH))); + (s -> sg . sg_flags) &=~ (CBREAK | RAW); + (s -> sg . sg_flags) |= (ECHO | CRMOD | ANYP); + (s -> lmode) &=~ LNOFLSH; + (s -> lmode) |= LPASS8; #endif /* HAVE_BSD_TTY_DRIVER */ #endif /* HAVE_TERMIOS or HAVE_TERMIO */ } @@ -435,6 +432,28 @@ DEFUN (OS_baud_rate_to_index, (rate), unsigned int rate) return ((scan - 1) - baud_convert); return (-1); } + +unsigned int +DEFUN_VOID (OS_terminal_state_size) +{ + return (sizeof (Ttty_state)); +} + +void +DEFUN (OS_terminal_get_state, (channel, statep), + Tchannel channel AND + PTR statep) +{ + get_terminal_state (channel, statep); +} + +void +DEFUN (OS_terminal_set_state, (channel, statep), + Tchannel channel AND + PTR statep) +{ + set_terminal_state (channel, statep); +} int DEFUN (OS_terminal_cooked_output_p, (channel), Tchannel channel) diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index f8b8940f0..be72ca239 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.49 1990/10/16 20:54:01 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.50 1990/11/01 04:33:46 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 49 +#define SUBVERSION 50 #endif #ifndef UCODE_TABLES_FILENAME diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 48bf2ac26..c6bc474eb 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.49 1990/10/16 20:54:01 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.50 1990/11/01 04:33:46 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 49 +#define SUBVERSION 50 #endif #ifndef UCODE_TABLES_FILENAME -- 2.25.1