]> code.delx.au - gnu-emacs/blobdiff - src/process.h
Merge from origin/emacs-25
[gnu-emacs] / src / process.h
index e889055dc2388977c16e1379147f69d7c4ba7d50..20593f5e8faff091d31ea8a31212a3c4d03a34e8 100644 (file)
@@ -1,12 +1,12 @@
 /* Definitions for asynchronous process control in GNU Emacs.
-   Copyright (C) 1985, 1994, 2001-2015 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1994, 2001-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,6 +16,9 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef EMACS_PROCESS_H
+#define EMACS_PROCESS_H
+
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -43,25 +46,25 @@ struct Lisp_Process
     /* Name of subprocess terminal.  */
     Lisp_Object tty_name;
 
-    /* Name of this process */
+    /* Name of this process */
     Lisp_Object name;
 
     /* List of command arguments that this process was run with.
-       Is set to t for a stopped network process; nil otherwise. */
+       Is set to t for a stopped network process; nil otherwise.  */
     Lisp_Object command;
 
     /* (funcall FILTER PROC STRING)  (if FILTER is non-nil)
-       to dispose of a bunch of chars from the process all at once */
+       to dispose of a bunch of chars from the process all at once */
     Lisp_Object filter;
 
-    /* (funcall SENTINEL PROCESS) when process state changes */
+    /* (funcall SENTINEL PROCESS) when process state changes */
     Lisp_Object sentinel;
 
     /* (funcall LOG SERVER CLIENT MESSAGE) when a server process
        accepts a connection from a client.  */
     Lisp_Object log;
 
-    /* Buffer that output is going to */
+    /* Buffer that output is going to */
     Lisp_Object buffer;
 
     /* t if this is a real child process.  For a network or serial
@@ -73,10 +76,10 @@ struct Lisp_Process
     /* Plist for programs to keep per-process state information, parameters, etc.  */
     Lisp_Object plist;
 
-    /* Symbol indicating the type of process: real, network, serial  */
+    /* Symbol indicating the type of process: real, network, serial.  */
     Lisp_Object type;
 
-    /* Marker set to end of last buffer-inserted output from this process */
+    /* Marker set to end of last buffer-inserted output from this process */
     Lisp_Object mark;
 
     /* Symbol indicating status of process.
@@ -98,11 +101,12 @@ struct Lisp_Process
     /* Working buffer for encoding.  */
     Lisp_Object encoding_buf;
 
-    /* Queue for storing waiting writes */
+    /* Queue for storing waiting writes */
     Lisp_Object write_queue;
 
 #ifdef HAVE_GNUTLS
     Lisp_Object gnutls_cred_type;
+    Lisp_Object gnutls_boot_parameters;
 #endif
 
     /* Pipe process attached to the standard error of this process.  */
@@ -116,9 +120,9 @@ struct Lisp_Process
        A value 0 is used for pseudo-processes such as network or serial
        connections.  */
     pid_t pid;
-    /* Descriptor by which we read from this process */
+    /* Descriptor by which we read from this process */
     int infd;
-    /* Descriptor by which we write to this process */
+    /* Descriptor by which we write to this process */
     int outfd;
     /* Descriptors that were created for this process and that need
        closing.  Unused entries are negative.  */
@@ -158,7 +162,25 @@ struct Lisp_Process
        flag indicates that `raw_status' contains a new status that still
        needs to be synced to `status'.  */
     bool_bf raw_status_new : 1;
+    /* Whether this is a nonblocking socket. */
+    bool_bf is_non_blocking_client : 1;
+    /* Whether this is a server or a client socket. */
+    bool_bf is_server : 1;
     int raw_status;
+    /* The length of the socket backlog. */
+    int backlog;
+    /* The port number. */
+    int port;
+    /* The socket type. */
+    int socktype;
+    /* The socket protocol. */
+    int ai_protocol;
+
+#ifdef HAVE_GETADDRINFO_A
+    /* Whether the socket is waiting for response from an asynchronous
+       DNS call. */
+    struct gaicb *dns_request;
+#endif
 
 #ifdef HAVE_GNUTLS
     gnutls_initstage_t gnutls_initstage;
@@ -171,6 +193,7 @@ struct Lisp_Process
     int gnutls_log_level;
     int gnutls_handshakes_tried;
     bool_bf gnutls_p : 1;
+    bool_bf gnutls_complete_negotiation_p : 1;
 #endif
 };
 
@@ -188,6 +211,12 @@ pset_childp (struct Lisp_Process *p, Lisp_Object val)
   p->childp = val;
 }
 
+INLINE void
+pset_status (struct Lisp_Process *p, Lisp_Object val)
+{
+  p->status = val;
+}
+
 #ifdef HAVE_GNUTLS
 INLINE void
 pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val)
@@ -222,7 +251,7 @@ extern Lisp_Object system_process_attributes (Lisp_Object);
 
 extern void record_deleted_pid (pid_t, Lisp_Object);
 struct sockaddr;
-extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, int);
+extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, ptrdiff_t);
 extern void hold_keyboard_input (void);
 extern void unhold_keyboard_input (void);
 extern bool kbd_on_hold_p (void);
@@ -243,3 +272,5 @@ extern Lisp_Object network_interface_info (Lisp_Object);
 extern Lisp_Object remove_slash_colon (Lisp_Object);
 
 INLINE_HEADER_END
+
+#endif /* EMACS_PROCESS_H */