/[emacs]/emacs/lisp/subr.el
ViewVC logotype

Diff of /emacs/lisp/subr.el

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

revision 1.448 by rms, Sat May 14 13:54:21 2005 UTC revision 1.449 by kfstorm, Sun May 15 20:42:43 2005 UTC
# Line 1041  This makes or adds to an entry on `after Line 1041  This makes or adds to an entry on `after
1041  FILE should be the name of a library, with no directory name."  FILE should be the name of a library, with no directory name."
1042    (eval-after-load file (read)))    (eval-after-load file (read)))
1043    
1044  ;;; make-network-process wrappers  ;;; open-network-stream is a wrapper around make-network-process.
1045    
1046  (if (featurep 'make-network-process)  (when (featurep 'make-network-process)
1047      (progn    (defun open-network-stream (name buffer host service)
   
 (defun open-network-stream (name buffer host service)  
1048    "Open a TCP connection for a service to a host.    "Open a TCP connection for a service to a host.
1049  Returns a subprocess-object to represent the connection.  Returns a subprocess-object to represent the connection.
1050  Input and output work as for subprocesses; `delete-process' closes it.  Input and output work as for subprocesses; `delete-process' closes it.
# Line 1062  HOST is name of the host to connect to, Line 1060  HOST is name of the host to connect to,
1060  SERVICE is name of the service desired, or an integer specifying  SERVICE is name of the service desired, or an integer specifying
1061   a port number to connect to."   a port number to connect to."
1062    (make-network-process :name name :buffer buffer    (make-network-process :name name :buffer buffer
1063                          :host host :service service))                          :host host :service service)))
   
 (defun open-network-stream-nowait (name buffer host service &optional sentinel filter)  
   "Initiate connection to a TCP connection for a service to a host.  
 It returns nil if non-blocking connects are not supported; otherwise,  
 it returns a subprocess-object to represent the connection.  
   
 This function is similar to `open-network-stream', except that it  
 returns before the connection is established.  When the connection  
 is completed, the sentinel function will be called with second arg  
 matching `open' (if successful) or `failed' (on error).  
   
 Args are NAME BUFFER HOST SERVICE SENTINEL FILTER.  
 NAME, BUFFER, HOST, and SERVICE are as for `open-network-stream'.  
 Optional args SENTINEL and FILTER specify the sentinel and filter  
 functions to be used for this network stream."  
   (if (featurep 'make-network-process  '(:nowait t))  
       (make-network-process :name name :buffer buffer :nowait t  
                             :host host :service service  
                             :filter filter :sentinel sentinel)))  
   
 (defun open-network-stream-server (name buffer service &optional sentinel filter)  
   "Create a network server process for a TCP service.  
 It returns nil if server processes are not supported; otherwise,  
 it returns a subprocess-object to represent the server.  
   
 When a client connects to the specified service, a new subprocess  
 is created to handle the new connection, and the sentinel function  
 is called for the new process.  
   
 Args are NAME BUFFER SERVICE SENTINEL FILTER.  
 NAME is name for the server process.  Client processes are named by  
  appending the ip-address and port number of the client to NAME.  
 BUFFER is the buffer (or buffer name) to associate with the server  
  process.  Client processes will not get a buffer if a process filter  
  is specified or BUFFER is nil; otherwise, a new buffer is created for  
  the client process.  The name is similar to the process name.  
 Third arg SERVICE is name of the service desired, or an integer  
  specifying a port number to connect to.  It may also be t to select  
  an unused port number for the server.  
 Optional args SENTINEL and FILTER specify the sentinel and filter  
  functions to be used for the client processes; the server process  
  does not use these function."  
   (if (featurep 'make-network-process '(:server t))  
       (make-network-process :name name :buffer buffer  
                             :service service :server t :noquery t  
                             :sentinel sentinel :filter filter)))  
   
 ))  ;; (featurep 'make-network-process)  
   
1064    
1065  ;; compatibility  ;; compatibility
1066    
# Line 2363  macros." Line 2312  macros."
2312    "Delete from ALIST all elements whose car is `eq' to KEY.    "Delete from ALIST all elements whose car is `eq' to KEY.
2313  Return the modified alist.  Return the modified alist.
2314  Elements of ALIST that are not conses are ignored."  Elements of ALIST that are not conses are ignored."
2315    (while (and (consp (car alist))    (while (and (consp (car alist))
2316                (eq (car (car alist)) key))                (eq (car (car alist)) key))
2317      (setq alist (cdr alist)))      (setq alist (cdr alist)))
2318    (let ((tail alist) tail-cdr)    (let ((tail alist) tail-cdr)
# Line 2378  Elements of ALIST that are not conses ar Line 2327  Elements of ALIST that are not conses ar
2327    "Delete from ALIST all elements whose cdr is `eq' to VALUE.    "Delete from ALIST all elements whose cdr is `eq' to VALUE.
2328  Return the modified alist.  Return the modified alist.
2329  Elements of ALIST that are not conses are ignored."  Elements of ALIST that are not conses are ignored."
2330    (while (and (consp (car alist))    (while (and (consp (car alist))
2331                (eq (cdr (car alist)) value))                (eq (cdr (car alist)) value))
2332      (setq alist (cdr alist)))      (setq alist (cdr alist)))
2333    (let ((tail alist) tail-cdr)    (let ((tail alist) tail-cdr)

Legend:
Removed from v.1.448  
changed lines
  Added in v.1.449

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