Mercurial > emacs
diff src/process.c @ 2200:5e58643bb169
(wait_reading_process_input): New option to wait
till a given cons cell has a non-nil car.
Delete vipc conditionals.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 15 Mar 1993 06:09:04 +0000 |
parents | fc3cdca22f8d |
children | 7edc78402205 |
line wrap: on
line diff
--- a/src/process.c Mon Mar 15 06:07:40 1993 +0000 +++ b/src/process.c Mon Mar 15 06:09:04 1993 +0000 @@ -211,13 +211,6 @@ #endif #endif /* VMS */ -#ifdef vipc - -#include "vipc.h" -extern int comm_server; -extern int net_listen_address; -#endif /* vipc */ - /* t means use pty, nil means use a pipe, maybe other values to come. */ Lisp_Object Vprocess_connection_type; @@ -1658,8 +1651,9 @@ read_kbd is a lisp value: 0 to ignore keyboard input, or 1 to return when input is available, or - -1 means caller will actually read the input, so don't throw to + -1 meaning caller will actually read the input, so don't throw to the quit handler, or + a cons cell, meaning wait wait until its car is non-nil, or a process object, meaning wait until something arrives from that process. The return value is true iff we read some input from that process. @@ -1686,6 +1680,7 @@ int wait_channel = 0; struct Lisp_Process *wait_proc = 0; int got_some_input = 0; + Lisp_Object *wait_for_cell = 0; FD_ZERO (&Available); @@ -1698,6 +1693,13 @@ XFASTINT (read_kbd) = 0; } + /* If waiting for non-nil in a cell, record where. */ + if (XTYPE (read_kbd) == Lisp_Cons) + { + wait_for_cell = &XCONS (read_kbd)->car; + XFASTINT (read_kbd) = 0; + } + waiting_for_user_input_p = XINT (read_kbd); /* Since we may need to wait several times, @@ -1846,29 +1848,20 @@ if (XINT (read_kbd) && detect_input_pending ()) break; + /* Exit now if the cell we're waiting for became non-nil. */ + if (wait_for_cell && ! NILP (*wait_for_cell)) + break; + #ifdef SIGIO /* If we think we have keyboard input waiting, but didn't get SIGIO go read it. This can happen with X on BSD after logging out. In that case, there really is no input and no SIGIO, but select says there is input. */ - /* - if (XINT (read_kbd) && interrupt_input && (Available & fileno (stdin))) - */ if (XINT (read_kbd) && interrupt_input && (FD_ISSET (fileno (stdin), &Available))) kill (0, SIGIO); #endif -#ifdef vipc - /* Check for connection from other process */ - - if (Available & ChannelMask (comm_server)) - { - Available &= ~(ChannelMask (comm_server)); - create_commchan (); - } -#endif /* vipc */ - if (! wait_proc) got_some_input |= nfds > 0; @@ -1897,24 +1890,6 @@ if (NILP (proc)) continue; -#ifdef vipc - /* It's a command channel */ - if (!NILP (XPROCESS (proc)->command_channel_p)) - { - ProcessCommChan (channel, proc); - if (NILP (XPROCESS (proc)->command_channel_p)) - { - /* It has ceased to be a command channel! */ - int bytes_available; - if (ioctl (channel, FIONREAD, &bytes_available) < 0) - bytes_available = 0; - if (bytes_available) - FD_SET (channel, &Available); - } - continue; - } -#endif /* vipc */ - /* Read data from the process, starting with our buffered-ahead character if we have one. */