Mercurial > emacs
comparison src/process.c @ 40656:cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
| author | Pavel Jan?k <Pavel@Janik.cz> |
|---|---|
| date | Fri, 02 Nov 2001 20:46:55 +0000 |
| parents | d94fc1022312 |
| children | 0028402ed7d1 |
comparison
equal
deleted
inserted
replaced
| 40655:45453187feeb | 40656:cdfd4d09b79a |
|---|---|
| 491 (name) | 491 (name) |
| 492 register Lisp_Object name; | 492 register Lisp_Object name; |
| 493 { | 493 { |
| 494 if (PROCESSP (name)) | 494 if (PROCESSP (name)) |
| 495 return name; | 495 return name; |
| 496 CHECK_STRING (name, 0); | 496 CHECK_STRING (name); |
| 497 return Fcdr (Fassoc (name, Vprocess_alist)); | 497 return Fcdr (Fassoc (name, Vprocess_alist)); |
| 498 } | 498 } |
| 499 | 499 |
| 500 DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, | 500 DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, |
| 501 doc: /* Return the (or a) process associated with BUFFER. | 501 doc: /* Return the (or a) process associated with BUFFER. |
| 549 if (NILP (proc)) | 549 if (NILP (proc)) |
| 550 error ("Buffer %s has no process", XSTRING (XBUFFER (obj)->name)->data); | 550 error ("Buffer %s has no process", XSTRING (XBUFFER (obj)->name)->data); |
| 551 } | 551 } |
| 552 else | 552 else |
| 553 { | 553 { |
| 554 CHECK_PROCESS (obj, 0); | 554 CHECK_PROCESS (obj); |
| 555 proc = obj; | 555 proc = obj; |
| 556 } | 556 } |
| 557 return proc; | 557 return proc; |
| 558 } | 558 } |
| 559 | 559 |
| 632 doc: /* Return the exit status of PROCESS or the signal number that killed it. | 632 doc: /* Return the exit status of PROCESS or the signal number that killed it. |
| 633 If PROCESS has not yet exited or died, return 0. */) | 633 If PROCESS has not yet exited or died, return 0. */) |
| 634 (process) | 634 (process) |
| 635 register Lisp_Object process; | 635 register Lisp_Object process; |
| 636 { | 636 { |
| 637 CHECK_PROCESS (process, 0); | 637 CHECK_PROCESS (process); |
| 638 if (!NILP (XPROCESS (process)->raw_status_low)) | 638 if (!NILP (XPROCESS (process)->raw_status_low)) |
| 639 update_status (XPROCESS (process)); | 639 update_status (XPROCESS (process)); |
| 640 if (CONSP (XPROCESS (process)->status)) | 640 if (CONSP (XPROCESS (process)->status)) |
| 641 return XCAR (XCDR (XPROCESS (process)->status)); | 641 return XCAR (XCDR (XPROCESS (process)->status)); |
| 642 return make_number (0); | 642 return make_number (0); |
| 647 This is the pid of the Unix process which PROCESS uses or talks to. | 647 This is the pid of the Unix process which PROCESS uses or talks to. |
| 648 For a network connection, this value is nil. */) | 648 For a network connection, this value is nil. */) |
| 649 (process) | 649 (process) |
| 650 register Lisp_Object process; | 650 register Lisp_Object process; |
| 651 { | 651 { |
| 652 CHECK_PROCESS (process, 0); | 652 CHECK_PROCESS (process); |
| 653 return XPROCESS (process)->pid; | 653 return XPROCESS (process)->pid; |
| 654 } | 654 } |
| 655 | 655 |
| 656 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, | 656 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, |
| 657 doc: /* Return the name of PROCESS, as a string. | 657 doc: /* Return the name of PROCESS, as a string. |
| 658 This is the name of the program invoked in PROCESS, | 658 This is the name of the program invoked in PROCESS, |
| 659 possibly modified to make it unique among process names. */) | 659 possibly modified to make it unique among process names. */) |
| 660 (process) | 660 (process) |
| 661 register Lisp_Object process; | 661 register Lisp_Object process; |
| 662 { | 662 { |
| 663 CHECK_PROCESS (process, 0); | 663 CHECK_PROCESS (process); |
| 664 return XPROCESS (process)->name; | 664 return XPROCESS (process)->name; |
| 665 } | 665 } |
| 666 | 666 |
| 667 DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, | 667 DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, |
| 668 doc: /* Return the command that was executed to start PROCESS. | 668 doc: /* Return the command that was executed to start PROCESS. |
| 670 and the rest of the strings being the arguments given to it. | 670 and the rest of the strings being the arguments given to it. |
| 671 For a non-child channel, this is nil. */) | 671 For a non-child channel, this is nil. */) |
| 672 (process) | 672 (process) |
| 673 register Lisp_Object process; | 673 register Lisp_Object process; |
| 674 { | 674 { |
| 675 CHECK_PROCESS (process, 0); | 675 CHECK_PROCESS (process); |
| 676 return XPROCESS (process)->command; | 676 return XPROCESS (process)->command; |
| 677 } | 677 } |
| 678 | 678 |
| 679 DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, | 679 DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, |
| 680 doc: /* Return the name of the terminal PROCESS uses, or nil if none. | 680 doc: /* Return the name of the terminal PROCESS uses, or nil if none. |
| 681 This is the terminal that the process itself reads and writes on, | 681 This is the terminal that the process itself reads and writes on, |
| 682 not the name of the pty that Emacs uses to talk with that terminal. */) | 682 not the name of the pty that Emacs uses to talk with that terminal. */) |
| 683 (process) | 683 (process) |
| 684 register Lisp_Object process; | 684 register Lisp_Object process; |
| 685 { | 685 { |
| 686 CHECK_PROCESS (process, 0); | 686 CHECK_PROCESS (process); |
| 687 return XPROCESS (process)->tty_name; | 687 return XPROCESS (process)->tty_name; |
| 688 } | 688 } |
| 689 | 689 |
| 690 DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, | 690 DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, |
| 691 2, 2, 0, | 691 2, 2, 0, |
| 692 doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). */) | 692 doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). */) |
| 693 (process, buffer) | 693 (process, buffer) |
| 694 register Lisp_Object process, buffer; | 694 register Lisp_Object process, buffer; |
| 695 { | 695 { |
| 696 CHECK_PROCESS (process, 0); | 696 CHECK_PROCESS (process); |
| 697 if (!NILP (buffer)) | 697 if (!NILP (buffer)) |
| 698 CHECK_BUFFER (buffer, 1); | 698 CHECK_BUFFER (buffer); |
| 699 XPROCESS (process)->buffer = buffer; | 699 XPROCESS (process)->buffer = buffer; |
| 700 return buffer; | 700 return buffer; |
| 701 } | 701 } |
| 702 | 702 |
| 703 DEFUN ("process-buffer", Fprocess_buffer, Sprocess_buffer, | 703 DEFUN ("process-buffer", Fprocess_buffer, Sprocess_buffer, |
| 705 doc: /* Return the buffer PROCESS is associated with. | 705 doc: /* Return the buffer PROCESS is associated with. |
| 706 Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */) | 706 Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */) |
| 707 (process) | 707 (process) |
| 708 register Lisp_Object process; | 708 register Lisp_Object process; |
| 709 { | 709 { |
| 710 CHECK_PROCESS (process, 0); | 710 CHECK_PROCESS (process); |
| 711 return XPROCESS (process)->buffer; | 711 return XPROCESS (process)->buffer; |
| 712 } | 712 } |
| 713 | 713 |
| 714 DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, | 714 DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, |
| 715 1, 1, 0, | 715 1, 1, 0, |
| 716 doc: /* Return the marker for the end of the last output from PROCESS. */) | 716 doc: /* Return the marker for the end of the last output from PROCESS. */) |
| 717 (process) | 717 (process) |
| 718 register Lisp_Object process; | 718 register Lisp_Object process; |
| 719 { | 719 { |
| 720 CHECK_PROCESS (process, 0); | 720 CHECK_PROCESS (process); |
| 721 return XPROCESS (process)->mark; | 721 return XPROCESS (process)->mark; |
| 722 } | 722 } |
| 723 | 723 |
| 724 DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, | 724 DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, |
| 725 2, 2, 0, | 725 2, 2, 0, |
| 732 (process, filter) | 732 (process, filter) |
| 733 register Lisp_Object process, filter; | 733 register Lisp_Object process, filter; |
| 734 { | 734 { |
| 735 struct Lisp_Process *p; | 735 struct Lisp_Process *p; |
| 736 | 736 |
| 737 CHECK_PROCESS (process, 0); | 737 CHECK_PROCESS (process); |
| 738 p = XPROCESS (process); | 738 p = XPROCESS (process); |
| 739 | 739 |
| 740 /* Don't signal an error if the process' input file descriptor | 740 /* Don't signal an error if the process' input file descriptor |
| 741 is closed. This could make debugging Lisp more difficult, | 741 is closed. This could make debugging Lisp more difficult, |
| 742 for example when doing something like | 742 for example when doing something like |
| 768 doc: /* Returns the filter function of PROCESS; nil if none. | 768 doc: /* Returns the filter function of PROCESS; nil if none. |
| 769 See `set-process-filter' for more info on filter functions. */) | 769 See `set-process-filter' for more info on filter functions. */) |
| 770 (process) | 770 (process) |
| 771 register Lisp_Object process; | 771 register Lisp_Object process; |
| 772 { | 772 { |
| 773 CHECK_PROCESS (process, 0); | 773 CHECK_PROCESS (process); |
| 774 return XPROCESS (process)->filter; | 774 return XPROCESS (process)->filter; |
| 775 } | 775 } |
| 776 | 776 |
| 777 DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, | 777 DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, |
| 778 2, 2, 0, | 778 2, 2, 0, |
| 780 The sentinel is called as a function when the process changes state. | 780 The sentinel is called as a function when the process changes state. |
| 781 It gets two arguments: the process, and a string describing the change. */) | 781 It gets two arguments: the process, and a string describing the change. */) |
| 782 (process, sentinel) | 782 (process, sentinel) |
| 783 register Lisp_Object process, sentinel; | 783 register Lisp_Object process, sentinel; |
| 784 { | 784 { |
| 785 CHECK_PROCESS (process, 0); | 785 CHECK_PROCESS (process); |
| 786 XPROCESS (process)->sentinel = sentinel; | 786 XPROCESS (process)->sentinel = sentinel; |
| 787 return sentinel; | 787 return sentinel; |
| 788 } | 788 } |
| 789 | 789 |
| 790 DEFUN ("process-sentinel", Fprocess_sentinel, Sprocess_sentinel, | 790 DEFUN ("process-sentinel", Fprocess_sentinel, Sprocess_sentinel, |
| 792 doc: /* Return the sentinel of PROCESS; nil if none. | 792 doc: /* Return the sentinel of PROCESS; nil if none. |
| 793 See `set-process-sentinel' for more info on sentinels. */) | 793 See `set-process-sentinel' for more info on sentinels. */) |
| 794 (process) | 794 (process) |
| 795 register Lisp_Object process; | 795 register Lisp_Object process; |
| 796 { | 796 { |
| 797 CHECK_PROCESS (process, 0); | 797 CHECK_PROCESS (process); |
| 798 return XPROCESS (process)->sentinel; | 798 return XPROCESS (process)->sentinel; |
| 799 } | 799 } |
| 800 | 800 |
| 801 DEFUN ("set-process-window-size", Fset_process_window_size, | 801 DEFUN ("set-process-window-size", Fset_process_window_size, |
| 802 Sset_process_window_size, 3, 3, 0, | 802 Sset_process_window_size, 3, 3, 0, |
| 803 doc: /* Tell PROCESS that it has logical window size HEIGHT and WIDTH. */) | 803 doc: /* Tell PROCESS that it has logical window size HEIGHT and WIDTH. */) |
| 804 (process, height, width) | 804 (process, height, width) |
| 805 register Lisp_Object process, height, width; | 805 register Lisp_Object process, height, width; |
| 806 { | 806 { |
| 807 CHECK_PROCESS (process, 0); | 807 CHECK_PROCESS (process); |
| 808 CHECK_NATNUM (height, 0); | 808 CHECK_NATNUM (height); |
| 809 CHECK_NATNUM (width, 0); | 809 CHECK_NATNUM (width); |
| 810 | 810 |
| 811 if (XINT (XPROCESS (process)->infd) < 0 | 811 if (XINT (XPROCESS (process)->infd) < 0 |
| 812 || set_window_size (XINT (XPROCESS (process)->infd), | 812 || set_window_size (XINT (XPROCESS (process)->infd), |
| 813 XINT (height), XINT (width)) <= 0) | 813 XINT (height), XINT (width)) <= 0) |
| 814 return Qnil; | 814 return Qnil; |
| 834 starting the process is an alternative way of setting the inherit flag | 834 starting the process is an alternative way of setting the inherit flag |
| 835 for the process which will run. */) | 835 for the process which will run. */) |
| 836 (process, flag) | 836 (process, flag) |
| 837 register Lisp_Object process, flag; | 837 register Lisp_Object process, flag; |
| 838 { | 838 { |
| 839 CHECK_PROCESS (process, 0); | 839 CHECK_PROCESS (process); |
| 840 XPROCESS (process)->inherit_coding_system_flag = flag; | 840 XPROCESS (process)->inherit_coding_system_flag = flag; |
| 841 return flag; | 841 return flag; |
| 842 } | 842 } |
| 843 | 843 |
| 844 DEFUN ("process-inherit-coding-system-flag", | 844 DEFUN ("process-inherit-coding-system-flag", |
| 849 associated with PROCESS will inherit the coding system used to decode | 849 associated with PROCESS will inherit the coding system used to decode |
| 850 the process output. */) | 850 the process output. */) |
| 851 (process) | 851 (process) |
| 852 register Lisp_Object process; | 852 register Lisp_Object process; |
| 853 { | 853 { |
| 854 CHECK_PROCESS (process, 0); | 854 CHECK_PROCESS (process); |
| 855 return XPROCESS (process)->inherit_coding_system_flag; | 855 return XPROCESS (process)->inherit_coding_system_flag; |
| 856 } | 856 } |
| 857 | 857 |
| 858 DEFUN ("process-kill-without-query", Fprocess_kill_without_query, | 858 DEFUN ("process-kill-without-query", Fprocess_kill_without_query, |
| 859 Sprocess_kill_without_query, 1, 2, 0, | 859 Sprocess_kill_without_query, 1, 2, 0, |
| 863 (process, value) | 863 (process, value) |
| 864 register Lisp_Object process, value; | 864 register Lisp_Object process, value; |
| 865 { | 865 { |
| 866 Lisp_Object tem; | 866 Lisp_Object tem; |
| 867 | 867 |
| 868 CHECK_PROCESS (process, 0); | 868 CHECK_PROCESS (process); |
| 869 tem = XPROCESS (process)->kill_without_query; | 869 tem = XPROCESS (process)->kill_without_query; |
| 870 XPROCESS (process)->kill_without_query = Fnull (value); | 870 XPROCESS (process)->kill_without_query = Fnull (value); |
| 871 | 871 |
| 872 return Fnull (tem); | 872 return Fnull (tem); |
| 873 } | 873 } |
| 877 doc: /* Return the contact info of PROCESS; t for a real child. | 877 doc: /* Return the contact info of PROCESS; t for a real child. |
| 878 For a net connection, the value is a cons cell of the form (HOST SERVICE). */) | 878 For a net connection, the value is a cons cell of the form (HOST SERVICE). */) |
| 879 (process) | 879 (process) |
| 880 register Lisp_Object process; | 880 register Lisp_Object process; |
| 881 { | 881 { |
| 882 CHECK_PROCESS (process, 0); | 882 CHECK_PROCESS (process); |
| 883 return XPROCESS (process)->childp; | 883 return XPROCESS (process)->childp; |
| 884 } | 884 } |
| 885 | 885 |
| 886 #if 0 /* Turned off because we don't currently record this info | 886 #if 0 /* Turned off because we don't currently record this info |
| 887 in the process. Perhaps add it. */ | 887 in the process. Perhaps add it. */ |
| 1088 | 1088 |
| 1089 UNGCPRO; | 1089 UNGCPRO; |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 name = args[0]; | 1092 name = args[0]; |
| 1093 CHECK_STRING (name, 0); | 1093 CHECK_STRING (name); |
| 1094 | 1094 |
| 1095 program = args[2]; | 1095 program = args[2]; |
| 1096 | 1096 |
| 1097 CHECK_STRING (program, 2); | 1097 CHECK_STRING (program); |
| 1098 | 1098 |
| 1099 proc = make_process (name); | 1099 proc = make_process (name); |
| 1100 /* If an error occurs and we can't start the process, we want to | 1100 /* If an error occurs and we can't start the process, we want to |
| 1101 remove it from the process list. This means that each error | 1101 remove it from the process list. This means that each error |
| 1102 check in create_process doesn't need to call remove_process | 1102 check in create_process doesn't need to call remove_process |
| 1167 together separated by a blank. */ | 1167 together separated by a blank. */ |
| 1168 len = STRING_BYTES (XSTRING (program)) + 2; | 1168 len = STRING_BYTES (XSTRING (program)) + 2; |
| 1169 for (i = 3; i < nargs; i++) | 1169 for (i = 3; i < nargs; i++) |
| 1170 { | 1170 { |
| 1171 tem = args[i]; | 1171 tem = args[i]; |
| 1172 CHECK_STRING (tem, i); | 1172 CHECK_STRING (tem); |
| 1173 len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */ | 1173 len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */ |
| 1174 } | 1174 } |
| 1175 new_argv = (unsigned char *) alloca (len); | 1175 new_argv = (unsigned char *) alloca (len); |
| 1176 strcpy (new_argv, XSTRING (program)->data); | 1176 strcpy (new_argv, XSTRING (program)->data); |
| 1177 for (i = 3; i < nargs; i++) | 1177 for (i = 3; i < nargs; i++) |
| 1178 { | 1178 { |
| 1179 tem = args[i]; | 1179 tem = args[i]; |
| 1180 CHECK_STRING (tem, i); | 1180 CHECK_STRING (tem); |
| 1181 strcat (new_argv, " "); | 1181 strcat (new_argv, " "); |
| 1182 strcat (new_argv, XSTRING (tem)->data); | 1182 strcat (new_argv, XSTRING (tem)->data); |
| 1183 } | 1183 } |
| 1184 /* Need to add code here to check for program existence on VMS */ | 1184 /* Need to add code here to check for program existence on VMS */ |
| 1185 | 1185 |
| 1218 process. */ | 1218 process. */ |
| 1219 | 1219 |
| 1220 for (i = 3; i < nargs; i++) | 1220 for (i = 3; i < nargs; i++) |
| 1221 { | 1221 { |
| 1222 tem = args[i]; | 1222 tem = args[i]; |
| 1223 CHECK_STRING (tem, i); | 1223 CHECK_STRING (tem); |
| 1224 if (STRING_MULTIBYTE (tem)) | 1224 if (STRING_MULTIBYTE (tem)) |
| 1225 tem = (code_convert_string_norecord | 1225 tem = (code_convert_string_norecord |
| 1226 (tem, XPROCESS (proc)->encode_coding_system, 1)); | 1226 (tem, XPROCESS (proc)->encode_coding_system, 1)); |
| 1227 new_argv[i - 2] = XSTRING (tem)->data; | 1227 new_argv[i - 2] = XSTRING (tem)->data; |
| 1228 } | 1228 } |
| 1782 /* Ensure socket support is loaded if available. */ | 1782 /* Ensure socket support is loaded if available. */ |
| 1783 init_winsock (TRUE); | 1783 init_winsock (TRUE); |
| 1784 #endif | 1784 #endif |
| 1785 | 1785 |
| 1786 GCPRO4 (name, buffer, host, service); | 1786 GCPRO4 (name, buffer, host, service); |
| 1787 CHECK_STRING (name, 0); | 1787 CHECK_STRING (name); |
| 1788 CHECK_STRING (host, 0); | 1788 CHECK_STRING (host); |
| 1789 | 1789 |
| 1790 #ifdef HAVE_GETADDRINFO | 1790 #ifdef HAVE_GETADDRINFO |
| 1791 /* SERVICE can either be a string or int. | 1791 /* SERVICE can either be a string or int. |
| 1792 Convert to a C string for later use by getaddrinfo. */ | 1792 Convert to a C string for later use by getaddrinfo. */ |
| 1793 if (INTEGERP (service)) | 1793 if (INTEGERP (service)) |
| 1795 sprintf (portbuf, "%ld", (long) XINT (service)); | 1795 sprintf (portbuf, "%ld", (long) XINT (service)); |
| 1796 portstring = portbuf; | 1796 portstring = portbuf; |
| 1797 } | 1797 } |
| 1798 else | 1798 else |
| 1799 { | 1799 { |
| 1800 CHECK_STRING (service, 0); | 1800 CHECK_STRING (service); |
| 1801 portstring = XSTRING (service)->data; | 1801 portstring = XSTRING (service)->data; |
| 1802 } | 1802 } |
| 1803 #else /* HAVE_GETADDRINFO */ | 1803 #else /* HAVE_GETADDRINFO */ |
| 1804 if (INTEGERP (service)) | 1804 if (INTEGERP (service)) |
| 1805 port = htons ((unsigned short) XINT (service)); | 1805 port = htons ((unsigned short) XINT (service)); |
| 1806 else | 1806 else |
| 1807 { | 1807 { |
| 1808 CHECK_STRING (service, 0); | 1808 CHECK_STRING (service); |
| 1809 svc_info = getservbyname (XSTRING (service)->data, "tcp"); | 1809 svc_info = getservbyname (XSTRING (service)->data, "tcp"); |
| 1810 if (svc_info == 0) | 1810 if (svc_info == 0) |
| 1811 error ("Unknown service \"%s\"", XSTRING (service)->data); | 1811 error ("Unknown service \"%s\"", XSTRING (service)->data); |
| 1812 port = svc_info->s_port; | 1812 port = svc_info->s_port; |
| 1813 } | 1813 } |
| 2248 { | 2248 { |
| 2249 int seconds; | 2249 int seconds; |
| 2250 int useconds; | 2250 int useconds; |
| 2251 | 2251 |
| 2252 if (! NILP (process)) | 2252 if (! NILP (process)) |
| 2253 CHECK_PROCESS (process, 0); | 2253 CHECK_PROCESS (process); |
| 2254 | 2254 |
| 2255 if (! NILP (timeout_msecs)) | 2255 if (! NILP (timeout_msecs)) |
| 2256 { | 2256 { |
| 2257 CHECK_NUMBER (timeout_msecs, 2); | 2257 CHECK_NUMBER (timeout_msecs); |
| 2258 useconds = XINT (timeout_msecs); | 2258 useconds = XINT (timeout_msecs); |
| 2259 if (!INTEGERP (timeout)) | 2259 if (!INTEGERP (timeout)) |
| 2260 XSETINT (timeout, 0); | 2260 XSETINT (timeout, 0); |
| 2261 | 2261 |
| 2262 { | 2262 { |
| 2278 else | 2278 else |
| 2279 useconds = 0; | 2279 useconds = 0; |
| 2280 | 2280 |
| 2281 if (! NILP (timeout)) | 2281 if (! NILP (timeout)) |
| 2282 { | 2282 { |
| 2283 CHECK_NUMBER (timeout, 1); | 2283 CHECK_NUMBER (timeout); |
| 2284 seconds = XINT (timeout); | 2284 seconds = XINT (timeout); |
| 2285 if (seconds < 0 || (seconds == 0 && useconds == 0)) | 2285 if (seconds < 0 || (seconds == 0 && useconds == 0)) |
| 2286 seconds = -1; | 2286 seconds = -1; |
| 2287 } | 2287 } |
| 2288 else | 2288 else |
| 3559 Output from processes can arrive in between bunches. */) | 3559 Output from processes can arrive in between bunches. */) |
| 3560 (process, string) | 3560 (process, string) |
| 3561 Lisp_Object process, string; | 3561 Lisp_Object process, string; |
| 3562 { | 3562 { |
| 3563 Lisp_Object proc; | 3563 Lisp_Object proc; |
| 3564 CHECK_STRING (string, 1); | 3564 CHECK_STRING (string); |
| 3565 proc = get_process (process); | 3565 proc = get_process (process); |
| 3566 send_process (proc, XSTRING (string)->data, | 3566 send_process (proc, XSTRING (string)->data, |
| 3567 STRING_BYTES (XSTRING (string)), string); | 3567 STRING_BYTES (XSTRING (string)), string); |
| 3568 return Qnil; | 3568 return Qnil; |
| 3569 } | 3569 } |
| 3902 PID must be an integer. The process need not be a child of this Emacs. | 3902 PID must be an integer. The process need not be a child of this Emacs. |
| 3903 SIGCODE may be an integer, or a symbol whose name is a signal name. */) | 3903 SIGCODE may be an integer, or a symbol whose name is a signal name. */) |
| 3904 (pid, sigcode) | 3904 (pid, sigcode) |
| 3905 Lisp_Object pid, sigcode; | 3905 Lisp_Object pid, sigcode; |
| 3906 { | 3906 { |
| 3907 CHECK_NUMBER (pid, 0); | 3907 CHECK_NUMBER (pid); |
| 3908 | 3908 |
| 3909 #define handle_signal(NAME, VALUE) \ | 3909 #define handle_signal(NAME, VALUE) \ |
| 3910 else if (!strcmp (name, NAME)) \ | 3910 else if (!strcmp (name, NAME)) \ |
| 3911 XSETINT (sigcode, VALUE) | 3911 XSETINT (sigcode, VALUE) |
| 3912 | 3912 |
| 3914 ; | 3914 ; |
| 3915 else | 3915 else |
| 3916 { | 3916 { |
| 3917 unsigned char *name; | 3917 unsigned char *name; |
| 3918 | 3918 |
| 3919 CHECK_SYMBOL (sigcode, 1); | 3919 CHECK_SYMBOL (sigcode); |
| 3920 name = XSYMBOL (sigcode)->name->data; | 3920 name = XSYMBOL (sigcode)->name->data; |
| 3921 | 3921 |
| 3922 if (0) | 3922 if (0) |
| 3923 ; | 3923 ; |
| 3924 #ifdef SIGHUP | 3924 #ifdef SIGHUP |
| 4514 (proc, decoding, encoding) | 4514 (proc, decoding, encoding) |
| 4515 register Lisp_Object proc, decoding, encoding; | 4515 register Lisp_Object proc, decoding, encoding; |
| 4516 { | 4516 { |
| 4517 register struct Lisp_Process *p; | 4517 register struct Lisp_Process *p; |
| 4518 | 4518 |
| 4519 CHECK_PROCESS (proc, 0); | 4519 CHECK_PROCESS (proc); |
| 4520 p = XPROCESS (proc); | 4520 p = XPROCESS (proc); |
| 4521 if (XINT (p->infd) < 0) | 4521 if (XINT (p->infd) < 0) |
| 4522 error ("Input file descriptor of %s closed", XSTRING (p->name)->data); | 4522 error ("Input file descriptor of %s closed", XSTRING (p->name)->data); |
| 4523 if (XINT (p->outfd) < 0) | 4523 if (XINT (p->outfd) < 0) |
| 4524 error ("Output file descriptor of %s closed", XSTRING (p->name)->data); | 4524 error ("Output file descriptor of %s closed", XSTRING (p->name)->data); |
| 4537 Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0, | 4537 Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0, |
| 4538 doc: /* Return a cons of coding systems for decoding and encoding of PROCESS. */) | 4538 doc: /* Return a cons of coding systems for decoding and encoding of PROCESS. */) |
| 4539 (proc) | 4539 (proc) |
| 4540 register Lisp_Object proc; | 4540 register Lisp_Object proc; |
| 4541 { | 4541 { |
| 4542 CHECK_PROCESS (proc, 0); | 4542 CHECK_PROCESS (proc); |
| 4543 return Fcons (XPROCESS (proc)->decode_coding_system, | 4543 return Fcons (XPROCESS (proc)->decode_coding_system, |
| 4544 XPROCESS (proc)->encode_coding_system); | 4544 XPROCESS (proc)->encode_coding_system); |
| 4545 } | 4545 } |
| 4546 | 4546 |
| 4547 /* The first time this is called, assume keyboard input comes from DESC | 4547 /* The first time this is called, assume keyboard input comes from DESC |
