/* -*-C-*-
-$Id: dosio.c,v 1.4 1993/04/06 22:19:01 cph Exp $
+$Id: dosio.c,v 1.5 1993/04/19 08:31:05 cph Exp $
Copyright (c) 1992-93 Massachusetts Institute of Technology
return (arg_index_integer (argument, 1));
}
-unsigned long
+unsigned int
DEFUN (OS_terminal_get_ispeed, (channel), Tchannel channel)
{
return (0);
}
-unsigned long
+unsigned int
DEFUN (OS_terminal_get_ospeed, (channel), Tchannel channel)
{
return (0);
}
+void
+DEFUN (terminal_state_set_ospeed, (s, b),
+ Ttty_state * s AND
+ unsigned int b)
+{
+ error_unimplemented_primitive ();
+}
+
+void
+DEFUN (terminal_state_set_ispeed, (s, b),
+ Ttty_state * s AND
+ unsigned int b)
+{
+ error_unimplemented_primitive ();
+}
+
unsigned int
DEFUN (OS_baud_index_to_rate, (index), unsigned int index)
{
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osterm.h,v 1.9 1992/05/05 06:35:52 jinx Exp $
+$Id: osterm.h,v 1.10 1993/04/19 08:28:05 cph Exp $
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-93 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
extern Tchannel EXFUN (arg_channel, (int));
extern Tchannel EXFUN (arg_terminal, (int));
-extern unsigned long EXFUN (OS_terminal_get_ispeed, (Tchannel channel));
-extern unsigned long EXFUN (OS_terminal_get_ospeed, (Tchannel channel));
+extern unsigned int EXFUN (OS_terminal_get_ispeed, (Tchannel channel));
+extern unsigned int EXFUN (OS_terminal_get_ospeed, (Tchannel channel));
+extern void EXFUN
+ (OS_terminal_set_ispeed, (Tchannel channel, unsigned int baud));
+extern void EXFUN
+ (OS_terminal_set_ospeed, (Tchannel channel, unsigned int baud));
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));
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosterm.c,v 1.12 1992/05/05 06:34:14 jinx Exp $
+$Id: prosterm.c,v 1.13 1993/04/19 08:27:48 cph Exp $
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-93 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(long_to_integer (OS_terminal_get_ospeed (arg_terminal (1))));
}
+DEFINE_PRIMITIVE ("TERMINAL-SET-ISPEED", Prim_terminal_set_ispeed, 2, 2, 0)
+{
+ PRIMITIVE_HEADER (2);
+ OS_terminal_set_ispeed ((arg_terminal (1)), (arg_baud_index (2)));
+ PRIMITIVE_RETURN (UNSPECIFIC);
+}
+
+DEFINE_PRIMITIVE ("TERMINAL-SET-OSPEED", Prim_terminal_set_ospeed, 2, 2, 0)
+{
+ PRIMITIVE_HEADER (2);
+ OS_terminal_set_ospeed ((arg_terminal (1)), (arg_baud_index (2)));
+ PRIMITIVE_RETURN (UNSPECIFIC);
+}
+
DEFINE_PRIMITIVE ("BAUD-INDEX->RATE", Prim_baud_index_to_rate, 1, 1, 0)
{
PRIMITIVE_HEADER (1);
/* -*-C-*-
-$Id: uxterm.c,v 1.21 1993/02/18 05:15:04 gjr Exp $
+$Id: uxterm.c,v 1.22 1993/04/19 08:27:29 cph Exp $
Copyright (c) 1990-1993 Massachusetts Institute of Technology
(UX_terminal_set_state ((CHANNEL_DESCRIPTOR (channel)), s)));
}
\f
-unsigned long
+unsigned int
DEFUN (terminal_state_get_ospeed, (s), Ttty_state * s)
{
#ifdef HAVE_TERMIOS
#endif /* not HAVE_TERMIOS */
}
-unsigned long
+unsigned int
DEFUN (terminal_state_get_ispeed, (s), Ttty_state * s)
{
#ifdef HAVE_TERMIOS
#endif /* not HAVE_TERMIOS */
}
+void
+DEFUN (terminal_state_set_ospeed, (s, b),
+ Ttty_state * s AND
+ unsigned int b)
+{
+#ifdef HAVE_TERMIOS
+ cfsetospeed ((TIO (s)), b);
+#else
+#ifdef HAVE_TERMIO
+ ((TIO (s)) -> c_cflag) = ((((TIO (s)) -> c_cflag) &~ CBAUD) | b);
+#else
+#ifdef HAVE_BSD_TTY_DRIVER
+ (s -> sg . sg_ospeed) = b;
+#endif /* HAVE_BSD_TTY_DRIVER */
+#endif /* not HAVE_TERMIO */
+#endif /* not HAVE_TERMIOS */
+}
+
+void
+DEFUN (terminal_state_set_ispeed, (s, b),
+ Ttty_state * s AND
+ unsigned int b)
+{
+#ifdef HAVE_TERMIOS
+ cfsetispeed ((TIO (s)), b);
+#else
+#ifdef HAVE_TERMIO
+ ((TIO (s)) -> c_cflag) =
+ ((((TIO (s)) -> c_cflag) &~ CIBAUD) | (b << IBSHIFT));
+#else
+#ifdef HAVE_BSD_TTY_DRIVER
+ (s -> sg . sg_ispeed) = b;
+#endif /* HAVE_BSD_TTY_DRIVER */
+#endif /* not HAVE_TERMIO */
+#endif /* not HAVE_TERMIOS */
+}
+
int
DEFUN (terminal_state_cooked_output_p, (s), Ttty_state * s)
{
#endif /* HAVE_TERMIOS or HAVE_TERMIO */
}
\f
-unsigned long
+unsigned int
DEFUN (OS_terminal_get_ispeed, (channel), Tchannel channel)
{
Ttty_state s;
return (terminal_state_get_ispeed (&s));
}
-unsigned long
+unsigned int
DEFUN (OS_terminal_get_ospeed, (channel), Tchannel channel)
{
Ttty_state s;
return (terminal_state_get_ospeed (&s));
}
+void
+DEFUN (OS_terminal_set_ispeed, (channel, baud),
+ Tchannel channel AND
+ unsigned int baud)
+{
+ Ttty_state s;
+ get_terminal_state (channel, (&s));
+ terminal_state_set_ispeed ((&s), baud);
+ set_terminal_state (channel, (&s));
+}
+
+void
+DEFUN (OS_terminal_set_ospeed, (channel, baud),
+ Tchannel channel AND
+ unsigned int baud)
+{
+ Ttty_state s;
+ get_terminal_state (channel, (&s));
+ terminal_state_set_ospeed ((&s), baud);
+ set_terminal_state (channel, (&s));
+}
+
#ifndef NO_BAUD_CONVERSION
static unsigned int baud_convert [] =
#ifdef _HPUX