Mercurial > hg > xemacs-beta
comparison src/process.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 3742ea8250b5 aa5ed11f473b |
children | 623d57b7fbe8 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
32 | 32 |
33 callproc.c deleted entirely 5-23-02, Ben Wing. Good riddance! | 33 callproc.c deleted entirely 5-23-02, Ben Wing. Good riddance! |
34 */ | 34 */ |
35 | 35 |
36 #include <config.h> | 36 #include <config.h> |
37 | |
38 #if defined (NO_SUBPROCESSES) | |
39 #error "We don't support this anymore." | |
40 #endif | |
41 | 37 |
42 #include "lisp.h" | 38 #include "lisp.h" |
43 | 39 |
44 #include "buffer.h" | 40 #include "buffer.h" |
45 #include "commands.h" | 41 #include "commands.h" |
110 | 106 |
111 /* Hash table which maps USIDs as returned by create_io_streams_cb to | 107 /* Hash table which maps USIDs as returned by create_io_streams_cb to |
112 process objects. Processes are not GC-protected through this! */ | 108 process objects. Processes are not GC-protected through this! */ |
113 struct hash_table *usid_to_process; | 109 struct hash_table *usid_to_process; |
114 | 110 |
115 /* List of process objects. */ | 111 /* Read-only to Lisp. See DEFUN Fprocess_list. */ |
116 Lisp_Object Vprocess_list; | 112 Lisp_Object Vprocess_list; |
117 | 113 |
114 /* Lisp variables; see docstrings below. */ | |
118 Lisp_Object Vnull_device; | 115 Lisp_Object Vnull_device; |
119 | |
120 /* Cons of coding systems used to initialize process I/O on a newly- | |
121 created process. */ | |
122 Lisp_Object Vdefault_process_coding_system; | 116 Lisp_Object Vdefault_process_coding_system; |
123 /* Same for a network connection. */ | |
124 Lisp_Object Vdefault_network_coding_system; | 117 Lisp_Object Vdefault_network_coding_system; |
125 | |
126 Lisp_Object Qprocess_error; | 118 Lisp_Object Qprocess_error; |
127 Lisp_Object Qnetwork_error; | 119 Lisp_Object Qnetwork_error; |
128 | |
129 Fixnum debug_process_io; | 120 Fixnum debug_process_io; |
130 | |
131 Lisp_Object Vshell_file_name; | 121 Lisp_Object Vshell_file_name; |
132 | |
133 /* The environment to pass to all subprocesses when they are started. | |
134 This is in the semi-bogus format of ("VAR=VAL" "VAR2=VAL2" ... ) | |
135 */ | |
136 Lisp_Object Vprocess_environment; | 122 Lisp_Object Vprocess_environment; |
137 | 123 |
138 /* Make sure egetenv() not called too soon */ | 124 /* Make sure egetenv() not called too soon */ |
139 int env_initted; | 125 int env_initted; |
140 | 126 |
127 /* Internal Lisp variable. */ | |
141 Lisp_Object Vlisp_EXEC_SUFFIXES; | 128 Lisp_Object Vlisp_EXEC_SUFFIXES; |
142 | 129 |
143 | 130 |
144 | 131 |
145 static const struct memory_description process_description [] = { | 132 static const struct memory_description process_description [] = { |
207 if (!for_disksave) | 194 if (!for_disksave) |
208 xfree (p->process_data, void *); | 195 xfree (p->process_data, void *); |
209 } | 196 } |
210 } | 197 } |
211 | 198 |
212 DEFINE_NONDUMPABLE_LISP_OBJECT ("process", process, | 199 DEFINE_NODUMP_LISP_OBJECT ("process", process, |
213 mark_process, print_process, finalize_process, | 200 mark_process, print_process, finalize_process, |
214 0, 0, process_description, Lisp_Process); | 201 0, 0, process_description, Lisp_Process); |
215 | 202 |
216 /************************************************************************/ | 203 /************************************************************************/ |
217 /* basic process accessors */ | 204 /* basic process accessors */ |
519 USID in_usid, err_usid; | 506 USID in_usid, err_usid; |
520 Lisp_Object incode, outcode; | 507 Lisp_Object incode, outcode; |
521 | 508 |
522 if (flags & STREAM_NETWORK_CONNECTION) | 509 if (flags & STREAM_NETWORK_CONNECTION) |
523 { | 510 { |
524 if (!CONSP (Vdefault_network_coding_system) || | 511 if (!LISTP (Vdefault_network_coding_system) || |
525 NILP (incode = (find_coding_system_for_text_file | 512 NILP (incode = (find_coding_system_for_text_file |
526 (Fcar (Vdefault_network_coding_system), 1))) || | 513 (Fcar (Vdefault_network_coding_system), 1))) || |
527 NILP (outcode = (find_coding_system_for_text_file | 514 NILP (outcode = (find_coding_system_for_text_file |
528 (Fcdr (Vdefault_network_coding_system), 0)))) | 515 (Fcdr (Vdefault_network_coding_system), 0)))) |
529 signal_error (Qinvalid_state, | 516 signal_error (Qinvalid_state, |
530 "Bogus value for `default-network-coding-system'", | 517 "Bogus value for `default-network-coding-system'", |
531 Vdefault_network_coding_system); | 518 Vdefault_network_coding_system); |
532 } | 519 } |
533 else | 520 else |
534 { | 521 { |
535 if (!CONSP (Vdefault_process_coding_system) || | 522 if (!LISTP (Vdefault_process_coding_system) || |
536 NILP (incode = (find_coding_system_for_text_file | 523 NILP (incode = (find_coding_system_for_text_file |
537 (Fcar (Vdefault_process_coding_system), 1))) || | 524 (Fcar (Vdefault_process_coding_system), 1))) || |
538 NILP (outcode = (find_coding_system_for_text_file | 525 NILP (outcode = (find_coding_system_for_text_file |
539 (Fcdr (Vdefault_process_coding_system), 0)))) | 526 (Fcdr (Vdefault_process_coding_system), 0)))) |
540 signal_error (Qinvalid_state, | 527 signal_error (Qinvalid_state, |
659 from `default-process-coding-system' if either or both are nil. You can | 646 from `default-process-coding-system' if either or both are nil. You can |
660 change the coding systems later on using `set-process-coding-system', | 647 change the coding systems later on using `set-process-coding-system', |
661 `set-process-input-coding-system', or `set-process-output-coding-system'. | 648 `set-process-input-coding-system', or `set-process-output-coding-system'. |
662 | 649 |
663 See also `set-process-filter' and `set-process-stderr-filter'. | 650 See also `set-process-filter' and `set-process-stderr-filter'. |
651 | |
652 arguments: (NAME BUFFER PROGRAM &rest PROGRAM-ARGS) | |
664 */ | 653 */ |
665 (int nargs, Lisp_Object *args)) | 654 (int nargs, Lisp_Object *args)) |
666 { | 655 { |
667 /* This function can call lisp */ | 656 /* This function can call lisp */ |
668 Lisp_Object buffer, stderr_buffer, name, program, process, current_dir; | 657 Lisp_Object buffer, stderr_buffer, name, program, process, current_dir; |
2650 debug_process_io = 0; | 2639 debug_process_io = 0; |
2651 | 2640 |
2652 DEFVAR_LISP ("default-process-coding-system", | 2641 DEFVAR_LISP ("default-process-coding-system", |
2653 &Vdefault_process_coding_system /* | 2642 &Vdefault_process_coding_system /* |
2654 Cons of coding systems used for process I/O by default. | 2643 Cons of coding systems used for process I/O by default. |
2644 May also be nil, interpreted as (nil . nil). | |
2655 The car part is used for reading (decoding) data from a process, and | 2645 The car part is used for reading (decoding) data from a process, and |
2656 the cdr part is used for writing (encoding) data to a process. | 2646 the cdr part is used for writing (encoding) data to a process. |
2657 */ ); | 2647 */ ); |
2658 /* This below will get its default set correctly in code-init.el. */ | 2648 /* Better, system-dependent defaults are set in code-init.el. */ |
2659 Vdefault_process_coding_system = Fcons (Qundecided, Qnil); | 2649 Vdefault_process_coding_system = Fcons (Qundecided, Qnil); |
2660 | 2650 |
2661 DEFVAR_LISP ("default-network-coding-system", | 2651 DEFVAR_LISP ("default-network-coding-system", |
2662 &Vdefault_network_coding_system /* | 2652 &Vdefault_network_coding_system /* |
2663 Cons of coding systems used for network I/O by default. | 2653 Cons of coding systems used for network I/O by default. |
2654 May also be nil, interpreted as (nil . nil). | |
2664 The car part is used for reading (decoding) data from a process, and | 2655 The car part is used for reading (decoding) data from a process, and |
2665 the cdr part is used for writing (encoding) data to a process. | 2656 the cdr part is used for writing (encoding) data to a process. |
2666 */ ); | 2657 */ ); |
2667 Vdefault_network_coding_system = Fcons (Qundecided, Qnil); | 2658 Vdefault_network_coding_system = Fcons (Qundecided, Qnil); |
2668 | 2659 |
2679 DEFVAR_LISP ("shell-file-name", &Vshell_file_name /* | 2670 DEFVAR_LISP ("shell-file-name", &Vshell_file_name /* |
2680 *File name to load inferior shells from. | 2671 *File name to load inferior shells from. |
2681 Initialized from the SHELL environment variable. | 2672 Initialized from the SHELL environment variable. |
2682 */ ); | 2673 */ ); |
2683 | 2674 |
2675 /* ben? thinks the format of this variable is "semi-bogus". | |
2676 sjt doesn't agree, since it captures a restriction that is | |
2677 present in POSIX shells, after all. */ | |
2684 DEFVAR_LISP ("process-environment", &Vprocess_environment /* | 2678 DEFVAR_LISP ("process-environment", &Vprocess_environment /* |
2685 List of environment variables for subprocesses to inherit. | 2679 List of environment variables for subprocesses to inherit. |
2686 Each element should be a string of the form ENVVARNAME=VALUE. | 2680 Each element should be a string of the form ENVVARNAME=VALUE. |
2687 The environment which Emacs inherits is placed in this variable | 2681 The environment which Emacs inherits is placed in this variable |
2688 when Emacs starts. | 2682 when Emacs starts. |