/[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.462 by ttn, Sun Aug 7 12:33:17 2005 UTC revision 1.463 by kfstorm, Mon Aug 15 08:44:53 2005 UTC
# Line 294  static Lisp_Object Vprocess_adaptive_rea Line 294  static Lisp_Object Vprocess_adaptive_rea
294    
295  #include "sysselect.h"  #include "sysselect.h"
296    
297  extern int keyboard_bit_set P_ ((SELECT_TYPE *));  static int keyboard_bit_set P_ ((SELECT_TYPE *));
298    static void deactivate_process P_ ((Lisp_Object));
299    static void status_notify P_ ((struct Lisp_Process *));
300    static int read_process_output P_ ((Lisp_Object, int));
301    
302  /* If we support a window system, turn on the code to poll periodically  /* If we support a window system, turn on the code to poll periodically
303     to detect C-g.  It isn't actually used when doing interrupt input.  */     to detect C-g.  It isn't actually used when doing interrupt input.  */
# Line 391  static char pty_name[24]; Line 394  static char pty_name[24];
394  /* Compute the Lisp form of the process status, p->status, from  /* Compute the Lisp form of the process status, p->status, from
395     the numeric status that was returned by `wait'.  */     the numeric status that was returned by `wait'.  */
396    
397  Lisp_Object status_convert ();  static Lisp_Object status_convert ();
398    
399  void  static void
400  update_status (p)  update_status (p)
401       struct Lisp_Process *p;       struct Lisp_Process *p;
402  {  {
# Line 407  update_status (p) Line 410  update_status (p)
410  /*  Convert a process status word in Unix format to  /*  Convert a process status word in Unix format to
411      the list that we use internally.  */      the list that we use internally.  */
412    
413  Lisp_Object  static Lisp_Object
414  status_convert (w)  status_convert (w)
415       WAITTYPE w;       WAITTYPE w;
416  {  {
# Line 426  status_convert (w) Line 429  status_convert (w)
429  /* Given a status-list, extract the three pieces of information  /* Given a status-list, extract the three pieces of information
430     and store them individually through the three pointers.  */     and store them individually through the three pointers.  */
431    
432  void  static void
433  decode_status (l, symbol, code, coredump)  decode_status (l, symbol, code, coredump)
434       Lisp_Object l;       Lisp_Object l;
435       Lisp_Object *symbol;       Lisp_Object *symbol;
# Line 505  status_message (p) Line 508  status_message (p)
508     The file name of the terminal corresponding to the pty     The file name of the terminal corresponding to the pty
509     is left in the variable pty_name.  */     is left in the variable pty_name.  */
510    
511  int  static int
512  allocate_pty ()  allocate_pty ()
513  {  {
514    register int c, i;    register int c, i;
# Line 590  allocate_pty () Line 593  allocate_pty ()
593  }  }
594  #endif /* HAVE_PTYS */  #endif /* HAVE_PTYS */
595    
596  Lisp_Object  static Lisp_Object
597  make_process (name)  make_process (name)
598       Lisp_Object name;       Lisp_Object name;
599  {  {
# Line 634  make_process (name) Line 637  make_process (name)
637    return val;    return val;
638  }  }
639    
640  void  static void
641  remove_process (proc)  remove_process (proc)
642       register Lisp_Object proc;       register Lisp_Object proc;
643  {  {
# Line 768  nil, indicating the current buffer's pro Line 771  nil, indicating the current buffer's pro
771       (process)       (process)
772       register Lisp_Object process;       register Lisp_Object process;
773  {  {
774      register struct Lisp_Process *p;
775    
776    process = get_process (process);    process = get_process (process);
777    XPROCESS (process)->raw_status_low = Qnil;    p = XPROCESS (process);
778    XPROCESS (process)->raw_status_high = Qnil;  
779    if (NETCONN_P (process))    p->raw_status_low = Qnil;
780      {    p->raw_status_high = Qnil;
781        XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil));    if (NETCONN1_P (p))
782        XSETINT (XPROCESS (process)->tick, ++process_tick);      {
783        status_notify ();        p->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
784          XSETINT (p->tick, ++process_tick);
785          status_notify (p);
786      }      }
787    else if (XINT (XPROCESS (process)->infd) >= 0)    else if (XINT (p->infd) >= 0)
788      {      {
789        Fkill_process (process, Qnil);        Fkill_process (process, Qnil);
790        /* Do this now, since remove_process will make sigchld_handler do nothing.  */        /* Do this now, since remove_process will make sigchld_handler do nothing.  */
791        XPROCESS (process)->status        p->status
792          = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));          = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
793        XSETINT (XPROCESS (process)->tick, ++process_tick);        XSETINT (p->tick, ++process_tick);
794        status_notify ();        status_notify (p);
795      }      }
796    remove_process (process);    remove_process (process);
797    return Qnil;    return Qnil;
# Line 1238  IP address.  Returns nil if format of AD Line 1245  IP address.  Returns nil if format of AD
1245  }  }
1246  #endif  #endif
1247    
1248  Lisp_Object  static Lisp_Object
1249  list_processes_1 (query_only)  list_processes_1 (query_only)
1250       Lisp_Object query_only;       Lisp_Object query_only;
1251  {  {
# Line 1708  start_process_unwind (proc) Line 1715  start_process_unwind (proc)
1715    return Qnil;    return Qnil;
1716  }  }
1717    
1718  void  static void
1719  create_process_1 (timer)  create_process_1 (timer)
1720       struct atimer *timer;       struct atimer *timer;
1721  {  {
# Line 2531  OPTION is not a supported option, return Line 2538  OPTION is not a supported option, return
2538    
2539  /* A version of request_sigio suitable for a record_unwind_protect.  */  /* A version of request_sigio suitable for a record_unwind_protect.  */
2540    
2541  Lisp_Object  static Lisp_Object
2542  unwind_request_sigio (dummy)  unwind_request_sigio (dummy)
2543       Lisp_Object dummy;       Lisp_Object dummy;
2544  {  {
# Line 4222  wait_reading_process_output (time_limit, Line 4229  wait_reading_process_output (time_limit,
4229                /* It's okay for us to do this and then continue with                /* It's okay for us to do this and then continue with
4230                   the loop, since timeout has already been zeroed out.  */                   the loop, since timeout has already been zeroed out.  */
4231                clear_waiting_for_input ();                clear_waiting_for_input ();
4232                status_notify ();                status_notify (NULL);
4233              }              }
4234          }          }
4235    
# Line 4740  read_process_output_error_handler (error Line 4747  read_process_output_error_handler (error
4747     The characters read are decoded according to PROC's coding-system     The characters read are decoded according to PROC's coding-system
4748     for decoding.  */     for decoding.  */
4749    
4750  int  static int
4751  read_process_output (proc, channel)  read_process_output (proc, channel)
4752       Lisp_Object proc;       Lisp_Object proc;
4753       register int channel;       register int channel;
# Line 5131  send_process_trap () Line 5138  send_process_trap ()
5138    
5139     This function can evaluate Lisp code and can garbage collect.  */     This function can evaluate Lisp code and can garbage collect.  */
5140    
5141  void  static void
5142  send_process (proc, buf, len, object)  send_process (proc, buf, len, object)
5143       volatile Lisp_Object proc;       volatile Lisp_Object proc;
5144       unsigned char *volatile buf;       unsigned char *volatile buf;
# Line 5725  process_send_signal (process, signo, cur Line 5732  process_send_signal (process, signo, cur
5732        p->status = Qrun;        p->status = Qrun;
5733        XSETINT (p->tick, ++process_tick);        XSETINT (p->tick, ++process_tick);
5734        if (!nomsg)        if (!nomsg)
5735          status_notify ();          status_notify (NULL);
5736        break;        break;
5737  #endif /* ! defined (SIGCONT) */  #endif /* ! defined (SIGCONT) */
5738      case SIGINT:      case SIGINT:
# Line 6393  exec_sentinel (proc, reason) Line 6400  exec_sentinel (proc, reason)
6400     This is usually done while Emacs is waiting for keyboard input     This is usually done while Emacs is waiting for keyboard input
6401     but can be done at other times.  */     but can be done at other times.  */
6402    
6403  void  static void
6404  status_notify ()  status_notify (deleting_process)
6405         struct Lisp_Process *deleting_process;
6406  {  {
6407    register Lisp_Object proc, buffer;    register Lisp_Object proc, buffer;
6408    Lisp_Object tail, msg;    Lisp_Object tail, msg;
# Line 6430  status_notify () Line 6438  status_notify ()
6438                   && ! EQ (p->status, Qlisten)                   && ! EQ (p->status, Qlisten)
6439                   && ! EQ (p->command, Qt)  /* Network process not stopped.  */                   && ! EQ (p->command, Qt)  /* Network process not stopped.  */
6440                   && XINT (p->infd) >= 0                   && XINT (p->infd) >= 0
6441                     && p != deleting_process
6442                   && read_process_output (proc, XINT (p->infd)) > 0);                   && read_process_output (proc, XINT (p->infd)) > 0);
6443    
6444            buffer = p->buffer;            buffer = p->buffer;
# Line 6633  delete_keyboard_wait_descriptor (desc) Line 6642  delete_keyboard_wait_descriptor (desc)
6642  /* Return nonzero if *MASK has a bit set  /* Return nonzero if *MASK has a bit set
6643     that corresponds to one of the keyboard input descriptors.  */     that corresponds to one of the keyboard input descriptors.  */
6644    
6645  int  static int
6646  keyboard_bit_set (mask)  keyboard_bit_set (mask)
6647       SELECT_TYPE *mask;       SELECT_TYPE *mask;
6648  {  {

Legend:
Removed from v.1.462  
changed lines
  Added in v.1.463

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