aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-06 15:16:07 +0400
committerDmitry Antipov2012-08-06 15:16:07 +0400
commit21238f117336d2a3f1e7970832ba05da14d44a03 (patch)
tree4510c0e3375f14f1e92960896fe24b5fcfe39baf /src
parent077288cf3f654776ee44bc9b56954c4e26b10d96 (diff)
downloademacs-21238f117336d2a3f1e7970832ba05da14d44a03.tar.gz
emacs-21238f117336d2a3f1e7970832ba05da14d44a03.zip
Separate read and write access to Lisp_Object slots of Lisp_Process.
* process.h (PGET, PSET): New macros similar to AREF and ASET. * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/gnutls.c2
-rw-r--r--src/print.c4
-rw-r--r--src/process.c456
-rw-r--r--src/process.h13
-rw-r--r--src/sysdep.c14
-rw-r--r--src/w32.c14
-rw-r--r--src/xdisp.c4
8 files changed, 262 insertions, 251 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f443a948331..caee8513e3e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12012-08-06 Dmitry Antipov <dmantipov@yandex.ru> 12012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Separate read and write access to Lisp_Object slots of Lisp_Process.
4 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6
72012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8
3 Separate read and write access to Lisp_Object slots of struct window. 9 Separate read and write access to Lisp_Object slots of struct window.
4 * window.h (WGET, WSET): New macros similar to AREF and ASET. 10 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: 11 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
diff --git a/src/gnutls.c b/src/gnutls.c
index 9895936c246..5189f2098cf 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -830,7 +830,7 @@ one trustfile (usually a CA bundle). */)
830 XPROCESS (proc)->gnutls_state = NULL; 830 XPROCESS (proc)->gnutls_state = NULL;
831 XPROCESS (proc)->gnutls_x509_cred = NULL; 831 XPROCESS (proc)->gnutls_x509_cred = NULL;
832 XPROCESS (proc)->gnutls_anon_cred = NULL; 832 XPROCESS (proc)->gnutls_anon_cred = NULL;
833 XPROCESS (proc)->gnutls_cred_type = type; 833 PSET (XPROCESS (proc), gnutls_cred_type, type);
834 GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY; 834 GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY;
835 835
836 GNUTLS_LOG (1, max_log_level, "allocating credentials"); 836 GNUTLS_LOG (1, max_log_level, "allocating credentials");
diff --git a/src/print.c b/src/print.c
index d45d3194c55..8e98fe4b233 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1697,11 +1697,11 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1697 if (escapeflag) 1697 if (escapeflag)
1698 { 1698 {
1699 strout ("#<process ", -1, -1, printcharfun); 1699 strout ("#<process ", -1, -1, printcharfun);
1700 print_string (PVAR (XPROCESS (obj), name), printcharfun); 1700 print_string (PGET (XPROCESS (obj), name), printcharfun);
1701 PRINTCHAR ('>'); 1701 PRINTCHAR ('>');
1702 } 1702 }
1703 else 1703 else
1704 print_string (PVAR (XPROCESS (obj), name), printcharfun); 1704 print_string (PGET (XPROCESS (obj), name), printcharfun);
1705 } 1705 }
1706 else if (BOOL_VECTOR_P (obj)) 1706 else if (BOOL_VECTOR_P (obj))
1707 { 1707 {
diff --git a/src/process.c b/src/process.c
index 2d2a1b5ac0e..fbc03493f80 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 (PVAR (XPROCESS (p), type), Qnetwork)) 175#define NETCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qnetwork))
176#define NETCONN1_P(p) (EQ (PVAR (p, type), Qnetwork)) 176#define NETCONN1_P(p) (EQ (PGET (p, type), Qnetwork))
177#define SERIALCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qserial)) 177#define SERIALCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qserial))
178#define SERIALCONN1_P(p) (EQ (PVAR (p, type), Qserial)) 178#define SERIALCONN1_P(p) (EQ (PGET (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 PVAR (p, status) = status_convert (p->raw_status); 431 PSET (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 = PVAR (p, status); 482 Lisp_Object status = PGET (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 PVAR (p, status) = Qrun; 629 PSET (p, status, Qrun);
630 PVAR (p, mark) = Fmake_marker (); 630 PSET (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 PVAR (p, name) = name; 651 PSET (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 PVAR (p, status) = Fcons (Qexit, Fcons (make_number (0), Qnil)); 748 PSET (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 = PVAR (p, status); 766 symbol = PGET (p, status);
767 if (CONSP (PVAR (p, status))) 767 if (CONSP (PGET (p, status)))
768 symbol = XCAR (PVAR (p, status)); 768 symbol = XCAR (PGET (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,8 +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 PVAR (p, status) 777 PSET (p, status, Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)));
778 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
779 p->tick = ++process_tick; 778 p->tick = ++process_tick;
780 status_notify (p); 779 status_notify (p);
781 redisplay_preserve_echo_area (13); 780 redisplay_preserve_echo_area (13);
@@ -816,14 +815,14 @@ nil, indicating the current buffer's process. */)
816 p = XPROCESS (process); 815 p = XPROCESS (process);
817 if (p->raw_status_new) 816 if (p->raw_status_new)
818 update_status (p); 817 update_status (p);
819 status = PVAR (p, status); 818 status = PGET (p, status);
820 if (CONSP (status)) 819 if (CONSP (status))
821 status = XCAR (status); 820 status = XCAR (status);
822 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 821 if (NETCONN1_P (p) || SERIALCONN1_P (p))
823 { 822 {
824 if (EQ (status, Qexit)) 823 if (EQ (status, Qexit))
825 status = Qclosed; 824 status = Qclosed;
826 else if (EQ (PVAR (p, command), Qt)) 825 else if (EQ (PGET (p, command), Qt))
827 status = Qstop; 826 status = Qstop;
828 else if (EQ (status, Qrun)) 827 else if (EQ (status, Qrun))
829 status = Qopen; 828 status = Qopen;
@@ -840,8 +839,8 @@ If PROCESS has not yet exited or died, return 0. */)
840 CHECK_PROCESS (process); 839 CHECK_PROCESS (process);
841 if (XPROCESS (process)->raw_status_new) 840 if (XPROCESS (process)->raw_status_new)
842 update_status (XPROCESS (process)); 841 update_status (XPROCESS (process));
843 if (CONSP (PVAR (XPROCESS (process), status))) 842 if (CONSP (PGET (XPROCESS (process), status)))
844 return XCAR (XCDR (PVAR (XPROCESS (process), status))); 843 return XCAR (XCDR (PGET (XPROCESS (process), status)));
845 return make_number (0); 844 return make_number (0);
846} 845}
847 846
@@ -865,7 +864,7 @@ possibly modified to make it unique among process names. */)
865 (register Lisp_Object process) 864 (register Lisp_Object process)
866{ 865{
867 CHECK_PROCESS (process); 866 CHECK_PROCESS (process);
868 return PVAR (XPROCESS (process), name); 867 return PGET (XPROCESS (process), name);
869} 868}
870 869
871DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, 870DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0,
@@ -877,7 +876,7 @@ For a network or serial process, this is nil (process is running) or t
877 (register Lisp_Object process) 876 (register Lisp_Object process)
878{ 877{
879 CHECK_PROCESS (process); 878 CHECK_PROCESS (process);
880 return PVAR (XPROCESS (process), command); 879 return PGET (XPROCESS (process), command);
881} 880}
882 881
883DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, 882DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0,
@@ -887,7 +886,7 @@ not the name of the pty that Emacs uses to talk with that terminal. */)
887 (register Lisp_Object process) 886 (register Lisp_Object process)
888{ 887{
889 CHECK_PROCESS (process); 888 CHECK_PROCESS (process);
890 return PVAR (XPROCESS (process), tty_name); 889 return PGET (XPROCESS (process), tty_name);
891} 890}
892 891
893DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, 892DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer,
@@ -902,9 +901,9 @@ Return BUFFER. */)
902 if (!NILP (buffer)) 901 if (!NILP (buffer))
903 CHECK_BUFFER (buffer); 902 CHECK_BUFFER (buffer);
904 p = XPROCESS (process); 903 p = XPROCESS (process);
905 PVAR (p, buffer) = buffer; 904 PSET (p, buffer, buffer);
906 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 905 if (NETCONN1_P (p) || SERIALCONN1_P (p))
907 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCbuffer, buffer); 906 PSET (p, childp, Fplist_put (PGET (p, childp), QCbuffer, buffer));
908 setup_process_coding_systems (process); 907 setup_process_coding_systems (process);
909 return buffer; 908 return buffer;
910} 909}
@@ -916,7 +915,7 @@ Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */)
916 (register Lisp_Object process) 915 (register Lisp_Object process)
917{ 916{
918 CHECK_PROCESS (process); 917 CHECK_PROCESS (process);
919 return PVAR (XPROCESS (process), buffer); 918 return PGET (XPROCESS (process), buffer);
920} 919}
921 920
922DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, 921DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
@@ -925,7 +924,7 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
925 (register Lisp_Object process) 924 (register Lisp_Object process)
926{ 925{
927 CHECK_PROCESS (process); 926 CHECK_PROCESS (process);
928 return PVAR (XPROCESS (process), mark); 927 return PGET (XPROCESS (process), mark);
929} 928}
930 929
931DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, 930DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter,
@@ -961,23 +960,23 @@ The string argument is normally a multibyte string, except:
961 960
962 if (p->infd >= 0) 961 if (p->infd >= 0)
963 { 962 {
964 if (EQ (filter, Qt) && !EQ (PVAR (p, status), Qlisten)) 963 if (EQ (filter, Qt) && !EQ (PGET (p, status), Qlisten))
965 { 964 {
966 FD_CLR (p->infd, &input_wait_mask); 965 FD_CLR (p->infd, &input_wait_mask);
967 FD_CLR (p->infd, &non_keyboard_wait_mask); 966 FD_CLR (p->infd, &non_keyboard_wait_mask);
968 } 967 }
969 else if (EQ (PVAR (p, filter), Qt) 968 else if (EQ (PGET (p, filter), Qt)
970 /* Network or serial process not stopped: */ 969 /* Network or serial process not stopped: */
971 && !EQ (PVAR (p, command), Qt)) 970 && !EQ (PGET (p, command), Qt))
972 { 971 {
973 FD_SET (p->infd, &input_wait_mask); 972 FD_SET (p->infd, &input_wait_mask);
974 FD_SET (p->infd, &non_keyboard_wait_mask); 973 FD_SET (p->infd, &non_keyboard_wait_mask);
975 } 974 }
976 } 975 }
977 976
978 PVAR (p, filter) = filter; 977 PSET (p, filter, filter);
979 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 978 if (NETCONN1_P (p) || SERIALCONN1_P (p))
980 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCfilter, filter); 979 PSET (p, childp, Fplist_put (PGET (p, childp), QCfilter, filter));
981 setup_process_coding_systems (process); 980 setup_process_coding_systems (process);
982 return filter; 981 return filter;
983} 982}
@@ -989,7 +988,7 @@ See `set-process-filter' for more info on filter functions. */)
989 (register Lisp_Object process) 988 (register Lisp_Object process)
990{ 989{
991 CHECK_PROCESS (process); 990 CHECK_PROCESS (process);
992 return PVAR (XPROCESS (process), filter); 991 return PGET (XPROCESS (process), filter);
993} 992}
994 993
995DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, 994DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel,
@@ -1004,9 +1003,9 @@ It gets two arguments: the process, and a string describing the change. */)
1004 CHECK_PROCESS (process); 1003 CHECK_PROCESS (process);
1005 p = XPROCESS (process); 1004 p = XPROCESS (process);
1006 1005
1007 PVAR (p, sentinel) = sentinel; 1006 PSET (p, sentinel, sentinel);
1008 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 1007 if (NETCONN1_P (p) || SERIALCONN1_P (p))
1009 PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCsentinel, sentinel); 1008 PSET (p, childp, Fplist_put (PGET (p, childp), QCsentinel, sentinel));
1010 return sentinel; 1009 return sentinel;
1011} 1010}
1012 1011
@@ -1017,7 +1016,7 @@ See `set-process-sentinel' for more info on sentinels. */)
1017 (register Lisp_Object process) 1016 (register Lisp_Object process)
1018{ 1017{
1019 CHECK_PROCESS (process); 1018 CHECK_PROCESS (process);
1020 return PVAR (XPROCESS (process), sentinel); 1019 return PGET (XPROCESS (process), sentinel);
1021} 1020}
1022 1021
1023DEFUN ("set-process-window-size", Fset_process_window_size, 1022DEFUN ("set-process-window-size", Fset_process_window_size,
@@ -1102,7 +1101,7 @@ list of keywords. */)
1102 Lisp_Object contact; 1101 Lisp_Object contact;
1103 1102
1104 CHECK_PROCESS (process); 1103 CHECK_PROCESS (process);
1105 contact = PVAR (XPROCESS (process), childp); 1104 contact = PGET (XPROCESS (process), childp);
1106 1105
1107#ifdef DATAGRAM_SOCKETS 1106#ifdef DATAGRAM_SOCKETS
1108 if (DATAGRAM_CONN_P (process) 1107 if (DATAGRAM_CONN_P (process)
@@ -1128,7 +1127,7 @@ DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
1128 (register Lisp_Object process) 1127 (register Lisp_Object process)
1129{ 1128{
1130 CHECK_PROCESS (process); 1129 CHECK_PROCESS (process);
1131 return PVAR (XPROCESS (process), plist); 1130 return PGET (XPROCESS (process), plist);
1132} 1131}
1133 1132
1134DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, 1133DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
@@ -1139,7 +1138,7 @@ DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
1139 CHECK_PROCESS (process); 1138 CHECK_PROCESS (process);
1140 CHECK_LIST (plist); 1139 CHECK_LIST (plist);
1141 1140
1142 PVAR (XPROCESS (process), plist) = plist; 1141 PSET (XPROCESS (process), plist, plist);
1143 return plist; 1142 return plist;
1144} 1143}
1145 1144
@@ -1151,7 +1150,7 @@ The value is nil for a pipe, t or `pty' for a pty, or `stream' for
1151a socket connection. */) 1150a socket connection. */)
1152 (Lisp_Object process) 1151 (Lisp_Object process)
1153{ 1152{
1154 return PVAR (XPROCESS (process), type); 1153 return PGET (XPROCESS (process), type);
1155} 1154}
1156#endif 1155#endif
1157 1156
@@ -1164,7 +1163,7 @@ nil, indicating the current buffer's process. */)
1164{ 1163{
1165 Lisp_Object proc; 1164 Lisp_Object proc;
1166 proc = get_process (process); 1165 proc = get_process (process);
1167 return PVAR (XPROCESS (proc), type); 1166 return PGET (XPROCESS (proc), type);
1168} 1167}
1169 1168
1170DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, 1169DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address,
@@ -1325,18 +1324,18 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1325 itself; it's all taken care of here. */ 1324 itself; it's all taken care of here. */
1326 record_unwind_protect (start_process_unwind, proc); 1325 record_unwind_protect (start_process_unwind, proc);
1327 1326
1328 PVAR (XPROCESS (proc), childp) = Qt; 1327 PSET (XPROCESS (proc), childp, Qt);
1329 PVAR (XPROCESS (proc), plist) = Qnil; 1328 PSET (XPROCESS (proc), plist, Qnil);
1330 PVAR (XPROCESS (proc), type) = Qreal; 1329 PSET (XPROCESS (proc), type, Qreal);
1331 PVAR (XPROCESS (proc), buffer) = buffer; 1330 PSET (XPROCESS (proc), buffer, buffer);
1332 PVAR (XPROCESS (proc), sentinel) = Qnil; 1331 PSET (XPROCESS (proc), sentinel, Qnil);
1333 PVAR (XPROCESS (proc), filter) = Qnil; 1332 PSET (XPROCESS (proc), filter, Qnil);
1334 PVAR (XPROCESS (proc), command) = Flist (nargs - 2, args + 2); 1333 PSET (XPROCESS (proc), command, Flist (nargs - 2, args + 2));
1335 1334
1336#ifdef HAVE_GNUTLS 1335#ifdef HAVE_GNUTLS
1337 /* AKA GNUTLS_INITSTAGE(proc). */ 1336 /* AKA GNUTLS_INITSTAGE(proc). */
1338 XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY; 1337 XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY;
1339 XPROCESS (proc)->gnutls_cred_type = Qnil; 1338 PSET (XPROCESS (proc), gnutls_cred_type, Qnil);
1340#endif 1339#endif
1341 1340
1342#ifdef ADAPTIVE_READ_BUFFERING 1341#ifdef ADAPTIVE_READ_BUFFERING
@@ -1347,7 +1346,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1347 1346
1348 /* Make the process marker point into the process buffer (if any). */ 1347 /* Make the process marker point into the process buffer (if any). */
1349 if (BUFFERP (buffer)) 1348 if (BUFFERP (buffer))
1350 set_marker_both (PVAR (XPROCESS (proc), mark), buffer, 1349 set_marker_both (PGET (XPROCESS (proc), mark), buffer,
1351 BUF_ZV (XBUFFER (buffer)), 1350 BUF_ZV (XBUFFER (buffer)),
1352 BUF_ZV_BYTE (XBUFFER (buffer))); 1351 BUF_ZV_BYTE (XBUFFER (buffer)));
1353 1352
@@ -1376,7 +1375,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1376 else if (CONSP (Vdefault_process_coding_system)) 1375 else if (CONSP (Vdefault_process_coding_system))
1377 val = XCAR (Vdefault_process_coding_system); 1376 val = XCAR (Vdefault_process_coding_system);
1378 } 1377 }
1379 PVAR (XPROCESS (proc), decode_coding_system) = val; 1378 PSET (XPROCESS (proc), decode_coding_system, val);
1380 1379
1381 val = Vcoding_system_for_write; 1380 val = Vcoding_system_for_write;
1382 if (NILP (val)) 1381 if (NILP (val))
@@ -1396,7 +1395,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1396 else if (CONSP (Vdefault_process_coding_system)) 1395 else if (CONSP (Vdefault_process_coding_system))
1397 val = XCDR (Vdefault_process_coding_system); 1396 val = XCDR (Vdefault_process_coding_system);
1398 } 1397 }
1399 PVAR (XPROCESS (proc), encode_coding_system) = val; 1398 PSET (XPROCESS (proc), encode_coding_system, val);
1400 /* Note: At this moment, the above coding system may leave 1399 /* Note: At this moment, the above coding system may leave
1401 text-conversion or eol-conversion unspecified. They will be 1400 text-conversion or eol-conversion unspecified. They will be
1402 decided after we read output from the process and decode it by 1401 decided after we read output from the process and decode it by
@@ -1405,9 +1404,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1405 } 1404 }
1406 1405
1407 1406
1408 PVAR (XPROCESS (proc), decoding_buf) = empty_unibyte_string; 1407 PSET (XPROCESS (proc), decoding_buf, empty_unibyte_string);
1409 XPROCESS (proc)->decoding_carryover = 0; 1408 XPROCESS (proc)->decoding_carryover = 0;
1410 PVAR (XPROCESS (proc), encoding_buf) = empty_unibyte_string; 1409 PSET (XPROCESS (proc), encoding_buf, empty_unibyte_string);
1411 1410
1412 XPROCESS (proc)->inherit_coding_system_flag 1411 XPROCESS (proc)->inherit_coding_system_flag
1413 = !(NILP (buffer) || !inherit_process_coding_system); 1412 = !(NILP (buffer) || !inherit_process_coding_system);
@@ -1465,7 +1464,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1465 { 1464 {
1466 if (NILP (arg_encoding)) 1465 if (NILP (arg_encoding))
1467 arg_encoding = (complement_process_encoding_system 1466 arg_encoding = (complement_process_encoding_system
1468 (PVAR (XPROCESS (proc), encode_coding_system))); 1467 (PGET (XPROCESS (proc), encode_coding_system)));
1469 XSETCAR (tem, 1468 XSETCAR (tem,
1470 code_convert_string_norecord 1469 code_convert_string_norecord
1471 (XCAR (tem), arg_encoding, 1)); 1470 (XCAR (tem), arg_encoding, 1));
@@ -1629,7 +1628,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1629 more portable (see USG_SUBTTY_WORKS above). */ 1628 more portable (see USG_SUBTTY_WORKS above). */
1630 1629
1631 XPROCESS (process)->pty_flag = pty_flag; 1630 XPROCESS (process)->pty_flag = pty_flag;
1632 PVAR (XPROCESS (process), status) = Qrun; 1631 PSET (XPROCESS (process), status, Qrun);
1633 1632
1634 /* Delay interrupts until we have a chance to store 1633 /* Delay interrupts until we have a chance to store
1635 the new fork's pid in its process structure */ 1634 the new fork's pid in its process structure */
@@ -1868,10 +1867,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1868 1867
1869#ifdef HAVE_PTYS 1868#ifdef HAVE_PTYS
1870 if (pty_flag) 1869 if (pty_flag)
1871 PVAR (XPROCESS (process), tty_name) = build_string (pty_name); 1870 PSET (XPROCESS (process), tty_name, build_string (pty_name));
1872 else 1871 else
1873#endif 1872#endif
1874 PVAR (XPROCESS (process), tty_name) = Qnil; 1873 PSET (XPROCESS (process), tty_name, Qnil);
1875 1874
1876#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) 1875#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
1877 /* Wait for child_setup to complete in case that vfork is 1876 /* Wait for child_setup to complete in case that vfork is
@@ -1966,7 +1965,7 @@ create_pty (Lisp_Object process)
1966 more portable (see USG_SUBTTY_WORKS above). */ 1965 more portable (see USG_SUBTTY_WORKS above). */
1967 1966
1968 XPROCESS (process)->pty_flag = pty_flag; 1967 XPROCESS (process)->pty_flag = pty_flag;
1969 PVAR (XPROCESS (process), status) = Qrun; 1968 PSET (XPROCESS (process), status, Qrun);
1970 setup_process_coding_systems (process); 1969 setup_process_coding_systems (process);
1971 1970
1972 FD_SET (inchannel, &input_wait_mask); 1971 FD_SET (inchannel, &input_wait_mask);
@@ -1977,10 +1976,10 @@ create_pty (Lisp_Object process)
1977 XPROCESS (process)->pid = -2; 1976 XPROCESS (process)->pid = -2;
1978#ifdef HAVE_PTYS 1977#ifdef HAVE_PTYS
1979 if (pty_flag) 1978 if (pty_flag)
1980 PVAR (XPROCESS (process), tty_name) = build_string (pty_name); 1979 PSET (XPROCESS (process), tty_name, build_string (pty_name));
1981 else 1980 else
1982#endif 1981#endif
1983 PVAR (XPROCESS (process), tty_name) = Qnil; 1982 PSET (XPROCESS (process), tty_name, Qnil);
1984} 1983}
1985 1984
1986 1985
@@ -2369,7 +2368,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
2369 2368
2370 if (set_socket_option (s, option, value)) 2369 if (set_socket_option (s, option, value))
2371 { 2370 {
2372 PVAR (p, childp) = Fplist_put (PVAR (p, childp), option, value); 2371 PSET (p, childp, Fplist_put (PGET (p, childp), option, value));
2373 return Qt; 2372 return Qt;
2374 } 2373 }
2375 2374
@@ -2458,10 +2457,10 @@ usage: (serial-process-configure &rest ARGS) */)
2458 proc = Fplist_get (contact, QCport); 2457 proc = Fplist_get (contact, QCport);
2459 proc = get_process (proc); 2458 proc = get_process (proc);
2460 p = XPROCESS (proc); 2459 p = XPROCESS (proc);
2461 if (!EQ (PVAR (p, type), Qserial)) 2460 if (!EQ (PGET (p, type), Qserial))
2462 error ("Not a serial process"); 2461 error ("Not a serial process");
2463 2462
2464 if (NILP (Fplist_get (PVAR (p, childp), QCspeed))) 2463 if (NILP (Fplist_get (PGET (p, childp), QCspeed)))
2465 { 2464 {
2466 UNGCPRO; 2465 UNGCPRO;
2467 return Qnil; 2466 return Qnil;
@@ -2602,21 +2601,21 @@ usage: (make-serial-process &rest ARGS) */)
2602 if (NILP (buffer)) 2601 if (NILP (buffer))
2603 buffer = name; 2602 buffer = name;
2604 buffer = Fget_buffer_create (buffer); 2603 buffer = Fget_buffer_create (buffer);
2605 PVAR (p, buffer) = buffer; 2604 PSET (p, buffer, buffer);
2606 2605
2607 PVAR (p, childp) = contact; 2606 PSET (p, childp, contact);
2608 PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); 2607 PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
2609 PVAR (p, type) = Qserial; 2608 PSET (p, type, Qserial);
2610 PVAR (p, sentinel) = Fplist_get (contact, QCsentinel); 2609 PSET (p, sentinel, Fplist_get (contact, QCsentinel));
2611 PVAR (p, filter) = Fplist_get (contact, QCfilter); 2610 PSET (p, filter, Fplist_get (contact, QCfilter));
2612 PVAR (p, log) = Qnil; 2611 PSET (p, log, Qnil);
2613 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) 2612 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
2614 p->kill_without_query = 1; 2613 p->kill_without_query = 1;
2615 if (tem = Fplist_get (contact, QCstop), !NILP (tem)) 2614 if (tem = Fplist_get (contact, QCstop), !NILP (tem))
2616 PVAR (p, command) = Qt; 2615 PSET (p, command, Qt);
2617 p->pty_flag = 0; 2616 p->pty_flag = 0;
2618 2617
2619 if (!EQ (PVAR (p, command), Qt)) 2618 if (!EQ (PGET (p, command), Qt))
2620 { 2619 {
2621 FD_SET (fd, &input_wait_mask); 2620 FD_SET (fd, &input_wait_mask);
2622 FD_SET (fd, &non_keyboard_wait_mask); 2621 FD_SET (fd, &non_keyboard_wait_mask);
@@ -2624,7 +2623,7 @@ usage: (make-serial-process &rest ARGS) */)
2624 2623
2625 if (BUFFERP (buffer)) 2624 if (BUFFERP (buffer))
2626 { 2625 {
2627 set_marker_both (PVAR (p, mark), buffer, 2626 set_marker_both (PGET (p, mark), buffer,
2628 BUF_ZV (XBUFFER (buffer)), 2627 BUF_ZV (XBUFFER (buffer)),
2629 BUF_ZV_BYTE (XBUFFER (buffer))); 2628 BUF_ZV_BYTE (XBUFFER (buffer)));
2630 } 2629 }
@@ -2645,7 +2644,7 @@ usage: (make-serial-process &rest ARGS) */)
2645 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) 2644 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2646 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) 2645 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2647 val = Qnil; 2646 val = Qnil;
2648 PVAR (p, decode_coding_system) = val; 2647 PSET (p, decode_coding_system, val);
2649 2648
2650 val = Qnil; 2649 val = Qnil;
2651 if (!NILP (tem)) 2650 if (!NILP (tem))
@@ -2659,12 +2658,12 @@ usage: (make-serial-process &rest ARGS) */)
2659 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) 2658 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2660 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) 2659 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2661 val = Qnil; 2660 val = Qnil;
2662 PVAR (p, encode_coding_system) = val; 2661 PSET (p, encode_coding_system, val);
2663 2662
2664 setup_process_coding_systems (proc); 2663 setup_process_coding_systems (proc);
2665 PVAR (p, decoding_buf) = empty_unibyte_string; 2664 PSET (p, decoding_buf, empty_unibyte_string);
2666 p->decoding_carryover = 0; 2665 p->decoding_carryover = 0;
2667 PVAR (p, encoding_buf) = empty_unibyte_string; 2666 PSET (p, encoding_buf, empty_unibyte_string);
2668 p->inherit_coding_system_flag 2667 p->inherit_coding_system_flag
2669 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 2668 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
2670 2669
@@ -3401,27 +3400,27 @@ usage: (make-network-process &rest ARGS) */)
3401 3400
3402 p = XPROCESS (proc); 3401 p = XPROCESS (proc);
3403 3402
3404 PVAR (p, childp) = contact; 3403 PSET (p, childp, contact);
3405 PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); 3404 PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
3406 PVAR (p, type) = Qnetwork; 3405 PSET (p, type, Qnetwork);
3407 3406
3408 PVAR (p, buffer) = buffer; 3407 PSET (p, buffer, buffer);
3409 PVAR (p, sentinel) = sentinel; 3408 PSET (p, sentinel, sentinel);
3410 PVAR (p, filter) = filter; 3409 PSET (p, filter, filter);
3411 PVAR (p, log) = Fplist_get (contact, QClog); 3410 PSET (p, log, Fplist_get (contact, QClog));
3412 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) 3411 if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
3413 p->kill_without_query = 1; 3412 p->kill_without_query = 1;
3414 if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) 3413 if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
3415 PVAR (p, command) = Qt; 3414 PSET (p, command, Qt);
3416 p->pid = 0; 3415 p->pid = 0;
3417 p->infd = inch; 3416 p->infd = inch;
3418 p->outfd = outch; 3417 p->outfd = outch;
3419 if (is_server && socktype != SOCK_DGRAM) 3418 if (is_server && socktype != SOCK_DGRAM)
3420 PVAR (p, status) = Qlisten; 3419 PSET (p, status, Qlisten);
3421 3420
3422 /* Make the process marker point into the process buffer (if any). */ 3421 /* Make the process marker point into the process buffer (if any). */
3423 if (BUFFERP (buffer)) 3422 if (BUFFERP (buffer))
3424 set_marker_both (PVAR (p, mark), buffer, 3423 set_marker_both (PGET (p, mark), buffer,
3425 BUF_ZV (XBUFFER (buffer)), 3424 BUF_ZV (XBUFFER (buffer)),
3426 BUF_ZV_BYTE (XBUFFER (buffer))); 3425 BUF_ZV_BYTE (XBUFFER (buffer)));
3427 3426
@@ -3431,7 +3430,7 @@ usage: (make-network-process &rest ARGS) */)
3431 /* We may get here if connect did succeed immediately. However, 3430 /* We may get here if connect did succeed immediately. However,
3432 in that case, we still need to signal this like a non-blocking 3431 in that case, we still need to signal this like a non-blocking
3433 connection. */ 3432 connection. */
3434 PVAR (p, status) = Qconnect; 3433 PSET (p, status, Qconnect);
3435 if (!FD_ISSET (inch, &connect_wait_mask)) 3434 if (!FD_ISSET (inch, &connect_wait_mask))
3436 { 3435 {
3437 FD_SET (inch, &connect_wait_mask); 3436 FD_SET (inch, &connect_wait_mask);
@@ -3443,8 +3442,8 @@ usage: (make-network-process &rest ARGS) */)
3443#endif 3442#endif
3444 /* A server may have a client filter setting of Qt, but it must 3443 /* A server may have a client filter setting of Qt, but it must
3445 still listen for incoming connects unless it is stopped. */ 3444 still listen for incoming connects unless it is stopped. */
3446 if ((!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) 3445 if ((!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt))
3447 || (EQ (PVAR (p, status), Qlisten) && NILP (PVAR (p, command)))) 3446 || (EQ (PGET (p, status), Qlisten) && NILP (PGET (p, command))))
3448 { 3447 {
3449 FD_SET (inch, &input_wait_mask); 3448 FD_SET (inch, &input_wait_mask);
3450 FD_SET (inch, &non_keyboard_wait_mask); 3449 FD_SET (inch, &non_keyboard_wait_mask);
@@ -3498,7 +3497,7 @@ usage: (make-network-process &rest ARGS) */)
3498 else 3497 else
3499 val = Qnil; 3498 val = Qnil;
3500 } 3499 }
3501 PVAR (p, decode_coding_system) = val; 3500 PSET (p, decode_coding_system, val);
3502 3501
3503 if (!NILP (tem)) 3502 if (!NILP (tem))
3504 { 3503 {
@@ -3532,13 +3531,13 @@ usage: (make-network-process &rest ARGS) */)
3532 else 3531 else
3533 val = Qnil; 3532 val = Qnil;
3534 } 3533 }
3535 PVAR (p, encode_coding_system) = val; 3534 PSET (p, encode_coding_system, val);
3536 } 3535 }
3537 setup_process_coding_systems (proc); 3536 setup_process_coding_systems (proc);
3538 3537
3539 PVAR (p, decoding_buf) = empty_unibyte_string; 3538 PSET (p, decoding_buf, empty_unibyte_string);
3540 p->decoding_carryover = 0; 3539 p->decoding_carryover = 0;
3541 PVAR (p, encoding_buf) = empty_unibyte_string; 3540 PSET (p, encoding_buf, empty_unibyte_string);
3542 3541
3543 p->inherit_coding_system_flag 3542 p->inherit_coding_system_flag
3544 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 3543 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@@ -4031,8 +4030,8 @@ server_accept_connection (Lisp_Object server, int channel)
4031 return; 4030 return;
4032#endif 4031#endif
4033 4032
4034 if (!NILP (PVAR (ps, log))) 4033 if (!NILP (PGET (ps, log)))
4035 call3 (PVAR (ps, log), server, Qnil, 4034 call3 (PGET (ps, log), server, Qnil,
4036 concat3 (build_string ("accept failed with code"), 4035 concat3 (build_string ("accept failed with code"),
4037 Fnumber_to_string (make_number (code)), 4036 Fnumber_to_string (make_number (code)),
4038 build_string ("\n"))); 4037 build_string ("\n")));
@@ -4102,15 +4101,15 @@ server_accept_connection (Lisp_Object server, int channel)
4102 process name of the server process concatenated with the caller 4101 process name of the server process concatenated with the caller
4103 identification. */ 4102 identification. */
4104 4103
4105 if (!NILP (PVAR (ps, filter)) && !EQ (PVAR (ps, filter), Qt)) 4104 if (!NILP (PGET (ps, filter)) && !EQ (PGET (ps, filter), Qt))
4106 buffer = Qnil; 4105 buffer = Qnil;
4107 else 4106 else
4108 { 4107 {
4109 buffer = PVAR (ps, buffer); 4108 buffer = PGET (ps, buffer);
4110 if (!NILP (buffer)) 4109 if (!NILP (buffer))
4111 buffer = Fbuffer_name (buffer); 4110 buffer = Fbuffer_name (buffer);
4112 else 4111 else
4113 buffer = PVAR (ps, name); 4112 buffer = PGET (ps, name);
4114 if (!NILP (buffer)) 4113 if (!NILP (buffer))
4115 { 4114 {
4116 buffer = concat2 (buffer, caller); 4115 buffer = concat2 (buffer, caller);
@@ -4121,7 +4120,7 @@ server_accept_connection (Lisp_Object server, int channel)
4121 /* Generate a unique name for the new server process. Combine the 4120 /* Generate a unique name for the new server process. Combine the
4122 server process name with the caller identification. */ 4121 server process name with the caller identification. */
4123 4122
4124 name = concat2 (PVAR (ps, name), caller); 4123 name = concat2 (PGET (ps, name), caller);
4125 proc = make_process (name); 4124 proc = make_process (name);
4126 4125
4127 chan_process[s] = proc; 4126 chan_process[s] = proc;
@@ -4137,7 +4136,7 @@ server_accept_connection (Lisp_Object server, int channel)
4137 p = XPROCESS (proc); 4136 p = XPROCESS (proc);
4138 4137
4139 /* Build new contact information for this setup. */ 4138 /* Build new contact information for this setup. */
4140 contact = Fcopy_sequence (PVAR (ps, childp)); 4139 contact = Fcopy_sequence (PGET (ps, childp));
4141 contact = Fplist_put (contact, QCserver, Qnil); 4140 contact = Fplist_put (contact, QCserver, Qnil);
4142 contact = Fplist_put (contact, QChost, host); 4141 contact = Fplist_put (contact, QChost, host);
4143 if (!NILP (service)) 4142 if (!NILP (service))
@@ -4151,21 +4150,21 @@ server_accept_connection (Lisp_Object server, int channel)
4151 conv_sockaddr_to_lisp (&saddr.sa, len)); 4150 conv_sockaddr_to_lisp (&saddr.sa, len));
4152#endif 4151#endif
4153 4152
4154 PVAR (p, childp) = contact; 4153 PSET (p, childp, contact);
4155 PVAR (p, plist) = Fcopy_sequence (PVAR (ps, plist)); 4154 PSET (p, plist, Fcopy_sequence (PGET (ps, plist)));
4156 PVAR (p, type) = Qnetwork; 4155 PSET (p, type, Qnetwork);
4157 4156
4158 PVAR (p, buffer) = buffer; 4157 PSET (p, buffer, buffer);
4159 PVAR (p, sentinel) = PVAR (ps, sentinel); 4158 PSET (p, sentinel, PGET (ps, sentinel));
4160 PVAR (p, filter) = PVAR (ps, filter); 4159 PSET (p, filter, PGET (ps, filter));
4161 PVAR (p, command) = Qnil; 4160 PSET (p, command, Qnil);
4162 p->pid = 0; 4161 p->pid = 0;
4163 p->infd = s; 4162 p->infd = s;
4164 p->outfd = s; 4163 p->outfd = s;
4165 PVAR (p, status) = Qrun; 4164 PSET (p, status, Qrun);
4166 4165
4167 /* Client processes for accepted connections are not stopped initially. */ 4166 /* Client processes for accepted connections are not stopped initially. */
4168 if (!EQ (PVAR (p, filter), Qt)) 4167 if (!EQ (PGET (p, filter), Qt))
4169 { 4168 {
4170 FD_SET (s, &input_wait_mask); 4169 FD_SET (s, &input_wait_mask);
4171 FD_SET (s, &non_keyboard_wait_mask); 4170 FD_SET (s, &non_keyboard_wait_mask);
@@ -4179,24 +4178,24 @@ server_accept_connection (Lisp_Object server, int channel)
4179 of the new process should reflect the settings at the time the 4178 of the new process should reflect the settings at the time the
4180 server socket was opened; not the current settings. */ 4179 server socket was opened; not the current settings. */
4181 4180
4182 PVAR (p, decode_coding_system) = PVAR (ps, decode_coding_system); 4181 PSET (p, decode_coding_system, PGET (ps, decode_coding_system));
4183 PVAR (p, encode_coding_system) = PVAR (ps, encode_coding_system); 4182 PSET (p, encode_coding_system, PGET (ps, encode_coding_system));
4184 setup_process_coding_systems (proc); 4183 setup_process_coding_systems (proc);
4185 4184
4186 PVAR (p, decoding_buf) = empty_unibyte_string; 4185 PSET (p, decoding_buf, empty_unibyte_string);
4187 p->decoding_carryover = 0; 4186 p->decoding_carryover = 0;
4188 PVAR (p, encoding_buf) = empty_unibyte_string; 4187 PSET (p, encoding_buf, empty_unibyte_string);
4189 4188
4190 p->inherit_coding_system_flag 4189 p->inherit_coding_system_flag
4191 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); 4190 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
4192 4191
4193 if (!NILP (PVAR (ps, log))) 4192 if (!NILP (PGET (ps, log)))
4194 call3 (PVAR (ps, log), server, proc, 4193 call3 (PGET (ps, log), server, proc,
4195 concat3 (build_string ("accept from "), 4194 concat3 (build_string ("accept from "),
4196 (STRINGP (host) ? host : build_string ("-")), 4195 (STRINGP (host) ? host : build_string ("-")),
4197 build_string ("\n"))); 4196 build_string ("\n")));
4198 4197
4199 if (!NILP (PVAR (p, sentinel))) 4198 if (!NILP (PGET (p, sentinel)))
4200 exec_sentinel (proc, 4199 exec_sentinel (proc,
4201 concat3 (build_string ("open from "), 4200 concat3 (build_string ("open from "),
4202 (STRINGP (host) ? host : build_string ("-")), 4201 (STRINGP (host) ? host : build_string ("-")),
@@ -4287,8 +4286,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4287 FD_ZERO (&Writeok); 4286 FD_ZERO (&Writeok);
4288 4287
4289 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) 4288 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit)
4290 && !(CONSP (PVAR (wait_proc, status)) 4289 && !(CONSP (PGET (wait_proc, status))
4291 && EQ (XCAR (PVAR (wait_proc, status)), Qexit))) 4290 && EQ (XCAR (PGET (wait_proc, status)), Qexit)))
4292 message ("Blocking call to accept-process-output with quit inhibited!!"); 4291 message ("Blocking call to accept-process-output with quit inhibited!!");
4293 4292
4294 /* If wait_proc is a process to watch, set wait_channel accordingly. */ 4293 /* If wait_proc is a process to watch, set wait_channel accordingly. */
@@ -4461,8 +4460,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4461 if (wait_proc && wait_proc->raw_status_new) 4460 if (wait_proc && wait_proc->raw_status_new)
4462 update_status (wait_proc); 4461 update_status (wait_proc);
4463 if (wait_proc 4462 if (wait_proc
4464 && ! EQ (PVAR (wait_proc, status), Qrun) 4463 && ! EQ (PGET (wait_proc, status), Qrun)
4465 && ! EQ (PVAR (wait_proc, status), Qconnect)) 4464 && ! EQ (PGET (wait_proc, status), Qconnect))
4466 { 4465 {
4467 int nread, total_nread = 0; 4466 int nread, total_nread = 0;
4468 4467
@@ -4821,7 +4820,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4821 continue; 4820 continue;
4822 4821
4823 /* If this is a server stream socket, accept connection. */ 4822 /* If this is a server stream socket, accept connection. */
4824 if (EQ (PVAR (XPROCESS (proc), status), Qlisten)) 4823 if (EQ (PGET (XPROCESS (proc), status), Qlisten))
4825 { 4824 {
4826 server_accept_connection (proc, channel); 4825 server_accept_connection (proc, channel);
4827 continue; 4826 continue;
@@ -4890,7 +4889,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4890 waitpid() will not find the process object to 4889 waitpid() will not find the process object to
4891 delete. Do it here. */ 4890 delete. Do it here. */
4892 p->tick = ++process_tick; 4891 p->tick = ++process_tick;
4893 PVAR (p, status) = Qfailed; 4892 PSET (p, status, Qfailed);
4894 } 4893 }
4895 else 4894 else
4896 kill (getpid (), SIGCHLD); 4895 kill (getpid (), SIGCHLD);
@@ -4909,9 +4908,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4909 deactivate_process (proc); 4908 deactivate_process (proc);
4910 if (XPROCESS (proc)->raw_status_new) 4909 if (XPROCESS (proc)->raw_status_new)
4911 update_status (XPROCESS (proc)); 4910 update_status (XPROCESS (proc));
4912 if (EQ (PVAR (XPROCESS (proc), status), Qrun)) 4911 if (EQ (PGET (XPROCESS (proc), status), Qrun))
4913 PVAR (XPROCESS (proc), status) 4912 PSET (XPROCESS (proc), status,
4914 = Fcons (Qexit, Fcons (make_number (256), Qnil)); 4913 Fcons (Qexit, Fcons (make_number (256), Qnil)));
4915 } 4914 }
4916 } 4915 }
4917#ifdef NON_BLOCKING_CONNECT 4916#ifdef NON_BLOCKING_CONNECT
@@ -4959,18 +4958,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4959 if (xerrno) 4958 if (xerrno)
4960 { 4959 {
4961 p->tick = ++process_tick; 4960 p->tick = ++process_tick;
4962 PVAR (p, status) 4961 PSET (p, status,
4963 = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); 4962 Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)));
4964 deactivate_process (proc); 4963 deactivate_process (proc);
4965 } 4964 }
4966 else 4965 else
4967 { 4966 {
4968 PVAR (p, status) = Qrun; 4967 PSET (p, status, Qrun);
4969 /* Execute the sentinel here. If we had relied on 4968 /* Execute the sentinel here. If we had relied on
4970 status_notify to do it later, it will read input 4969 status_notify to do it later, it will read input
4971 from the process before calling the sentinel. */ 4970 from the process before calling the sentinel. */
4972 exec_sentinel (proc, build_string ("open\n")); 4971 exec_sentinel (proc, build_string ("open\n"));
4973 if (!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) 4972 if (!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt))
4974 { 4973 {
4975 FD_SET (p->infd, &input_wait_mask); 4974 FD_SET (p->infd, &input_wait_mask);
4976 FD_SET (p->infd, &non_keyboard_wait_mask); 4975 FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -5042,7 +5041,7 @@ read_process_output (Lisp_Object proc, register int channel)
5042 chars = alloca (carryover + readmax); 5041 chars = alloca (carryover + readmax);
5043 if (carryover) 5042 if (carryover)
5044 /* See the comment above. */ 5043 /* See the comment above. */
5045 memcpy (chars, SDATA (PVAR (p, decoding_buf)), carryover); 5044 memcpy (chars, SDATA (PGET (p, decoding_buf)), carryover);
5046 5045
5047#ifdef DATAGRAM_SOCKETS 5046#ifdef DATAGRAM_SOCKETS
5048 /* We have a working select, so proc_buffered_char is always -1. */ 5047 /* We have a working select, so proc_buffered_char is always -1. */
@@ -5121,7 +5120,7 @@ read_process_output (Lisp_Object proc, register int channel)
5121 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 5120 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
5122 5121
5123 /* Read and dispose of the process output. */ 5122 /* Read and dispose of the process output. */
5124 outstream = PVAR (p, filter); 5123 outstream = PGET (p, filter);
5125 if (!NILP (outstream)) 5124 if (!NILP (outstream))
5126 { 5125 {
5127 Lisp_Object text; 5126 Lisp_Object text;
@@ -5163,9 +5162,9 @@ read_process_output (Lisp_Object proc, register int channel)
5163 text = coding->dst_object; 5162 text = coding->dst_object;
5164 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5163 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5165 /* A new coding system might be found. */ 5164 /* A new coding system might be found. */
5166 if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used)) 5165 if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used))
5167 { 5166 {
5168 PVAR (p, decode_coding_system) = Vlast_coding_system_used; 5167 PSET (p, decode_coding_system, Vlast_coding_system_used);
5169 5168
5170 /* Don't call setup_coding_system for 5169 /* Don't call setup_coding_system for
5171 proc_decode_coding_system[channel] here. It is done in 5170 proc_decode_coding_system[channel] here. It is done in
@@ -5178,21 +5177,21 @@ read_process_output (Lisp_Object proc, register int channel)
5178 proc_encode_coding_system[p->outfd] surely points to a 5177 proc_encode_coding_system[p->outfd] surely points to a
5179 valid memory because p->outfd will be changed once EOF is 5178 valid memory because p->outfd will be changed once EOF is
5180 sent to the process. */ 5179 sent to the process. */
5181 if (NILP (PVAR (p, encode_coding_system)) 5180 if (NILP (PGET (p, encode_coding_system))
5182 && proc_encode_coding_system[p->outfd]) 5181 && proc_encode_coding_system[p->outfd])
5183 { 5182 {
5184 PVAR (p, encode_coding_system) 5183 PSET (p, encode_coding_system,
5185 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); 5184 coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
5186 setup_coding_system (PVAR (p, encode_coding_system), 5185 setup_coding_system (PGET (p, encode_coding_system),
5187 proc_encode_coding_system[p->outfd]); 5186 proc_encode_coding_system[p->outfd]);
5188 } 5187 }
5189 } 5188 }
5190 5189
5191 if (coding->carryover_bytes > 0) 5190 if (coding->carryover_bytes > 0)
5192 { 5191 {
5193 if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) 5192 if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes)
5194 PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); 5193 PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes));
5195 memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, 5194 memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover,
5196 coding->carryover_bytes); 5195 coding->carryover_bytes);
5197 p->decoding_carryover = coding->carryover_bytes; 5196 p->decoding_carryover = coding->carryover_bytes;
5198 } 5197 }
@@ -5228,7 +5227,7 @@ read_process_output (Lisp_Object proc, register int channel)
5228 } 5227 }
5229 5228
5230 /* If no filter, write into buffer if it isn't dead. */ 5229 /* If no filter, write into buffer if it isn't dead. */
5231 else if (!NILP (PVAR (p, buffer)) && !NILP (BVAR (XBUFFER (PVAR (p, buffer)), name))) 5230 else if (!NILP (PGET (p, buffer)) && !NILP (BVAR (XBUFFER (PGET (p, buffer)), name)))
5232 { 5231 {
5233 Lisp_Object old_read_only; 5232 Lisp_Object old_read_only;
5234 ptrdiff_t old_begv, old_zv; 5233 ptrdiff_t old_begv, old_zv;
@@ -5238,7 +5237,7 @@ read_process_output (Lisp_Object proc, register int channel)
5238 Lisp_Object text; 5237 Lisp_Object text;
5239 struct buffer *b; 5238 struct buffer *b;
5240 5239
5241 Fset_buffer (PVAR (p, buffer)); 5240 Fset_buffer (PGET (p, buffer));
5242 opoint = PT; 5241 opoint = PT;
5243 opoint_byte = PT_BYTE; 5242 opoint_byte = PT_BYTE;
5244 old_read_only = BVAR (current_buffer, read_only); 5243 old_read_only = BVAR (current_buffer, read_only);
@@ -5252,11 +5251,11 @@ read_process_output (Lisp_Object proc, register int channel)
5252 /* Insert new output into buffer 5251 /* Insert new output into buffer
5253 at the current end-of-output marker, 5252 at the current end-of-output marker,
5254 thus preserving logical ordering of input and output. */ 5253 thus preserving logical ordering of input and output. */
5255 if (XMARKER (PVAR (p, mark))->buffer) 5254 if (XMARKER (PGET (p, mark))->buffer)
5256 SET_PT_BOTH (clip_to_bounds (BEGV, 5255 SET_PT_BOTH (clip_to_bounds (BEGV,
5257 marker_position (PVAR (p, mark)), ZV), 5256 marker_position (PGET (p, mark)), ZV),
5258 clip_to_bounds (BEGV_BYTE, 5257 clip_to_bounds (BEGV_BYTE,
5259 marker_byte_position (PVAR (p, mark)), 5258 marker_byte_position (PGET (p, mark)),
5260 ZV_BYTE)); 5259 ZV_BYTE));
5261 else 5260 else
5262 SET_PT_BOTH (ZV, ZV_BYTE); 5261 SET_PT_BOTH (ZV, ZV_BYTE);
@@ -5273,23 +5272,23 @@ read_process_output (Lisp_Object proc, register int channel)
5273 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5272 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5274 /* A new coding system might be found. See the comment in the 5273 /* A new coding system might be found. See the comment in the
5275 similar code in the previous `if' block. */ 5274 similar code in the previous `if' block. */
5276 if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used)) 5275 if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used))
5277 { 5276 {
5278 PVAR (p, decode_coding_system) = Vlast_coding_system_used; 5277 PSET (p, decode_coding_system, Vlast_coding_system_used);
5279 if (NILP (PVAR (p, encode_coding_system)) 5278 if (NILP (PGET (p, encode_coding_system))
5280 && proc_encode_coding_system[p->outfd]) 5279 && proc_encode_coding_system[p->outfd])
5281 { 5280 {
5282 PVAR (p, encode_coding_system) 5281 PSET (p, encode_coding_system,
5283 = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); 5282 coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
5284 setup_coding_system (PVAR (p, encode_coding_system), 5283 setup_coding_system (PGET (p, encode_coding_system),
5285 proc_encode_coding_system[p->outfd]); 5284 proc_encode_coding_system[p->outfd]);
5286 } 5285 }
5287 } 5286 }
5288 if (coding->carryover_bytes > 0) 5287 if (coding->carryover_bytes > 0)
5289 { 5288 {
5290 if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) 5289 if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes)
5291 PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); 5290 PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes));
5292 memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, 5291 memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover,
5293 coding->carryover_bytes); 5292 coding->carryover_bytes);
5294 p->decoding_carryover = coding->carryover_bytes; 5293 p->decoding_carryover = coding->carryover_bytes;
5295 } 5294 }
@@ -5307,11 +5306,11 @@ read_process_output (Lisp_Object proc, register int channel)
5307 /* Make sure the process marker's position is valid when the 5306 /* Make sure the process marker's position is valid when the
5308 process buffer is changed in the signal_after_change above. 5307 process buffer is changed in the signal_after_change above.
5309 W3 is known to do that. */ 5308 W3 is known to do that. */
5310 if (BUFFERP (PVAR (p, buffer)) 5309 if (BUFFERP (PGET (p, buffer))
5311 && (b = XBUFFER (PVAR (p, buffer)), b != current_buffer)) 5310 && (b = XBUFFER (PGET (p, buffer)), b != current_buffer))
5312 set_marker_both (PVAR (p, mark), PVAR (p, buffer), BUF_PT (b), BUF_PT_BYTE (b)); 5311 set_marker_both (PGET (p, mark), PGET (p, buffer), BUF_PT (b), BUF_PT_BYTE (b));
5313 else 5312 else
5314 set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); 5313 set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE);
5315 5314
5316 update_mode_lines++; 5315 update_mode_lines++;
5317 5316
@@ -5405,9 +5404,9 @@ write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj,
5405 entry = Fcons (obj, Fcons (make_number (offset), make_number (len))); 5404 entry = Fcons (obj, Fcons (make_number (offset), make_number (len)));
5406 5405
5407 if (front) 5406 if (front)
5408 PVAR (p, write_queue) = Fcons (entry, PVAR (p, write_queue)); 5407 PSET (p, write_queue, Fcons (entry, PGET (p, write_queue)));
5409 else 5408 else
5410 PVAR (p, write_queue) = nconc2 (PVAR (p, write_queue), Fcons (entry, Qnil)); 5409 PSET (p, write_queue, nconc2 (PGET (p, write_queue), Fcons (entry, Qnil)));
5411} 5410}
5412 5411
5413/* Remove the first element in the write_queue of process P, put its 5412/* Remove the first element in the write_queue of process P, put its
@@ -5421,11 +5420,11 @@ write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj,
5421 Lisp_Object entry, offset_length; 5420 Lisp_Object entry, offset_length;
5422 ptrdiff_t offset; 5421 ptrdiff_t offset;
5423 5422
5424 if (NILP (PVAR (p, write_queue))) 5423 if (NILP (PGET (p, write_queue)))
5425 return 0; 5424 return 0;
5426 5425
5427 entry = XCAR (PVAR (p, write_queue)); 5426 entry = XCAR (PGET (p, write_queue));
5428 PVAR (p, write_queue) = XCDR (PVAR (p, write_queue)); 5427 PSET (p, write_queue, XCDR (PGET (p, write_queue)));
5429 5428
5430 *obj = XCAR (entry); 5429 *obj = XCAR (entry);
5431 offset_length = XCDR (entry); 5430 offset_length = XCDR (entry);
@@ -5459,10 +5458,10 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5459 5458
5460 if (p->raw_status_new) 5459 if (p->raw_status_new)
5461 update_status (p); 5460 update_status (p);
5462 if (! EQ (PVAR (p, status), Qrun)) 5461 if (! EQ (PGET (p, status), Qrun))
5463 error ("Process %s not running", SDATA (PVAR (p, name))); 5462 error ("Process %s not running", SDATA (PGET (p, name)));
5464 if (p->outfd < 0) 5463 if (p->outfd < 0)
5465 error ("Output file descriptor of %s is closed", SDATA (PVAR (p, name))); 5464 error ("Output file descriptor of %s is closed", SDATA (PGET (p, name)));
5466 5465
5467 coding = proc_encode_coding_system[p->outfd]; 5466 coding = proc_encode_coding_system[p->outfd];
5468 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5467 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
@@ -5472,9 +5471,9 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5472 && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters))) 5471 && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters)))
5473 || EQ (object, Qt)) 5472 || EQ (object, Qt))
5474 { 5473 {
5475 PVAR (p, encode_coding_system) 5474 PSET (p, encode_coding_system,
5476 = complement_process_encoding_system (PVAR (p, encode_coding_system)); 5475 complement_process_encoding_system (PGET (p, encode_coding_system)));
5477 if (!EQ (Vlast_coding_system_used, PVAR (p, encode_coding_system))) 5476 if (!EQ (Vlast_coding_system_used, PGET (p, encode_coding_system)))
5478 { 5477 {
5479 /* The coding system for encoding was changed to raw-text 5478 /* The coding system for encoding was changed to raw-text
5480 because we sent a unibyte text previously. Now we are 5479 because we sent a unibyte text previously. Now we are
@@ -5484,8 +5483,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5484 Another reason we come here is that the coding system 5483 Another reason we come here is that the coding system
5485 was just complemented and a new one was returned by 5484 was just complemented and a new one was returned by
5486 complement_process_encoding_system. */ 5485 complement_process_encoding_system. */
5487 setup_coding_system (PVAR (p, encode_coding_system), coding); 5486 setup_coding_system (PGET (p, encode_coding_system), coding);
5488 Vlast_coding_system_used = PVAR (p, encode_coding_system); 5487 Vlast_coding_system_used = PGET (p, encode_coding_system);
5489 } 5488 }
5490 coding->src_multibyte = 1; 5489 coding->src_multibyte = 1;
5491 } 5490 }
@@ -5572,7 +5571,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5572 5571
5573 /* If there is already data in the write_queue, put the new data 5572 /* If there is already data in the write_queue, put the new data
5574 in the back of queue. Otherwise, ignore it. */ 5573 in the back of queue. Otherwise, ignore it. */
5575 if (!NILP (PVAR (p, write_queue))) 5574 if (!NILP (PGET (p, write_queue)))
5576 write_queue_push (p, object, buf, len, 0); 5575 write_queue_push (p, object, buf, len, 0);
5577 5576
5578 do /* while !NILP (p->write_queue) */ 5577 do /* while !NILP (p->write_queue) */
@@ -5686,7 +5685,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5686 cur_len -= written; 5685 cur_len -= written;
5687 } 5686 }
5688 } 5687 }
5689 while (!NILP (PVAR (p, write_queue))); 5688 while (!NILP (PGET (p, write_queue)));
5690 } 5689 }
5691 else 5690 else
5692 { 5691 {
@@ -5694,10 +5693,10 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5694 proc = process_sent_to; 5693 proc = process_sent_to;
5695 p = XPROCESS (proc); 5694 p = XPROCESS (proc);
5696 p->raw_status_new = 0; 5695 p->raw_status_new = 0;
5697 PVAR (p, status) = Fcons (Qexit, Fcons (make_number (256), Qnil)); 5696 PSET (p, status, Fcons (Qexit, Fcons (make_number (256), Qnil)));
5698 p->tick = ++process_tick; 5697 p->tick = ++process_tick;
5699 deactivate_process (proc); 5698 deactivate_process (proc);
5700 error ("SIGPIPE raised on process %s; closed it", SDATA (PVAR (p, name))); 5699 error ("SIGPIPE raised on process %s; closed it", SDATA (PGET (p, name)));
5701 } 5700 }
5702} 5701}
5703 5702
@@ -5755,12 +5754,12 @@ emacs_get_tty_pgrp (struct Lisp_Process *p)
5755 pid_t gid = -1; 5754 pid_t gid = -1;
5756 5755
5757#ifdef TIOCGPGRP 5756#ifdef TIOCGPGRP
5758 if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PVAR (p, tty_name))) 5757 if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PGET (p, tty_name)))
5759 { 5758 {
5760 int fd; 5759 int fd;
5761 /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the 5760 /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the
5762 master side. Try the slave side. */ 5761 master side. Try the slave side. */
5763 fd = emacs_open (SSDATA (PVAR (p, tty_name)), O_RDONLY, 0); 5762 fd = emacs_open (SSDATA (PGET (p, tty_name)), O_RDONLY, 0);
5764 5763
5765 if (fd != -1) 5764 if (fd != -1)
5766 { 5765 {
@@ -5789,12 +5788,12 @@ return t unconditionally. */)
5789 proc = get_process (process); 5788 proc = get_process (process);
5790 p = XPROCESS (proc); 5789 p = XPROCESS (proc);
5791 5790
5792 if (!EQ (PVAR (p, type), Qreal)) 5791 if (!EQ (PGET (p, type), Qreal))
5793 error ("Process %s is not a subprocess", 5792 error ("Process %s is not a subprocess",
5794 SDATA (PVAR (p, name))); 5793 SDATA (PGET (p, name)));
5795 if (p->infd < 0) 5794 if (p->infd < 0)
5796 error ("Process %s is not active", 5795 error ("Process %s is not active",
5797 SDATA (PVAR (p, name))); 5796 SDATA (PGET (p, name)));
5798 5797
5799 gid = emacs_get_tty_pgrp (p); 5798 gid = emacs_get_tty_pgrp (p);
5800 5799
@@ -5829,12 +5828,12 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5829 proc = get_process (process); 5828 proc = get_process (process);
5830 p = XPROCESS (proc); 5829 p = XPROCESS (proc);
5831 5830
5832 if (!EQ (PVAR (p, type), Qreal)) 5831 if (!EQ (PGET (p, type), Qreal))
5833 error ("Process %s is not a subprocess", 5832 error ("Process %s is not a subprocess",
5834 SDATA (PVAR (p, name))); 5833 SDATA (PGET (p, name)));
5835 if (p->infd < 0) 5834 if (p->infd < 0)
5836 error ("Process %s is not active", 5835 error ("Process %s is not active",
5837 SDATA (PVAR (p, name))); 5836 SDATA (PGET (p, name)));
5838 5837
5839 if (!p->pty_flag) 5838 if (!p->pty_flag)
5840 current_group = Qnil; 5839 current_group = Qnil;
@@ -5923,7 +5922,7 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5923#ifdef SIGCONT 5922#ifdef SIGCONT
5924 case SIGCONT: 5923 case SIGCONT:
5925 p->raw_status_new = 0; 5924 p->raw_status_new = 0;
5926 PVAR (p, status) = Qrun; 5925 PSET (p, status, Qrun);
5927 p->tick = ++process_tick; 5926 p->tick = ++process_tick;
5928 if (!nomsg) 5927 if (!nomsg)
5929 { 5928 {
@@ -6013,13 +6012,13 @@ traffic. */)
6013 struct Lisp_Process *p; 6012 struct Lisp_Process *p;
6014 6013
6015 p = XPROCESS (process); 6014 p = XPROCESS (process);
6016 if (NILP (PVAR (p, command)) 6015 if (NILP (PGET (p, command))
6017 && p->infd >= 0) 6016 && p->infd >= 0)
6018 { 6017 {
6019 FD_CLR (p->infd, &input_wait_mask); 6018 FD_CLR (p->infd, &input_wait_mask);
6020 FD_CLR (p->infd, &non_keyboard_wait_mask); 6019 FD_CLR (p->infd, &non_keyboard_wait_mask);
6021 } 6020 }
6022 PVAR (p, command) = Qt; 6021 PSET (p, command, Qt);
6023 return process; 6022 return process;
6024 } 6023 }
6025#ifndef SIGTSTP 6024#ifndef SIGTSTP
@@ -6042,9 +6041,9 @@ traffic. */)
6042 struct Lisp_Process *p; 6041 struct Lisp_Process *p;
6043 6042
6044 p = XPROCESS (process); 6043 p = XPROCESS (process);
6045 if (EQ (PVAR (p, command), Qt) 6044 if (EQ (PGET (p, command), Qt)
6046 && p->infd >= 0 6045 && p->infd >= 0
6047 && (!EQ (PVAR (p, filter), Qt) || EQ (PVAR (p, status), Qlisten))) 6046 && (!EQ (PGET (p, filter), Qt) || EQ (PGET (p, status), Qlisten)))
6048 { 6047 {
6049 FD_SET (p->infd, &input_wait_mask); 6048 FD_SET (p->infd, &input_wait_mask);
6050 FD_SET (p->infd, &non_keyboard_wait_mask); 6049 FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -6055,7 +6054,7 @@ traffic. */)
6055 tcflush (p->infd, TCIFLUSH); 6054 tcflush (p->infd, TCIFLUSH);
6056#endif /* not WINDOWSNT */ 6055#endif /* not WINDOWSNT */
6057 } 6056 }
6058 PVAR (p, command) = Qnil; 6057 PSET (p, command, Qnil);
6059 return process; 6058 return process;
6060 } 6059 }
6061#ifdef SIGCONT 6060#ifdef SIGCONT
@@ -6103,7 +6102,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
6103 pid = XPROCESS (process)->pid; 6102 pid = XPROCESS (process)->pid;
6104 if (pid <= 0) 6103 if (pid <= 0)
6105 error ("Cannot signal process %s", 6104 error ("Cannot signal process %s",
6106 SDATA (PVAR (XPROCESS (process), name))); 6105 SDATA (PGET (XPROCESS (process), name)));
6107 } 6106 }
6108 6107
6109#define parse_signal(NAME, VALUE) \ 6108#define parse_signal(NAME, VALUE) \
@@ -6247,8 +6246,8 @@ process has been transmitted to the serial port. */)
6247 /* Make sure the process is really alive. */ 6246 /* Make sure the process is really alive. */
6248 if (XPROCESS (proc)->raw_status_new) 6247 if (XPROCESS (proc)->raw_status_new)
6249 update_status (XPROCESS (proc)); 6248 update_status (XPROCESS (proc));
6250 if (! EQ (PVAR (XPROCESS (proc), status), Qrun)) 6249 if (! EQ (PGET (XPROCESS (proc), status), Qrun))
6251 error ("Process %s not running", SDATA (PVAR (XPROCESS (proc), name))); 6250 error ("Process %s not running", SDATA (PGET (XPROCESS (proc), name)));
6252 6251
6253 if (CODING_REQUIRE_FLUSHING (coding)) 6252 if (CODING_REQUIRE_FLUSHING (coding))
6254 { 6253 {
@@ -6258,7 +6257,7 @@ process has been transmitted to the serial port. */)
6258 6257
6259 if (XPROCESS (proc)->pty_flag) 6258 if (XPROCESS (proc)->pty_flag)
6260 send_process (proc, "\004", 1, Qnil); 6259 send_process (proc, "\004", 1, Qnil);
6261 else if (EQ (PVAR (XPROCESS (proc), type), Qserial)) 6260 else if (EQ (PGET (XPROCESS (proc), type), Qserial))
6262 { 6261 {
6263#ifndef WINDOWSNT 6262#ifndef WINDOWSNT
6264 if (tcdrain (XPROCESS (proc)->outfd) != 0) 6263 if (tcdrain (XPROCESS (proc)->outfd) != 0)
@@ -6275,7 +6274,7 @@ process has been transmitted to the serial port. */)
6275 for communication with the subprocess, call shutdown to cause EOF. 6274 for communication with the subprocess, call shutdown to cause EOF.
6276 (In some old system, shutdown to socketpair doesn't work. 6275 (In some old system, shutdown to socketpair doesn't work.
6277 Then we just can't win.) */ 6276 Then we just can't win.) */
6278 if (EQ (PVAR (XPROCESS (proc), type), Qnetwork) 6277 if (EQ (PGET (XPROCESS (proc), type), Qnetwork)
6279 || XPROCESS (proc)->outfd == XPROCESS (proc)->infd) 6278 || XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
6280 shutdown (XPROCESS (proc)->outfd, 1); 6279 shutdown (XPROCESS (proc)->outfd, 1);
6281 /* In case of socketpair, outfd == infd, so don't close it. */ 6280 /* In case of socketpair, outfd == infd, so don't close it. */
@@ -6388,7 +6387,7 @@ sigchld_handler (int signo)
6388 { 6387 {
6389 proc = XCDR (XCAR (tail)); 6388 proc = XCDR (XCAR (tail));
6390 p = XPROCESS (proc); 6389 p = XPROCESS (proc);
6391 if (EQ (PVAR (p, type), Qreal) && p->pid == pid) 6390 if (EQ (PGET (p, type), Qreal) && p->pid == pid)
6392 break; 6391 break;
6393 p = 0; 6392 p = 0;
6394 } 6393 }
@@ -6472,7 +6471,7 @@ sigchld_handler (int signo)
6472static Lisp_Object 6471static Lisp_Object
6473exec_sentinel_unwind (Lisp_Object data) 6472exec_sentinel_unwind (Lisp_Object data)
6474{ 6473{
6475 PVAR (XPROCESS (XCAR (data)), sentinel) = XCDR (data); 6474 PSET (XPROCESS (XCAR (data)), sentinel, XCDR (data));
6476 return Qnil; 6475 return Qnil;
6477} 6476}
6478 6477
@@ -6512,13 +6511,13 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6512 friends don't expect current-buffer to be changed from under them. */ 6511 friends don't expect current-buffer to be changed from under them. */
6513 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 6512 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
6514 6513
6515 sentinel = PVAR (p, sentinel); 6514 sentinel = PGET (p, sentinel);
6516 if (NILP (sentinel)) 6515 if (NILP (sentinel))
6517 return; 6516 return;
6518 6517
6519 /* Zilch the sentinel while it's running, to avoid recursive invocations; 6518 /* Zilch the sentinel while it's running, to avoid recursive invocations;
6520 assure that it gets restored no matter how the sentinel exits. */ 6519 assure that it gets restored no matter how the sentinel exits. */
6521 PVAR (p, sentinel) = Qnil; 6520 PSET (p, sentinel, Qnil);
6522 record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel)); 6521 record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel));
6523 /* Inhibit quit so that random quits don't screw up a running filter. */ 6522 /* Inhibit quit so that random quits don't screw up a running filter. */
6524 specbind (Qinhibit_quit, Qt); 6523 specbind (Qinhibit_quit, Qt);
@@ -6606,16 +6605,16 @@ status_notify (struct Lisp_Process *deleting_process)
6606 p->update_tick = p->tick; 6605 p->update_tick = p->tick;
6607 6606
6608 /* If process is still active, read any output that remains. */ 6607 /* If process is still active, read any output that remains. */
6609 while (! EQ (PVAR (p, filter), Qt) 6608 while (! EQ (PGET (p, filter), Qt)
6610 && ! EQ (PVAR (p, status), Qconnect) 6609 && ! EQ (PGET (p, status), Qconnect)
6611 && ! EQ (PVAR (p, status), Qlisten) 6610 && ! EQ (PGET (p, status), Qlisten)
6612 /* Network or serial process not stopped: */ 6611 /* Network or serial process not stopped: */
6613 && ! EQ (PVAR (p, command), Qt) 6612 && ! EQ (PGET (p, command), Qt)
6614 && p->infd >= 0 6613 && p->infd >= 0
6615 && p != deleting_process 6614 && p != deleting_process
6616 && read_process_output (proc, p->infd) > 0); 6615 && read_process_output (proc, p->infd) > 0);
6617 6616
6618 buffer = PVAR (p, buffer); 6617 buffer = PGET (p, buffer);
6619 6618
6620 /* Get the text to use for the message. */ 6619 /* Get the text to use for the message. */
6621 if (p->raw_status_new) 6620 if (p->raw_status_new)
@@ -6623,9 +6622,9 @@ status_notify (struct Lisp_Process *deleting_process)
6623 msg = status_message (p); 6622 msg = status_message (p);
6624 6623
6625 /* If process is terminated, deactivate it or delete it. */ 6624 /* If process is terminated, deactivate it or delete it. */
6626 symbol = PVAR (p, status); 6625 symbol = PGET (p, status);
6627 if (CONSP (PVAR (p, status))) 6626 if (CONSP (PGET (p, status)))
6628 symbol = XCAR (PVAR (p, status)); 6627 symbol = XCAR (PGET (p, status));
6629 6628
6630 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) 6629 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)
6631 || EQ (symbol, Qclosed)) 6630 || EQ (symbol, Qclosed))
@@ -6642,7 +6641,7 @@ status_notify (struct Lisp_Process *deleting_process)
6642 this code to be run again. */ 6641 this code to be run again. */
6643 p->update_tick = p->tick; 6642 p->update_tick = p->tick;
6644 /* Now output the message suitably. */ 6643 /* Now output the message suitably. */
6645 if (!NILP (PVAR (p, sentinel))) 6644 if (!NILP (PGET (p, sentinel)))
6646 exec_sentinel (proc, msg); 6645 exec_sentinel (proc, msg);
6647 /* Don't bother with a message in the buffer 6646 /* Don't bother with a message in the buffer
6648 when a process becomes runnable. */ 6647 when a process becomes runnable. */
@@ -6664,8 +6663,8 @@ status_notify (struct Lisp_Process *deleting_process)
6664 /* Insert new output into buffer 6663 /* Insert new output into buffer
6665 at the current end-of-output marker, 6664 at the current end-of-output marker,
6666 thus preserving logical ordering of input and output. */ 6665 thus preserving logical ordering of input and output. */
6667 if (XMARKER (PVAR (p, mark))->buffer) 6666 if (XMARKER (PGET (p, mark))->buffer)
6668 Fgoto_char (PVAR (p, mark)); 6667 Fgoto_char (PGET (p, mark));
6669 else 6668 else
6670 SET_PT_BOTH (ZV, ZV_BYTE); 6669 SET_PT_BOTH (ZV, ZV_BYTE);
6671 6670
@@ -6675,11 +6674,12 @@ status_notify (struct Lisp_Process *deleting_process)
6675 tem = BVAR (current_buffer, read_only); 6674 tem = BVAR (current_buffer, read_only);
6676 BVAR (current_buffer, read_only) = Qnil; 6675 BVAR (current_buffer, read_only) = Qnil;
6677 insert_string ("\nProcess "); 6676 insert_string ("\nProcess ");
6678 Finsert (1, &PVAR (p, name)); 6677 { /* FIXME: temporary kludge */
6678 Lisp_Object tem2 = PGET (p, name); Finsert (1, &tem2); }
6679 insert_string (" "); 6679 insert_string (" ");
6680 Finsert (1, &msg); 6680 Finsert (1, &msg);
6681 BVAR (current_buffer, read_only) = tem; 6681 BVAR (current_buffer, read_only) = tem;
6682 set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); 6682 set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE);
6683 6683
6684 if (opoint >= before) 6684 if (opoint >= before)
6685 SET_PT_BOTH (opoint + (PT - before), 6685 SET_PT_BOTH (opoint + (PT - before),
@@ -6709,14 +6709,14 @@ encode subprocess input. */)
6709 CHECK_PROCESS (process); 6709 CHECK_PROCESS (process);
6710 p = XPROCESS (process); 6710 p = XPROCESS (process);
6711 if (p->infd < 0) 6711 if (p->infd < 0)
6712 error ("Input file descriptor of %s closed", SDATA (PVAR (p, name))); 6712 error ("Input file descriptor of %s closed", SDATA (PGET (p, name)));
6713 if (p->outfd < 0) 6713 if (p->outfd < 0)
6714 error ("Output file descriptor of %s closed", SDATA (PVAR (p, name))); 6714 error ("Output file descriptor of %s closed", SDATA (PGET (p, name)));
6715 Fcheck_coding_system (decoding); 6715 Fcheck_coding_system (decoding);
6716 Fcheck_coding_system (encoding); 6716 Fcheck_coding_system (encoding);
6717 encoding = coding_inherit_eol_type (encoding, Qnil); 6717 encoding = coding_inherit_eol_type (encoding, Qnil);
6718 PVAR (p, decode_coding_system) = decoding; 6718 PSET (p, decode_coding_system, decoding);
6719 PVAR (p, encode_coding_system) = encoding; 6719 PSET (p, encode_coding_system, encoding);
6720 setup_process_coding_systems (process); 6720 setup_process_coding_systems (process);
6721 6721
6722 return Qnil; 6722 return Qnil;
@@ -6728,8 +6728,8 @@ DEFUN ("process-coding-system",
6728 (register Lisp_Object process) 6728 (register Lisp_Object process)
6729{ 6729{
6730 CHECK_PROCESS (process); 6730 CHECK_PROCESS (process);
6731 return Fcons (PVAR (XPROCESS (process), decode_coding_system), 6731 return Fcons (PGET (XPROCESS (process), decode_coding_system),
6732 PVAR (XPROCESS (process), encode_coding_system)); 6732 PGET (XPROCESS (process), encode_coding_system));
6733} 6733}
6734 6734
6735DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, 6735DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte,
@@ -6746,8 +6746,8 @@ suppressed. */)
6746 CHECK_PROCESS (process); 6746 CHECK_PROCESS (process);
6747 p = XPROCESS (process); 6747 p = XPROCESS (process);
6748 if (NILP (flag)) 6748 if (NILP (flag))
6749 PVAR (p, decode_coding_system) 6749 PSET (p, decode_coding_system,
6750 = raw_text_coding_system (PVAR (p, decode_coding_system)); 6750 raw_text_coding_system (PGET (p, decode_coding_system)));
6751 setup_process_coding_systems (process); 6751 setup_process_coding_systems (process);
6752 6752
6753 return Qnil; 6753 return Qnil;
@@ -7085,19 +7085,19 @@ setup_process_coding_systems (Lisp_Object process)
7085 7085
7086 if (!proc_decode_coding_system[inch]) 7086 if (!proc_decode_coding_system[inch])
7087 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); 7087 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
7088 coding_system = PVAR (p, decode_coding_system); 7088 coding_system = PGET (p, decode_coding_system);
7089 if (! NILP (PVAR (p, filter))) 7089 if (! NILP (PGET (p, filter)))
7090 ; 7090 ;
7091 else if (BUFFERP (PVAR (p, buffer))) 7091 else if (BUFFERP (PGET (p, buffer)))
7092 { 7092 {
7093 if (NILP (BVAR (XBUFFER (PVAR (p, buffer)), enable_multibyte_characters))) 7093 if (NILP (BVAR (XBUFFER (PGET (p, buffer)), enable_multibyte_characters)))
7094 coding_system = raw_text_coding_system (coding_system); 7094 coding_system = raw_text_coding_system (coding_system);
7095 } 7095 }
7096 setup_coding_system (coding_system, proc_decode_coding_system[inch]); 7096 setup_coding_system (coding_system, proc_decode_coding_system[inch]);
7097 7097
7098 if (!proc_encode_coding_system[outch]) 7098 if (!proc_encode_coding_system[outch])
7099 proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system)); 7099 proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system));
7100 setup_coding_system (PVAR (p, encode_coding_system), 7100 setup_coding_system (PGET (p, encode_coding_system),
7101 proc_encode_coding_system[outch]); 7101 proc_encode_coding_system[outch]);
7102#endif 7102#endif
7103} 7103}
@@ -7143,7 +7143,7 @@ BUFFER may be a buffer or the name of one. */)
7143 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) 7143 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
7144 { 7144 {
7145 proc = Fcdr (XCAR (tail)); 7145 proc = Fcdr (XCAR (tail));
7146 if (PROCESSP (proc) && EQ (PVAR (XPROCESS (proc), buffer), buf)) 7146 if (PROCESSP (proc) && EQ (PGET (XPROCESS (proc), buffer), buf))
7147 return proc; 7147 return proc;
7148 } 7148 }
7149#endif /* subprocesses */ 7149#endif /* subprocesses */
@@ -7182,7 +7182,7 @@ kill_buffer_processes (Lisp_Object buffer)
7182 { 7182 {
7183 proc = XCDR (XCAR (tail)); 7183 proc = XCDR (XCAR (tail));
7184 if (PROCESSP (proc) 7184 if (PROCESSP (proc)
7185 && (NILP (buffer) || EQ (PVAR (XPROCESS (proc), buffer), buffer))) 7185 && (NILP (buffer) || EQ (PGET (XPROCESS (proc), buffer), buffer)))
7186 { 7186 {
7187 if (NETCONN_P (proc) || SERIALCONN_P (proc)) 7187 if (NETCONN_P (proc) || SERIALCONN_P (proc))
7188 Fdelete_process (proc); 7188 Fdelete_process (proc);
diff --git a/src/process.h b/src/process.h
index dafa870b620..2bcb0c4bff6 100644
--- a/src/process.h
+++ b/src/process.h
@@ -26,10 +26,15 @@ 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/* Most code should use this macro to access 29/* Most code should use these macros to access Lisp fields in
30 Lisp fields in struct Lisp_Process. */ 30 struct Lisp_Process. PGET should not be used as lvalue. */
31 31
32#define PVAR(w, field) ((w)->INTERNAL_FIELD (field)) 32#define PGET(p, field) \
33 (eassert (offsetof (struct Lisp_Process, field ## _) \
34 < offsetof (struct Lisp_Process, pid)), \
35 ((p)->INTERNAL_FIELD (field)))
36
37#define PSET(p, field, value) ((p)->INTERNAL_FIELD (field) = (value))
33 38
34/* This structure records information about a subprocess 39/* This structure records information about a subprocess
35 or network connection. */ 40 or network connection. */
@@ -100,7 +105,7 @@ struct Lisp_Process
100 Lisp_Object INTERNAL_FIELD (write_queue); 105 Lisp_Object INTERNAL_FIELD (write_queue);
101 106
102#ifdef HAVE_GNUTLS 107#ifdef HAVE_GNUTLS
103 Lisp_Object gnutls_cred_type; 108 Lisp_Object INTERNAL_FIELD (gnutls_cred_type);
104#endif 109#endif
105 110
106 /* After this point, there are no Lisp_Objects any more. */ 111 /* After this point, there are no Lisp_Objects any more. */
diff --git a/src/sysdep.c b/src/sysdep.c
index d6bddd7a502..b2b3556d125 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2159,7 +2159,7 @@ serial_configure (struct Lisp_Process *p,
2159 int err = -1; 2159 int err = -1;
2160 char summary[4] = "???"; /* This usually becomes "8N1". */ 2160 char summary[4] = "???"; /* This usually becomes "8N1". */
2161 2161
2162 childp2 = Fcopy_sequence (PVAR (p, childp)); 2162 childp2 = Fcopy_sequence (PGET (p, childp));
2163 2163
2164 /* Read port attributes and prepare default configuration. */ 2164 /* Read port attributes and prepare default configuration. */
2165 err = tcgetattr (p->outfd, &attr); 2165 err = tcgetattr (p->outfd, &attr);
@@ -2177,7 +2177,7 @@ serial_configure (struct Lisp_Process *p,
2177 if (!NILP (Fplist_member (contact, QCspeed))) 2177 if (!NILP (Fplist_member (contact, QCspeed)))
2178 tem = Fplist_get (contact, QCspeed); 2178 tem = Fplist_get (contact, QCspeed);
2179 else 2179 else
2180 tem = Fplist_get (PVAR (p, childp), QCspeed); 2180 tem = Fplist_get (PGET (p, childp), QCspeed);
2181 CHECK_NUMBER (tem); 2181 CHECK_NUMBER (tem);
2182 err = cfsetspeed (&attr, XINT (tem)); 2182 err = cfsetspeed (&attr, XINT (tem));
2183 if (err != 0) 2183 if (err != 0)
@@ -2189,7 +2189,7 @@ serial_configure (struct Lisp_Process *p,
2189 if (!NILP (Fplist_member (contact, QCbytesize))) 2189 if (!NILP (Fplist_member (contact, QCbytesize)))
2190 tem = Fplist_get (contact, QCbytesize); 2190 tem = Fplist_get (contact, QCbytesize);
2191 else 2191 else
2192 tem = Fplist_get (PVAR (p, childp), QCbytesize); 2192 tem = Fplist_get (PGET (p, childp), QCbytesize);
2193 if (NILP (tem)) 2193 if (NILP (tem))
2194 tem = make_number (8); 2194 tem = make_number (8);
2195 CHECK_NUMBER (tem); 2195 CHECK_NUMBER (tem);
@@ -2210,7 +2210,7 @@ serial_configure (struct Lisp_Process *p,
2210 if (!NILP (Fplist_member (contact, QCparity))) 2210 if (!NILP (Fplist_member (contact, QCparity)))
2211 tem = Fplist_get (contact, QCparity); 2211 tem = Fplist_get (contact, QCparity);
2212 else 2212 else
2213 tem = Fplist_get (PVAR (p, childp), QCparity); 2213 tem = Fplist_get (PGET (p, childp), QCparity);
2214 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) 2214 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
2215 error (":parity must be nil (no parity), `even', or `odd'"); 2215 error (":parity must be nil (no parity), `even', or `odd'");
2216#if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK) 2216#if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK)
@@ -2243,7 +2243,7 @@ serial_configure (struct Lisp_Process *p,
2243 if (!NILP (Fplist_member (contact, QCstopbits))) 2243 if (!NILP (Fplist_member (contact, QCstopbits)))
2244 tem = Fplist_get (contact, QCstopbits); 2244 tem = Fplist_get (contact, QCstopbits);
2245 else 2245 else
2246 tem = Fplist_get (PVAR (p, childp), QCstopbits); 2246 tem = Fplist_get (PGET (p, childp), QCstopbits);
2247 if (NILP (tem)) 2247 if (NILP (tem))
2248 tem = make_number (1); 2248 tem = make_number (1);
2249 CHECK_NUMBER (tem); 2249 CHECK_NUMBER (tem);
@@ -2265,7 +2265,7 @@ serial_configure (struct Lisp_Process *p,
2265 if (!NILP (Fplist_member (contact, QCflowcontrol))) 2265 if (!NILP (Fplist_member (contact, QCflowcontrol)))
2266 tem = Fplist_get (contact, QCflowcontrol); 2266 tem = Fplist_get (contact, QCflowcontrol);
2267 else 2267 else
2268 tem = Fplist_get (PVAR (p, childp), QCflowcontrol); 2268 tem = Fplist_get (PGET (p, childp), QCflowcontrol);
2269 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) 2269 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
2270 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); 2270 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
2271#if defined (CRTSCTS) 2271#if defined (CRTSCTS)
@@ -2307,7 +2307,7 @@ serial_configure (struct Lisp_Process *p,
2307 error ("tcsetattr() failed: %s", emacs_strerror (errno)); 2307 error ("tcsetattr() failed: %s", emacs_strerror (errno));
2308 2308
2309 childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); 2309 childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
2310 PVAR (p, childp) = childp2; 2310 PSET (p, childp, childp2);
2311 2311
2312} 2312}
2313#endif /* not DOS_NT */ 2313#endif /* not DOS_NT */
diff --git a/src/w32.c b/src/w32.c
index 91f9f543add..810ae024173 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6891,7 +6891,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6891 error ("Not a serial process"); 6891 error ("Not a serial process");
6892 hnd = fd_info[ p->outfd ].hnd; 6892 hnd = fd_info[ p->outfd ].hnd;
6893 6893
6894 childp2 = Fcopy_sequence (PVAR (p, childp)); 6894 childp2 = Fcopy_sequence (PGET (p, childp));
6895 6895
6896 /* Initialize timeouts for blocking read and blocking write. */ 6896 /* Initialize timeouts for blocking read and blocking write. */
6897 if (!GetCommTimeouts (hnd, &ct)) 6897 if (!GetCommTimeouts (hnd, &ct))
@@ -6920,7 +6920,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6920 if (!NILP (Fplist_member (contact, QCspeed))) 6920 if (!NILP (Fplist_member (contact, QCspeed)))
6921 tem = Fplist_get (contact, QCspeed); 6921 tem = Fplist_get (contact, QCspeed);
6922 else 6922 else
6923 tem = Fplist_get (PVAR (p, childp), QCspeed); 6923 tem = Fplist_get (PGET (p, childp), QCspeed);
6924 CHECK_NUMBER (tem); 6924 CHECK_NUMBER (tem);
6925 dcb.BaudRate = XINT (tem); 6925 dcb.BaudRate = XINT (tem);
6926 childp2 = Fplist_put (childp2, QCspeed, tem); 6926 childp2 = Fplist_put (childp2, QCspeed, tem);
@@ -6929,7 +6929,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6929 if (!NILP (Fplist_member (contact, QCbytesize))) 6929 if (!NILP (Fplist_member (contact, QCbytesize)))
6930 tem = Fplist_get (contact, QCbytesize); 6930 tem = Fplist_get (contact, QCbytesize);
6931 else 6931 else
6932 tem = Fplist_get (PVAR (p, childp), QCbytesize); 6932 tem = Fplist_get (PGET (p, childp), QCbytesize);
6933 if (NILP (tem)) 6933 if (NILP (tem))
6934 tem = make_number (8); 6934 tem = make_number (8);
6935 CHECK_NUMBER (tem); 6935 CHECK_NUMBER (tem);
@@ -6943,7 +6943,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6943 if (!NILP (Fplist_member (contact, QCparity))) 6943 if (!NILP (Fplist_member (contact, QCparity)))
6944 tem = Fplist_get (contact, QCparity); 6944 tem = Fplist_get (contact, QCparity);
6945 else 6945 else
6946 tem = Fplist_get (PVAR (p, childp), QCparity); 6946 tem = Fplist_get (PGET (p, childp), QCparity);
6947 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) 6947 if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
6948 error (":parity must be nil (no parity), `even', or `odd'"); 6948 error (":parity must be nil (no parity), `even', or `odd'");
6949 dcb.fParity = FALSE; 6949 dcb.fParity = FALSE;
@@ -6973,7 +6973,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6973 if (!NILP (Fplist_member (contact, QCstopbits))) 6973 if (!NILP (Fplist_member (contact, QCstopbits)))
6974 tem = Fplist_get (contact, QCstopbits); 6974 tem = Fplist_get (contact, QCstopbits);
6975 else 6975 else
6976 tem = Fplist_get (PVAR (p, childp), QCstopbits); 6976 tem = Fplist_get (PGET (p, childp), QCstopbits);
6977 if (NILP (tem)) 6977 if (NILP (tem))
6978 tem = make_number (1); 6978 tem = make_number (1);
6979 CHECK_NUMBER (tem); 6979 CHECK_NUMBER (tem);
@@ -6990,7 +6990,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
6990 if (!NILP (Fplist_member (contact, QCflowcontrol))) 6990 if (!NILP (Fplist_member (contact, QCflowcontrol)))
6991 tem = Fplist_get (contact, QCflowcontrol); 6991 tem = Fplist_get (contact, QCflowcontrol);
6992 else 6992 else
6993 tem = Fplist_get (PVAR (p, childp), QCflowcontrol); 6993 tem = Fplist_get (PGET (p, childp), QCflowcontrol);
6994 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) 6994 if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
6995 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); 6995 error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
6996 dcb.fOutxCtsFlow = FALSE; 6996 dcb.fOutxCtsFlow = FALSE;
@@ -7024,7 +7024,7 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
7024 error ("SetCommState() failed"); 7024 error ("SetCommState() failed");
7025 7025
7026 childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); 7026 childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
7027 PVAR (p, childp) = childp2; 7027 PSET (p, childp, childp2);
7028} 7028}
7029 7029
7030#ifdef HAVE_GNUTLS 7030#ifdef HAVE_GNUTLS
diff --git a/src/xdisp.c b/src/xdisp.c
index 9906a70a227..d0338db44f0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21677,9 +21677,9 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21677 if (PROCESSP (obj)) 21677 if (PROCESSP (obj))
21678 { 21678 {
21679 p = decode_mode_spec_coding 21679 p = decode_mode_spec_coding
21680 (PVAR (XPROCESS (obj), decode_coding_system), p, eol_flag); 21680 (PGET (XPROCESS (obj), decode_coding_system), p, eol_flag);
21681 p = decode_mode_spec_coding 21681 p = decode_mode_spec_coding
21682 (PVAR (XPROCESS (obj), encode_coding_system), p, eol_flag); 21682 (PGET (XPROCESS (obj), encode_coding_system), p, eol_flag);
21683 } 21683 }
21684#endif /* subprocesses */ 21684#endif /* subprocesses */
21685#endif /* 0 */ 21685#endif /* 0 */