\f
/* Standard Input and Output */
-static Tchannel input_channel;
-static Tchannel output_channel;
+static Tchannel tty_channel;
HANDLE master_tty_window = 0;
Tchannel
OS_tty_input_channel (void)
{
- return (input_channel);
+ return (tty_channel);
}
Tchannel
OS_tty_output_channel (void)
{
- return (output_channel);
+ return (tty_channel);
+}
+
+Tchannel
+OS_tty_error_channel (void)
+{
+ return (tty_channel);
}
unsigned int
void
NT_initialize_tty (void)
{
- input_channel = (NT_open_handle (master_tty_window));
- (CHANNEL_INTERNAL (input_channel)) = 1;
- output_channel = input_channel;
+ tty_channel = (NT_open_handle (master_tty_window));
+ (CHANNEL_INTERNAL (tty_channel)) = 1;
Screen_GetSize (master_tty_window, (&tty_y_size), (&tty_x_size));
tty_command_beep = ALERT_STRING;
tty_command_clear = "\014";
extern Tchannel OS_tty_input_channel (void);
extern Tchannel OS_tty_output_channel (void);
+extern Tchannel OS_tty_error_channel (void);
extern unsigned int OS_tty_x_size (void);
extern unsigned int OS_tty_y_size (void);
extern const char * OS_tty_command_beep (void);
PRIMITIVE_RETURN (long_to_integer (OS_tty_output_channel ()));
}
+DEFINE_PRIMITIVE ("TTY-ERROR-CHANNEL", Prim_tty_error_channel, 0, 0,
+ "Return the standard error channel.")
+{
+ PRIMITIVE_HEADER (0);
+ PRIMITIVE_RETURN (long_to_integer (OS_tty_error_channel ()));
+}
+
DEFINE_PRIMITIVE ("TTY-X-SIZE", Prim_tty_x_size, 0, 0,
"Return the display width in character columns.")
{
static Tchannel input_channel;
static Tchannel output_channel;
+static Tchannel error_channel;
static int tty_x_size;
static int tty_y_size;
return (output_channel);
}
+Tchannel
+OS_tty_error_channel (void)
+{
+ return (error_channel);
+}
+
unsigned int
OS_tty_x_size (void)
{
(CHANNEL_INTERNAL (input_channel)) = 1;
output_channel = (OS_open_fd (STDOUT_FILENO));
(CHANNEL_INTERNAL (output_channel)) = 1;
+ error_channel = (OS_open_fd (STDERR_FILENO));
+ (CHANNEL_INTERNAL (error_channel)) = 1;
tty_size_synchronized_p = false;
UX_synchronize_tty_size ();
tty_command_beep = ALERT_STRING;