Mercurial > hg > xemacs-beta
comparison src/process.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | cc15677e0335 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
44 #include "insdel.h" | 44 #include "insdel.h" |
45 #include "lstream.h" | 45 #include "lstream.h" |
46 #include "opaque.h" | 46 #include "opaque.h" |
47 #include "process.h" | 47 #include "process.h" |
48 #include "procimpl.h" | 48 #include "procimpl.h" |
49 #include "sysdep.h" | |
50 #include "window.h" | 49 #include "window.h" |
51 #ifdef FILE_CODING | 50 #ifdef FILE_CODING |
52 #include "file-coding.h" | 51 #include "file-coding.h" |
53 #endif | 52 #endif |
54 | 53 |
98 static int update_tick; | 97 static int update_tick; |
99 | 98 |
100 /* Nonzero means delete a process right away if it exits. */ | 99 /* Nonzero means delete a process right away if it exits. */ |
101 int delete_exited_processes; | 100 int delete_exited_processes; |
102 | 101 |
103 /* Hashtable which maps USIDs as returned by create_stream_pair_cb to | 102 /* Hash table which maps USIDs as returned by create_stream_pair_cb to |
104 process objects. Processes are not GC-protected through this! */ | 103 process objects. Processes are not GC-protected through this! */ |
105 c_hashtable usid_to_process; | 104 struct hash_table *usid_to_process; |
106 | 105 |
107 /* List of process objects. */ | 106 /* List of process objects. */ |
108 Lisp_Object Vprocess_list; | 107 Lisp_Object Vprocess_list; |
109 | 108 |
110 | 109 |
112 static Lisp_Object | 111 static Lisp_Object |
113 mark_process (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 112 mark_process (Lisp_Object obj, void (*markobj) (Lisp_Object)) |
114 { | 113 { |
115 struct Lisp_Process *proc = XPROCESS (obj); | 114 struct Lisp_Process *proc = XPROCESS (obj); |
116 MAYBE_PROCMETH (mark_process_data, (proc, markobj)); | 115 MAYBE_PROCMETH (mark_process_data, (proc, markobj)); |
117 ((markobj) (proc->name)); | 116 markobj (proc->name); |
118 ((markobj) (proc->command)); | 117 markobj (proc->command); |
119 ((markobj) (proc->filter)); | 118 markobj (proc->filter); |
120 ((markobj) (proc->sentinel)); | 119 markobj (proc->sentinel); |
121 ((markobj) (proc->buffer)); | 120 markobj (proc->buffer); |
122 ((markobj) (proc->mark)); | 121 markobj (proc->mark); |
123 ((markobj) (proc->pid)); | 122 markobj (proc->pid); |
124 ((markobj) (proc->pipe_instream)); | 123 markobj (proc->pipe_instream); |
125 ((markobj) (proc->pipe_outstream)); | 124 markobj (proc->pipe_outstream); |
126 #ifdef FILE_CODING | 125 #ifdef FILE_CODING |
127 ((markobj) (proc->coding_instream)); | 126 markobj (proc->coding_instream); |
128 ((markobj) (proc->coding_outstream)); | 127 markobj (proc->coding_outstream); |
129 #endif | 128 #endif |
130 return proc->status_symbol; | 129 return proc->status_symbol; |
131 } | 130 } |
132 | 131 |
133 static void | 132 static void |
190 /************************************************************************/ | 189 /************************************************************************/ |
191 /* basic process accessors */ | 190 /* basic process accessors */ |
192 /************************************************************************/ | 191 /************************************************************************/ |
193 | 192 |
194 /* Under FILE_CODING, this function returns low-level streams, connected | 193 /* Under FILE_CODING, this function returns low-level streams, connected |
195 directrly to the child process, rather than en/decoding FILE_CODING | 194 directly to the child process, rather than en/decoding FILE_CODING |
196 streams */ | 195 streams */ |
197 void | 196 void |
198 get_process_streams (struct Lisp_Process *p, | 197 get_process_streams (struct Lisp_Process *p, |
199 Lisp_Object *instr, Lisp_Object *outstr) | 198 Lisp_Object *instr, Lisp_Object *outstr) |
200 { | 199 { |
355 error ("Buffer %s has no process", XSTRING_DATA (XBUFFER(obj)->name)); | 354 error ("Buffer %s has no process", XSTRING_DATA (XBUFFER(obj)->name)); |
356 } | 355 } |
357 else | 356 else |
358 { | 357 { |
359 /* #### This was commented out. Although, simple | 358 /* #### This was commented out. Although, simple |
360 (kill-process 7 "qqq") resulted in a falat error. - kkm */ | 359 (kill-process 7 "qqq") resulted in a fatal error. - kkm */ |
361 CHECK_PROCESS (obj); | 360 CHECK_PROCESS (obj); |
362 proc = obj; | 361 proc = obj; |
363 } | 362 } |
364 return proc; | 363 return proc; |
365 } | 364 } |
641 | 640 |
642 It must accept a property list describing the connection. The current | 641 It must accept a property list describing the connection. The current |
643 functions must then go to lisp and provide a suitable list for the | 642 functions must then go to lisp and provide a suitable list for the |
644 generalized connection function. | 643 generalized connection function. |
645 | 644 |
646 Both UNIX ans Win32 support BSD sockets, and there are many extensions | 645 Both UNIX and Win32 support BSD sockets, and there are many extensions |
647 availalble (Sockets 2 spec). | 646 available (Sockets 2 spec). |
648 | 647 |
649 A todo is define a consistent set of properties abstracting a | 648 A todo is define a consistent set of properties abstracting a |
650 network connection. -kkm | 649 network connection. -kkm |
651 */ | 650 */ |
652 | 651 |
895 old_begv += nchars; | 894 old_begv += nchars; |
896 if (BUF_PT (buf) <= old_zv) | 895 if (BUF_PT (buf) <= old_zv) |
897 old_zv += nchars; | 896 old_zv += nchars; |
898 | 897 |
899 #if 0 | 898 #if 0 |
900 /* This screws up intial display of the window. jla */ | 899 /* This screws up initial display of the window. jla */ |
901 | 900 |
902 /* Insert before markers in case we are inserting where | 901 /* Insert before markers in case we are inserting where |
903 the buffer's mark is, and the user's next command is Meta-y. */ | 902 the buffer's mark is, and the user's next command is Meta-y. */ |
904 buffer_insert_raw_string_1 (buf, -1, chars, | 903 buffer_insert_raw_string_1 (buf, -1, chars, |
905 nbytes, INSDEL_BEFORE_MARKERS); | 904 nbytes, INSDEL_BEFORE_MARKERS); |
1741 #endif | 1740 #endif |
1742 #ifdef SIGUNUSED | 1741 #ifdef SIGUNUSED |
1743 handle_signal (SIGUNUSED); | 1742 handle_signal (SIGUNUSED); |
1744 #endif | 1743 #endif |
1745 #ifdef SIGDANGER | 1744 #ifdef SIGDANGER |
1746 handle_signal (SIGDANGER); | 1745 handle_signal (SIGDANGER); /* AIX */ |
1747 #endif | 1746 #endif |
1748 #ifdef SIGMSG | 1747 #ifdef SIGMSG |
1749 handle_signal (SIGMSG); | 1748 handle_signal (SIGMSG); |
1750 #endif | 1749 #endif |
1751 #ifdef SIGSOUND | 1750 #ifdef SIGSOUND |
1944 init_xemacs_process (void) | 1943 init_xemacs_process (void) |
1945 { | 1944 { |
1946 MAYBE_PROCMETH (init_process, ()); | 1945 MAYBE_PROCMETH (init_process, ()); |
1947 | 1946 |
1948 Vprocess_list = Qnil; | 1947 Vprocess_list = Qnil; |
1949 usid_to_process = make_hashtable (32); | 1948 |
1949 if (usid_to_process) | |
1950 clrhash (usid_to_process); | |
1951 else | |
1952 usid_to_process = make_hash_table (32); | |
1950 } | 1953 } |
1951 | 1954 |
1952 #if 0 | 1955 #if 0 |
1953 | 1956 |
1954 xxDEFUN ("process-connection", Fprocess_connection, 0, 1, 0, /* | 1957 xxDEFUN ("process-connection", Fprocess_connection, 0, 1, 0, /* |
2052 The value takes effect when `start-process' is called. | 2055 The value takes effect when `start-process' is called. |
2053 */ ); | 2056 */ ); |
2054 Vprocess_connection_type = Qt; | 2057 Vprocess_connection_type = Qt; |
2055 | 2058 |
2056 DEFVAR_BOOL ("windowed-process-io", &windowed_process_io /* | 2059 DEFVAR_BOOL ("windowed-process-io", &windowed_process_io /* |
2057 Enables input/ouptut on standard handles of a windowed process. | 2060 Enables input/output on standard handles of a windowed process. |
2058 When this variable is nil (the default), XEmacs does not attempt to read | 2061 When this variable is nil (the default), XEmacs does not attempt to read |
2059 standard output handle of a windowed process. Instead, the process is | 2062 standard output handle of a windowed process. Instead, the process is |
2060 immediately marked as exited immediately upon successful launching. This is | 2063 immediately marked as exited immediately upon successful launching. This is |
2061 done because normal windowed processes do not use stadnard I/O, as they are | 2064 done because normal windowed processes do not use standard I/O, as they are |
2062 not connected to any console. | 2065 not connected to any console. |
2063 | 2066 |
2064 When launching a specially crafted windowed process, which expects to be | 2067 When launching a specially crafted windowed process, which expects to be |
2065 launched by XEmacs, or by other program which pipes its standard input and | 2068 launched by XEmacs, or by other program which pipes its standard input and |
2066 output, this variable must be set to non-nil, in which case XEmacs will | 2069 output, this variable must be set to non-nil, in which case XEmacs will |