Commit 7e59217d authored by Karoly Lorentey's avatar Karoly Lorentey

Rename `struct display' to `struct device'. Update function, parameter and...

Rename `struct display' to `struct device'.  Update function, parameter and variable names accordingly.

* src/termhooks.h (struct device): Rename to `struct device'.
  Rename member `next_display' to `next_device'.
  Rename member `delete_display_hook' to `delete_device_hook'.
  (FRAME_DISPLAY): Rename to FRAME_DEVICE.
  (DISPLAY_ACTIVE_P): Rename to DEVICE_ACTIVE_P.
  (DISPLAY_TERMINAL_CODING): Rename to DEVICE_TERMINAL_CODING.
  (DISPLAY_KEYBOARD_CODING): Rename to DEVICE_KEYBOARD_CODING.

* src/frame.h (stuct frame): Rename `display' member to `device'.

* src/xterm.h (x_display_info): Rename member `frame_display' to `device'.

* src/termchar.h (struct tty_display_info): Rename `display' member to `device'.

* src/keyboard.c (push_display_kboard): Rename to push_device_kboard.

* lisp/frame.el (make-frame): Rename frame parameter `display-id' to `device'.
* src/frame.c (Fmake_terminal_frame): Ditto.
* src/xfns.c (Fx_create_frame): Ditto.

* src/term.c (display_list): Rename to device_list.
* src/term.c (initial_display): Rename to initial_device.
* src/term.c (next_display_id): Rename to next_device_id.
* src/term.c (get_display): Rename to get_device.
* src/term.c (get_tty_display): Rename to get_tty_device.
* src/term.c (get_named_tty_display): Rename to get_named_tty.
* src/term.c (init_initial_display): Rename to init_initial_device.
* src/term.c (delete_initial_display): Rename to delete_initial_device.
* src/term.c (create_display): Rename to create_device.
* src/term.c (delete_display): Rename to delete_device.

* src/xfns.c (check_x_display_info): Document that the function allows
  display ids as well.

* src/xterm.c (x_delete_frame_display): Rename to x_delete_device.
* src/xterm.c (x_create_frame_display): Rename to x_create_device.

* src/coding.c: Update.
* src/dispextern.h: Update.
* src/data.c: Update.
* src/dispnew.c: Update.
* src/frame.c: Update.
* src/frame.h: Update.
* src/keyboard.c: Update.
* src/keyboard.h: Update.
* src/lisp.h: Update.
* src/sysdep.c: Update.
* src/term.c: Update.
* src/xdisp.c: Update.
* src/xselect.c: Update.
* src/xterm.c: Update.

