aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-01 10:23:24 +0400
committerDmitry Antipov2012-08-01 10:23:24 +0400
commit3193acd258557340907a7281d067fdbb426c2f54 (patch)
tree533f741701969dc6dcb6111ed3c64549fbc0c79a /src
parent3a45383a47009a5e6a15a4005ad95ecf63539182 (diff)
downloademacs-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')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/print.c4
-rw-r--r--src/process.c446
-rw-r--r--src/process.h61
-rw-r--r--src/sysdep.c14
-rw-r--r--src/w32.c14
-rw-r--r--src/xdisp.c8
7 files changed, 293 insertions, 261 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c82dfd6060b..e6b8051458f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12012-08-01 Dmitry Antipov <dmantipov@yandex.ru> 12012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Use INTERNAL_FIELD for processes.
4 * process.h (PVAR): New macro. Adjust style.
5 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7
82012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9
3 Use INTERNAL_FIELD for windows. 10 Use INTERNAL_FIELD for windows.
4 * window.h (WVAR): New macro. 11 * window.h (WVAR): New macro.
5 (struct window): Change Lisp_Object members to INTERNAL_FIELD. 12 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
diff --git a/src/print.c b/src/print.c
index 5effec7fd44..c4b96ff88ff 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1699,11 +1699,11 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1699 if (escapeflag) 1699 if (escapeflag)
1700 { 1700 {
1701 strout ("#<process ", -1, -1, printcharfun); 1701 strout ("#<process ", -1, -1, printcharfun);
1702 print_string (XPROCESS (obj)->name, printcharfun); 1702 print_string (PVAR (XPROCESS (obj), name), printcharfun);
1703 PRINTCHAR ('>'); 1703 PRINTCHAR ('>');
1704 } 1704 }
1705 else 1705 else
1706 print_string (XPROCESS (obj)->name, printcharfun); 1706 print_string (PVAR (XPROCESS (obj), name), printcharfun);
1707 } 1707 }
1708 else if (BOOL_VECTOR_P (obj)) 1708 else if (BOOL_VECTOR_P (obj))
1709 { 1709 {
diff --git a/src/process.c b/src/process.c
index 1b66bef03a8..47f10814333 100644
--- a/src/process.c
+++ b/src/process.c
@@ -172,10 +172,10 @@ extern Lisp_Object QCfamily;
172/* QCfilter is defined in keyboard.c. */ 172/* QCfilter is defined in keyboard.c. */
173extern Lisp_Object QCfilter; 173extern Lisp_Object QCfilter;
174 174
175#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) 175#define NETCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qnetwork))
176#define NETCONN1_P(p) (EQ ((p)->type, Qnetwork)) 176#define NETCONN1_P(p) (EQ (PVAR (p, type), Qnetwork))
177#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) 177#define SERIALCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qserial))
178#define SERIALCONN1_P(p) (EQ ((p)->type, Qserial)) 178#define SERIALCONN1_P(p) (EQ (PVAR (p, type), Qserial))
179 179
180#ifndef HAVE_H_ERRNO 180#ifndef HAVE_H_ERRNO
181extern int h_errno; 181extern int h_errno;
@@ -428,7 +428,7 @@ static void
428update_status (struct Lisp_Process *p) 428update_status (struct Lisp_Process *p)
429{ 429{
430 eassert (p->raw_status_new); 430 eassert (p->raw_status_new);
431 p->status = status_convert (p->raw_status); 431 PVAR (p, status) = status_convert (p->raw_status);
432 p->raw_status_new = 0; 432 p->raw_status_new = 0;
433} 433}
434 434
@@ -479,7 +479,7 @@ decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, int *coredump)
479static Lisp_Object 479static Lisp_Object
480status_message (struct Lisp_Process *p) 480status_message (struct Lisp_Process *p)
481{ 481{
482 Lisp_Object status = p->status; 482 Lisp_Object status = PVAR (p, status);
483 Lisp_Object symbol; 483 Lisp_Object symbol;
484 int code, coredump; 484 int code, coredump;
485 Lisp_Object string, string2; 485 Lisp_Object string, string2;
@@ -626,8 +626,8 @@ make_process (Lisp_Object name)
626 p = allocate_process (); 626 p = allocate_process ();
627 /* Initialize Lisp data. Note that allocate_process initializes all 627 /* Initialize Lisp data. Note that allocate_process initializes all
628 Lisp data to nil, so do it only for slots which should not be nil. */ 628 Lisp data to nil, so do it only for slots which should not be nil. */
629 p->status = Qrun; 629 PVAR (p, status) = Qrun;
630 p->mark = Fmake_marker (); 630 PVAR (p, mark) = Fmake_marker ();
631 631
632 /* Initialize non-Lisp data. Note that allocate_process zeroes out all 632 /* Initialize non-Lisp data. Note that allocate_process zeroes out all
633 non-Lisp data, so do it only for slots which should not be zero. */ 633 non-Lisp data, so do it only for slots which should not be zero. */
@@ -648,7 +648,7 @@ make_process (Lisp_Object name)
648 name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i)); 648 name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i));
649 } 649 }
650 name = name1; 650 name = name1;
651 p->name = name; 651 PVAR (p, name) = name;
652 XSETPROCESS (val, p); 652 XSETPROCESS (val, p);
653 Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist); 653 Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist);
654 return val; 654 return val;
@@ -745,7 +745,7 @@ nil, indicating the current buffer's process. */)
745 p->raw_status_new = 0; 745 p->raw_status_new = 0;
746 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 746 if (NETCONN1_P (p) || SERIALCONN1_P (p))
747 { 747 {
748 p->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); 748 PVAR (p, status) = Fcons (Qexit, Fcons (make_number (0), Qnil));
749 p->tick = ++process_tick; 749 p->tick = ++process_tick;
750 status_notify (p); 750 status_notify (p);
751 redisplay_preserve_echo_area (13); 751 redisplay_preserve_echo_area (13);
@@ -763,9 +763,9 @@ nil, indicating the current buffer's process. */)
763 /* If the process has already signaled, remove it from the list. */ 763 /* If the process has already signaled, remove it from the list. */
764 if (p->raw_status_new) 764 if (p->raw_status_new)
765 update_status (p); 765 update_status (p);
766 symbol = p->status; 766 symbol = PVAR (p, status);
767 if (CONSP (p->status)) 767 if (CONSP (PVAR (p, status)))
768 symbol = XCAR (p->status); 768 symbol = XCAR (PVAR (p, status));
769 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) 769 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
770 deleted_pid_list 770 deleted_pid_list
771 = Fdelete (make_fixnum_or_float (pid), deleted_pid_list); 771 = Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
@@ -774,7 +774,7 @@ nil, indicating the current buffer's process. */)
774 { 774 {
775 Fkill_process (process, Qnil); 775 Fkill_process (process, Qnil);
776 /* Do this now, since remove_process will make sigchld_handler do nothing. */ 776 /* Do this now, since remove_process will make sigchld_handler do nothing. */
777 p->status 777 PVAR (p, status)
778 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); 778 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
779 p->tick = ++process_tick; 779 p->tick = ++process_tick;
780 status_notify (p); 780 status_notify (p);
@@ -816,14 +816,14 @@ nil, indicating the current buffer's process. */)
816 p = XPROCESS (process); 816 p = XPROCESS (process);
817 if (p->raw_status_new) 817 if (p->raw_status_new)
818 update_status (p); 818 update_status (p);
819 status = p->status; 819 status = PVAR (p, status);
820 if (CONSP (status)) 820 if (CONSP (status))
821 status = XCAR (status); 821 status = XCAR (status);
822 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 822 if (NETCONN1_P (p) || SERIALCONN1_P (p))
823 { 823 {
824 if (EQ (status, Qexit)) 824 if (EQ (status, Qexit))
825 status = Qclosed; 825 status = Qclosed;
826 else if (EQ (p->command, Qt)) 826 else if (EQ (PVAR (p, command), Qt))
827 status = Qstop; 827 status = Qstop;
828 else if (EQ (status, Qrun)) 828 else if (EQ (status, Qrun))
829 status = Qopen; 829 status = Qopen;
@@ -840,8 +840,8 @@ If PROCESS has not yet exited or died, return 0. */)
840 CHECK_PROCESS (process); 840 CHECK_PROCESS (process);
841 if (XPROCESS (process)->raw_status_new) 841 if (XPROCESS (process)->raw_status_new)
842 update_status (XPROCESS (process)); 842 update_status (XPROCESS (process));
843 if (CONSP (XPROCESS (process)->status)) 843 if (CONSP (PVAR (XPROCESS (process), status)))
844 return XCAR (XCDR (XPROCESS (process)->status)); 844 return XCAR (XCDR (PVAR (XPROCESS (process), status)));
845 return make_number (0); 845 return make_number (0);
846} 846}
847 847
@@ -865,7 +865,7 @@ possibly modified to make it unique among process names. */)
865 (register Lisp_Object process) 865 (register Lisp_Object process)
866{ 866{
867 CHECK_PROCESS (process); 867 CHECK_PROCESS (process);
868 return XPROCESS (process)->name; 868 return PVAR (XPROCESS (process), name);
869} 869}
870 870
871DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, 871DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0,
@@ -877,7 +877,7 @@ For a network or serial process, this is nil (process is running) or t
877 (register Lisp_Object process) 877 (register Lisp_Object process)
878{ 878{
879 CHECK_PROCESS (process); 879 CHECK_PROCESS (process);
880 return XPROCESS (process)->command; 880 return PVAR (XPROCESS (process), command);
881} 881}
882 882
883DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, 883DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0,
@@ -887,7 +887,7 @@ not the name of the pty that Emacs uses to talk with that terminal. */)
887 (register Lisp_Object process) 887 (register Lisp_Object process)
888{ 888{
889 CHECK_PROCESS (process); 889 CHECK_PROCESS (process);
890 return XPROCESS (process)->tty_name; 890 return PVAR (XPROCESS (process), tty_name);
891} 891}
892 892
893DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, 893DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer,
@@ -902,9 +902,9 @@ Return BUFFER. */)
902 if (!NILP (buffer)) 902 if (!NILP (buffer))
903 CHECK_BUFFER (buffer); 903 CHECK_BUFFER (buffer);
904 p = XPROCESS (process); 904 p = XPROCESS (process);
905 p->buffer = buffer; 905 PVAR (p, buffer) = buffer;
906 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 906 if (NETCONN1_P (p) || SERIALCONN1_P (p))
907 p->childp = Fplist_put (p->childp, QCbuffer, buffer); 907 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCbuffer, buffer);
908 setup_process_coding_systems (process); 908 setup_process_coding_systems (process);
909 return buffer; 909 return buffer;
910} 910}
@@ -916,7 +916,7 @@ Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */)
916 (register Lisp_Object process) 916 (register Lisp_Object process)
917{ 917{
918 CHECK_PROCESS (process); 918 CHECK_PROCESS (process);
919 return XPROCESS (process)->buffer; 919 return PVAR (XPROCESS (process), buffer);
920} 920}
921 921
922DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, 922DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
@@ -925,7 +925,7 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
925 (register Lisp_Object process) 925 (register Lisp_Object process)
926{ 926{
927 CHECK_PROCESS (process); 927 CHECK_PROCESS (process);
928 return XPROCESS (process)->mark; 928 return PVAR (XPROCESS (process), mark);
929} 929}
930 930
931DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, 931DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter,
@@ -961,23 +961,23 @@ The string argument is normally a multibyte string, except:
961 961
962 if (p->infd >= 0) 962 if (p->infd >= 0)
963 { 963 {
964 if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) 964 if (EQ (filter, Qt) && !EQ (PVAR (p, status), Qlisten))
965 { 965 {
966 FD_CLR (p->infd, &input_wait_mask); 966 FD_CLR (p->infd, &input_wait_mask);
967 FD_CLR (p->infd, &non_keyboard_wait_mask); 967 FD_CLR (p->infd, &non_keyboard_wait_mask);
968 } 968 }
969 else if (EQ (p->filter, Qt) 969 else if (EQ (PVAR (p, filter), Qt)
970 /* Network or serial process not stopped: */ 970 /* Network or serial process not stopped: */
971 && !EQ (p->command, Qt)) 971 && !EQ (PVAR (p, command), Qt))
972 { 972 {
973 FD_SET (p->infd, &input_wait_mask); 973 FD_SET (p->infd, &input_wait_mask);
974 FD_SET (p->infd, &non_keyboard_wait_mask); 974 FD_SET (p->infd, &non_keyboard_wait_mask);
975 } 975 }
976 } 976 }
977 977
978 p->filter = filter; 978 PVAR (p, filter) = filter;
979 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 979 if (NETCONN1_P (p) || SERIALCONN1_P (p))
980 p->childp = Fplist_put (p->childp, QCfilter, filter); 980 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCfilter, filter);
981 setup_process_coding_systems (process); 981 setup_process_coding_systems (process);
982 return filter; 982 return filter;
983} 983}
@@ -989,7 +989,7 @@ See `set-process-filter' for more info on filter functions. */)
989 (register Lisp_Object process) 989 (register Lisp_Object process)
990{ 990{
991 CHECK_PROCESS (process); 991 CHECK_PROCESS (process);
992 return XPROCESS (process)->filter; 992 return PVAR (XPROCESS (process), filter);
993} 993}
994 994
995DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, 995DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel,
@@ -1004,9 +1004,9 @@ It gets two arguments: the process, and a string describing the change. */)
1004 CHECK_PROCESS (process); 1004 CHECK_PROCESS (process);
1005 p = XPROCESS (process); 1005 p = XPROCESS (process);
1006 1006
1007 p->sentinel = sentinel; 1007 PVAR (p, sentinel) = sentinel;
1008 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 1008 if (NETCONN1_P (p) || SERIALCONN1_P (p))
1009 p->childp = Fplist_put (p->childp, QCsentinel, sentinel); 1009 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCsentinel, sentinel);
1010 return sentinel; 1010 return sentinel;
1011} 1011}
1012 1012
@@ -1017,7 +1017,7 @@ See `set-process-sentinel' for more info on sentinels. */)
1017 (register Lisp_Object process) 1017 (register Lisp_Object process)
1018{ 1018{
1019 CHECK_PROCESS (process); 1019 CHECK_PROCESS (process);
1020 return XPROCESS (process)->sentinel; 1020 return PVAR (XPROCESS (process), sentinel);
1021} 1021}
1022 1022
1023DEFUN ("set-process-window-size", Fset_process_window_size, 1023DEFUN ("set-process-window-size", Fset_process_window_size,
@@ -1102,7 +1102,7 @@ list of keywords. */)
1102 Lisp_Object contact; 1102 Lisp_Object contact;
1103 1103
1104 CHECK_PROCESS (process); 1104 CHECK_PROCESS (process);
1105 contact = XPROCESS (process)->childp; 1105 contact = PVAR (XPROCESS (process), childp);
1106 1106
1107#ifdef DATAGRAM_SOCKETS 1107#ifdef DATAGRAM_SOCKETS
1108 if (DATAGRAM_CONN_P (process) 1108 if (DATAGRAM_CONN_P (process)
@@ -1128,7 +1128,7 @@ DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
1128 (register Lisp_Object process) 1128 (register Lisp_Object process)
1129{ 1129{
1130 CHECK_PROCESS (process); 1130 CHECK_PROCESS (process);
1131 return XPROCESS (process)->plist; 1131 return PVAR (XPROCESS (process), plist);
1132} 1132}
1133 1133
1134DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, 1134DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
@@ -1139,7 +1139,7 @@ DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
1139 CHECK_PROCESS (process); 1139 CHECK_PROCESS (process);
1140 CHECK_LIST (plist); 1140 CHECK_LIST (plist);
1141 1141
1142 XPROCESS (process)->plist = plist; 1142 PVAR (XPROCESS (process), plist) = plist;
1143 return plist; 1143 return plist;
1144} 1144}
1145 1145
@@ -1151,7 +1151,7 @@ The value is nil for a pipe, t or `pty' for a pty, or `stream' for
1151a socket connection. */) 1151a socket connection. */)
1152 (Lisp_Object process) 1152 (Lisp_Object process)
1153{ 1153{
1154 return XPROCESS (process)->type; 1154 return PVAR (XPROCESS (process), type);
1155} 1155}
1156#endif 1156#endif
1157 1157
@@ -1164,7 +1164,7 @@ nil, indicating the current buffer's process. */)
1164{ 1164{
1165 Lisp_Object proc; 1165 Lisp_Object proc;
1166 proc = get_process (process); 1166 proc = get_process (process);
1167 return XPROCESS (proc)->type; 1167 return PVAR (XPROCESS (proc), type);
1168} 1168}
1169 1169
1170DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, 1170DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address,
@@ -1325,13 +1325,13 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1325 itself; it's all taken care of here. */ 1325 itself; it's all taken care of here. */
1326 record_unwind_protect (start_process_unwind, proc); 1326 record_unwind_protect (start_process_unwind, proc);
1327 1327
1328 XPROCESS (proc)->childp = Qt; 1328 PVAR (XPROCESS (proc), childp) = Qt;
1329 XPROCESS (proc)->plist = Qnil; 1329 PVAR (XPROCESS (proc), plist) = Qnil;
1330 XPROCESS (proc)->type = Qreal; 1330 PVAR (XPROCESS (proc), type) = Qreal;
1331 XPROCESS (proc)->buffer = buffer; 1331 PVAR (XPROCESS (proc), buffer) = buffer;
1332 XPROCESS (proc)->sentinel = Qnil; 1332 PVAR (XPROCESS (proc), sentinel) = Qnil;
1333 XPROCESS (proc)->filter = Qnil; 1333 PVAR (XPROCESS (proc), filter) = Qnil;
1334 XPROCESS (proc)->command = Flist (nargs - 2, args + 2); 1334 PVAR (XPROCESS (proc), command) = Flist (nargs - 2, args + 2);
1335 1335
1336#ifdef HAVE_GNUTLS 1336#ifdef HAVE_GNUTLS
1337 /* AKA GNUTLS_INITSTAGE(proc). */ 1337 /* AKA GNUTLS_INITSTAGE(proc). */
@@ -1347,7 +1347,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1347 1347
1348 /* Make the process marker point into the process buffer (if any). */ 1348 /* Make the process marker point into the process buffer (if any). */
1349 if (BUFFERP (buffer)) 1349 if (BUFFERP (buffer))
1350 set_marker_both (XPROCESS (proc)->mark, buffer, 1350 set_marker_both (PVAR (XPROCESS (proc), mark), buffer,
1351 BUF_ZV (XBUFFER (buffer)), 1351 BUF_ZV (XBUFFER (buffer)),
1352 BUF_ZV_BYTE (XBUFFER (buffer))); 1352 BUF_ZV_BYTE (XBUFFER (buffer)));
1353 1353
@@ -1376,7 +1376,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1376 else if (CONSP (Vdefault_process_coding_system)) 1376 else if (CONSP (Vdefault_process_coding_system))
1377 val = XCAR (Vdefault_process_coding_system); 1377 val = XCAR (Vdefault_process_coding_system);
1378 } 1378 }
1379 XPROCESS (proc)->decode_coding_system = val; 1379 PVAR (XPROCESS (proc), decode_coding_system) = val;
1380 1380
1381 val = Vcoding_system_for_write; 1381 val = Vcoding_system_for_write;
1382 if (NILP (val)) 1382 if (NILP (val))
@@ -1396,7 +1396,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1396 else if (CONSP (Vdefault_process_coding_system)) 1396 else if (CONSP (Vdefault_process_coding_system))
1397 val = XCDR (Vdefault_process_coding_system); 1397 val = XCDR (Vdefault_process_coding_system);
1398 } 1398 }
1399 XPROCESS (proc)->encode_coding_system = val; 1399 PVAR (XPROCESS (proc), encode_coding_system) = val;
1400 /* Note: At this moment, the above coding system may leave 1400 /* Note: At this moment, the above coding system may leave
1401 text-conversion or eol-conversion unspecified. They will be 1401 text-conversion or eol-conversion unspecified. They will be
1402 decided after we read output from the process and decode it by 1402 decided after we read output from the process and decode it by
@@ -1405,9 +1405,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1405 } 1405 }
1406 1406
1407 1407
1408 XPROCESS (proc)->decoding_buf = empty_unibyte_string; 1408 PVAR (XPROCESS (proc), decoding_buf) = empty_unibyte_string;
1409 XPROCESS (proc)->decoding_carryover = 0; 1409 XPROCESS (proc)->decoding_carryover = 0;
1410 XPROCESS (proc)->encoding_buf = empty_unibyte_string; 1410 PVAR (XPROCESS (proc), encoding_buf) = empty_unibyte_string;
1411 1411
1412 XPROCESS (proc)->inherit_coding_system_flag 1412 XPROCESS (proc)->inherit_coding_system_flag
1413 = !(NILP (buffer) || !inherit_process_coding_system); 1413 = !(NILP (buffer) || !inherit_process_coding_system);
@@ -1465,7 +1465,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1465 { 1465 {
1466 if (NILP (arg_encoding)) 1466 if (NILP (arg_encoding))
1467 arg_encoding = (complement_process_encoding_system 1467 arg_encoding = (complement_process_encoding_system
1468 (XPROCESS (proc)->encode_coding_system)); 1468 (PVAR (XPROCESS (proc), encode_coding_system)));
1469 XSETCAR (tem, 1469 XSETCAR (tem,
1470 code_convert_string_norecord 1470 code_convert_string_norecord
1471 (XCAR (tem), arg_encoding, 1)); 1471 (XCAR (tem), arg_encoding, 1));
@@ -1629,7 +1629,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1629 more portable (see USG_SUBTTY_WORKS above). */ 1629 more portable (see USG_SUBTTY_WORKS above). */
1630 1630
1631 XPROCESS (process)->pty_flag = pty_flag; 1631 XPROCESS (process)->pty_flag = pty_flag;
1632 XPROCESS (process)->status = Qrun; 1632 PVAR (XPROCESS (process), status) = Qrun;
1633 1633
1634 /* Delay interrupts until we have a chance to store 1634 /* Delay interrupts until we have a chance to store
1635 the new fork's pid in its process structure */ 1635 the new fork's pid in its process structure */
@@ -1868,10 +1868,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1868 1868
1869#ifdef HAVE_PTYS 1869#ifdef HAVE_PTYS
1870 if (pty_flag) 1870 if (pty_flag)
1871 XPROCESS (process)->tty_name = build_string (pty_name); 1871 PVAR (XPROCESS (process), tty_name) = build_string (pty_name);
1872 else 1872 else
1873#endif 1873#endif
1874 XPROCESS (process)->tty_name = Qnil; 1874 PVAR (XPROCESS (process), tty_name) = Qnil;
1875 1875
1876#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) 1876#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
1877 /* Wait for child_setup to complete in case that vfork is 1877 /* Wait for child_setup to complete in case that vfork is
@@ -1966,7 +1966,7 @@ create_pty (Lisp_Object process)
1966 more portable (see USG_SUBTTY_WORKS above). */ 1966 more portable (see USG_SUBTTY_WORKS above). */
1967 1967
1968 XPROCESS (process)->pty_flag = pty_flag; 1968 XPROCESS (process)->pty_flag = pty_flag;
1969 XPROCESS (process)->status = Qrun; 1969 PVAR (XPROCESS (process), status) = Qrun;
1970 setup_process_coding_systems (process); 1970 setup_process_coding_systems (process);
1971 1971
1972 FD_SET (inchannel, &input_wait_mask); 1972 FD_SET (inchannel, &input_wait_mask);
@@ -1977,10 +1977,10 @@ create_pty (Lisp_Object process)
1977 XPROCESS (process)->pid = -2; 1977 XPROCESS (process)->pid = -2;
1978#ifdef HAVE_PTYS 1978#ifdef HAVE_PTYS
1979 if (pty_flag) 1979 if (pty_flag)
1980 XPROCESS (process)->tty_name = build_string (pty_name); 1980 PVAR (XPROCESS (process), tty_name) = build_string (pty_name);
1981 else 1981 else
1982#endif 1982#endif
1983 XPROCESS (process)->tty_name = Qnil; 1983 PVAR (XPROCESS (process), tty_name) = Qnil;
1984} 1984}
1985 1985
1986 1986
@@ -2369,7 +2369,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
2369 2369
2370 if (set_socket_option (s, option, value)) 2370 if (set_socket_option (s, option, value))
2371 { 2371 {
2372 p->childp = Fplist_put (p->childp, option, value); 2372 PVAR (p, childp) = Fplist_put (PVAR (p, childp), option, value);
2373 return Qt; 2373 return Qt;
2374 } 2374 }
2375 2375
@@ -2458,10 +2458,10 @@ usage: (serial-process-configure &rest ARGS) */)
2458 proc = Fplist_get (contact, QCport); 2458 proc = Fplist_get (contact, QCport);
2459 proc = get_process (proc); 2459 proc = get_process (proc);
2460 p = XPROCESS (proc); 2460 p = XPROCESS (proc);
2461 if (!EQ (p->type, Qserial)) 2461 if (!EQ (PVAR (p, type), Qserial))
2462 error ("Not a serial process"); 2462 error ("Not a serial process");
2463 2463
2464 if (NILP (Fplist_get (p->childp, QCspeed))) 2464 if (NILP (Fplist_get (PVAR (p, childp), QCspeed)))
2465 { 2465 {
2466 UNGCPRO; 2466 UNGCPRO;
2467 return Qnil; 2467 return Qnil;
@@ -2602,21 +2602,21 @@ usage: (make-serial-process &rest ARGS) */)
2602 if (NILP (buffer)) 2602 if (NILP (buffer))
2603 buffer = name; 2603 buffer = name;
2604 buffer = Fget_buffer_create (buffer); 2604 buffer = Fget_buffer_create (buffer);
2605 p->buffer = buffer; 2605 PVAR (p, buffer) = buffer;
2606 2606
2607 p->childp = contact; 2607 PVAR (p, childp) = contact;
2608 p->plist = Fcopy_sequence (Fplist_get (contact, QCplist)); 2608 PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist));
2609 p->type = Qserial; 2609 PVAR (p, type) = Qserial;
2610 p->sentinel = Fplist_get (contact, QCsentinel); 2610 PVAR (p, sentinel) = Fplist_get (contact, QCsentinel);
2611 p->filter = Fplist_get (contact, QCfilter); 2611 PVAR (p, filter) = Fplist_get (contact, QCfilter);
2612 p->log = Qnil; 2612 PVAR (p, log) = Qnil;
2613 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) 2613 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
2614 p->kill_without_query = 1; 2614 p->kill_without_query = 1;
2615 if (tem = Fplist_get (contact, QCstop), !NILP (tem)) 2615 if (tem = Fplist_get (contact, QCstop), !NILP (tem))
2616 p->command = Qt; 2616 PVAR (p, command) = Qt;
2617 p->pty_flag = 0; 2617 p->pty_flag = 0;
2618 2618
2619 if (!EQ (p->command, Qt)) 2619 if (!EQ (PVAR (p, command), Qt))
2620 { 2620 {
2621 FD_SET (fd, &input_wait_mask); 2621 FD_SET (fd, &input_wait_mask);
2622 FD_SET (fd, &non_keyboard_wait_mask); 2622 FD_SET (fd, &non_keyboard_wait_mask);
@@ -2624,7 +2624,7 @@ usage: (make-serial-process &rest ARGS) */)
2624 2624
2625 if (BUFFERP (buffer)) 2625 if (BUFFERP (buffer))
2626 { 2626 {
2627 set_marker_both (p->mark, buffer, 2627 set_marker_both (PVAR (p, mark), buffer,
2628 BUF_ZV (XBUFFER (buffer)), 2628 BUF_ZV (XBUFFER (buffer)),
2629 BUF_ZV_BYTE (XBUFFER (buffer))); 2629 BUF_ZV_BYTE (XBUFFER (buffer)));
2630 } 2630 }
@@ -2645,7 +2645,7 @@ usage: (make-serial-process &rest ARGS) */)
2645 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) 2645 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2646 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) 2646 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2647 val = Qnil; 2647 val = Qnil;
2648 p->decode_coding_system = val; 2648 PVAR (p, decode_coding_system) = val;
2649 2649
2650 val = Qnil; 2650 val = Qnil;
2651 if (!NILP (tem)) 2651 if (!NILP (tem))
@@ -2659,12 +2659,12 @@ usage: (make-serial-process &rest ARGS) */)
2659 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) 2659 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2660 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) 2660 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2661 val = Qnil; 2661 val = Qnil;
2662 p->encode_coding_system = val; 2662 PVAR (p, encode_coding_system) = val;
2663 2663
2664 setup_process_coding_systems (proc); 2664 setup_process_coding_systems (proc);
2665 p->decoding_buf = empty_unibyte_string; 2665 PVAR (p, decoding_buf) = empty_unibyte_string;
2666 p->decoding_carryover = 0; 2666 p->decoding_carryover = 0;
2667 p->encoding_buf = empty_unibyte_string; 2667 PVAR (p, encoding_buf) = empty_unibyte_string;
2668 p->inherit_coding_system_flag 2668 p->inherit_coding_system_flag
2669 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 2669 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
2670 2670
@@ -3401,27 +3401,27 @@ usage: (make-network-process &rest ARGS) */)
3401 3401
3402 p = XPROCESS (proc); 3402 p = XPROCESS (proc);
3403 3403
3404 p->childp = contact; 3404 PVAR (p, childp) = contact;
3405 p->plist = Fcopy_sequence (Fplist_get (contact, QCplist)); 3405 PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist));
3406 p->type = Qnetwork; 3406 PVAR (p, type) = Qnetwork;
3407 3407
3408 p->buffer = buffer; 3408 PVAR (p, buffer) = buffer;
3409 p->sentinel = sentinel; 3409 PVAR (p, sentinel) = sentinel;
3410 p->filter = filter; 3410 PVAR (p, filter) = filter;
3411 p->log = Fplist_get (contact, QClog); 3411 PVAR (p, log) = Fplist_get (contact, QClog);
3412 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) 3412 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
3413 p->kill_without_query = 1; 3413 p->kill_without_query = 1;
3414 if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) 3414 if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
3415 p->command = Qt; 3415 PVAR (p, command) = Qt;
3416 p->pid = 0; 3416 p->pid = 0;
3417 p->infd = inch; 3417 p->infd = inch;
3418 p->outfd = outch; 3418 p->outfd = outch;
3419 if (is_server && socktype != SOCK_DGRAM) 3419 if (is_server && socktype != SOCK_DGRAM)
3420 p->status = Qlisten; 3420 PVAR (p, status) = Qlisten;
3421 3421
3422 /* Make the process marker point into the process buffer (if any). */ 3422 /* Make the process marker point into the process buffer (if any). */
3423 if (BUFFERP (buffer)) 3423 if (BUFFERP (buffer))
3424 set_marker_both (p->mark, buffer, 3424 set_marker_both (PVAR (p, mark), buffer,
3425 BUF_ZV (XBUFFER (buffer)), 3425 BUF_ZV (XBUFFER (buffer)),
3426 BUF_ZV_BYTE (XBUFFER (buffer))); 3426 BUF_ZV_BYTE (XBUFFER (buffer)));
3427 3427
@@ -3431,7 +3431,7 @@ usage: (make-network-process &rest ARGS) */)
3431 /* We may get here if connect did succeed immediately. However, 3431 /* We may get here if connect did succeed immediately. However,
3432 in that case, we still need to signal this like a non-blocking 3432 in that case, we still need to signal this like a non-blocking
3433 connection. */ 3433 connection. */
3434 p->status = Qconnect; 3434 PVAR (p, status) = Qconnect;
3435 if (!FD_ISSET (inch, &connect_wait_mask)) 3435 if (!FD_ISSET (inch, &connect_wait_mask))
3436 { 3436 {
3437 FD_SET (inch, &connect_wait_mask); 3437 FD_SET (inch, &connect_wait_mask);
@@ -3443,8 +3443,8 @@ usage: (make-network-process &rest ARGS) */)
3443#endif 3443#endif
3444 /* A server may have a client filter setting of Qt, but it must 3444 /* A server may have a client filter setting of Qt, but it must
3445 still listen for incoming connects unless it is stopped. */ 3445 still listen for incoming connects unless it is stopped. */
3446 if ((!EQ (p->filter, Qt) && !EQ (p->command, Qt)) 3446 if ((!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt))
3447 || (EQ (p->status, Qlisten) && NILP (p->command))) 3447 || (EQ (PVAR (p, status), Qlisten) && NILP (PVAR (p, command))))
3448 { 3448 {
3449 FD_SET (inch, &input_wait_mask); 3449 FD_SET (inch, &input_wait_mask);
3450 FD_SET (inch, &non_keyboard_wait_mask); 3450 FD_SET (inch, &non_keyboard_wait_mask);
@@ -3498,7 +3498,7 @@ usage: (make-network-process &rest ARGS) */)
3498 else 3498 else
3499 val = Qnil; 3499 val = Qnil;
3500 } 3500 }
3501 p->decode_coding_system = val; 3501 PVAR (p, decode_coding_system) = val;
3502 3502
3503 if (!NILP (tem)) 3503 if (!NILP (tem))
3504 { 3504 {
@@ -3532,13 +3532,13 @@ usage: (make-network-process &rest ARGS) */)
3532 else 3532 else
3533 val = Qnil; 3533 val = Qnil;
3534 } 3534 }
3535 p->encode_coding_system = val; 3535 PVAR (p, encode_coding_system) = val;
3536 } 3536 }
3537 setup_process_coding_systems (proc); 3537 setup_process_coding_systems (proc);
3538 3538
3539 p->decoding_buf = empty_unibyte_string; 3539 PVAR (p, decoding_buf) = empty_unibyte_string;
3540 p->decoding_carryover = 0; 3540 p->decoding_carryover = 0;
3541 p->encoding_buf = empty_unibyte_string; 3541 PVAR (p, encoding_buf) = empty_unibyte_string;
3542 3542
3543 p->inherit_coding_system_flag 3543 p->inherit_coding_system_flag
3544 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 3544 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@@ -4031,8 +4031,8 @@ server_accept_connection (Lisp_Object server, int channel)
4031 return; 4031 return;
4032#endif 4032#endif
4033 4033
4034 if (!NILP (ps->log)) 4034 if (!NILP (PVAR (ps, log)))
4035 call3 (ps->log, server, Qnil, 4035 call3 (PVAR (ps, log), server, Qnil,
4036 concat3 (build_string ("accept failed with code"), 4036 concat3 (build_string ("accept failed with code"),
4037 Fnumber_to_string (make_number (code)), 4037 Fnumber_to_string (make_number (code)),
4038 build_string ("\n"))); 4038 build_string ("\n")));
@@ -4102,15 +4102,15 @@ server_accept_connection (Lisp_Object server, int channel)
4102 process name of the server process concatenated with the caller 4102 process name of the server process concatenated with the caller
4103 identification. */ 4103 identification. */
4104 4104
4105 if (!NILP (ps->filter) && !EQ (ps->filter, Qt)) 4105 if (!NILP (PVAR (ps, filter)) && !EQ (PVAR (ps, filter), Qt))
4106 buffer = Qnil; 4106 buffer = Qnil;
4107 else 4107 else
4108 { 4108 {
4109 buffer = ps->buffer; 4109 buffer = PVAR (ps, buffer);
4110 if (!NILP (buffer)) 4110 if (!NILP (buffer))
4111 buffer = Fbuffer_name (buffer); 4111 buffer = Fbuffer_name (buffer);
4112 else 4112 else
4113 buffer = ps->name; 4113 buffer = PVAR (ps, name);
4114 if (!NILP (buffer)) 4114 if (!NILP (buffer))
4115 { 4115 {
4116 buffer = concat2 (buffer, caller); 4116 buffer = concat2 (buffer, caller);
@@ -4121,7 +4121,7 @@ server_accept_connection (Lisp_Object server, int channel)
4121 /* Generate a unique name for the new server process. Combine the 4121 /* Generate a unique name for the new server process. Combine the
4122 server process name with the caller identification. */ 4122 server process name with the caller identification. */
4123 4123
4124 name = concat2 (ps->name, caller); 4124 name = concat2 (PVAR (ps, name), caller);
4125 proc = make_process (name); 4125 proc = make_process (name);
4126 4126
4127 chan_process[s] = proc; 4127 chan_process[s] = proc;
@@ -4137,7 +4137,7 @@ server_accept_connection (Lisp_Object server, int channel)
4137 p = XPROCESS (proc); 4137 p = XPROCESS (proc);
4138 4138
4139 /* Build new contact information for this setup. */ 4139 /* Build new contact information for this setup. */
4140 contact = Fcopy_sequence (ps->childp); 4140 contact = Fcopy_sequence (PVAR (ps, childp));
4141 contact = Fplist_put (contact, QCserver, Qnil); 4141 contact = Fplist_put (contact, QCserver, Qnil);
4142 contact = Fplist_put (contact, QChost, host); 4142 contact = Fplist_put (contact, QChost, host);
4143 if (!NILP (service)) 4143 if (!NILP (service))
@@ -4151,21 +4151,21 @@ server_accept_connection (Lisp_Object server, int channel)
4151 conv_sockaddr_to_lisp (&saddr.sa, len)); 4151 conv_sockaddr_to_lisp (&saddr.sa, len));
4152#endif 4152#endif
4153 4153
4154 p->childp = contact; 4154 PVAR (p, childp) = contact;
4155 p->plist = Fcopy_sequence (ps->plist); 4155 PVAR (p, plist) = Fcopy_sequence (PVAR (ps, plist));
4156 p->type = Qnetwork; 4156 PVAR (p, type) = Qnetwork;
4157 4157
4158 p->buffer = buffer; 4158 PVAR (p, buffer) = buffer;
4159 p->sentinel = ps->sentinel; 4159 PVAR (p, sentinel) = PVAR (ps, sentinel);
4160 p->filter = ps->filter; 4160 PVAR (p, filter) = PVAR (ps, filter);
4161 p->command = Qnil; 4161 PVAR (p, command) = Qnil;
4162 p->pid = 0; 4162 p->pid = 0;
4163 p->infd = s; 4163 p->infd = s;
4164 p->outfd = s; 4164 p->outfd = s;
4165 p->status = Qrun; 4165 PVAR (p, status) = Qrun;
4166 4166
4167 /* Client processes for accepted connections are not stopped initially. */ 4167 /* Client processes for accepted connections are not stopped initially. */
4168 if (!EQ (p->filter, Qt)) 4168 if (!EQ (PVAR (p, filter), Qt))
4169 { 4169 {
4170 FD_SET (s, &input_wait_mask); 4170 FD_SET (s, &input_wait_mask);
4171 FD_SET (s, &non_keyboard_wait_mask); 4171 FD_SET (s, &non_keyboard_wait_mask);
@@ -4179,24 +4179,24 @@ server_accept_connection (Lisp_Object server, int channel)
4179 of the new process should reflect the settings at the time the 4179 of the new process should reflect the settings at the time the
4180 server socket was opened; not the current settings. */ 4180 server socket was opened; not the current settings. */
4181 4181
4182 p->decode_coding_system = ps->decode_coding_system; 4182 PVAR (p, decode_coding_system) = PVAR (ps, decode_coding_system);
4183 p->encode_coding_system = ps->encode_coding_system; 4183 PVAR (p, encode_coding_system) = PVAR (ps, encode_coding_system);
4184 setup_process_coding_systems (proc); 4184 setup_process_coding_systems (proc);
4185 4185
4186 p->decoding_buf = empty_unibyte_string; 4186 PVAR (p, decoding_buf) = empty_unibyte_string;
4187 p->decoding_carryover = 0; 4187 p->decoding_carryover = 0;
4188 p->encoding_buf = empty_unibyte_string; 4188 PVAR (p, encoding_buf) = empty_unibyte_string;
4189 4189
4190 p->inherit_coding_system_flag 4190 p->inherit_coding_system_flag
4191 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); 4191 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
4192 4192
4193 if (!NILP (ps->log)) 4193 if (!NILP (PVAR (ps, log)))
4194 call3 (ps->log, server, proc, 4194 call3 (PVAR (ps, log), server, proc,
4195 concat3 (build_string ("accept from "), 4195 concat3 (build_string ("accept from "),
4196 (STRINGP (host) ? host : build_string ("-")), 4196 (STRINGP (host) ? host : build_string ("-")),
4197 build_string ("\n"))); 4197 build_string ("\n")));
4198 4198
4199 if (!NILP (p->sentinel)) 4199 if (!NILP (PVAR (p, sentinel)))
4200 exec_sentinel (proc, 4200 exec_sentinel (proc,
4201 concat3 (build_string ("open from "), 4201 concat3 (build_string ("open from "),
4202 (STRINGP (host) ? host : build_string ("-")), 4202 (STRINGP (host) ? host : build_string ("-")),
@@ -4287,7 +4287,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4287 FD_ZERO (&Writeok); 4287 FD_ZERO (&Writeok);
4288 4288
4289 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) 4289 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit)
4290 && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit))) 4290 && !(CONSP (PVAR (wait_proc, status))
4291 && EQ (XCAR (PVAR (wait_proc, status)), Qexit)))
4291 message ("Blocking call to accept-process-output with quit inhibited!!"); 4292 message ("Blocking call to accept-process-output with quit inhibited!!");
4292 4293
4293 /* If wait_proc is a process to watch, set wait_channel accordingly. */ 4294 /* If wait_proc is a process to watch, set wait_channel accordingly. */
@@ -4460,8 +4461,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4460 if (wait_proc && wait_proc->raw_status_new) 4461 if (wait_proc && wait_proc->raw_status_new)
4461 update_status (wait_proc); 4462 update_status (wait_proc);
4462 if (wait_proc 4463 if (wait_proc
4463 && ! EQ (wait_proc->status, Qrun) 4464 && ! EQ (PVAR (wait_proc, status), Qrun)
4464 && ! EQ (wait_proc->status, Qconnect)) 4465 && ! EQ (PVAR (wait_proc, status), Qconnect))
4465 { 4466 {
4466 int nread, total_nread = 0; 4467 int nread, total_nread = 0;
4467 4468
@@ -4820,7 +4821,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4820 continue; 4821 continue;
4821 4822
4822 /* If this is a server stream socket, accept connection. */ 4823 /* If this is a server stream socket, accept connection. */
4823 if (EQ (XPROCESS (proc)->status, Qlisten)) 4824 if (EQ (PVAR (XPROCESS (proc), status), Qlisten))
4824 { 4825 {
4825 server_accept_connection (proc, channel); 4826 server_accept_connection (proc, channel);
4826 continue; 4827 continue;
@@ -4889,7 +4890,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4889 wait3() will not find the process object to 4890 wait3() will not find the process object to
4890 delete. Do it here. */ 4891 delete. Do it here. */
4891 p->tick = ++process_tick; 4892 p->tick = ++process_tick;
4892 p->status = Qfailed; 4893 PVAR (p, status) = Qfailed;
4893 } 4894 }
4894 else 4895 else
4895 kill (getpid (), SIGCHLD); 4896 kill (getpid (), SIGCHLD);
@@ -4908,8 +4909,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4908 deactivate_process (proc); 4909 deactivate_process (proc);
4909 if (XPROCESS (proc)->raw_status_new) 4910 if (XPROCESS (proc)->raw_status_new)
4910 update_status (XPROCESS (proc)); 4911 update_status (XPROCESS (proc));
4911 if (EQ (XPROCESS (proc)->status, Qrun)) 4912 if (EQ (PVAR (XPROCESS (proc), status), Qrun))
4912 XPROCESS (proc)->status 4913 PVAR (XPROCESS (proc), status)
4913 = Fcons (Qexit, Fcons (make_number (256), Qnil)); 4914 = Fcons (Qexit, Fcons (make_number (256), Qnil));
4914 } 4915 }
4915 } 4916 }
@@ -4958,17 +4959,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4958 if (xerrno) 4959 if (xerrno)
4959 { 4960 {
4960 p->tick = ++process_tick; 4961 p->tick = ++process_tick;
4961 p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); 4962 PVAR (p, status)
4963 = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
4962 deactivate_process (proc); 4964 deactivate_process (proc);
4963 } 4965 }
4964 else 4966 else
4965 { 4967 {
4966 p->status = Qrun; 4968 PVAR (p, status) = Qrun;
4967 /* Execute the sentinel here. If we had relied on 4969 /* Execute the sentinel here. If we had relied on
4968 status_notify to do it later, it will read input 4970 status_notify to do it later, it will read input
4969 from the process before calling the sentinel. */ 4971 from the process before calling the sentinel. */
4970 exec_sentinel (proc, build_string ("open\n")); 4972 exec_sentinel (proc, build_string ("open\n"));
4971 if (!EQ (p->filter, Qt) && !EQ (p->command, Qt)) 4973 if (!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt))
4972 { 4974 {
4973 FD_SET (p->infd, &input_wait_mask); 4975 FD_SET (p->infd, &input_wait_mask);
4974 FD_SET (p->infd, &non_keyboard_wait_mask); 4976 FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -5040,7 +5042,7 @@ read_process_output (Lisp_Object proc, register int channel)
5040 chars = alloca (carryover + readmax); 5042 chars = alloca (carryover + readmax);
5041 if (carryover) 5043 if (carryover)
5042 /* See the comment above. */ 5044 /* See the comment above. */
5043 memcpy (chars, SDATA (p->decoding_buf), carryover); 5045 memcpy (chars, SDATA (PVAR (p, decoding_buf)), carryover);
5044 5046
5045#ifdef DATAGRAM_SOCKETS 5047#ifdef DATAGRAM_SOCKETS
5046 /* We have a working select, so proc_buffered_char is always -1. */ 5048 /* We have a working select, so proc_buffered_char is always -1. */
@@ -5119,7 +5121,7 @@ read_process_output (Lisp_Object proc, register int channel)
5119 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 5121 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
5120 5122
5121 /* Read and dispose of the process output. */ 5123 /* Read and dispose of the process output. */
5122 outstream = p->filter; 5124 outstream = PVAR (p, filter);
5123 if (!NILP (outstream)) 5125 if (!NILP (outstream))
5124 { 5126 {
5125 Lisp_Object text; 5127 Lisp_Object text;
@@ -5161,9 +5163,9 @@ read_process_output (Lisp_Object proc, register int channel)
5161 text = coding->dst_object; 5163 text = coding->dst_object;
5162 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5164 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5163 /* A new coding system might be found. */ 5165 /* A new coding system might be found. */
5164 if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) 5166 if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used))
5165 { 5167 {
5166 p->decode_coding_system = Vlast_coding_system_used; 5168 PVAR (p, decode_coding_system) = Vlast_coding_system_used;
5167 5169
5168 /* Don't call setup_coding_system for 5170 /* Don't call setup_coding_system for
5169 proc_decode_coding_system[channel] here. It is done in 5171 proc_decode_coding_system[channel] here. It is done in
@@ -5176,21 +5178,21 @@ read_process_output (Lisp_Object proc, register int channel)
5176 proc_encode_coding_system[p->outfd] surely points to a 5178 proc_encode_coding_system[p->outfd] surely points to a
5177 valid memory because p->outfd will be changed once EOF is 5179 valid memory because p->outfd will be changed once EOF is
5178 sent to the process. */ 5180 sent to the process. */
5179 if (NILP (p->encode_coding_system) 5181 if (NILP (PVAR (p, encode_coding_system))
5180 && proc_encode_coding_system[p->outfd]) 5182 && proc_encode_coding_system[p->outfd])
5181 { 5183 {
5182 p->encode_coding_system 5184 PVAR (p, encode_coding_system)
5183 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); 5185 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
5184 setup_coding_system (p->encode_coding_system, 5186 setup_coding_system (PVAR (p, encode_coding_system),
5185 proc_encode_coding_system[p->outfd]); 5187 proc_encode_coding_system[p->outfd]);
5186 } 5188 }
5187 } 5189 }
5188 5190
5189 if (coding->carryover_bytes > 0) 5191 if (coding->carryover_bytes > 0)
5190 { 5192 {
5191 if (SCHARS (p->decoding_buf) < coding->carryover_bytes) 5193 if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes)
5192 p->decoding_buf = make_uninit_string (coding->carryover_bytes); 5194 PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes);
5193 memcpy (SDATA (p->decoding_buf), coding->carryover, 5195 memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover,
5194 coding->carryover_bytes); 5196 coding->carryover_bytes);
5195 p->decoding_carryover = coding->carryover_bytes; 5197 p->decoding_carryover = coding->carryover_bytes;
5196 } 5198 }
@@ -5226,7 +5228,7 @@ read_process_output (Lisp_Object proc, register int channel)
5226 } 5228 }
5227 5229
5228 /* If no filter, write into buffer if it isn't dead. */ 5230 /* If no filter, write into buffer if it isn't dead. */
5229 else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name))) 5231 else if (!NILP (PVAR (p, buffer)) && !NILP (BVAR (XBUFFER (PVAR (p, buffer)), name)))
5230 { 5232 {
5231 Lisp_Object old_read_only; 5233 Lisp_Object old_read_only;
5232 ptrdiff_t old_begv, old_zv; 5234 ptrdiff_t old_begv, old_zv;
@@ -5236,7 +5238,7 @@ read_process_output (Lisp_Object proc, register int channel)
5236 Lisp_Object text; 5238 Lisp_Object text;
5237 struct buffer *b; 5239 struct buffer *b;
5238 5240
5239 Fset_buffer (p->buffer); 5241 Fset_buffer (PVAR (p, buffer));
5240 opoint = PT; 5242 opoint = PT;
5241 opoint_byte = PT_BYTE; 5243 opoint_byte = PT_BYTE;
5242 old_read_only = BVAR (current_buffer, read_only); 5244 old_read_only = BVAR (current_buffer, read_only);
@@ -5250,9 +5252,11 @@ read_process_output (Lisp_Object proc, register int channel)
5250 /* Insert new output into buffer 5252 /* Insert new output into buffer
5251 at the current end-of-output marker, 5253 at the current end-of-output marker,
5252 thus preserving logical ordering of input and output. */ 5254 thus preserving logical ordering of input and output. */
5253 if (XMARKER (p->mark)->buffer) 5255 if (XMARKER (PVAR (p, mark))->buffer)
5254 SET_PT_BOTH (clip_to_bounds (BEGV, marker_position (p->mark), ZV), 5256 SET_PT_BOTH (clip_to_bounds (BEGV,
5255 clip_to_bounds (BEGV_BYTE, marker_byte_position (p->mark), 5257 marker_position (PVAR (p, mark)), ZV),
5258 clip_to_bounds (BEGV_BYTE,
5259 marker_byte_position (PVAR (p, mark)),
5256 ZV_BYTE)); 5260 ZV_BYTE));
5257 else 5261 else
5258 SET_PT_BOTH (ZV, ZV_BYTE); 5262 SET_PT_BOTH (ZV, ZV_BYTE);
@@ -5269,23 +5273,23 @@ read_process_output (Lisp_Object proc, register int channel)
5269 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5273 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5270 /* A new coding system might be found. See the comment in the 5274 /* A new coding system might be found. See the comment in the
5271 similar code in the previous `if' block. */ 5275 similar code in the previous `if' block. */
5272 if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) 5276 if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used))
5273 { 5277 {
5274 p->decode_coding_system = Vlast_coding_system_used; 5278 PVAR (p, decode_coding_system) = Vlast_coding_system_used;
5275 if (NILP (p->encode_coding_system) 5279 if (NILP (PVAR (p, encode_coding_system))
5276 && proc_encode_coding_system[p->outfd]) 5280 && proc_encode_coding_system[p->outfd])
5277 { 5281 {
5278 p->encode_coding_system 5282 PVAR (p, encode_coding_system)
5279 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); 5283 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
5280 setup_coding_system (p->encode_coding_system, 5284 setup_coding_system (PVAR (p, encode_coding_system),
5281 proc_encode_coding_system[p->outfd]); 5285 proc_encode_coding_system[p->outfd]);
5282 } 5286 }
5283 } 5287 }
5284 if (coding->carryover_bytes > 0) 5288 if (coding->carryover_bytes > 0)
5285 { 5289 {
5286 if (SCHARS (p->decoding_buf) < coding->carryover_bytes) 5290 if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes)
5287 p->decoding_buf = make_uninit_string (coding->carryover_bytes); 5291 PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes);
5288 memcpy (SDATA (p->decoding_buf), coding->carryover, 5292 memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover,
5289 coding->carryover_bytes); 5293 coding->carryover_bytes);
5290 p->decoding_carryover = coding->carryover_bytes; 5294 p->decoding_carryover = coding->carryover_bytes;
5291 } 5295 }
@@ -5303,11 +5307,11 @@ read_process_output (Lisp_Object proc, register int channel)
5303 /* Make sure the process marker's position is valid when the 5307 /* Make sure the process marker's position is valid when the
5304 process buffer is changed in the signal_after_change above. 5308 process buffer is changed in the signal_after_change above.
5305 W3 is known to do that. */ 5309 W3 is known to do that. */
5306 if (BUFFERP (p->buffer) 5310 if (BUFFERP (PVAR (p, buffer))
5307 && (b = XBUFFER (p->buffer), b != current_buffer)) 5311 && (b = XBUFFER (PVAR (p, buffer)), b != current_buffer))
5308 set_marker_both (p->mark, p->buffer, BUF_PT (b), BUF_PT_BYTE (b)); 5312 set_marker_both (PVAR (p, mark), PVAR (p, buffer), BUF_PT (b), BUF_PT_BYTE (b));
5309 else 5313 else
5310 set_marker_both (p->mark, p->buffer, PT, PT_BYTE); 5314 set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE);
5311 5315
5312 update_mode_lines++; 5316 update_mode_lines++;
5313 5317
@@ -5401,9 +5405,9 @@ write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj,
5401 entry = Fcons (obj, Fcons (make_number (offset), make_number (len))); 5405 entry = Fcons (obj, Fcons (make_number (offset), make_number (len)));
5402 5406
5403 if (front) 5407 if (front)
5404 p->write_queue = Fcons (entry, p->write_queue); 5408 PVAR (p, write_queue) = Fcons (entry, PVAR (p, write_queue));
5405 else 5409 else
5406 p->write_queue = nconc2 (p->write_queue, Fcons (entry, Qnil)); 5410 PVAR (p, write_queue) = nconc2 (PVAR (p, write_queue), Fcons (entry, Qnil));
5407} 5411}
5408 5412
5409/* Remove the first element in the write_queue of process P, put its 5413/* Remove the first element in the write_queue of process P, put its
@@ -5417,11 +5421,11 @@ write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj,
5417 Lisp_Object entry, offset_length; 5421 Lisp_Object entry, offset_length;
5418 ptrdiff_t offset; 5422 ptrdiff_t offset;
5419 5423
5420 if (NILP (p->write_queue)) 5424 if (NILP (PVAR (p, write_queue)))
5421 return 0; 5425 return 0;
5422 5426
5423 entry = XCAR (p->write_queue); 5427 entry = XCAR (PVAR (p, write_queue));
5424 p->write_queue = XCDR (p->write_queue); 5428 PVAR (p, write_queue) = XCDR (PVAR (p, write_queue));
5425 5429
5426 *obj = XCAR (entry); 5430 *obj = XCAR (entry);
5427 offset_length = XCDR (entry); 5431 offset_length = XCDR (entry);
@@ -5455,10 +5459,10 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5455 5459
5456 if (p->raw_status_new) 5460 if (p->raw_status_new)
5457 update_status (p); 5461 update_status (p);
5458 if (! EQ (p->status, Qrun)) 5462 if (! EQ (PVAR (p, status), Qrun))
5459 error ("Process %s not running", SDATA (p->name)); 5463 error ("Process %s not running", SDATA (PVAR (p, name)));
5460 if (p->outfd < 0) 5464 if (p->outfd < 0)
5461 error ("Output file descriptor of %s is closed", SDATA (p->name)); 5465 error ("Output file descriptor of %s is closed", SDATA (PVAR (p, name)));
5462 5466
5463 coding = proc_encode_coding_system[p->outfd]; 5467 coding = proc_encode_coding_system[p->outfd];
5464 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5468 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
@@ -5468,9 +5472,9 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5468 && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters))) 5472 && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters)))
5469 || EQ (object, Qt)) 5473 || EQ (object, Qt))
5470 { 5474 {
5471 p->encode_coding_system 5475 PVAR (p, encode_coding_system)
5472 = complement_process_encoding_system (p->encode_coding_system); 5476 = complement_process_encoding_system (PVAR (p, encode_coding_system));
5473 if (!EQ (Vlast_coding_system_used, p->encode_coding_system)) 5477 if (!EQ (Vlast_coding_system_used, PVAR (p, encode_coding_system)))
5474 { 5478 {
5475 /* The coding system for encoding was changed to raw-text 5479 /* The coding system for encoding was changed to raw-text
5476 because we sent a unibyte text previously. Now we are 5480 because we sent a unibyte text previously. Now we are
@@ -5480,8 +5484,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5480 Another reason we come here is that the coding system 5484 Another reason we come here is that the coding system
5481 was just complemented and a new one was returned by 5485 was just complemented and a new one was returned by
5482 complement_process_encoding_system. */ 5486 complement_process_encoding_system. */
5483 setup_coding_system (p->encode_coding_system, coding); 5487 setup_coding_system (PVAR (p, encode_coding_system), coding);
5484 Vlast_coding_system_used = p->encode_coding_system; 5488 Vlast_coding_system_used = PVAR (p, encode_coding_system);
5485 } 5489 }
5486 coding->src_multibyte = 1; 5490 coding->src_multibyte = 1;
5487 } 5491 }
@@ -5568,7 +5572,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5568 5572
5569 /* If there is already data in the write_queue, put the new data 5573 /* If there is already data in the write_queue, put the new data
5570 in the back of queue. Otherwise, ignore it. */ 5574 in the back of queue. Otherwise, ignore it. */
5571 if (!NILP (p->write_queue)) 5575 if (!NILP (PVAR (p, write_queue)))
5572 write_queue_push (p, object, buf, len, 0); 5576 write_queue_push (p, object, buf, len, 0);
5573 5577
5574 do /* while !NILP (p->write_queue) */ 5578 do /* while !NILP (p->write_queue) */
@@ -5682,7 +5686,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5682 cur_len -= written; 5686 cur_len -= written;
5683 } 5687 }
5684 } 5688 }
5685 while (!NILP (p->write_queue)); 5689 while (!NILP (PVAR (p, write_queue)));
5686 } 5690 }
5687 else 5691 else
5688 { 5692 {
@@ -5690,10 +5694,10 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5690 proc = process_sent_to; 5694 proc = process_sent_to;
5691 p = XPROCESS (proc); 5695 p = XPROCESS (proc);
5692 p->raw_status_new = 0; 5696 p->raw_status_new = 0;
5693 p->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); 5697 PVAR (p, status) = Fcons (Qexit, Fcons (make_number (256), Qnil));
5694 p->tick = ++process_tick; 5698 p->tick = ++process_tick;
5695 deactivate_process (proc); 5699 deactivate_process (proc);
5696 error ("SIGPIPE raised on process %s; closed it", SDATA (p->name)); 5700 error ("SIGPIPE raised on process %s; closed it", SDATA (PVAR (p, name)));
5697 } 5701 }
5698} 5702}
5699 5703
@@ -5751,12 +5755,12 @@ emacs_get_tty_pgrp (struct Lisp_Process *p)
5751 pid_t gid = -1; 5755 pid_t gid = -1;
5752 5756
5753#ifdef TIOCGPGRP 5757#ifdef TIOCGPGRP
5754 if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name)) 5758 if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PVAR (p, tty_name)))
5755 { 5759 {
5756 int fd; 5760 int fd;
5757 /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the 5761 /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the
5758 master side. Try the slave side. */ 5762 master side. Try the slave side. */
5759 fd = emacs_open (SSDATA (p->tty_name), O_RDONLY, 0); 5763 fd = emacs_open (SSDATA (PVAR (p, tty_name)), O_RDONLY, 0);
5760 5764
5761 if (fd != -1) 5765 if (fd != -1)
5762 { 5766 {
@@ -5785,12 +5789,12 @@ return t unconditionally. */)
5785 proc = get_process (process); 5789 proc = get_process (process);
5786 p = XPROCESS (proc); 5790 p = XPROCESS (proc);
5787 5791
5788 if (!EQ (p->type, Qreal)) 5792 if (!EQ (PVAR (p, type), Qreal))
5789 error ("Process %s is not a subprocess", 5793 error ("Process %s is not a subprocess",
5790 SDATA (p->name)); 5794 SDATA (PVAR (p, name)));
5791 if (p->infd < 0) 5795 if (p->infd < 0)
5792 error ("Process %s is not active", 5796 error ("Process %s is not active",
5793 SDATA (p->name)); 5797 SDATA (PVAR (p, name)));
5794 5798
5795 gid = emacs_get_tty_pgrp (p); 5799 gid = emacs_get_tty_pgrp (p);
5796 5800
@@ -5825,12 +5829,12 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5825 proc = get_process (process); 5829 proc = get_process (process);
5826 p = XPROCESS (proc); 5830 p = XPROCESS (proc);
5827 5831
5828 if (!EQ (p->type, Qreal)) 5832 if (!EQ (PVAR (p, type), Qreal))
5829 error ("Process %s is not a subprocess", 5833 error ("Process %s is not a subprocess",
5830 SDATA (p->name)); 5834 SDATA (PVAR (p, name)));
5831 if (p->infd < 0) 5835 if (p->infd < 0)
5832 error ("Process %s is not active", 5836 error ("Process %s is not active",
5833 SDATA (p->name)); 5837 SDATA (PVAR (p, name)));
5834 5838
5835 if (!p->pty_flag) 5839 if (!p->pty_flag)
5836 current_group = Qnil; 5840 current_group = Qnil;
@@ -5919,7 +5923,7 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5919#ifdef SIGCONT 5923#ifdef SIGCONT
5920 case SIGCONT: 5924 case SIGCONT:
5921 p->raw_status_new = 0; 5925 p->raw_status_new = 0;
5922 p->status = Qrun; 5926 PVAR (p, status) = Qrun;
5923 p->tick = ++process_tick; 5927 p->tick = ++process_tick;
5924 if (!nomsg) 5928 if (!nomsg)
5925 { 5929 {
@@ -6009,13 +6013,13 @@ traffic. */)
6009 struct Lisp_Process *p; 6013 struct Lisp_Process *p;
6010 6014
6011 p = XPROCESS (process); 6015 p = XPROCESS (process);
6012 if (NILP (p->command) 6016 if (NILP (PVAR (p, command))
6013 && p->infd >= 0) 6017 && p->infd >= 0)
6014 { 6018 {
6015 FD_CLR (p->infd, &input_wait_mask); 6019 FD_CLR (p->infd, &input_wait_mask);
6016 FD_CLR (p->infd, &non_keyboard_wait_mask); 6020 FD_CLR (p->infd, &non_keyboard_wait_mask);
6017 } 6021 }
6018 p->command = Qt; 6022 PVAR (p, command) = Qt;
6019 return process; 6023 return process;
6020 } 6024 }
6021#ifndef SIGTSTP 6025#ifndef SIGTSTP
@@ -6038,9 +6042,9 @@ traffic. */)
6038 struct Lisp_Process *p; 6042 struct Lisp_Process *p;
6039 6043
6040 p = XPROCESS (process); 6044 p = XPROCESS (process);
6041 if (EQ (p->command, Qt) 6045 if (EQ (PVAR (p, command), Qt)
6042 && p->infd >= 0 6046 && p->infd >= 0
6043 && (!EQ (p->filter, Qt) || EQ (p->status, Qlisten))) 6047 && (!EQ (PVAR (p, filter), Qt) || EQ (PVAR (p, status), Qlisten)))
6044 { 6048 {
6045 FD_SET (p->infd, &input_wait_mask); 6049 FD_SET (p->infd, &input_wait_mask);
6046 FD_SET (p->infd, &non_keyboard_wait_mask); 6050 FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -6051,7 +6055,7 @@ traffic. */)
6051 tcflush (p->infd, TCIFLUSH); 6055 tcflush (p->infd, TCIFLUSH);
6052#endif /* not WINDOWSNT */ 6056#endif /* not WINDOWSNT */
6053 } 6057 }
6054 p->command = Qnil; 6058 PVAR (p, command) = Qnil;
6055 return process; 6059 return process;
6056 } 6060 }
6057#ifdef SIGCONT 6061#ifdef SIGCONT
@@ -6098,7 +6102,8 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
6098 CHECK_PROCESS (process); 6102 CHECK_PROCESS (process);
6099 pid = XPROCESS (process)->pid; 6103 pid = XPROCESS (process)->pid;
6100 if (pid <= 0) 6104 if (pid <= 0)
6101 error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); 6105 error ("Cannot signal process %s",
6106 SDATA (PVAR (XPROCESS (process), name)));
6102 } 6107 }
6103 6108
6104#define parse_signal(NAME, VALUE) \ 6109#define parse_signal(NAME, VALUE) \
@@ -6242,8 +6247,8 @@ process has been transmitted to the serial port. */)
6242 /* Make sure the process is really alive. */ 6247 /* Make sure the process is really alive. */
6243 if (XPROCESS (proc)->raw_status_new) 6248 if (XPROCESS (proc)->raw_status_new)
6244 update_status (XPROCESS (proc)); 6249 update_status (XPROCESS (proc));
6245 if (! EQ (XPROCESS (proc)->status, Qrun)) 6250 if (! EQ (PVAR (XPROCESS (proc), status), Qrun))
6246 error ("Process %s not running", SDATA (XPROCESS (proc)->name)); 6251 error ("Process %s not running", SDATA (PVAR (XPROCESS (proc), name)));
6247 6252
6248 if (CODING_REQUIRE_FLUSHING (coding)) 6253 if (CODING_REQUIRE_FLUSHING (coding))
6249 { 6254 {
@@ -6253,7 +6258,7 @@ process has been transmitted to the serial port. */)
6253 6258
6254 if (XPROCESS (proc)->pty_flag) 6259 if (XPROCESS (proc)->pty_flag)
6255 send_process (proc, "\004", 1, Qnil); 6260 send_process (proc, "\004", 1, Qnil);
6256 else if (EQ (XPROCESS (proc)->type, Qserial)) 6261 else if (EQ (PVAR (XPROCESS (proc), type), Qserial))
6257 { 6262 {
6258#ifndef WINDOWSNT 6263#ifndef WINDOWSNT
6259 if (tcdrain (XPROCESS (proc)->outfd) != 0) 6264 if (tcdrain (XPROCESS (proc)->outfd) != 0)
@@ -6270,7 +6275,7 @@ process has been transmitted to the serial port. */)
6270 for communication with the subprocess, call shutdown to cause EOF. 6275 for communication with the subprocess, call shutdown to cause EOF.
6271 (In some old system, shutdown to socketpair doesn't work. 6276 (In some old system, shutdown to socketpair doesn't work.
6272 Then we just can't win.) */ 6277 Then we just can't win.) */
6273 if (EQ (XPROCESS (proc)->type, Qnetwork) 6278 if (EQ (PVAR (XPROCESS (proc), type), Qnetwork)
6274 || XPROCESS (proc)->outfd == XPROCESS (proc)->infd) 6279 || XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
6275 shutdown (XPROCESS (proc)->outfd, 1); 6280 shutdown (XPROCESS (proc)->outfd, 1);
6276 /* In case of socketpair, outfd == infd, so don't close it. */ 6281 /* In case of socketpair, outfd == infd, so don't close it. */
@@ -6383,7 +6388,7 @@ sigchld_handler (int signo)
6383 { 6388 {
6384 proc = XCDR (XCAR (tail)); 6389 proc = XCDR (XCAR (tail));
6385 p = XPROCESS (proc); 6390 p = XPROCESS (proc);
6386 if (EQ (p->type, Qreal) && p->pid == pid) 6391 if (EQ (PVAR (p, type), Qreal) && p->pid == pid)
6387 break; 6392 break;
6388 p = 0; 6393 p = 0;
6389 } 6394 }
@@ -6467,7 +6472,7 @@ sigchld_handler (int signo)
6467static Lisp_Object 6472static Lisp_Object
6468exec_sentinel_unwind (Lisp_Object data) 6473exec_sentinel_unwind (Lisp_Object data)
6469{ 6474{
6470 XPROCESS (XCAR (data))->sentinel = XCDR (data); 6475 PVAR (XPROCESS (XCAR (data)), sentinel) = XCDR (data);
6471 return Qnil; 6476 return Qnil;
6472} 6477}
6473 6478
@@ -6507,13 +6512,13 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6507 friends don't expect current-buffer to be changed from under them. */ 6512 friends don't expect current-buffer to be changed from under them. */
6508 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 6513 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
6509 6514
6510 sentinel = p->sentinel; 6515 sentinel = PVAR (p, sentinel);
6511 if (NILP (sentinel)) 6516 if (NILP (sentinel))
6512 return; 6517 return;
6513 6518
6514 /* Zilch the sentinel while it's running, to avoid recursive invocations; 6519 /* Zilch the sentinel while it's running, to avoid recursive invocations;
6515 assure that it gets restored no matter how the sentinel exits. */ 6520 assure that it gets restored no matter how the sentinel exits. */
6516 p->sentinel = Qnil; 6521 PVAR (p, sentinel) = Qnil;
6517 record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel)); 6522 record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel));
6518 /* Inhibit quit so that random quits don't screw up a running filter. */ 6523 /* Inhibit quit so that random quits don't screw up a running filter. */
6519 specbind (Qinhibit_quit, Qt); 6524 specbind (Qinhibit_quit, Qt);
@@ -6601,16 +6606,16 @@ status_notify (struct Lisp_Process *deleting_process)
6601 p->update_tick = p->tick; 6606 p->update_tick = p->tick;
6602 6607
6603 /* If process is still active, read any output that remains. */ 6608 /* If process is still active, read any output that remains. */
6604 while (! EQ (p->filter, Qt) 6609 while (! EQ (PVAR (p, filter), Qt)
6605 && ! EQ (p->status, Qconnect) 6610 && ! EQ (PVAR (p, status), Qconnect)
6606 && ! EQ (p->status, Qlisten) 6611 && ! EQ (PVAR (p, status), Qlisten)
6607 /* Network or serial process not stopped: */ 6612 /* Network or serial process not stopped: */
6608 && ! EQ (p->command, Qt) 6613 && ! EQ (PVAR (p, command), Qt)
6609 && p->infd >= 0 6614 && p->infd >= 0
6610 && p != deleting_process 6615 && p != deleting_process
6611 && read_process_output (proc, p->infd) > 0); 6616 && read_process_output (proc, p->infd) > 0);
6612 6617
6613 buffer = p->buffer; 6618 buffer = PVAR (p, buffer);
6614 6619
6615 /* Get the text to use for the message. */ 6620 /* Get the text to use for the message. */
6616 if (p->raw_status_new) 6621 if (p->raw_status_new)
@@ -6618,9 +6623,9 @@ status_notify (struct Lisp_Process *deleting_process)
6618 msg = status_message (p); 6623 msg = status_message (p);
6619 6624
6620 /* If process is terminated, deactivate it or delete it. */ 6625 /* If process is terminated, deactivate it or delete it. */
6621 symbol = p->status; 6626 symbol = PVAR (p, status);
6622 if (CONSP (p->status)) 6627 if (CONSP (PVAR (p, status)))
6623 symbol = XCAR (p->status); 6628 symbol = XCAR (PVAR (p, status));
6624 6629
6625 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) 6630 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)
6626 || EQ (symbol, Qclosed)) 6631 || EQ (symbol, Qclosed))
@@ -6637,7 +6642,7 @@ status_notify (struct Lisp_Process *deleting_process)
6637 this code to be run again. */ 6642 this code to be run again. */
6638 p->update_tick = p->tick; 6643 p->update_tick = p->tick;
6639 /* Now output the message suitably. */ 6644 /* Now output the message suitably. */
6640 if (!NILP (p->sentinel)) 6645 if (!NILP (PVAR (p, sentinel)))
6641 exec_sentinel (proc, msg); 6646 exec_sentinel (proc, msg);
6642 /* Don't bother with a message in the buffer 6647 /* Don't bother with a message in the buffer
6643 when a process becomes runnable. */ 6648 when a process becomes runnable. */
@@ -6659,8 +6664,8 @@ status_notify (struct Lisp_Process *deleting_process)
6659 /* Insert new output into buffer 6664 /* Insert new output into buffer
6660 at the current end-of-output marker, 6665 at the current end-of-output marker,
6661 thus preserving logical ordering of input and output. */ 6666 thus preserving logical ordering of input and output. */
6662 if (XMARKER (p->mark)->buffer) 6667 if (XMARKER (PVAR (p, mark))->buffer)
6663 Fgoto_char (p->mark); 6668 Fgoto_char (PVAR (p, mark));
6664 else 6669 else
6665 SET_PT_BOTH (ZV, ZV_BYTE); 6670 SET_PT_BOTH (ZV, ZV_BYTE);
6666 6671
@@ -6670,11 +6675,11 @@ status_notify (struct Lisp_Process *deleting_process)
6670 tem = BVAR (current_buffer, read_only); 6675 tem = BVAR (current_buffer, read_only);
6671 BVAR (current_buffer, read_only) = Qnil; 6676 BVAR (current_buffer, read_only) = Qnil;
6672 insert_string ("\nProcess "); 6677 insert_string ("\nProcess ");
6673 Finsert (1, &p->name); 6678 Finsert (1, &PVAR (p, name));
6674 insert_string (" "); 6679 insert_string (" ");
6675 Finsert (1, &msg); 6680 Finsert (1, &msg);
6676 BVAR (current_buffer, read_only) = tem; 6681 BVAR (current_buffer, read_only) = tem;
6677 set_marker_both (p->mark, p->buffer, PT, PT_BYTE); 6682 set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE);
6678 6683
6679 if (opoint >= before) 6684 if (opoint >= before)
6680 SET_PT_BOTH (opoint + (PT - before), 6685 SET_PT_BOTH (opoint + (PT - before),
@@ -6704,14 +6709,14 @@ encode subprocess input. */)
6704 CHECK_PROCESS (process); 6709 CHECK_PROCESS (process);
6705 p = XPROCESS (process); 6710 p = XPROCESS (process);
6706 if (p->infd < 0) 6711 if (p->infd < 0)
6707 error ("Input file descriptor of %s closed", SDATA (p->name)); 6712 error ("Input file descriptor of %s closed", SDATA (PVAR (p, name)));
6708 if (p->outfd < 0) 6713 if (p->outfd < 0)
6709 error ("Output file descriptor of %s closed", SDATA (p->name)); 6714 error ("Output file descriptor of %s closed", SDATA (PVAR (p, name)));
6710 Fcheck_coding_system (decoding); 6715 Fcheck_coding_system (decoding);
6711 Fcheck_coding_system (encoding); 6716 Fcheck_coding_system (encoding);
6712 encoding = coding_inherit_eol_type (encoding, Qnil); 6717 encoding = coding_inherit_eol_type (encoding, Qnil);
6713 p->decode_coding_system = decoding; 6718 PVAR (p, decode_coding_system) = decoding;
6714 p->encode_coding_system = encoding; 6719 PVAR (p, encode_coding_system) = encoding;
6715 setup_process_coding_systems (process); 6720 setup_process_coding_systems (process);
6716 6721
6717 return Qnil; 6722 return Qnil;
@@ -6723,8 +6728,8 @@ DEFUN ("process-coding-system",
6723 (register Lisp_Object process) 6728 (register Lisp_Object process)
6724{ 6729{
6725 CHECK_PROCESS (process); 6730 CHECK_PROCESS (process);
6726 return Fcons (XPROCESS (process)->decode_coding_system, 6731 return Fcons (PVAR (XPROCESS (process), decode_coding_system),
6727 XPROCESS (process)->encode_coding_system); 6732 PVAR (XPROCESS (process), encode_coding_system));
6728} 6733}
6729 6734
6730DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, 6735DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte,
@@ -6741,7 +6746,8 @@ suppressed. */)
6741 CHECK_PROCESS (process); 6746 CHECK_PROCESS (process);
6742 p = XPROCESS (process); 6747 p = XPROCESS (process);
6743 if (NILP (flag)) 6748 if (NILP (flag))
6744 p->decode_coding_system = raw_text_coding_system (p->decode_coding_system); 6749 PVAR (p, decode_coding_system)
6750 = raw_text_coding_system (PVAR (p, decode_coding_system));
6745 setup_process_coding_systems (process); 6751 setup_process_coding_systems (process);
6746 6752
6747 return Qnil; 6753 return Qnil;
@@ -7079,19 +7085,19 @@ setup_process_coding_systems (Lisp_Object process)
7079 7085
7080 if (!proc_decode_coding_system[inch]) 7086 if (!proc_decode_coding_system[inch])
7081 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); 7087 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
7082 coding_system = p->decode_coding_system; 7088 coding_system = PVAR (p, decode_coding_system);
7083 if (! NILP (p->filter)) 7089 if (! NILP (PVAR (p, filter)))
7084 ; 7090 ;
7085 else if (BUFFERP (p->buffer)) 7091 else if (BUFFERP (PVAR (p, buffer)))
7086 { 7092 {
7087 if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))) 7093 if (NILP (BVAR (XBUFFER (PVAR (p, buffer)), enable_multibyte_characters)))
7088 coding_system = raw_text_coding_system (coding_system); 7094 coding_system = raw_text_coding_system (coding_system);
7089 } 7095 }
7090 setup_coding_system (coding_system, proc_decode_coding_system[inch]); 7096 setup_coding_system (coding_system, proc_decode_coding_system[inch]);
7091 7097
7092 if (!proc_encode_coding_system[outch]) 7098 if (!proc_encode_coding_system[outch])
7093 proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system)); 7099 proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system));
7094 setup_coding_system (p->encode_coding_system, 7100 setup_coding_system (PVAR (p, encode_coding_system),
7095 proc_encode_coding_system[outch]); 7101 proc_encode_coding_system[outch]);
7096#endif 7102#endif
7097} 7103}
@@ -7137,7 +7143,7 @@ BUFFER may be a buffer or the name of one. */)
7137 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) 7143 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
7138 { 7144 {
7139 proc = Fcdr (XCAR (tail)); 7145 proc = Fcdr (XCAR (tail));
7140 if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) 7146 if (PROCESSP (proc) && EQ (PVAR (XPROCESS (proc), buffer), buf))
7141 return proc; 7147 return proc;
7142 } 7148 }
7143#endif /* subprocesses */ 7149#endif /* subprocesses */
@@ -7176,7 +7182,7 @@ kill_buffer_processes (Lisp_Object buffer)
7176 { 7182 {
7177 proc = XCDR (XCAR (tail)); 7183 proc = XCDR (XCAR (tail));
7178 if (PROCESSP (proc) 7184 if (PROCESSP (proc)
7179 && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) 7185 && (NILP (buffer) || EQ (PVAR (XPROCESS (proc), buffer), buffer)))
7180 { 7186 {
7181 if (NETCONN_P (proc) || SERIALCONN_P (proc)) 7187 if (NETCONN_P (proc) || SERIALCONN_P (proc))
7182 Fdelete_process (proc); 7188 Fdelete_process (proc);
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
35struct Lisp_Process 37struct 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;
diff --git a/src/sysdep.c b/src/sysdep.c
index 6ce583b3d53..2bfdb35fdfb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2156,7 +2156,7 @@ serial_configure (struct Lisp_Process *p,
2156 int err = -1; 2156 int err = -1;
2157 char summary[4] = "???"; /* This usually becomes "8N1". */ 2157 char summary[4] = "???"; /* This usually becomes "8N1". */
2158 2158
2159 childp2 = Fcopy_sequence (p->childp); 2159 childp2 = Fcopy_sequence (PVAR (p, childp));
2160 2160
2161 /* Read port attributes and prepare default configuration. */ 2161 /* Read port attributes and prepare default configuration. */
2162 err = tcgetattr (p->outfd, &attr); 2162 err = tcgetattr (p->outfd, &attr);
@@ -2174,7 +2174,7 @@ serial_configure (struct Lisp_Process *p,
2174 if (!NILP (Fplist_member (contact, QCspeed))) 2174 if (!NILP (Fplist_member (contact, QCspeed)))
2175 tem = Fplist_get (contact, QCspeed); 2175 tem = Fplist_get (contact, QCspeed);
2176 else 2176 else
2177 tem = Fplist_get (p->childp, QCspeed); 2177 tem = Fplist_get (PVAR (p, childp), QCspeed);
2178 CHECK_NUMBER (tem); 2178 CHECK_NUMBER (tem);
2179 err = cfsetspeed (&attr, XINT (tem)); 2179 err = cfsetspeed (&attr, XINT (tem));
2180 if (err != 0) 2180 if (err != 0)
@@ -2186,7 +2186,7 @@ serial_configure (struct Lisp_Process *p,
2186 if (!NILP (Fplist_member (contact, QCbytesize))) 2186 if (!NILP (Fplist_member (contact, QCbytesize)))
2187 tem = Fplist_get (contact, QCbytesize); 2187 tem = Fplist_get (contact, QCbytesize);
2188 else 2188 else
2189 tem = Fplist_get (p->childp, QCbytesize); 2189 tem = Fplist_get (PVAR (p, childp), QCbytesize);
2190 if (NILP (tem)) 2190 if (NILP (tem))
2191 tem = make_number (8); 2191 tem = make_number (8);
2192 CHECK_NUMBER (tem); 2192 CHECK_NUMBER (tem);
@@ -2207,7 +2207,7 @@ serial_configure (struct Lisp_Process *p,
2207 if (!NILP (Fplist_member (contact, QCparity))) 2207 if (!NILP (Fplist_member (contact, QCparity)))
2208 tem = Fplist_get (contact, QCparity); 2208 tem = Fplist_get (contact, QCparity);
2209 else 2209 else
2210 tem = Fplist_get (p->childp, QCparity); 2210 tem = Fplist_get (PVAR (p, childp), QCparity);
2211 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) 2211 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
2212 error (":parity must be nil (no parity), `even', or `odd'"); 2212 error (":parity must be nil (no parity), `even', or `odd'");
2213#if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK) 2213#if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK)
@@ -2240,7 +2240,7 @@ serial_configure (struct Lisp_Process *p,
2240 if (!NILP (Fplist_member (contact, QCstopbits))) 2240 if (!NILP (Fplist_member (contact, QCstopbits)))
2241 tem = Fplist_get (contact, QCstopbits); 2241 tem = Fplist_get (contact, QCstopbits);
2242 else 2242 else
2243 tem = Fplist_get (p->childp, QCstopbits); 2243 tem = Fplist_get (PVAR (p, childp), QCstopbits);
2244 if (NILP (tem)) 2244 if (NILP (tem))
2245 tem = make_number (1); 2245 tem = make_number (1);
2246 CHECK_NUMBER (tem); 2246 CHECK_NUMBER (tem);
@@ -2262,7 +2262,7 @@ serial_configure (struct Lisp_Process *p,
2262 if (!NILP (Fplist_member (contact, QCflowcontrol))) 2262 if (!NILP (Fplist_member (contact, QCflowcontrol)))
2263 tem = Fplist_get (contact, QCflowcontrol); 2263 tem = Fplist_get (contact, QCflowcontrol);
2264 else 2264 else
2265 tem = Fplist_get (p->childp, QCflowcontrol); 2265 tem = Fplist_get (PVAR (p, childp), QCflowcontrol);
2266 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) 2266 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
2267 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); 2267 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
2268#if defined (CRTSCTS) 2268#if defined (CRTSCTS)
@@ -2304,7 +2304,7 @@ serial_configure (struct Lisp_Process *p,
2304 error ("tcsetattr() failed: %s", emacs_strerror (errno)); 2304 error ("tcsetattr() failed: %s", emacs_strerror (errno));
2305 2305
2306 childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); 2306 childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
2307 p->childp = childp2; 2307 PVAR (p, childp) = childp2;
2308 2308
2309} 2309}
2310#endif /* not DOS_NT */ 2310#endif /* not DOS_NT */
diff --git a/src/w32.c b/src/w32.c
index a9f4f6fb50e..5d2c8a34495 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6144,7 +6144,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6144 error ("Not a serial process"); 6144 error ("Not a serial process");
6145 hnd = fd_info[ p->outfd ].hnd; 6145 hnd = fd_info[ p->outfd ].hnd;
6146 6146
6147 childp2 = Fcopy_sequence (p->childp); 6147 childp2 = Fcopy_sequence (PVAR (p, childp));
6148 6148
6149 /* Initialize timeouts for blocking read and blocking write. */ 6149 /* Initialize timeouts for blocking read and blocking write. */
6150 if (!GetCommTimeouts (hnd, &ct)) 6150 if (!GetCommTimeouts (hnd, &ct))
@@ -6173,7 +6173,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6173 if (!NILP (Fplist_member (contact, QCspeed))) 6173 if (!NILP (Fplist_member (contact, QCspeed)))
6174 tem = Fplist_get (contact, QCspeed); 6174 tem = Fplist_get (contact, QCspeed);
6175 else 6175 else
6176 tem = Fplist_get (p->childp, QCspeed); 6176 tem = Fplist_get (PVAR (p, childp), QCspeed);
6177 CHECK_NUMBER (tem); 6177 CHECK_NUMBER (tem);
6178 dcb.BaudRate = XINT (tem); 6178 dcb.BaudRate = XINT (tem);
6179 childp2 = Fplist_put (childp2, QCspeed, tem); 6179 childp2 = Fplist_put (childp2, QCspeed, tem);
@@ -6182,7 +6182,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6182 if (!NILP (Fplist_member (contact, QCbytesize))) 6182 if (!NILP (Fplist_member (contact, QCbytesize)))
6183 tem = Fplist_get (contact, QCbytesize); 6183 tem = Fplist_get (contact, QCbytesize);
6184 else 6184 else
6185 tem = Fplist_get (p->childp, QCbytesize); 6185 tem = Fplist_get (PVAR (p, childp), QCbytesize);
6186 if (NILP (tem)) 6186 if (NILP (tem))
6187 tem = make_number (8); 6187 tem = make_number (8);
6188 CHECK_NUMBER (tem); 6188 CHECK_NUMBER (tem);
@@ -6196,7 +6196,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6196 if (!NILP (Fplist_member (contact, QCparity))) 6196 if (!NILP (Fplist_member (contact, QCparity)))
6197 tem = Fplist_get (contact, QCparity); 6197 tem = Fplist_get (contact, QCparity);
6198 else 6198 else
6199 tem = Fplist_get (p->childp, QCparity); 6199 tem = Fplist_get (PVAR (p, childp), QCparity);
6200 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) 6200 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
6201 error (":parity must be nil (no parity), `even', or `odd'"); 6201 error (":parity must be nil (no parity), `even', or `odd'");
6202 dcb.fParity = FALSE; 6202 dcb.fParity = FALSE;
@@ -6226,7 +6226,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6226 if (!NILP (Fplist_member (contact, QCstopbits))) 6226 if (!NILP (Fplist_member (contact, QCstopbits)))
6227 tem = Fplist_get (contact, QCstopbits); 6227 tem = Fplist_get (contact, QCstopbits);
6228 else 6228 else
6229 tem = Fplist_get (p->childp, QCstopbits); 6229 tem = Fplist_get (PVAR (p, childp), QCstopbits);
6230 if (NILP (tem)) 6230 if (NILP (tem))
6231 tem = make_number (1); 6231 tem = make_number (1);
6232 CHECK_NUMBER (tem); 6232 CHECK_NUMBER (tem);
@@ -6243,7 +6243,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6243 if (!NILP (Fplist_member (contact, QCflowcontrol))) 6243 if (!NILP (Fplist_member (contact, QCflowcontrol)))
6244 tem = Fplist_get (contact, QCflowcontrol); 6244 tem = Fplist_get (contact, QCflowcontrol);
6245 else 6245 else
6246 tem = Fplist_get (p->childp, QCflowcontrol); 6246 tem = Fplist_get (PVAR (p, childp), QCflowcontrol);
6247 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) 6247 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
6248 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); 6248 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
6249 dcb.fOutxCtsFlow = FALSE; 6249 dcb.fOutxCtsFlow = FALSE;
@@ -6277,7 +6277,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6277 error ("SetCommState() failed"); 6277 error ("SetCommState() failed");
6278 6278
6279 childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); 6279 childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
6280 p->childp = childp2; 6280 PVAR (p, childp) = childp2;
6281} 6281}
6282 6282
6283#ifdef HAVE_GNUTLS 6283#ifdef HAVE_GNUTLS
diff --git a/src/xdisp.c b/src/xdisp.c
index 153e139b043..7d7e2acc74d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21678,10 +21678,10 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21678 obj = Fget_buffer_process (Fcurrent_buffer ()); 21678 obj = Fget_buffer_process (Fcurrent_buffer ());
21679 if (PROCESSP (obj)) 21679 if (PROCESSP (obj))
21680 { 21680 {
21681 p = decode_mode_spec_coding (XPROCESS (obj)->decode_coding_system, 21681 p = decode_mode_spec_coding
21682 p, eol_flag); 21682 (PVAR (XPROCESS (obj), decode_coding_system), p, eol_flag);
21683 p = decode_mode_spec_coding (XPROCESS (obj)->encode_coding_system, 21683 p = decode_mode_spec_coding
21684 p, eol_flag); 21684 (PVAR (XPROCESS (obj), encode_coding_system), p, eol_flag);
21685 } 21685 }
21686#endif /* subprocesses */ 21686#endif /* subprocesses */
21687#endif /* 0 */ 21687#endif /* 0 */