/[emacs]/emacs/src/process.c
ViewVC logotype

Diff of /emacs/src/process.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.373.2.12 by miles, Sat Sep 4 09:19:27 2004 UTC revision 1.373.2.13 by miles, Sat Sep 4 09:24:36 2004 UTC
# Line 3718  close_process_descs () Line 3718  close_process_descs ()
3718  }  }
3719    
3720  DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output,  DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output,
3721         0, 3, 0,         0, 4, 0,
3722         doc: /* Allow any pending output from subprocesses to be read by Emacs.         doc: /* Allow any pending output from subprocesses to be read by Emacs.
3723  It is read into the process' buffers or given to their filter functions.  It is read into the process' buffers or given to their filter functions.
3724  Non-nil arg PROCESS means do not return until some output has been received  Non-nil arg PROCESS means do not return until some output has been received
# Line 3726  from PROCESS. Line 3726  from PROCESS.
3726  Non-nil second arg TIMEOUT and third arg TIMEOUT-MSECS are number of  Non-nil second arg TIMEOUT and third arg TIMEOUT-MSECS are number of
3727  seconds and microseconds to wait; return after that much time whether  seconds and microseconds to wait; return after that much time whether
3728  or not there is input.  or not there is input.
3729    If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
3730    from PROCESS, suspending reading output from other processes.
3731    If JUST-THIS-ONE is an integer, don't run any timers either.
3732  Return non-nil iff we received any output before the timeout expired.  */)  Return non-nil iff we received any output before the timeout expired.  */)
3733       (process, timeout, timeout_msecs)       (process, timeout, timeout_msecs, just_this_one)
3734       register Lisp_Object process, timeout, timeout_msecs;       register Lisp_Object process, timeout, timeout_msecs, just_this_one;
3735  {  {
3736    int seconds;    int seconds;
3737    int useconds;    int useconds;
3738    
3739    if (! NILP (process))    if (! NILP (process))
3740      CHECK_PROCESS (process);      CHECK_PROCESS (process);
3741      else
3742        just_this_one = Qnil;
3743    
3744    if (! NILP (timeout_msecs))    if (! NILP (timeout_msecs))
3745      {      {
# Line 3776  Return non-nil iff we received any outpu Line 3781  Return non-nil iff we received any outpu
3781      XSETFASTINT (process, 0);      XSETFASTINT (process, 0);
3782    
3783    return    return
3784      (wait_reading_process_input (seconds, useconds, process, 0)      (wait_reading_process_input (seconds, useconds, process,
3785                                     NILP (just_this_one) ? 0 :
3786                                     !INTEGERP (just_this_one) ? -1 : -2)
3787       ? Qt : Qnil);       ? Qt : Qnil);
3788  }  }
3789    
# Line 4009  wait_reading_process_input_1 () Line 4016  wait_reading_process_input_1 ()
4016         process.  The return value is true iff we read some input from         process.  The return value is true iff we read some input from
4017         that process.         that process.
4018    
4019     DO_DISPLAY != 0 means redisplay should be done to show subprocess     If READ_KBD is a process object, DO_DISPLAY < 0 means handle only
4020     output that arrives.       output from that process (suspending output from other processes)
4021         and DO_DISPLAY == -2 specifically means don't run any timers either.
4022       Otherwise, != 0 means redisplay should be done to show subprocess
4023         output that arrives.
4024    
4025     If READ_KBD is a pointer to a struct Lisp_Process, then the     If READ_KBD is a pointer to a struct Lisp_Process, then the
4026       function returns true iff we received input from that process       function returns true iff we received input from that process
# Line 4032  wait_reading_process_input (time_limit, Line 4042  wait_reading_process_input (time_limit,
4042    EMACS_TIME timeout, end_time;    EMACS_TIME timeout, end_time;
4043    int wait_channel = -1;    int wait_channel = -1;
4044    struct Lisp_Process *wait_proc = 0;    struct Lisp_Process *wait_proc = 0;
4045      int just_wait_proc = 0;
4046    int got_some_input = 0;    int got_some_input = 0;
4047    /* Either nil or a cons cell, the car of which is of interest and    /* Either nil or a cons cell, the car of which is of interest and
4048       may be changed outside of this routine.  */       may be changed outside of this routine.  */
# Line 4048  wait_reading_process_input (time_limit, Line 4059  wait_reading_process_input (time_limit,
4059        wait_proc = XPROCESS (read_kbd);        wait_proc = XPROCESS (read_kbd);
4060        wait_channel = XINT (wait_proc->infd);        wait_channel = XINT (wait_proc->infd);
4061        XSETFASTINT (read_kbd, 0);        XSETFASTINT (read_kbd, 0);
4062          if (do_display < 0)
4063            {
4064              just_wait_proc = do_display;
4065              do_display = 0;
4066            }
4067      }      }
4068    
4069    /* If waiting for non-nil in a cell, record where.  */    /* If waiting for non-nil in a cell, record where.  */
# Line 4122  wait_reading_process_input (time_limit, Line 4138  wait_reading_process_input (time_limit,
4138           But not if wait_for_cell; in those cases,           But not if wait_for_cell; in those cases,
4139           the wait is supposed to be short,           the wait is supposed to be short,
4140           and those callers cannot handle running arbitrary Lisp code here.  */           and those callers cannot handle running arbitrary Lisp code here.  */
4141        if (NILP (wait_for_cell))        if (NILP (wait_for_cell)
4142              && just_wait_proc != -2)
4143          {          {
4144            EMACS_TIME timer_delay;            EMACS_TIME timer_delay;
4145    
# Line 4258  wait_reading_process_input (time_limit, Line 4275  wait_reading_process_input (time_limit,
4275    
4276        /* Wait till there is something to do */        /* Wait till there is something to do */
4277    
4278        if (!NILP (wait_for_cell))        if (just_wait_proc)
4279            {
4280              FD_SET (XINT (wait_proc->infd), &Available);
4281              check_connect = check_delay = 0;
4282            }
4283          else if (!NILP (wait_for_cell))
4284          {          {
4285            Available = non_process_wait_mask;            Available = non_process_wait_mask;
4286            check_connect = check_delay = 0;            check_connect = check_delay = 0;
# Line 5549  process_send_signal (process, signo, cur Line 5571  process_send_signal (process, signo, cur
5571           work.  If the system has it, use it.  */           work.  If the system has it, use it.  */
5572  #ifdef HAVE_TERMIOS  #ifdef HAVE_TERMIOS
5573        struct termios t;        struct termios t;
5574          cc_t *sig_char = NULL;
5575    
5576          tcgetattr (XINT (p->infd), &t);
5577    
5578        switch (signo)        switch (signo)
5579          {          {
5580          case SIGINT:          case SIGINT:
5581            tcgetattr (XINT (p->infd), &t);            sig_char = &t.c_cc[VINTR];
5582            send_process (proc, &t.c_cc[VINTR], 1, Qnil);            break;
           return;  
5583    
5584          case SIGQUIT:          case SIGQUIT:
5585            tcgetattr (XINT (p->infd), &t);            sig_char = &t.c_cc[VQUIT];
5586            send_process (proc, &t.c_cc[VQUIT], 1, Qnil);            break;
           return;  
5587    
5588          case SIGTSTP:          case SIGTSTP:
           tcgetattr (XINT (p->infd), &t);  
5589  #if defined (VSWTCH) && !defined (PREFER_VSUSP)  #if defined (VSWTCH) && !defined (PREFER_VSUSP)
5590            send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);            sig_char = &t.c_cc[VSWTCH];
5591  #else  #else
5592            send_process (proc, &t.c_cc[VSUSP], 1, Qnil);            sig_char = &t.c_cc[VSUSP];
5593  #endif  #endif
5594            return;            break;
5595          }          }
5596    
5597    #ifndef _POSIX_VDISABLE
5598    #ifdef CVDISABLE
5599    #define _POSIX_VDISABLE CVDISABLE
5600    #else
5601    #define _POSIX_VDISABLE '\0'
5602    #endif
5603    #endif
5604    
5605          if (sig_char && *sig_char != _POSIX_VDISABLE)
5606            send_process (proc, sig_char, 1, Qnil);
5607          return;
5608  #else /* ! HAVE_TERMIOS */  #else /* ! HAVE_TERMIOS */
5609    
5610        /* On Berkeley descendants, the following IOCTL's retrieve the        /* On Berkeley descendants, the following IOCTL's retrieve the

Legend:
Removed from v.1.373.2.12  
changed lines
  Added in v.1.373.2.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26