2010-11-09 Eli Zaretskii <eliz@gnu.org>
+ * keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
+ (kbd_buffer_store_event_hold, kbd_buffer_get_event)
+ (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
+ subprocesses. Use buffer_free only ifdef subprocesses.
+
+ * process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
+ the subprocesses version, not in the non-subprocesses one.
+
* Makefile.in: Don't use ## comment, it breaks the MSDOS build.
* xfns.c (x_real_positions): Fix declaration-after-statement
return FRAME_KBOARD (XFRAME (frame));
}
+#ifdef subprocesses
/* Return the number of slots occupied in kbd_buffer. */
static int
: ((kbd_buffer + KBD_BUFFER_SIZE) - kbd_fetch_ptr
+ (kbd_store_ptr - kbd_buffer)));
}
+#endif /* subprocesses */
Lisp_Object Vthrow_on_input;
{
*kbd_store_ptr = *event;
++kbd_store_ptr;
+#ifdef subprocesses
if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ())
{
/* Don't read keyboard input until we have processed kbd_buffer.
#endif
stop_polling ();
}
+#endif /* subprocesses */
}
/* If we're inside while-no-input, and this event qualifies
register int c;
Lisp_Object obj;
+#ifdef subprocesses
if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
{
/* Start reading input again, we have processed enough so we can
#endif /* SIGIO */
start_polling ();
}
+#endif /* subprocesses */
if (noninteractive
/* In case we are running as a daemon, only do this before
int n_to_read, i;
struct tty_display_info *tty = terminal->display_info.tty;
int nread = 0;
+#ifdef subprocesses
int buffer_free = KBD_BUFFER_SIZE - kbd_buffer_nr_stored () - 1;
if (kbd_on_hold_p () || buffer_free <= 0)
return 0;
+#endif /* subprocesses */
if (!terminal->name) /* Don't read from a dead terminal. */
return 0;
#endif
#endif
+#ifdef subprocesses
/* Don't read more than we can store. */
if (n_to_read > buffer_free)
n_to_read = buffer_free;
+#endif /* subprocesses */
/* Now read; for one reason or another, this will not block.
NREAD is set to the number of chars read. */