X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fevent-tty.c;h=59b4e00d2c5fe6ddf279aaeac5f56a0f813614c7;hb=341b931fa7ec4177794ad4ee2089fde2c5ec3c36;hp=00dd49ce10837af325a71d1486e833ddcec58a19;hpb=35adcaaeafb1fe93eaf00c39b48619e8f188ff3f;p=chise%2Fxemacs-chise.git.1 diff --git a/src/event-tty.c b/src/event-tty.c index 00dd49c..59b4e00 100644 --- a/src/event-tty.c +++ b/src/event-tty.c @@ -64,7 +64,7 @@ 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 */ @@ -94,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; @@ -112,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) { @@ -142,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)) @@ -156,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); @@ -188,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 */ } 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); } @@ -245,11 +244,12 @@ 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); tty_event_stream->event_pending_p = emacs_tty_event_pending_p; + tty_event_stream->force_event_pending = 0; tty_event_stream->next_event_cb = emacs_tty_next_event; tty_event_stream->handle_magic_event_cb = emacs_tty_handle_magic_event; tty_event_stream->add_timeout_cb = emacs_tty_add_timeout; @@ -264,6 +264,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;