XEmacs 21.2.28 "Hermes".
[chise/xemacs-chise.git.1] / src / event-tty.c
index 6f02747..93fb928 100644 (file)
@@ -64,13 +64,15 @@ emacs_tty_remove_timeout (int id)
 }
 
 static void
-tty_timeout_to_emacs_event (struct Lisp_Event *emacs_event)
+tty_timeout_to_emacs_event (Lisp_Event *emacs_event)
 {
   emacs_event->event_type = timeout_event;
   /* timeout events have nil as channel */
   emacs_event->timestamp  = 0; /* #### */
   emacs_event->event.timeout.interval_id =
     pop_low_level_timeout (&tty_timer_queue, 0);
+  emacs_event->event.timeout.function = Qnil;
+  emacs_event->event.timeout.object = Qnil;
 }
 
 \f
@@ -92,8 +94,8 @@ emacs_tty_event_pending_p (int user_p)
                             non_fake_input_wait_mask);
 }
 
-static struct console *
-find_console_from_fd (int fd)
+struct console *
+tty_find_console_from_fd (int fd)
 {
   Lisp_Object concons;
 
@@ -110,7 +112,7 @@ find_console_from_fd (int fd)
 }
 
 static void
-emacs_tty_next_event (struct Lisp_Event *emacs_event)
+emacs_tty_next_event (Lisp_Event *emacs_event)
 {
   while (1)
     {
@@ -140,7 +142,7 @@ emacs_tty_next_event (struct Lisp_Event *emacs_event)
                 user events ahead of process events. */
              if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask))
                {
-                 struct console *c = find_console_from_fd (i);
+                 struct console *c = tty_find_console_from_fd (i);
 
                  assert (c);
                  if (read_event_from_tty_or_stream_desc (emacs_event, c, i))
@@ -154,8 +156,7 @@ emacs_tty_next_event (struct Lisp_Event *emacs_event)
              if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask))
                {
                  Lisp_Object process;
-                 struct Lisp_Process *p =
-                   get_process_from_usid (FD_TO_USID(i));
+                 Lisp_Process *p = get_process_from_usid (FD_TO_USID(i));
 
                  assert (p);
                  XSETPROCESS (process, p);
@@ -186,20 +187,20 @@ emacs_tty_next_event (struct Lisp_Event *emacs_event)
 }
 
 static void
-emacs_tty_handle_magic_event (struct Lisp_Event *emacs_event)
+emacs_tty_handle_magic_event (Lisp_Event *emacs_event)
 {
   /* Nothing to do currently */
 }
 
 \f
 static void
-emacs_tty_select_process (struct Lisp_Process *process)
+emacs_tty_select_process (Lisp_Process *process)
 {
   event_stream_unixoid_select_process (process);
 }
 
 static void
-emacs_tty_unselect_process (struct Lisp_Process *process)
+emacs_tty_unselect_process (Lisp_Process *process)
 {
   event_stream_unixoid_unselect_process (process);
 }
@@ -243,7 +244,7 @@ emacs_tty_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream)
 /************************************************************************/
 
 void
-vars_of_event_tty (void)
+reinit_vars_of_event_tty (void)
 {
   tty_event_stream = xnew (struct event_stream);
 
@@ -262,6 +263,12 @@ vars_of_event_tty (void)
 }
 
 void
+vars_of_event_tty (void)
+{
+  reinit_vars_of_event_tty ();
+}
+
+void
 init_event_tty_late (void)
 {
   event_stream = tty_event_stream;