comparison src/process.h @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children 11054d720c21
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
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 INCLUDED_process_h_ 21 #ifndef _XEMACS_PROCESS_H_
22 #define INCLUDED_process_h_ 22 #define _XEMACS_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
35 #define init_xemacs_process() 0 35 #define init_xemacs_process() 0
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 /* struct Lisp_Process is defined in procimpl.h; only process-*.c need 40 /* Only process.c needs to know about the guts of this */
41 to know about the guts of it. */ 41 struct Lisp_Process;
42 42
43 DECLARE_LRECORD (process, Lisp_Process); 43 DECLARE_LRECORD (process, struct Lisp_Process);
44 #define XPROCESS(x) XRECORD (x, process, Lisp_Process) 44 #define XPROCESS(x) XRECORD (x, process, struct Lisp_Process)
45 #define XSETPROCESS(x, p) XSETRECORD (x, p, process) 45 #define XSETPROCESS(x, p) XSETRECORD (x, p, process)
46 #define PROCESSP(x) RECORDP (x, process) 46 #define PROCESSP(x) RECORDP (x, process)
47 #define GC_PROCESSP(x) GC_RECORDP (x, process)
47 #define CHECK_PROCESS(x) CHECK_RECORD (x, process) 48 #define CHECK_PROCESS(x) CHECK_RECORD (x, process)
48 #define PROCESS_LIVE_P(x) (!NILP ((x)->pipe_instream)) 49 #define PROCESS_LIVE_P(x) (!NILP (XPROCESS(x)->pipe_instream))
49
50 #define CHECK_LIVE_PROCESS(x) do { \
51 CHECK_PROCESS (x); \
52 if (! PROCESS_LIVE_P (XPROCESS (x))) \
53 dead_wrong_type_argument (Qprocess_live_p, (x)); \
54 } while (0)
55 50
56 #ifdef emacs 51 #ifdef emacs
57 52
58 EXFUN (Fprocess_kill_without_query, 2); 53 EXFUN (Fprocess_kill_without_query, 2);
59 EXFUN (Fprocess_id, 1); 54 EXFUN (Fprocess_id, 1);
60 55
61 Lisp_Object connect_to_file_descriptor (Lisp_Object name, 56 Lisp_Object connect_to_file_descriptor (Lisp_Object name,
62 Lisp_Object buffer, 57 Lisp_Object buffer,
63 Lisp_Object infd, 58 Lisp_Object infd,
64 Lisp_Object outfd); 59 Lisp_Object outfd);
65 int connected_via_filedesc_p (Lisp_Process *p); 60 int connected_via_filedesc_p (struct Lisp_Process *p);
66 void kill_buffer_processes (Lisp_Object buffer); 61 void kill_buffer_processes (Lisp_Object buffer);
67 void close_process_descs (void); 62 void close_process_descs (void);
68 63
69 void set_process_filter (Lisp_Object proc, 64 void set_process_filter (Lisp_Object proc,
70 Lisp_Object filter, int filter_does_read); 65 Lisp_Object filter, int filter_does_read);
72 /* True iff we are about to fork off a synchronous process or if we 67 /* True iff we are about to fork off a synchronous process or if we
73 are waiting for it. */ 68 are waiting for it. */
74 extern volatile int synch_process_alive; 69 extern volatile int synch_process_alive;
75 70
76 /* Nonzero => this is a string explaining death of synchronous subprocess. */ 71 /* Nonzero => this is a string explaining death of synchronous subprocess. */
77 extern const char *synch_process_death; 72 extern CONST char *synch_process_death;
78 73
79 /* If synch_process_death is zero, 74 /* If synch_process_death is zero,
80 this is exit code of synchronous subprocess. */ 75 this is exit code of synchronous subprocess. */
81 extern int synch_process_retcode; 76 extern int synch_process_retcode;
82 77
83 78
84 void update_process_status (Lisp_Object p, 79 void update_process_status (Lisp_Object p,
85 Lisp_Object status_symbol, 80 Lisp_Object status_symbol,
86 int exit_code, int core_dumped); 81 int exit_code, int core_dumped);
87 82
88 void get_process_streams (Lisp_Process *p, 83 void get_process_streams (struct Lisp_Process *p,
89 Lisp_Object *instr, Lisp_Object *outstr); 84 Lisp_Object *instr, Lisp_Object *outstr);
90 int get_process_selected_p (Lisp_Process *p); 85 int get_process_selected_p (struct Lisp_Process *p);
91 void set_process_selected_p (Lisp_Process *p, int selected_p); 86 void set_process_selected_p (struct Lisp_Process *p, int selected_p);
92 87
93 Lisp_Process *get_process_from_usid (USID usid); 88 struct Lisp_Process *get_process_from_usid (USID usid);
94 89
95 #ifdef HAVE_SOCKETS 90 #ifdef HAVE_SOCKETS
96 int network_connection_p (Lisp_Object process); 91 int network_connection_p (Lisp_Object process);
97 #else 92 #else
98 #define network_connection_p(x) 0 93 #define network_connection_p(x) 0
99 #endif 94 #endif
100 95
101 extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcp, Qudp; 96 extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcpip;
102 extern Lisp_Object Vprocess_connection_type, Vprocess_list; 97 extern Lisp_Object Vprocess_connection_type, Vprocess_list;
103 98
104 /* Report all recent events of a change in process status 99 /* Report all recent events of a change in process status
105 (either run the sentinel or output a message). 100 (either run the sentinel or output a message).
106 This is done while Emacs is waiting for keyboard input. */ 101 This is done while Emacs is waiting for keyboard input. */
107 void status_notify (void); 102 void status_notify (void);
108 void kick_status_notify (void); 103 void kick_status_notify (void);
109 104
110 void deactivate_process (Lisp_Object proc); 105 void deactivate_process (Lisp_Object proc);
111 106
112 #ifdef WIN32_NATIVE 107 #ifdef WINDOWSNT
113 int 108 int
114 #else 109 #else
115 void 110 void
116 #endif 111 #endif
117 child_setup (int in, int out, int err, 112 child_setup (int in, int out, int err,
118 char **new_argv, const char *current_dir); 113 char **new_argv, CONST char *current_dir);
119 114
120 Charcount read_process_output (Lisp_Object proc); 115 Charcount read_process_output (Lisp_Object proc);
121 116
122 const char *signal_name (int signum); 117 CONST char *signal_name (int signum);
123 118
124 Lisp_Object canonicalize_host_name (Lisp_Object host); 119 Lisp_Object canonicalize_host_name (Lisp_Object host);
125 120
126 #endif /* not NO_SUBPROCESSES */ 121 #endif /* not NO_SUBPROCESSES */
127 122
137 #define EXEC_SUFFIXES "" 132 #define EXEC_SUFFIXES ""
138 #endif 133 #endif
139 134
140 #endif /* emacs */ 135 #endif /* emacs */
141 136
142 #ifdef HAVE_GETPT 137 #endif /* _XEMACS_PROCESS_H_ */
143 #define PTY_ITERATION
144 #define PTY_OPEN \
145 if ((fd = getpt()) < 0 || grantpt (fd) < 0 || unlockpt (fd) < 0) \
146 return -1;
147 #define PTY_NAME_SPRINTF
148 #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ptsname (fd));
149 #endif
150
151 #endif /* INCLUDED_process_h_ */