diff options
| author | Dmitry Antipov | 2012-08-01 10:23:24 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-01 10:23:24 +0400 |
| commit | 3193acd258557340907a7281d067fdbb426c2f54 (patch) | |
| tree | 533f741701969dc6dcb6111ed3c64549fbc0c79a /src/process.h | |
| parent | 3a45383a47009a5e6a15a4005ad95ecf63539182 (diff) | |
| download | emacs-3193acd258557340907a7281d067fdbb426c2f54.tar.gz emacs-3193acd258557340907a7281d067fdbb426c2f54.zip | |
Use INTERNAL_FIELD for processes.
* src/process.h (PVAR): New macro. Adjust style.
(struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
* src/print.c, src/process.c, src/sysdep.c, src/w32.c:
* src/xdisp.c: Users changed.
* admin/coccinelle/process.cocci: Semantic patch to replace direct
access to Lisp_Object members of struct Lisp_Process to PVAR.
Diffstat (limited to 'src/process.h')
| -rw-r--r-- | src/process.h | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/src/process.h b/src/process.h index 747540f26a9..dafa870b620 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -26,59 +26,78 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | #include "gnutls.h" | 26 | #include "gnutls.h" |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | /* This structure records information about a subprocess | 29 | /* Most code should use this macro to access |
| 30 | or network connection. | 30 | Lisp fields in struct Lisp_Process. */ |
| 31 | 31 | ||
| 32 | Every field in this structure except for the header | 32 | #define PVAR(w, field) ((w)->INTERNAL_FIELD (field)) |
| 33 | must be a Lisp_Object, for GC's sake. */ | 33 | |
| 34 | /* This structure records information about a subprocess | ||
| 35 | or network connection. */ | ||
| 34 | 36 | ||
| 35 | struct Lisp_Process | 37 | struct Lisp_Process |
| 36 | { | 38 | { |
| 37 | struct vectorlike_header header; | 39 | struct vectorlike_header header; |
| 38 | 40 | ||
| 39 | /* Name of subprocess terminal. */ | 41 | /* Name of subprocess terminal. */ |
| 40 | Lisp_Object tty_name; | 42 | Lisp_Object INTERNAL_FIELD (tty_name); |
| 43 | |||
| 41 | /* Name of this process */ | 44 | /* Name of this process */ |
| 42 | Lisp_Object name; | 45 | Lisp_Object INTERNAL_FIELD (name); |
| 46 | |||
| 43 | /* List of command arguments that this process was run with. | 47 | /* List of command arguments that this process was run with. |
| 44 | Is set to t for a stopped network process; nil otherwise. */ | 48 | Is set to t for a stopped network process; nil otherwise. */ |
| 45 | Lisp_Object command; | 49 | Lisp_Object INTERNAL_FIELD (command); |
| 50 | |||
| 46 | /* (funcall FILTER PROC STRING) (if FILTER is non-nil) | 51 | /* (funcall FILTER PROC STRING) (if FILTER is non-nil) |
| 47 | to dispose of a bunch of chars from the process all at once */ | 52 | to dispose of a bunch of chars from the process all at once */ |
| 48 | Lisp_Object filter; | 53 | Lisp_Object INTERNAL_FIELD (filter); |
| 54 | |||
| 49 | /* (funcall SENTINEL PROCESS) when process state changes */ | 55 | /* (funcall SENTINEL PROCESS) when process state changes */ |
| 50 | Lisp_Object sentinel; | 56 | Lisp_Object INTERNAL_FIELD (sentinel); |
| 57 | |||
| 51 | /* (funcall LOG SERVER CLIENT MESSAGE) when a server process | 58 | /* (funcall LOG SERVER CLIENT MESSAGE) when a server process |
| 52 | accepts a connection from a client. */ | 59 | accepts a connection from a client. */ |
| 53 | Lisp_Object log; | 60 | Lisp_Object INTERNAL_FIELD (log); |
| 61 | |||
| 54 | /* Buffer that output is going to */ | 62 | /* Buffer that output is going to */ |
| 55 | Lisp_Object buffer; | 63 | Lisp_Object INTERNAL_FIELD (buffer); |
| 64 | |||
| 56 | /* t if this is a real child process. For a network or serial | 65 | /* t if this is a real child process. For a network or serial |
| 57 | connection, it is a plist based on the arguments to | 66 | connection, it is a plist based on the arguments to |
| 58 | make-network-process or make-serial-process. */ | 67 | make-network-process or make-serial-process. */ |
| 59 | Lisp_Object childp; | 68 | |
| 69 | Lisp_Object INTERNAL_FIELD (childp); | ||
| 70 | |||
| 60 | /* Plist for programs to keep per-process state information, parameters, etc. */ | 71 | /* Plist for programs to keep per-process state information, parameters, etc. */ |
| 61 | Lisp_Object plist; | 72 | Lisp_Object INTERNAL_FIELD (plist); |
| 73 | |||
| 62 | /* Symbol indicating the type of process: real, network, serial */ | 74 | /* Symbol indicating the type of process: real, network, serial */ |
| 63 | Lisp_Object type; | 75 | Lisp_Object INTERNAL_FIELD (type); |
| 76 | |||
| 64 | /* Marker set to end of last buffer-inserted output from this process */ | 77 | /* Marker set to end of last buffer-inserted output from this process */ |
| 65 | Lisp_Object mark; | 78 | Lisp_Object INTERNAL_FIELD (mark); |
| 79 | |||
| 66 | /* Symbol indicating status of process. | 80 | /* Symbol indicating status of process. |
| 67 | This may be a symbol: run, open, or closed. | 81 | This may be a symbol: run, open, or closed. |
| 68 | Or it may be a list, whose car is stop, exit or signal | 82 | Or it may be a list, whose car is stop, exit or signal |
| 69 | and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) | 83 | and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) |
| 70 | or (SIGNAL_NUMBER . COREDUMP_FLAG). */ | 84 | or (SIGNAL_NUMBER . COREDUMP_FLAG). */ |
| 71 | Lisp_Object status; | 85 | Lisp_Object INTERNAL_FIELD (status); |
| 86 | |||
| 72 | /* Coding-system for decoding the input from this process. */ | 87 | /* Coding-system for decoding the input from this process. */ |
| 73 | Lisp_Object decode_coding_system; | 88 | Lisp_Object INTERNAL_FIELD (decode_coding_system); |
| 89 | |||
| 74 | /* Working buffer for decoding. */ | 90 | /* Working buffer for decoding. */ |
| 75 | Lisp_Object decoding_buf; | 91 | Lisp_Object INTERNAL_FIELD (decoding_buf); |
| 92 | |||
| 76 | /* Coding-system for encoding the output to this process. */ | 93 | /* Coding-system for encoding the output to this process. */ |
| 77 | Lisp_Object encode_coding_system; | 94 | Lisp_Object INTERNAL_FIELD (encode_coding_system); |
| 95 | |||
| 78 | /* Working buffer for encoding. */ | 96 | /* Working buffer for encoding. */ |
| 79 | Lisp_Object encoding_buf; | 97 | Lisp_Object INTERNAL_FIELD (encoding_buf); |
| 98 | |||
| 80 | /* Queue for storing waiting writes */ | 99 | /* Queue for storing waiting writes */ |
| 81 | Lisp_Object write_queue; | 100 | Lisp_Object INTERNAL_FIELD (write_queue); |
| 82 | 101 | ||
| 83 | #ifdef HAVE_GNUTLS | 102 | #ifdef HAVE_GNUTLS |
| 84 | Lisp_Object gnutls_cred_type; | 103 | Lisp_Object gnutls_cred_type; |