/[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.393 by kfstorm, Sun Jan 12 20:24:06 2003 UTC revision 1.394 by kfstorm, Tue Jan 14 09:55:27 2003 UTC
# Line 132  Lisp_Object Qlocal, Qdatagram; Line 132  Lisp_Object Qlocal, Qdatagram;
132  Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype;  Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype;
133  Lisp_Object QClocal, QCremote, QCcoding;  Lisp_Object QClocal, QCremote, QCcoding;
134  Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;  Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
135  Lisp_Object QCsentinel, QClog, QCoptions, QCvars;  Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
136  Lisp_Object Qlast_nonmenu_event;  Lisp_Object Qlast_nonmenu_event;
137  /* QCfamily is declared and initialized in xfaces.c,  /* QCfamily is declared and initialized in xfaces.c,
138     QCfilter in keyboard.c.  */     QCfilter in keyboard.c.  */
# Line 1037  See `make-network-process' for a list of Line 1037  See `make-network-process' for a list of
1037    return Fplist_get (contact, key);    return Fplist_get (contact, key);
1038  }  }
1039    
1040  DEFUN ("process-variable", Fprocess_variable, Sprocess_variable,  DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
1041         1, 2, 0,         1, 1, 0,
1042         doc: /* Return the value of PROCESS' private variable VAR.         doc: /* Return the plist of PROCESS.  */)
1043  If VARIABLE is omitted or nil, return plist with all PROCESS variables.  */)       (process)
1044       (process, var)       register Lisp_Object process;
      register Lisp_Object process, var;  
1045  {  {
1046    CHECK_PROCESS (process);    CHECK_PROCESS (process);
1047      return XPROCESS (process)->plist;
   if (NILP (var))  
     return XPROCESS (process)->private_vars;  
   
   return Fplist_get (XPROCESS (process)->private_vars, var);  
1048  }  }
1049    
1050  DEFUN ("set-process-variable", Fset_process_variable, Sset_process_variable,  DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
1051         3, 3, 0,         2, 2, 0,
1052         doc: /* Change value of PROCESS' private variable VAR to VAL, and return VAL.         doc: /* Replace the plist of PROCESS with PLIST.  */)
1053  If VAR is nil, set all PROCESS' private variables according to plist VAL.  */)       (process, plist)
1054       (process, var, val)       register Lisp_Object process, plist;
      register Lisp_Object process, var, val;  
1055  {  {
1056    CHECK_PROCESS (process);    CHECK_PROCESS (process);
1057      CHECK_LIST (plist);
1058    
1059    XPROCESS (process)->private_vars    XPROCESS (process)->plist = plist;
     = (NILP (var)  
        ? val  
        : Fplist_put (XPROCESS (process)->private_vars, var, val));  
   
   return val;  
1060  }  }
1061    
1062  #if 0 /* Turned off because we don't currently record this info  #if 0 /* Turned off because we don't currently record this info
# Line 1434  usage: (start-process NAME BUFFER PROGRA Line 1424  usage: (start-process NAME BUFFER PROGRA
1424    record_unwind_protect (start_process_unwind, proc);    record_unwind_protect (start_process_unwind, proc);
1425    
1426    XPROCESS (proc)->childp = Qt;    XPROCESS (proc)->childp = Qt;
1427    XPROCESS (proc)->private_vars = Qnil;    XPROCESS (proc)->plist = Qnil;
1428    XPROCESS (proc)->command_channel_p = Qnil;    XPROCESS (proc)->command_channel_p = Qnil;
1429    XPROCESS (proc)->buffer = buffer;    XPROCESS (proc)->buffer = buffer;
1430    XPROCESS (proc)->sentinel = Qnil;    XPROCESS (proc)->sentinel = Qnil;
# Line 2599  client.  The arguments are SERVER, CLIEN Line 2589  client.  The arguments are SERVER, CLIEN
2589  is the server process, CLIENT is the new process for the connection,  is the server process, CLIENT is the new process for the connection,
2590  and MESSAGE is a string.  and MESSAGE is a string.
2591    
2592  :vars VARS -- Initialize the process' private variables according to  :plist PLIST -- Install PLIST as the new process' initial plist.
 a list of variable/value pairs (VAR1 VAL1 VAR2 VAL2...).  
