annotate src/systty.h @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 74fd4e045ea6
children 697ef44129c6
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
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
23 #ifndef INCLUDED_systty_h_
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
24 #define INCLUDED_systty_h_
0
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
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
56 #ifdef HAVE_UNISTD_H
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
57 #include <unistd.h>
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
58 #endif
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
59
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 /* 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
61 there. Since TERMIO is backward-compatibility stuff if both it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 and TERMIOS exist, it's more likely to be broken. */
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 (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 /***** (1) The TERMIOS way (POSIX style) *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 # if defined (_AIX) && defined (_I386)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 # include <termios.h> /* termios.h needs to be before termio.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 # if !defined (NO_TERMIO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 # include <termios.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 # endif /* _AIX && _I386 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 # ifndef INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 # define INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 # include <fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 #elif defined (HAVE_TERMIO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /***** (2) The TERMIO way (system V style) *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 # ifdef __DGUX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 # include <sys/ioctl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # ifndef NO_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 # include <termio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 # endif /* not NO_TERMIO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 # ifndef INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 # define INCLUDED_FCNTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 # include <fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
97 #elif defined (WIN32_NATIVE)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
99 /***** (3) The WIN32_NATIVE way *****/
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 /* Nothing doing */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 203
diff changeset
103 #else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 /***** (4) The BSD way *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 # ifdef linux /* XEmacs addition -- necessary? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 # include <bsd/sgtty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 # include <sgtty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 203
diff changeset
114 #endif /* HAVE_TERMIOS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 /* XEmacs: I don't think we need the following crap. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #ifdef __GNU_LIBRARY__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #include <termios.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 /* Formerly there was a conditional that included sys/filio.h if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 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
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /* Generally useful to include this file: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 /* But Sun OS has broken include files and doesn't want it included */
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
127 #if !defined (WIN32_NATIVE) && !defined (SUNOS4)
0
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 /* UNIPLUS systems may have FIONREAD. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 #ifdef UNIPLUS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 #include <sys.ioctl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 #endif
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 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 /* miscellaneous includes */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 #ifdef AIXHFT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 /* Get files for keyboard remapping */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 #define HFNKEYS 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 #include <sys/hft.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 #include <sys/devinfo.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 /* XEmacs: We don't support BSD 4.1 any more */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #ifdef NEED_BSDTTY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 #include <sys/bsdtty.h>
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 209
diff changeset
151 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 /* Include files for PTY's */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #if defined (HPUX) && defined (HAVE_PTYS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #include <sys/ptyio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #endif
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 AIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #include <sys/pty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #endif /* AIX */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 #ifdef SYSV_PTYS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 # include <sys/types.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 # include <sys/tty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 # ifdef titan
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 # include <sys/ttyhw.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 # include <sys/stream.h>
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 # ifndef NO_PTY_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 # include <sys/pty.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 /* XEmacs: removed some random if defined (pfa) crap for FASYNC (SIGIO).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 We've cleaned SIGIO up. */
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 /* inhibiting particular features */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
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 /* On TERMIOS systems, the tcmumbleattr calls take care of these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 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
198 tty hang for a long time). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #define HAVE_LTCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 #define HAVE_TCHARS
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 /* disabling terminal functions */
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 /* Try to establish the correct character to disable terminal functions
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
213 in a system-independent manner.
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
214 We use the POSIX standard way to do this, and emulate on other systems. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
216 #ifndef _POSIX_VDISABLE
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
217 # if defined CDEL
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
218 # define _POSIX_VDISABLE CDEL
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
219 # else
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
220 # define _POSIX_VDISABLE 255
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
221 # endif
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
222 #endif /* ! _POSIX_VDISABLE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 /* Get the number of characters queued for output */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 /* ----------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 /* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 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
231 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
232 otherwise. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 #ifdef TIOCOUTQ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 #define EMACS_OUTQSIZE(fd, size) ioctl (fd, TIOCOUTQ, size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 #ifdef TCOUTQ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 #undef EMACS_OUTQSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 #define EMACS_OUTQSIZE(fd, size) ioctl (fd, TCOUTQ, size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 #endif
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 /* -------------------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 /* Manipulate a terminal's current (foreground) process group */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 /* -------------------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 /* 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
250 controlling process group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 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
253 current process group. Return -1 if there is an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 current process group to *PGID. Return -1 if there is an error. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 /* HPUX tty process group stuff doesn't work, says the anonymous voice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 from the past. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 /* But HPUX people say it does, so I've removed it. --ben */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 # ifdef TIOCGPGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 # define EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 # ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 # define EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 #ifdef EMACS_HAVE_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 #if defined (HAVE_TERMIOS) && ! defined (BSD_TERMIOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 /* Resist the urge to insert needless extra parentheses. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 #define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp (fd))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 #define EMACS_SET_TTY_PGRP(fd, pgid) tcsetpgrp (fd, *(pgid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 #elif defined (TIOCSPGRP)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 #define EMACS_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 #define EMACS_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 #endif /* EMACS_HAVE_TTY_PGRP */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 #ifndef EMACS_GET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 /* Just ignore this for now and hope for the best */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 #define EMACS_GET_TTY_PGRP(fd, pgid) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 #define EMACS_SET_TTY_PGRP(fd, pgif) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 /* XEmacs interim backward-compatibility */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 #define EMACS_GET_TTY_PROCESS_GROUP EMACS_GET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 #define EMACS_SET_TTY_PROCESS_GROUP EMACS_SET_TTY_PGRP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 /* EMACS_GETPGRP (arg) returns the process group of the terminal. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
300 #ifdef GETPGRP_VOID
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
301 #define EMACS_GETPGRP(x) getpgrp()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 #else
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
303 #define EMACS_GETPGRP(x) getpgrp(x)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 0
diff changeset
304 #endif /* GETPGRP_VOID */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 /* XEmacs backward-compatibility. Is 0 always a reasonable argument? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 #define EMACS_GET_PROCESS_GROUP() EMACS_GETPGRP (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 175
diff changeset
309 /* XEmacs addition? */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 /* EMACS_SEPARATE_PROCESS_GROUP () creates a separate process group for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 running process. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 /* EMACS_SET_PROCESS_GROUP () sets our process group as specified. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 /* POSIX calls for setpgid(), so we use it if it's available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 Otherwise use setpgrp(), in USG or BSD flavor. Note that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 on newer systems, setpgrp() has unwanted effects (e.g.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 creating a new session), so we want to avoid its use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 if possible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 NOTE: On some older systems, we should consider using setpgrp2()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 if it exists. This is sufficiently rare, though, that there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 seems no point in autodetecting it. Currently dgux.h is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 only place where this has to be munged. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 #if defined (HAVE_SETPGID)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 # define EMACS_SEPARATE_PROCESS_GROUP() setpgid (0, 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 # define EMACS_SET_PROCESS_GROUP(pg) setpgid (0, pg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 #elif defined (USG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 /* old (pre-SVR4) USG's don't provide any way to do this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 No big loss -- it just means that ^Z won't work right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 if we're run from sh. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 # define EMACS_SET_PROCESS_GROUP(pg)
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
336 #elif defined(MINGW)
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
337 # define EMACS_SEPARATE_PROCESS_GROUP()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 /* Under NeXTstep, a process group of 0 is not the same as specifying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 your own process ID, so we go ahead and specify it explicitly. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp (0, getpid ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 # define EMACS_SET_PROCESS_GROUP(pg) setpgrp (0, pg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 /* Manipulate a TTY's input/output processing parameters */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 /* struct emacs_tty is a structure used to hold the current tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 parameters. If the terminal has several structures describing its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 state, for example a struct tchars, a struct sgttyb, a struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 tchars, a struct ltchars, and a struct pagechars, struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 emacs_tty should contain an element for each parameter struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 that Emacs may change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
357 emacs_get_tty (int FD, struct emacs_tty *P) stores the parameters
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 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
359 into an error we couldn't deal with.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
361 emacs_set_tty (int FD, struct emacs_tty *P, int flushp)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 sets the parameters of the tty on FD according to the contents of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 *P. If flushp is non-zero, we discard queued input to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 written before making the change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 Return 0 if all went well, and -1 if anything failed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 expands tabs to spaces upon output; in that case, there is no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 advantage to using tabs over spaces. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 /* For each tty parameter structure that Emacs might want to save and restore,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 - include an element for it in this structure, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 - 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
375 new members. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 struct emacs_tty {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 /* There is always one of the following elements, so there is no need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 for dummy get and set definitions. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 #ifdef HAVE_TCATTR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 struct termios main;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
383 #else /* !HAVE_TCATTR */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 struct termio main;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
386 #else /* !HAVE_TERMIO */
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
387 #ifdef WIN32_NATIVE
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 int main;
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
389 #else /* not WIN32_NATIVE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 struct sgttyb main;
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
391 #endif /* not WIN32_NATIVE */
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
392 #endif /* !HAVE_TERMIO */
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
393 #endif /* !HAVE_TCATTR */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 /* 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
396 by the tc*attr calls. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 #ifndef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 #ifdef HAVE_LTCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 struct ltchars ltchars;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
400 #endif /* HAVE_LTCHARS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 #ifdef HAVE_TCHARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 struct tchars tchars;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 int lmode;
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
405 #endif /* HAVE_TCHARS */
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
406 #endif /* HAVE_TERMIOS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
409 int emacs_get_tty (int fd, struct emacs_tty *settings);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
410 int emacs_set_tty (int fd, struct emacs_tty *settings, int flushp);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411
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_TTY_TABS_OK */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 /* --------------------------------------------------------- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 #ifdef HAVE_TERMIOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 #ifdef TABDLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 #define EMACS_TTY_TABS_OK(p) 1
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
423 #endif /* TABDLY */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 #else /* not def HAVE_TERMIOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 #ifdef HAVE_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
431 #ifdef WIN32_NATIVE
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 #define EMACS_TTY_TABS_OK(p) 0
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
433 #else /* not WIN32_NATIVE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS)
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
435 #endif /* not WIN32_NATIVE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 #endif /* not def HAVE_TERMIO */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 #endif /* not def HAVE_TERMIOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
440 #endif /* INCLUDED_systty_h_ */