annotate src/procimpl.h @ 5627:37fb945697f5

text_width_single_run cleanup. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2011-12-28 Didier Verna <didier@xemacs.org> * redisplay-xlike-inc.c (XLIKE_text_width_single_run): Get only what's needed as argument: an XLIKE_DISPLAY instead of a frame pointer. * redisplay-xlike-inc.c (XLIKE_text_width): * redisplay-xlike-inc.c (XLIKE_output_string): Update accordingly. Use the generic XLIKE_ name instead of the specific x_ one.
author Didier Verna <didier@xemacs.org>
date Wed, 28 Dec 2011 10:53:38 +0100
parents 308d34e9f07d
children a216b3c2b09e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Processes implementation header
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc.
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
3 Copyright (C) 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5127
diff changeset
7 XEmacs is free software: you can redistribute it and/or modify it
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5127
diff changeset
9 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5127
diff changeset
10 option) any later version.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5127
diff changeset
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1111
diff changeset
20 /* Synched up with: ????. Split out of process.h. */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1111
diff changeset
21
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* This file must be only included by the process implementation files:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 process-unix.c, process-msw.c etc. The Lisp_Process structure and other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 contents of this file is not exported to the rest of the world */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
26 #ifndef INCLUDED_procimpl_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
27 #define INCLUDED_procimpl_h_
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 * Structure which keeps methods of the process implementation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 * There is only one object of this class exists in a particular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 * XEmacs implementation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 /* #### Comment me... */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 struct process_methods
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
39 void (*print_process_data) (Lisp_Process *proc, Lisp_Object printcharfun);
5124
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
40 void (*finalize_process_data) (Lisp_Process *proc);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
41 void (*alloc_process_data) (Lisp_Process *p);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
42 void (*init_process_io_handles) (Lisp_Process *p,
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
43 void* in, void* out, void *err, int flags);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
44 int (*create_process) (Lisp_Process *p,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 Lisp_Object *argv, int nargv,
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
46 Lisp_Object program, Lisp_Object cur_dir,
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
47 int separate_err);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
48 int (*tooltalk_connection_p) (Lisp_Process *p);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 #ifdef HAVE_SOCKETS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 void (*open_network_stream) (Lisp_Object name, Lisp_Object host,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 Lisp_Object service, Lisp_Object protocol,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 void** vinfd, void** voutfd);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 #ifdef HAVE_MULTICAST
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 void (*open_multicast_group) (Lisp_Object name, Lisp_Object dest,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 Lisp_Object port, Lisp_Object ttl,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 void** vinfd, void** voutfd);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 #endif /* HAVE_MULTICAST */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 #endif /* HAVE_SOCKETS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Lisp_Object (*canonicalize_host_name) (Lisp_Object host);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
60 int (*set_window_size) (Lisp_Process* p, int height, int width);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 void (*send_process) (Lisp_Object proc, struct lstream* lstream);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 void (*reap_exited_processes) (void);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
63 void (*update_status_if_terminated) (Lisp_Process* p);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 void (*kill_child_process) (Lisp_Object proc, int signo,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 int current_group, int nomsg);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 int (*kill_process_by_pid) (int pid, int sigcode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 int (*process_send_eof) (Lisp_Object proc);
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
68 void (*deactivate_process) (Lisp_Process *p,
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
69 USID* in_usid,
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
70 USID* err_usid);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 void (*init_process) (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 extern struct process_methods the_process_methods;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 * Accessors for process_methods
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 #define HAS_PROCMETH_P(name) (the_process_methods.name != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 #define PROCMETH(name, par) ((the_process_methods.name) par)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 #define PROCMETH_OR_GIVEN(name, par, given) (HAS_PROCMETH_P(name) ? PROCMETH(name, par) : (given))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 #define MAYBE_PROCMETH(name, par) do { if (HAS_PROCMETH_P(name)) PROCMETH(name, par); } while (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 #define MAYBE_LISP_PROCMETH(name, par) PROCMETH_OR_GIVEN(name, par, Qnil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 #define MAYBE_INT_PROCMETH(name, par) PROCMETH_OR_GIVEN(name, par, 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 #define PROCESS_HAS_METHOD(os, name) the_process_methods.name = os##_##name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 * Structure records pertinent information about open channels.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 * There is one channel associated with each process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 struct Lisp_Process
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 {
5127
a9c41067dd88 more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents: 5124
diff changeset
95 NORMAL_LISP_OBJECT_HEADER header;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 /* Exit code if process has terminated,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 signal which stopped/interrupted process
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 or 0 if process is running */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 int exit_code;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 /* Non-false if process has exited and "dumped core" on its way down */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 char core_dumped;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
2297
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 1204
diff changeset
104 /* #### Is this field unused? */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 /* if this flag is not NIL, then filter will do the read on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 channel, rather than having a call to make_string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 This only works if the filter is a subr. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 char filter_does_read;
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
109 /* Non-zero means kill silently if Emacs is exited. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 char kill_without_query;
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
111 char in_selected, err_selected;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 /* Event-count of last event in which this process changed status. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 volatile int tick;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 /* Event-count of last such event reported. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 int update_tick;
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
116 /* Non-zero if stderr and stdout are separated. */
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
117 char separate_stderr;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1111
diff changeset
119 #define MARKED_SLOT(x) Lisp_Object x;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1111
diff changeset
120 #include "process-slots.h"
934
c925bacdda60 [xemacs-hg @ 2002-07-29 09:21:12 by michaels]
michaels
parents: 867
diff changeset
121
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 /* Implementation dependent data */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 void *process_data;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 /* Macros to refer to data connection streams */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 #define DATA_INSTREAM(p) (p)->coding_instream
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 #define DATA_OUTSTREAM(p) (p)->coding_outstream
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
129 #define DATA_ERRSTREAM(p) (p)->coding_errstream
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 /* Random externs from process.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 extern Lisp_Object Qrun, Qstop, Qopen, Qclosed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 extern Lisp_Object Qtcp, Qudp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 extern Lisp_Object Vprocess_connection_type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 extern Lisp_Object Vprocess_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 extern struct hash_table *usid_to_process;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 extern volatile int process_tick;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 extern int windowed_process_io;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 #ifdef PROCESS_IO_BLOCKING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 extern Lisp_Object network_stream_blocking_port_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 #endif /* PROCESS_IO_BLOCKING */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 Lisp_Object make_process_internal (Lisp_Object name);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
148 void init_process_io_handles (Lisp_Process *p, void* in,
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 771
diff changeset
149 void* out, void *err, int flags);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 void send_process (Lisp_Object proc,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 Lisp_Object relocatable,
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 853
diff changeset
152 const Ibyte *nonrelocatable,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 int start, int len);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
155 #endif /* INCLUDED_procimpl_h_ */