2593    
2594  :server BOOL -- if BOOL is non-nil, create a server process for the  :server BOOL -- if BOOL is non-nil, create a server process for the
2595  specified FAMILY, SERVICE, and connection type (stream or datagram).  specified FAMILY, SERVICE, and connection type (stream or datagram).
# Line 2619  NAME concatenated with the client identi Line 2608  NAME concatenated with the client identi
2608  inherited from the server process' TYPE, FILTER and SENTINEL.  inherited from the server process' TYPE, FILTER and SENTINEL.
2609  - The client process' contact info is set according to the client's  - The client process' contact info is set according to the client's
2610  addressing information (typically an IP address and a port number).  addressing information (typically an IP address and a port number).
2611  - The client process' private variables are initialized from the  - The client process' plist is initialized from the server's plist.
 server's private variables.  
2612    
2613  Notice that the FILTER and SENTINEL args are never used directly by  Notice that the FILTER and SENTINEL args are never used directly by
2614  the server process.  Also, the BUFFER argument is not used directly by  the server process.  Also, the BUFFER argument is not used directly by
# Line 3183  usage: (make-network-process &rest ARGS) Line 3171  usage: (make-network-process &rest ARGS)
3171    p = XPROCESS (proc);    p = XPROCESS (proc);
3172    
3173    p->childp = contact;    p->childp = contact;
3174    p->private_vars = Fcopy_sequence (Fplist_get (contact, QCvars));    p->plist = Fcopy_sequence (Fplist_get (contact, QCplist));
3175        
3176    p->buffer = buffer;    p->buffer = buffer;
3177    p->sentinel = sentinel;    p->sentinel = sentinel;
# Line 3616  server_accept_connection (server, channe Line 3604  server_accept_connection (server, channe
3604  #endif  #endif
3605    
3606    p->childp = contact;    p->childp = contact;
3607    p->private_vars = Fcopy_sequence (ps->private_vars);    p->plist = Fcopy_sequence (ps->plist);
3608    
3609    p->buffer = buffer;    p->buffer = buffer;
3610    p->sentinel = ps->sentinel;    p->sentinel = ps->sentinel;
# Line 6343  syms_of_process () Line 6331  syms_of_process ()
6331    staticpro (&QCstop);    staticpro (&QCstop);
6332    QCoptions = intern (":options");    QCoptions = intern (":options");
6333    staticpro (&QCoptions);    staticpro (&QCoptions);
6334    QCvars = intern (":vars");    QCplist = intern (":plist");
6335    staticpro (&QCvars);    staticpro (&QCplist);
6336            
6337    Qlast_nonmenu_event = intern ("last-nonmenu-event");    Qlast_nonmenu_event = intern ("last-nonmenu-event");
6338    staticpro (&Qlast_nonmenu_event);    staticpro (&Qlast_nonmenu_event);
# Line 6388  The value takes effect when `start-proce Line 6376  The value takes effect when `start-proce
6376    defsubr (&Sset_process_query_on_exit_flag);    defsubr (&Sset_process_query_on_exit_flag);
6377    defsubr (&Sprocess_query_on_exit_flag);    defsubr (&Sprocess_query_on_exit_flag);
6378    defsubr (&Sprocess_contact);    defsubr (&Sprocess_contact);
6379    defsubr (&Sprocess_variable);    defsubr (&Sprocess_plist);
6380    defsubr (&Sset_process_variable);    defsubr (&Sset_process_plist);
6381    defsubr (&Slist_processes);    defsubr (&Slist_processes);
6382    defsubr (&Sprocess_list);    defsubr (&Sprocess_list);
6383    defsubr (&Sstart_process);    defsubr (&Sstart_process);

Legend:
Removed from v.1.393  
changed lines
  Added in v.1.394

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