* src/prefix-args.c: Include stdlib.h for exit.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-382
parent a4c6993d
......@@ -461,6 +461,7 @@ THINGS TO DO
display-name terminal-name
display-tty-type terminal-tty-type
frame-display terminal-of-frame
delete-display delete-terminal
** The semantics of terminal-local variables are confusing; it is not
clear what binding is in effect in any given time. See if
......
......@@ -640,7 +640,7 @@ You cannot specify either `width' or `height', you must use neither or both.
(window-system . nil) The frame should be displayed on a terminal device.
(window-system . x) The frame should be displayed in an X window.
(display-id . ID) The frame should use the display identified by ID.
(device . ID) The frame should use the display device identified by ID.
Before the frame is created (via `frame-creation-function-alist'), functions on the
hook `before-make-frame-hook' are run. After the frame is created, functions
......@@ -653,11 +653,11 @@ instance if the frame appears under the mouse pointer and your
setup is for focus to follow the pointer."
(interactive)
(let* ((w (cond
((assq 'display-id parameters)
(let ((type (display-live-p (cdr (assq 'display-id parameters)))))
((assq 'device parameters)
(let ((type (display-live-p (cdr (assq 'device parameters)))))
(cond
((eq type t) nil)
((eq type nil) (error "Display %s does not exist" (cdr (assq 'display-id parameters))))
((eq type nil) (error "Display %s does not exist" (cdr (assq 'device parameters))))
(t type))))
((assq 'window-system parameters)
(cdr (assq 'window-system parameters)))
......
......@@ -7307,11 +7307,11 @@ Return the corresponding character code in Big5. */)
DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
Sset_terminal_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
(coding_system, display)
(coding_system, device)
Lisp_Object coding_system;
Lisp_Object display;
Lisp_Object device;
{
struct coding_system *terminal_coding = DISPLAY_TERMINAL_CODING (get_display (display, 1));
struct coding_system *terminal_coding = DEVICE_TERMINAL_CODING (get_device (device, 1));
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
/* We had better not send unsafe characters to terminal. */
......@@ -7345,38 +7345,39 @@ DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_sys
DEFUN ("terminal-coding-system", Fterminal_coding_system,
Sterminal_coding_system, 0, 1, 0,
doc: /* Return coding system specified for terminal output on the given display.
DISPLAY may be a display id, a frame, or nil for the selected frame's display. */)
(display)
Lisp_Object display;
doc: /* Return coding system specified for terminal output on the given device.
DEVICE may be a display device id, a frame, or nil for the selected
frame's display device. */)
(device)
Lisp_Object device;
{
return DISPLAY_TERMINAL_CODING (get_display (display, 1))->symbol;
return DEVICE_TERMINAL_CODING (get_device (device, 1))->symbol;
}
DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
Sset_keyboard_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
(coding_system, display)
(coding_system, device)
Lisp_Object coding_system;
Lisp_Object display;
Lisp_Object device;
{
struct display *d = get_display (display, 1);
struct device *d = get_device (device, 1);
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
DISPLAY_KEYBOARD_CODING (d));
DEVICE_KEYBOARD_CODING (d));
/* Character composition should be disabled. */
DISPLAY_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED;
DEVICE_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED;
return Qnil;
}
DEFUN ("keyboard-coding-system", Fkeyboard_coding_system,
Skeyboard_coding_system, 0, 1, 0,
doc: /* Return coding system specified for decoding keyboard input. */)
(display)
Lisp_Object display;
(device)
Lisp_Object device;
{
return DISPLAY_KEYBOARD_CODING (get_display (display, 1))->symbol;
return DEVICE_KEYBOARD_CODING (get_device (device, 1))->symbol;
}
......
......@@ -1876,39 +1876,42 @@ If the current binding is global (the default), the value is nil. */)
return Qnil;
}
extern struct display *get_display P_ ((Lisp_Object display, int));
extern struct device *get_device P_ ((Lisp_Object display, int));
DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
doc: /* Return the terminal-local value of SYMBOL on DISPLAY.
doc: /* Return the terminal-local value of SYMBOL on DEVICE.
If SYMBOL is not a terminal-local variable, then return its normal
value, like `symbol-value'.
DISPLAY may be a display, a frame, or nil (meaning the selected
frame's display). */)
(symbol, display)
DEVICE may be a display device id, a frame, or nil (meaning the
selected frame's display device). */)
(symbol, device)
Lisp_Object symbol;
Lisp_Object display;
Lisp_Object device;
{
Lisp_Object result;
struct display *d = get_display (display, 1);
push_display_kboard (d);
struct device *d = get_device (device, 1);
push_device_kboard (d);
result = Fsymbol_value (symbol);
pop_frame_kboard ();
return result;
}
DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
doc: /* Set the terminal-local binding of SYMBOL on DISPLAY to VALUE.
doc: /* Set the terminal-local binding of SYMBOL on DEVICE to VALUE.
If VARIABLE is not a terminal-local variable, then set its normal
binding, like `set'. */)
(symbol, display, value)
binding, like `set'.
DEVICE may be a display device id, a frame, or nil (meaning the
selected frame's display device). */)
(symbol, device, value)
Lisp_Object symbol;
Lisp_Object display;
Lisp_Object device;
Lisp_Object value;
{
Lisp_Object result;
struct display *d = get_display (display, 1);
push_display_kboard (d);
struct device *d = get_device (device, 1);
push_device_kboard (d);
result = Fset (symbol, value);
pop_frame_kboard ();
return result;
......
......@@ -2929,17 +2929,17 @@ extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
extern void tty_setup_colors P_ ((struct tty_display_info *, int));
extern struct display *get_display P_ ((Lisp_Object display, int));
extern struct display *get_named_tty_display P_ ((char *));
extern struct device *get_device P_ ((Lisp_Object display, int));
extern struct device *get_named_tty P_ ((char *));
EXFUN (Fdisplay_tty_type, 1);
extern struct display *init_initial_display P_ ((void));
extern struct display *init_tty P_ ((char *, char *, int));
extern void delete_tty P_ ((struct display *));
extern struct device *init_initial_device P_ ((void));
extern struct device *init_tty P_ ((char *, char *, int));
extern void delete_tty P_ ((struct device *));
extern void fatal P_ ((/* char *, ... */));
extern void cursor_to P_ ((struct frame *, int, int));
extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
extern void tty_set_terminal_modes P_ ((struct display *));
extern void tty_reset_terminal_modes P_ ((struct display *));
extern void tty_set_terminal_modes P_ ((struct device *));
extern void tty_reset_terminal_modes P_ ((struct device *));
extern void create_tty_output P_ ((struct frame *));
......
......@@ -3343,7 +3343,7 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
update_begin (f);
#ifdef MSDOS
if (FRAME_MSDOS_P (f))
set_terminal_modes (FRAME_DISPLAY (f));
set_terminal_modes (FRAME_DEVICE (f));
#endif
clear_frame (f);
clear_current_matrices (f);
......@@ -6723,7 +6723,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
#endif /* VMS */
{
struct display *d;
struct device *d;
struct frame *f = XFRAME (selected_frame);
/* Open a display on the controlling tty. */
......@@ -6733,16 +6733,16 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
if (f->output_method != output_initial)
abort ();
f->output_method = d->type;
f->display = d;
f->device = d;
d->reference_count++;
d->display_info.tty->top_frame = selected_frame;
change_frame_size (XFRAME (selected_frame), FrameRows (d->display_info.tty), FrameCols (d->display_info.tty), 0, 0, 1);
/* Delete the initial display. */
if (--initial_display->reference_count == 0
&& initial_display->delete_display_hook)
(*initial_display->delete_display_hook) (initial_display);
if (--initial_device->reference_count == 0
&& initial_device->delete_device_hook)
(*initial_device->delete_device_hook) (initial_device);
/* Update frame parameters to reflect the new type. */
Fmodify_frame_parameters
......
......@@ -76,7 +76,7 @@ Lisp_Object Qinhibit_default_face_x_resources;
Lisp_Object Qx_frame_parameter;
Lisp_Object Qx_resource_name;
Lisp_Object Qdisplay_id;
Lisp_Object Qdevice;
Lisp_Object Qdisplay_live_p;
/* Frame parameters (set or reported). */
......@@ -422,7 +422,7 @@ make_frame_without_minibuffer (mini_window, kb, display)
#ifdef MULTI_KBOARD
if (!NILP (mini_window)
&& XFRAME (XWINDOW (mini_window)->frame)->display->kboard != kb)
&& XFRAME (XWINDOW (mini_window)->frame)->device->kboard != kb)
error ("Frame and minibuffer must be on the same display");
#endif
......@@ -507,7 +507,7 @@ struct frame *
make_initial_frame (void)
{
struct frame *f;
struct display *display;
struct device *device;
Lisp_Object frame;
#ifdef MULTI_KBOARD
......@@ -525,7 +525,7 @@ make_initial_frame (void)
if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
Vframe_list = Qnil;
display = init_initial_display ();
device = init_initial_device ();
f = make_frame (1);
XSETFRAME (frame, f);
......@@ -538,9 +538,9 @@ make_initial_frame (void)
f->visible = 1;
f->async_visible = 1;
f->output_method = display->type;
f->display = display;
f->display->reference_count++;
f->output_method = device->type;
f->device = device;
f->device->reference_count++;
f->output_data.nothing = 0;
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
......@@ -554,7 +554,7 @@ make_initial_frame (void)
struct frame *
make_terminal_frame (struct display *display)
make_terminal_frame (struct device *device)
{
register struct frame *f;
Lisp_Object frame;
......@@ -605,8 +605,8 @@ make_terminal_frame (struct display *display)
#else
{
f->output_method = output_termcap;
f->display = display;
f->display->reference_count++;
f->device = device;
f->device->reference_count++;
create_tty_output (f);
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
......@@ -658,7 +658,7 @@ affects all frames on the same terminal device. */)
Lisp_Object parms;
{
struct frame *f;
struct display *d = NULL;
struct device *d = NULL;
Lisp_Object frame, tem;
struct frame *sf = SELECTED_FRAME ();
......@@ -682,12 +682,12 @@ affects all frames on the same terminal device. */)
{
Lisp_Object display_device;
display_device = Fassq (Qdisplay_id, parms);
display_device = Fassq (Qdevice, parms);
if (!NILP (display_device))
{
display_device = XCDR (display_device);
CHECK_NUMBER (display_device);
d = get_display (XINT (display_device), 1);
d = get_device (XINT (display_device), 1);
}
}
......@@ -1053,14 +1053,14 @@ The display device is represented by its integer identifier. */)
(frame)
Lisp_Object frame;
{
struct display *d;
struct device *d;
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
d = get_display (frame, 0);
d = get_device (frame, 0);
if (!d)
return Qnil;
......@@ -1502,27 +1502,27 @@ The functions are run with one arg, the frame to be deleted. */)
promise that the display of the frame must be valid until we have
called the window-system-dependent frame destruction routine. */
if (FRAME_DISPLAY (f)->delete_frame_hook)
(*FRAME_DISPLAY (f)->delete_frame_hook) (f);
if (FRAME_DEVICE (f)->delete_frame_hook)
(*FRAME_DEVICE (f)->delete_frame_hook) (f);
{
struct display *display = FRAME_DISPLAY (f);
struct device *device = FRAME_DEVICE (f);
f->output_data.nothing = 0;
f->display = 0; /* Now the frame is dead. */
f->device = 0; /* Now the frame is dead. */
/* If needed, delete the device that this frame was on.
(This must be done after the frame is killed.) */
display->reference_count--;
if (display->reference_count == 0)
device->reference_count--;
if (device->reference_count == 0)
{
kb = NULL;
if (display->delete_display_hook)
(*display->delete_display_hook) (display);
if (device->delete_device_hook)
(*device->delete_device_hook) (device);
else
delete_display (display);
delete_device (device);
}
else
kb = display->kboard;
kb = device->kboard;
}
/* If we've deleted the last_nonminibuf_frame, then try to find
......@@ -1669,8 +1669,8 @@ and returns whatever that function returns. */)
#ifdef HAVE_MOUSE
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_DISPLAY (f)->mouse_position_hook)
(*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1,
if (FRAME_DEVICE (f)->mouse_position_hook)
(*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
&lispy_dummy, &party_dummy,
&x, &y,
&long_dummy);
......@@ -1712,8 +1712,8 @@ and nil for X and Y. */)
#ifdef HAVE_MOUSE
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_DISPLAY (f)->mouse_position_hook)
(*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1,
if (FRAME_DEVICE (f)->mouse_position_hook)
(*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
&lispy_dummy, &party_dummy,
&x, &y,
&long_dummy);
......@@ -1993,8 +1993,8 @@ doesn't support multiple overlapping frames, this function does nothing. */)
/* Do like the documentation says. */
Fmake_frame_visible (frame);
if (FRAME_DISPLAY (f)->frame_raise_lower_hook)
(*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 1);
if (FRAME_DEVICE (f)->frame_raise_lower_hook)
(*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 1);
return Qnil;
}
......@@ -2017,8 +2017,8 @@ doesn't support multiple overlapping frames, this function does nothing. */)
f = XFRAME (frame);
if (FRAME_DISPLAY (f)->frame_raise_lower_hook)
(*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 0);
if (FRAME_DEVICE (f)->frame_raise_lower_hook)
(*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 0);
return Qnil;
}
......@@ -2066,8 +2066,8 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */)
f->focus_frame = focus_frame;
if (FRAME_DISPLAY (f)->frame_rehighlight_hook)
(*FRAME_DISPLAY (f)->frame_rehighlight_hook) (f);
if (FRAME_DEVICE (f)->frame_rehighlight_hook)
(*FRAME_DEVICE (f)->frame_rehighlight_hook) (f);
return Qnil;
}
......@@ -4223,8 +4223,8 @@ syms_of_frame ()
Qx_frame_parameter = intern ("x-frame-parameter");
staticpro (&Qx_frame_parameter);
Qdisplay_id = intern ("display-id");
staticpro (&Qdisplay_id);
Qdevice = intern ("device");
staticpro (&Qdevice);
Qdisplay_live_p = intern ("display-live-p");
staticpro (&Qdisplay_live_p);
......
......@@ -69,7 +69,7 @@ enum text_cursor_kinds
#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
struct display;
struct device;
struct frame
{
......@@ -131,7 +131,7 @@ struct frame
Actually, we don't specify exactly what is stored here at all; the
scroll bar implementation code can use it to store anything it likes.
This field is marked by the garbage collector. It is here
instead of in the `display' structure so that the garbage
instead of in the `device' structure so that the garbage
collector doesn't need to look inside the window-system-dependent
structure. */
Lisp_Object scroll_bars;
......@@ -262,14 +262,14 @@ struct frame
/* The output method says how the contents of this frame are
displayed. It could be using termcap, or using an X window.
This must be the same as the display->type. */
This must be the same as the device->type. */
enum output_method output_method;
/* The display that this frame uses. If this is NULL, then the
frame is deleted. */
struct display *display;
/* The display device that this frame uses. If this is NULL, then
the frame has been deleted. */
struct device *device;
/* Display-dependent, frame-local auxiliary data used for displaying
/* Device-dependent, frame-local auxiliary data used for displaying
the contents. When the frame is deleted, this data is deleted as
well. */
union output_data
......@@ -415,7 +415,7 @@ struct frame
/* The baud rate that was used to calculate costs for this frame. */
int cost_calculation_baud_rate;
/* Nonzero if the mouse has moved on this display
/* Nonzero if the mouse has moved on this display device
since the last time we checked. */
char mouse_moved;
......@@ -446,7 +446,7 @@ struct frame
};
#ifdef MULTI_KBOARD
#define FRAME_KBOARD(f) ((f)->display->kboard)
#define FRAME_KBOARD(f) ((f)->device->kboard)
#else
#define FRAME_KBOARD(f) (&the_only_kboard)
#endif
......@@ -484,7 +484,7 @@ typedef struct frame *FRAME_PTR;
#endif
/* Nonzero if frame F is still alive (not deleted). */
#define FRAME_LIVE_P(f) ((f)->display != 0)
#define FRAME_LIVE_P(f) ((f)->device != 0)
/* Nonzero if frame F is a minibuffer-only frame. */
#define FRAME_MINIBUF_ONLY_P(f) \
......@@ -768,12 +768,12 @@ typedef struct frame *FRAME_PTR;
extern Lisp_Object Qframep, Qframe_live_p;
extern Lisp_Object Qtty, Qtty_type;
extern Lisp_Object Qdisplay_id, Qdisplay_live_p;
extern Lisp_Object Qdevice, Qdisplay_live_p;
extern struct frame *last_nonminibuf_frame;
extern struct frame *make_initial_frame P_ ((void));
extern struct frame *make_terminal_frame P_ ((struct display *));
extern struct frame *make_terminal_frame P_ ((struct device *));
extern struct frame *make_frame P_ ((int));
#ifdef HAVE_WINDOW_SYSTEM
extern struct frame *make_minibuffer_frame P_ ((void));
......
......@@ -1112,8 +1112,8 @@ struct kboard_stack
static struct kboard_stack *kboard_stack;
void
push_display_kboard (d)
struct display *d;
push_device_kboard (d)
struct device *d;
{
#ifdef MULTI_KBOARD
struct kboard_stack *p
......@@ -4169,9 +4169,9 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
x = Qnil;
/* XXX Can f or mouse_position_hook be NULL here? */
if (f && FRAME_DISPLAY (f)->mouse_position_hook)
(*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window,
&part, &x, &y, &time);
if (f && FRAME_DEVICE (f)->mouse_position_hook)
(*FRAME_DEVICE (f)->mouse_position_hook) (&f, 0, &bar_window,
&part, &x, &y, &time);
obj = Qnil;
......@@ -6670,13 +6670,13 @@ read_avail_input (expected)
{
int nread = 0;
int err = 0;
struct display *d;
struct device *d;
/* Loop through the available displays, and call their input hooks. */
d = display_list;
/* Loop through the available devices, and call their input hooks. */
d = device_list;
while (d)
{
struct display *next = d->next_display;
struct device *next = d->next_device;
if (d->read_socket_hook)
{
......@@ -6702,7 +6702,7 @@ read_avail_input (expected)
/* The display device terminated; it should be closed. */
/* Kill Emacs if this was our last display. */
if (! display_list->next_display)
if (! device_list->next_device)
/* Formerly simply reported no input, but that
sometimes led to a failure of Emacs to terminate.
SIGHUP seems appropriate if we can't reach the
......@@ -6713,11 +6713,11 @@ read_avail_input (expected)
alone in its group. */
kill (getpid (), SIGHUP);
/* XXX Is calling delete_display safe here? It calls Fdelete_frame. */
if (d->delete_display_hook)
(*d->delete_display_hook) (d);
/* XXX Is calling delete_device safe here? It calls Fdelete_frame. */
if (d->delete_device_hook)
(*d->delete_device_hook) (d);
else
delete_display (d);
delete_device (d);
}
if (hold_quit.kind != NO_EVENT)
......@@ -6735,12 +6735,12 @@ read_avail_input (expected)
/* This is the tty way of reading available input.
Note that each terminal device has its own `struct display' object,
Note that each terminal device has its own `struct device' object,
and so this function is called once for each individual termcap
display. The first parameter indicates which device to read from. */
int
tty_read_avail_input (struct display *display,
tty_read_avail_input (struct device *device,
int expected,
struct input_event *hold_quit)
{
......@@ -6749,10 +6749,10 @@ tty_read_avail_input (struct display *display,
of characters on some systems when input is stuffed at us. */
unsigned char cbuf[KBD_BUFFER_SIZE - 1];
int n_to_read, i;
struct tty_display_info *tty = display->display_info.tty;
struct tty_display_info *tty = device->display_info.tty;
int nread = 0;
if (display->type != output_termcap)
if (device->type != output_termcap)
abort ();
/* XXX I think the following code should be moved to separate hook
......@@ -6782,7 +6782,7 @@ tty_read_avail_input (struct display *display,
if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
{
if (! noninteractive)
return -2; /* Close this display. */
return -2; /* Close this device. */
else
n_to_read = 0;
}
......@@ -6811,14 +6811,14 @@ tty_read_avail_input (struct display *display,
when the control tty is taken away.
Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
if (nread == -1 && errno == EIO)
return -2; /* Close this display. */
return -2; /* Close this device. */
#if defined (AIX) && (! defined (aix386) && defined (_BSD))
/* The kernel sometimes fails to deliver SIGHUP for ptys.
This looks incorrect, but it isn't, because _BSD causes
O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
and that causes a value other than 0 when there is no input. */
if (nread == 0)
return -2; /* Close this display. */
return -2; /* Close this device. */
#endif
}
while (
......@@ -10365,7 +10365,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
{
/* Must preserve main program's value of errno. */
int old_errno = errno;
struct display *display;
struct device *device;
#if defined (USG) && !defined (POSIX_SIGNALS)
/* USG systems forget handlers when they are used;
......@@ -10377,8 +10377,8 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
SIGNAL_THREAD_CHECK (signalnum);
/* See if we have an active display on our controlling terminal. */
display = get_named_tty_display (NULL);
if (!display)
device = get_named_tty (NULL);
if (!device)
{
/* If there are no frames there, let's pretend that we are a
well-behaving UN*X program and quit. */
......@@ -10392,7 +10392,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
controlling tty, if we have a frame there. We disable the
interrupt key on secondary ttys, so the SIGINT must have come
from the controlling tty. */
internal_last_event_frame = display->display_info.tty->top_frame;
internal_last_event_frame = device->display_info.tty->top_frame;
handle_interrupt ();
}
......@@ -10421,7 +10421,7 @@ handle_interrupt ()
/* XXX This code needs to be revised for multi-tty support. */
if (!NILP (Vquit_flag)
#ifndef MSDOS
&& get_named_tty_display (NULL)