diff options
| author | Bill Wohler | 2014-02-23 18:04:35 -0800 |
|---|---|---|
| committer | Bill Wohler | 2014-02-23 18:04:35 -0800 |
| commit | 3e93bafb95608467e438ba7f725fd1f020669f8c (patch) | |
| tree | f2f90109f283e06a18caea3cb2a2623abcfb3a92 /src/process.h | |
| parent | 791c0d7634e44bb92ca85af605be84ff2ae08963 (diff) | |
| parent | e918e27fdf331e89268fc2c9d7cf838d3ecf7aa7 (diff) | |
| download | emacs-3e93bafb95608467e438ba7f725fd1f020669f8c.tar.gz emacs-3e93bafb95608467e438ba7f725fd1f020669f8c.zip | |
Merge from trunk; up to 2014-02-23T23:41:17Z!lekktu@gmail.com.
Diffstat (limited to 'src/process.h')
| -rw-r--r-- | src/process.h | 71 |
1 files changed, 51 insertions, 20 deletions
diff --git a/src/process.h b/src/process.h index a003ffa147f..c3481f295f5 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Definitions for asynchronous process control in GNU Emacs. | 1 | /* Definitions for asynchronous process control in GNU Emacs. |
| 2 | Copyright (C) 1985, 1994, 2001-2013 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1994, 2001-2014 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -27,9 +27,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | INLINE_HEADER_BEGIN | 29 | INLINE_HEADER_BEGIN |
| 30 | #ifndef PROCESS_INLINE | 30 | |
| 31 | # define PROCESS_INLINE INLINE | 31 | /* Bound on number of file descriptors opened on behalf of a process, |
| 32 | #endif | 32 | that need to be closed. */ |
| 33 | |||
| 34 | enum { PROCESS_OPEN_FDS = 6 }; | ||
| 33 | 35 | ||
| 34 | /* This structure records information about a subprocess | 36 | /* This structure records information about a subprocess |
| 35 | or network connection. */ | 37 | or network connection. */ |
| @@ -115,6 +117,9 @@ struct Lisp_Process | |||
| 115 | int infd; | 117 | int infd; |
| 116 | /* Descriptor by which we write to this process */ | 118 | /* Descriptor by which we write to this process */ |
| 117 | int outfd; | 119 | int outfd; |
| 120 | /* Descriptors that were created for this process and that need | ||
| 121 | closing. Unused entries are negative. */ | ||
| 122 | int open_fd[PROCESS_OPEN_FDS]; | ||
| 118 | /* Event-count of last event in which this process changed status. */ | 123 | /* Event-count of last event in which this process changed status. */ |
| 119 | EMACS_INT tick; | 124 | EMACS_INT tick; |
| 120 | /* Event-count of last such event reported. */ | 125 | /* Event-count of last such event reported. */ |
| @@ -133,23 +138,23 @@ struct Lisp_Process | |||
| 133 | 0 = nil, 1 = t, 2 = other. */ | 138 | 0 = nil, 1 = t, 2 = other. */ |
| 134 | unsigned int adaptive_read_buffering : 2; | 139 | unsigned int adaptive_read_buffering : 2; |
| 135 | /* Skip reading this process on next read. */ | 140 | /* Skip reading this process on next read. */ |
| 136 | unsigned int read_output_skip : 1; | 141 | bool_bf read_output_skip : 1; |
| 137 | /* Non-nil means kill silently if Emacs is exited. | 142 | /* True means kill silently if Emacs is exited. |
| 138 | This is the inverse of the `query-on-exit' flag. */ | 143 | This is the inverse of the `query-on-exit' flag. */ |
| 139 | unsigned int kill_without_query : 1; | 144 | bool_bf kill_without_query : 1; |
| 140 | /* Non-nil if communicating through a pty. */ | 145 | /* True if communicating through a pty. */ |
| 141 | unsigned int pty_flag : 1; | 146 | bool_bf pty_flag : 1; |
| 142 | /* Flag to set coding-system of the process buffer from the | 147 | /* Flag to set coding-system of the process buffer from the |
| 143 | coding_system used to decode process output. */ | 148 | coding_system used to decode process output. */ |
| 144 | unsigned int inherit_coding_system_flag : 1; | 149 | bool_bf inherit_coding_system_flag : 1; |
| 145 | /* Whether the process is alive, i.e., can be waited for. Running | 150 | /* Whether the process is alive, i.e., can be waited for. Running |
| 146 | processes can be waited for, but exited and fake processes cannot. */ | 151 | processes can be waited for, but exited and fake processes cannot. */ |
| 147 | unsigned int alive : 1; | 152 | bool_bf alive : 1; |
| 148 | /* Record the process status in the raw form in which it comes from `wait'. | 153 | /* Record the process status in the raw form in which it comes from `wait'. |
| 149 | This is to avoid consing in a signal handler. The `raw_status_new' | 154 | This is to avoid consing in a signal handler. The `raw_status_new' |
| 150 | flag indicates that `raw_status' contains a new status that still | 155 | flag indicates that `raw_status' contains a new status that still |
| 151 | needs to be synced to `status'. */ | 156 | needs to be synced to `status'. */ |
| 152 | unsigned int raw_status_new : 1; | 157 | bool_bf raw_status_new : 1; |
| 153 | int raw_status; | 158 | int raw_status; |
| 154 | 159 | ||
| 155 | #ifdef HAVE_GNUTLS | 160 | #ifdef HAVE_GNUTLS |
| @@ -159,7 +164,7 @@ struct Lisp_Process | |||
| 159 | gnutls_anon_client_credentials_t gnutls_anon_cred; | 164 | gnutls_anon_client_credentials_t gnutls_anon_cred; |
| 160 | int gnutls_log_level; | 165 | int gnutls_log_level; |
| 161 | int gnutls_handshakes_tried; | 166 | int gnutls_handshakes_tried; |
| 162 | int gnutls_p; | 167 | bool_bf gnutls_p : 1; |
| 163 | #endif | 168 | #endif |
| 164 | }; | 169 | }; |
| 165 | 170 | ||
| @@ -171,23 +176,23 @@ struct Lisp_Process | |||
| 171 | /* Most code should use these functions to set Lisp fields in struct | 176 | /* Most code should use these functions to set Lisp fields in struct |
| 172 | process. */ | 177 | process. */ |
| 173 | 178 | ||
| 174 | PROCESS_INLINE void | 179 | INLINE void |
| 175 | pset_childp (struct Lisp_Process *p, Lisp_Object val) | 180 | pset_childp (struct Lisp_Process *p, Lisp_Object val) |
| 176 | { | 181 | { |
| 177 | p->childp = val; | 182 | p->childp = val; |
| 178 | } | 183 | } |
| 179 | 184 | ||
| 180 | #ifdef HAVE_GNUTLS | 185 | #ifdef HAVE_GNUTLS |
| 181 | PROCESS_INLINE void | 186 | INLINE void |
| 182 | pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) | 187 | pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) |
| 183 | { | 188 | { |
| 184 | p->gnutls_cred_type = val; | 189 | p->gnutls_cred_type = val; |
| 185 | } | 190 | } |
| 186 | #endif | 191 | #endif |
| 187 | 192 | ||
| 188 | /* Nonzero means don't run process sentinels. This is used | 193 | /* True means don't run process sentinels. This is used |
| 189 | when exiting. */ | 194 | when exiting. */ |
| 190 | extern int inhibit_sentinels; | 195 | extern bool inhibit_sentinels; |
| 191 | 196 | ||
| 192 | extern Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname; | 197 | extern Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname; |
| 193 | extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime; | 198 | extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime; |
| @@ -198,18 +203,36 @@ extern Lisp_Object QCspeed; | |||
| 198 | extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; | 203 | extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; |
| 199 | extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; | 204 | extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; |
| 200 | 205 | ||
| 206 | /* Exit statuses for GNU programs that exec other programs. */ | ||
| 207 | enum | ||
| 208 | { | ||
| 209 | EXIT_CANCELED = 125, /* Internal error prior to exec attempt. */ | ||
| 210 | EXIT_CANNOT_INVOKE = 126, /* Program located, but not usable. */ | ||
| 211 | EXIT_ENOENT = 127 /* Could not find program to exec. */ | ||
| 212 | }; | ||
| 213 | |||
| 201 | /* Defined in callproc.c. */ | 214 | /* Defined in callproc.c. */ |
| 202 | 215 | ||
| 203 | extern void record_kill_process (struct Lisp_Process *); | 216 | extern void block_child_signal (void); |
| 217 | extern void unblock_child_signal (void); | ||
| 218 | extern Lisp_Object encode_current_directory (void); | ||
| 219 | extern void record_kill_process (struct Lisp_Process *, Lisp_Object); | ||
| 204 | 220 | ||
| 205 | /* Defined in process.c. */ | 221 | /* Defined in sysdep.c. */ |
| 206 | 222 | ||
| 207 | extern Lisp_Object list_system_processes (void); | 223 | extern Lisp_Object list_system_processes (void); |
| 208 | extern Lisp_Object system_process_attributes (Lisp_Object); | 224 | extern Lisp_Object system_process_attributes (Lisp_Object); |
| 209 | 225 | ||
| 226 | /* Defined in process.c. */ | ||
| 227 | |||
| 228 | extern void record_deleted_pid (pid_t, Lisp_Object); | ||
| 229 | struct sockaddr; | ||
| 230 | #ifdef WINDOWSNT | ||
| 231 | extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, int); | ||
| 232 | #endif | ||
| 210 | extern void hold_keyboard_input (void); | 233 | extern void hold_keyboard_input (void); |
| 211 | extern void unhold_keyboard_input (void); | 234 | extern void unhold_keyboard_input (void); |
| 212 | extern int kbd_on_hold_p (void); | 235 | extern bool kbd_on_hold_p (void); |
| 213 | 236 | ||
| 214 | typedef void (*fd_callback) (int fd, void *data); | 237 | typedef void (*fd_callback) (int fd, void *data); |
| 215 | 238 | ||
| @@ -217,5 +240,13 @@ extern void add_read_fd (int fd, fd_callback func, void *data); | |||
| 217 | extern void delete_read_fd (int fd); | 240 | extern void delete_read_fd (int fd); |
| 218 | extern void add_write_fd (int fd, fd_callback func, void *data); | 241 | extern void add_write_fd (int fd, fd_callback func, void *data); |
| 219 | extern void delete_write_fd (int fd); | 242 | extern void delete_write_fd (int fd); |
| 243 | #ifdef NS_IMPL_GNUSTEP | ||
| 244 | extern void catch_child_signal (void); | ||
| 245 | #endif | ||
| 246 | |||
| 247 | #ifdef WINDOWSNT | ||
| 248 | extern Lisp_Object network_interface_list (void); | ||
| 249 | extern Lisp_Object network_interface_info (Lisp_Object); | ||
| 250 | #endif | ||
| 220 | 251 | ||
| 221 | INLINE_HEADER_END | 252 | INLINE_HEADER_END |