comparison src/process.h @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents cc15677e0335
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to 17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 #ifndef _XEMACS_PROCESS_H_ 21 #ifndef INCLUDED_process_h_
22 #define _XEMACS_PROCESS_H_ 22 #define INCLUDED_process_h_
23 23
24 #if defined (NO_SUBPROCESSES) 24 #if defined (NO_SUBPROCESSES)
25 #undef XPROCESS 25 #undef XPROCESS
26 #undef CHECK_PROCESS 26 #undef CHECK_PROCESS
27 #undef XSETPROCESS 27 #undef XSETPROCESS
36 void wait_without_blocking (void); 36 void wait_without_blocking (void);
37 37
38 #else /* not NO_SUBPROCESSES */ 38 #else /* not NO_SUBPROCESSES */
39 39
40 /* Only process.c needs to know about the guts of this */ 40 /* Only process.c needs to know about the guts of this */
41 struct Lisp_Process;
42 41
43 DECLARE_LRECORD (process, struct Lisp_Process); 42 DECLARE_LRECORD (process, Lisp_Process);
44 #define XPROCESS(x) XRECORD (x, process, struct Lisp_Process) 43 #define XPROCESS(x) XRECORD (x, process, Lisp_Process)
45 #define XSETPROCESS(x, p) XSETRECORD (x, p, process) 44 #define XSETPROCESS(x, p) XSETRECORD (x, p, process)
46 #define PROCESSP(x) RECORDP (x, process) 45 #define PROCESSP(x) RECORDP (x, process)
47 #define GC_PROCESSP(x) GC_RECORDP (x, process)
48 #define CHECK_PROCESS(x) CHECK_RECORD (x, process) 46 #define CHECK_PROCESS(x) CHECK_RECORD (x, process)
49 #define PROCESS_LIVE_P(x) (!NILP (XPROCESS(x)->pipe_instream)) 47 #define PROCESS_LIVE_P(x) (!NILP ((x)->pipe_instream))
48
49 #define CHECK_LIVE_PROCESS(x) do { \
50 CHECK_PROCESS (x); \
51 if (! PROCESS_LIVE_P (XPROCESS (x))) \
52 dead_wrong_type_argument (Qprocess_live_p, (x)); \
53 } while (0)
50 54
51 #ifdef emacs 55 #ifdef emacs
52 56
53 EXFUN (Fprocess_kill_without_query, 2); 57 EXFUN (Fprocess_kill_without_query, 2);
54 EXFUN (Fprocess_id, 1); 58 EXFUN (Fprocess_id, 1);
55 59
56 Lisp_Object connect_to_file_descriptor (Lisp_Object name, 60 Lisp_Object connect_to_file_descriptor (Lisp_Object name,
57 Lisp_Object buffer, 61 Lisp_Object buffer,
58 Lisp_Object infd, 62 Lisp_Object infd,
59 Lisp_Object outfd); 63 Lisp_Object outfd);
60 int connected_via_filedesc_p (struct Lisp_Process *p); 64 int connected_via_filedesc_p (Lisp_Process *p);
61 void kill_buffer_processes (Lisp_Object buffer); 65 void kill_buffer_processes (Lisp_Object buffer);
62 void close_process_descs (void); 66 void close_process_descs (void);
63 67
64 void set_process_filter (Lisp_Object proc, 68 void set_process_filter (Lisp_Object proc,
65 Lisp_Object filter, int filter_does_read); 69 Lisp_Object filter, int filter_does_read);
67 /* True iff we are about to fork off a synchronous process or if we 71 /* True iff we are about to fork off a synchronous process or if we
68 are waiting for it. */ 72 are waiting for it. */
69 extern volatile int synch_process_alive; 73 extern volatile int synch_process_alive;
70 74
71 /* Nonzero => this is a string explaining death of synchronous subprocess. */ 75 /* Nonzero => this is a string explaining death of synchronous subprocess. */
72 extern CONST char *synch_process_death; 76 extern const char *synch_process_death;
73 77
74 /* If synch_process_death is zero, 78 /* If synch_process_death is zero,
75 this is exit code of synchronous subprocess. */ 79 this is exit code of synchronous subprocess. */
76 extern int synch_process_retcode; 80 extern int synch_process_retcode;
77 81
78 82
79 void update_process_status (Lisp_Object p, 83 void update_process_status (Lisp_Object p,
80 Lisp_Object status_symbol, 84 Lisp_Object status_symbol,
81 int exit_code, int core_dumped); 85 int exit_code, int core_dumped);
82 86
83 void get_process_streams (struct Lisp_Process *p, 87 void get_process_streams (Lisp_Process *p,
84 Lisp_Object *instr, Lisp_Object *outstr); 88 Lisp_Object *instr, Lisp_Object *outstr);
85 int get_process_selected_p (struct Lisp_Process *p); 89 int get_process_selected_p (Lisp_Process *p);
86 void set_process_selected_p (struct Lisp_Process *p, int selected_p); 90 void set_process_selected_p (Lisp_Process *p, int selected_p);
87 91
88 struct Lisp_Process *get_process_from_usid (USID usid); 92 Lisp_Process *get_process_from_usid (USID usid);
89 93
90 #ifdef HAVE_SOCKETS 94 #ifdef HAVE_SOCKETS
91 int network_connection_p (Lisp_Object process); 95 int network_connection_p (Lisp_Object process);
92 #else 96 #else
93 #define network_connection_p(x) 0 97 #define network_connection_p(x) 0
94 #endif 98 #endif
95 99
96 extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcpip; 100 extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcp, Qudp;
97 extern Lisp_Object Vprocess_connection_type, Vprocess_list; 101 extern Lisp_Object Vprocess_connection_type, Vprocess_list;
98 102
99 /* Report all recent events of a change in process status 103 /* Report all recent events of a change in process status
100 (either run the sentinel or output a message). 104 (either run the sentinel or output a message).
101 This is done while Emacs is waiting for keyboard input. */ 105 This is done while Emacs is waiting for keyboard input. */
108 int 112 int
109 #else 113 #else
110 void 114 void
111 #endif 115 #endif
112 child_setup (int in, int out, int err, 116 child_setup (int in, int out, int err,
113 char **new_argv, CONST char *current_dir); 117 char **new_argv, const char *current_dir);
114 118
115 Charcount read_process_output (Lisp_Object proc); 119 Charcount read_process_output (Lisp_Object proc);
116 120
117 CONST char *signal_name (int signum); 121 const char *signal_name (int signum);
118 122
119 Lisp_Object canonicalize_host_name (Lisp_Object host); 123 Lisp_Object canonicalize_host_name (Lisp_Object host);
120 124
121 #endif /* not NO_SUBPROCESSES */ 125 #endif /* not NO_SUBPROCESSES */
122 126
132 #define EXEC_SUFFIXES "" 136 #define EXEC_SUFFIXES ""
133 #endif 137 #endif
134 138
135 #endif /* emacs */ 139 #endif /* emacs */
136 140
137 #endif /* _XEMACS_PROCESS_H_ */ 141 #ifdef HAVE_GETPT
142 #define PTY_ITERATION
143 #define PTY_OPEN \
144 if ((fd = getpt()) < 0 || grantpt (fd) < 0 || unlockpt (fd) < 0) \
145 return -1;
146 #define PTY_NAME_SPRINTF
147 #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ptsname (fd));
148 #endif
149
150 #endif /* INCLUDED_process_h_ */