annotate src/systty.h @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 41ff10fd062f
children 8626e4521993
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* systty.h - System-dependent definitions for terminals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: FSF 19.30. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #ifndef _XEMACS_SYSTTY_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #define _XEMACS_SYSTTY_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 # define HAVE_TCATTR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 /* If we defined these before and we are about to redefine them,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 prevent alarming warnings. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #ifdef BSD_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #undef NL0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #undef NL1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #undef CR0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #undef CR1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #undef CR2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #undef CR3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #undef TAB0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #undef TAB1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #undef TAB2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #undef XTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #undef BS0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #undef BS1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #undef FF0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #undef FF1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #undef ECHO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #undef NOFLSH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #undef TOSTOP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #undef FLUSHO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #undef PENDIN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 /* Include the proper files. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 /* XEmacs: TERMIOS is mo' better than TERMIO so we use it if it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 there. Since TERMIO is backward-compatibility stuff if both it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 and TERMIOS exist, it's more likely to be broken. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #if defined (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 /***** (1) The TERMIOS way (POSIX style) *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 # if defined (_AIX) && defined (_I386)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 # include <termios.h> /* termios.h needs to be before termio.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 # if !defined (NO_TERMIO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 # include <termios.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 # endif /* _AIX && _I386 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 # ifndef INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 # define INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 # include <fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #elif defined (HAVE_TERMIO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 /***** (2) The TERMIO way (system V style) *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 # ifdef __DGUX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 # include <sys/ioctl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 # ifndef NO_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 # endif /* not NO_TERMIO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 # ifndef INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # define INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 # include <fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 #elif defined (DOS_NT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 /***** (3) The MSDOS/NT way *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 /* Nothing doing */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 203
diff changeset
99 #else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 /***** (4) The BSD way *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 # ifdef linux /* XEmacs addition -- necessary? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 # include <bsd/sgtty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 # include <sgtty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 203
diff changeset
110 #endif /* HAVE_TERMIOS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 /* XEmacs: I don't think we need the following crap. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #ifdef __GNU_LIBRARY__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #include <termios.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 /* Formerly there was a conditional that included sys/filio.h if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 USG5_4 was defined, but this is already included in s/usg5-4.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 /* Generally useful to include this file: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 /* But Sun OS has broken include files and doesn't want it included */
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 203
diff changeset
123 #if !defined (DOS_NT) && !defined (WIN32) && !defined (SUNOS4)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 # include <sys/ioctl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 /* UNIPLUS systems may have FIONREAD. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 #ifdef UNIPLUS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 #include <sys.ioctl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 /* miscellaneous includes */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 #ifdef AIXHFT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 /* Get files for keyboard remapping */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 #define HFNKEYS 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #include <sys/hft.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 #include <sys/devinfo.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 /* XEmacs: We don't support BSD 4.1 any more */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 #ifdef NEED_BSDTTY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 #include <sys/bsdtty.h>
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 209
diff changeset
147 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 /* Include files for PTY's */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #if defined (HPUX) && defined (HAVE_PTYS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 #include <sys/ptyio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #ifdef AIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #include <sys/pty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #endif /* AIX */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #ifdef SYSV_PTYS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 # include <sys/types.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 # include <sys/tty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 # ifdef titan
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 # include <sys/ttyhw.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 # include <sys/stream.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 # ifndef NO_PTY_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 # include <sys/pty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 /* XEmacs: removed some random if defined (pfa) crap for FASYNC (SIGIO).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 We've cleaned SIGIO up. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 /* inhibiting particular features */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 #ifdef APOLLO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 #undef TIOCSTART
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 #if defined (XENIX) || defined (BROKEN_TIOCGETC)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #undef TIOCGETC /* Avoid confusing some conditionals that test this. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 /* XEmacs: SIGIO is cleaned up so we remove the crap here that messes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 with it (and FIONREAD and FASYNC, which are related). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 #ifdef BROKEN_TIOCGWINSZ /* XEmacs addition */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 #undef TIOCGWINSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 #undef TIOCSWINSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 #ifdef BROKEN_O_NONBLOCK /* XEmacs addition */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 # undef O_NONBLOCK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #endif /* BROKEN_O_NONBLOCK */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 /* On TERMIOS systems, the tcmumbleattr calls take care of these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 parameters, and it's a bad idea to use them (on AIX, it makes the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 tty hang for a long time). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 #define HAVE_LTCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #define HAVE_TCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 /* disabling terminal functions */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 /* Try to establish the correct character to disable terminal functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 in a system-independent manner. Note that USG (at least) define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 _POSIX_VDISABLE as 0! */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 #ifdef _POSIX_VDISABLE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #define CDISABLE _POSIX_VDISABLE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 #else /* not _POSIX_VDISABLE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 #ifdef CDEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 #undef CDISABLE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 #define CDISABLE CDEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 #else /* not CDEL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 #define CDISABLE 255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 #endif /* not CDEL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 #endif /* not _POSIX_VDISABLE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 /* Get the number of characters queued for output */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 /* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 queued for output to the terminal FD in *SIZE, if FD is a tty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 Returns -1 if there was an error (i.e. FD is not a tty), 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 otherwise. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 #ifdef TIOCOUTQ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 #define EMACS_OUTQSIZE(fd, size) ioctl (fd, TIOCOUTQ, size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 #ifdef TCOUTQ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 #undef EMACS_OUTQSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 #define EMACS_OUTQSIZE(fd, size) ioctl (fd, TCOUTQ, size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 /* -------------------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 /* Manipulate a terminal's current (foreground) process group */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 /* -------------------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 /* EMACS_HAVE_TTY_PGRP is true if we can get and set the tty's current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 controlling process group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 current process group. Return -1 if there is an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 current process group to *PGID. Return -1 if there is an error. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 /* HPUX tty process group stuff doesn't work, says the anonymous voice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 from the past. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 /* But HPUX people say it does, so I've removed it. --ben */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 # ifdef TIOCGPGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 # define EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 # ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 # define EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 #ifdef EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 #if defined (HAVE_TERMIOS) && ! defined (BSD_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 /* Resist the urge to insert needless extra parentheses. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 #define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp (fd))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 #define EMACS_SET_TTY_PGRP(fd, pgid) tcsetpgrp (fd, *(pgid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 #elif defined (TIOCSPGRP)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 #define EMACS_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 #define EMACS_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 #endif /* EMACS_HAVE_TTY_PGRP */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 #ifndef EMACS_GET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 /* Just ignore this for now and hope for the best */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 #define EMACS_GET_TTY_PGRP(fd, pgid) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 #define EMACS_SET_TTY_PGRP(fd, pgif) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 /* XEmacs interim backward-compatibility */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 #define EMACS_GET_TTY_PROCESS_GROUP EMACS_GET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 #define EMACS_SET_TTY_PROCESS_GROUP EMACS_SET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 /* EMACS_GETPGRP (arg) returns the process group of the terminal. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
307 #ifdef GETPGRP_VOID
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
308 #define EMACS_GETPGRP(x) getpgrp()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 #else
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
310 #define EMACS_GETPGRP(x) getpgrp(x)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
311 #endif /* GETPGRP_VOID */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 /* XEmacs backward-compatibility. Is 0 always a reasonable argument? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 #define EMACS_GET_PROCESS_GROUP() EMACS_GETPGRP (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 175
diff changeset
316 /* XEmacs addition? */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 /* EMACS_SEPARATE_PROCESS_GROUP () creates a separate process group for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 running process. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 /* EMACS_SET_PROCESS_GROUP () sets our process group as specified. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 /* POSIX calls for setpgid(), so we use it if it's available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 Otherwise use setpgrp(), in USG or BSD flavor. Note that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 on newer systems, setpgrp() has unwanted effects (e.g.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 creating a new session), so we want to avoid its use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 if possible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 NOTE: On some older systems, we should consider using setpgrp2()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 if it exists. This is sufficiently rare, though, that there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 seems no point in autodetecting it. Currently dgux.h is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 only place where this has to be munged. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 #if defined (HAVE_SETPGID)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 # define EMACS_SEPARATE_PROCESS_GROUP() setpgid (0, 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 # define EMACS_SET_PROCESS_GROUP(pg) setpgid (0, pg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 #elif defined (USG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 /* old (pre-SVR4) USG's don't provide any way to do this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 No big loss -- it just means that ^Z won't work right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 if we're run from sh. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 # define EMACS_SET_PROCESS_GROUP(pg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 /* Under NeXTstep, a process group of 0 is not the same as specifying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 your own process ID, so we go ahead and specify it explicitly. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp (0, getpid ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 # define EMACS_SET_PROCESS_GROUP(pg) setpgrp (0, pg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 /* Manipulate a TTY's input/output processing parameters */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 /* struct emacs_tty is a structure used to hold the current tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 parameters. If the terminal has several structures describing its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 state, for example a struct tchars, a struct sgttyb, a struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 tchars, a struct ltchars, and a struct pagechars, struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 emacs_tty should contain an element for each parameter struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 that Emacs may change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 of the tty on FD in *P. Return zero if all's well, or -1 if we ran
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 into an error we couldn't deal with.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 EMACS_SET_TTY (int FD, struct emacs_tty *P, int flushp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 sets the parameters of the tty on FD according to the contents of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 *P. If flushp is non-zero, we discard queued input to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 written before making the change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 Return 0 if all went well, and -1 if anything failed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 expands tabs to spaces upon output; in that case, there is no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 advantage to using tabs over spaces. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 /* For each tty parameter structure that Emacs might want to save and restore,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 - include an element for it in this structure, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 new members. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 struct emacs_tty {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 /* There is always one of the following elements, so there is no need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 for dummy get and set definitions. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 #ifdef HAVE_TCATTR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 struct termios main;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
388 #else /* !HAVE_TCATTR */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 struct termio main;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
391 #else /* !HAVE_TERMIO */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 #ifdef DOS_NT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 int main;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 #else /* not DOS_NT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 struct sgttyb main;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 #endif /* not DOS_NT */
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
397 #endif /* !HAVE_TERMIO */
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
398 #endif /* !HAVE_TCATTR */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 /* If we have TERMIOS, we don't need to do this - they're taken care of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 by the tc*attr calls. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 #ifndef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 #ifdef HAVE_LTCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 struct ltchars ltchars;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
405 #endif /* HAVE_LTCHARS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 #ifdef HAVE_TCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 struct tchars tchars;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 int lmode;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
410 #endif /* HAVE_TCHARS */
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
411 #endif /* HAVE_TERMIOS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 /* Define EMACS_GET_TTY and EMACS_SET_TTY,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 the macros for reading and setting parts of `struct emacs_tty'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 These got pretty unmanageable (huge macros are hard to debug), and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 finally needed some code which couldn't be done as part of an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 expression, so we moved them out to their own functions in sysdep.c. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 #define EMACS_GET_TTY(fd, p) emacs_get_tty (fd, p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 #define EMACS_SET_TTY(fd, p, waitp) emacs_set_tty (fd, p, waitp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 /* Define EMACS_TTY_TABS_OK */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 #ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 #ifdef TABDLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 #define EMACS_TTY_TABS_OK(p) 1
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
434 #endif /* TABDLY */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 #else /* not def HAVE_TERMIOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 #ifdef DOS_NT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 #define EMACS_TTY_TABS_OK(p) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 #else /* not DOS_NT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 #endif /* not DOS_NT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 #endif /* not def HAVE_TERMIO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 #endif /* not def HAVE_TERMIOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 #endif /* _XEMACS_SYSTTY_H_ */