Synch with Linux 2.4.5:
[glibc.git] / sysdeps / unix / sysv / linux / powerpc / bits / termios.h
bloba445fa692b884e1a4ba708e88c09c24f30dc754b
1 /* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _TERMIOS_H
20 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
21 #endif
23 typedef unsigned char cc_t;
24 typedef unsigned int speed_t;
25 typedef unsigned int tcflag_t;
28 * termios type and macro definitions. Be careful about adding stuff
29 * to this file since it's used in GNU libc and there are strict rules
30 * concerning namespace pollution.
33 #define NCCS 32
34 struct termios {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline (== c_cc[19]) */
40 cc_t c_cc[NCCS]; /* control characters */
41 speed_t c_ispeed; /* input speed */
42 speed_t c_ospeed; /* output speed */
45 /* c_cc characters */
46 #define VINTR 0
47 #define VQUIT 1
48 #define VERASE 2
49 #define VKILL 3
50 #define VEOF 4
51 #define VMIN 5
52 #define VEOL 6
53 #define VTIME 7
54 #define VEOL2 8
55 #define VSWTC 9
57 #define VWERASE 10
58 #define VREPRINT 11
59 #define VSUSP 12
60 #define VSTART 13
61 #define VSTOP 14
62 #define VLNEXT 15
63 #define VDISCARD 16
65 /* c_iflag bits */
66 #define IGNBRK 0000001
67 #define BRKINT 0000002
68 #define IGNPAR 0000004
69 #define PARMRK 0000010
70 #define INPCK 0000020
71 #define ISTRIP 0000040
72 #define INLCR 0000100
73 #define IGNCR 0000200
74 #define ICRNL 0000400
75 #define IXON 0001000
76 #define IXOFF 0002000
77 #define IXANY 0004000
78 #define IUCLC 0010000
79 #define IMAXBEL 0020000
81 /* c_oflag bits */
82 #define OPOST 0000001
83 #define ONLCR 0000002
84 #define OLCUC 0000004
86 #define OCRNL 0000010
87 #define ONOCR 0000020
88 #define ONLRET 0000040
90 #define OFILL 00000100
91 #define OFDEL 00000200
92 #define NLDLY 00001400
93 #define NL0 00000000
94 #define NL1 00000400
95 #define NL2 00001000
96 #define NL3 00001400
97 #define TABDLY 00006000
98 #define TAB0 00000000
99 #define TAB1 00002000
100 #define TAB2 00004000
101 #define TAB3 00006000
102 #define CRDLY 00030000
103 #define CR0 00000000
104 #define CR1 00010000
105 #define CR2 00020000
106 #define CR3 00030000
107 #define FFDLY 00040000
108 #define FF0 00000000
109 #define FF1 00040000
110 #define BSDLY 00100000
111 #define BS0 00000000
112 #define BS1 00100000
113 #define VTDLY 00200000
114 #define VT0 00000000
115 #define VT1 00200000
116 #define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
118 /* c_cflag bit meaning */
119 #define CBAUD 0000377
120 #define B0 0000000 /* hang up */
121 #define B50 0000001
122 #define B75 0000002
123 #define B110 0000003
124 #define B134 0000004
125 #define B150 0000005
126 #define B200 0000006
127 #define B300 0000007
128 #define B600 0000010
129 #define B1200 0000011
130 #define B1800 0000012
131 #define B2400 0000013
132 #define B4800 0000014
133 #define B9600 0000015
134 #define B19200 0000016
135 #define B38400 0000017
136 #define EXTA B19200
137 #define EXTB B38400
138 #define CBAUDEX 0000020
139 #define B57600 00020
140 #define B115200 00021
141 #define B230400 00022
142 #define B460800 00023
143 #define B500000 00024
144 #define B576000 00025
145 #define B921600 00026
146 #define B1000000 00027
147 #define B1152000 00030
148 #define B1500000 00031
149 #define B2000000 00032
150 #define B2500000 00033
151 #define B3000000 00034
152 #define B3500000 00035
153 #define B4000000 00036
154 #define __MAX_BAUD B4000000
156 #define CSIZE 00001400
157 #define CS5 00000000
158 #define CS6 00000400
159 #define CS7 00001000
160 #define CS8 00001400
162 #define CSTOPB 00002000
163 #define CREAD 00004000
164 #define PARENB 00010000
165 #define PARODD 00020000
166 #define HUPCL 00040000
168 #define CLOCAL 00100000
169 #define CRTSCTS 020000000000 /* flow control */
171 /* c_lflag bits */
172 #define ISIG 0x00000080
173 #define ICANON 0x00000100
174 #define XCASE 0x00004000
175 #define ECHO 0x00000008
176 #define ECHOE 0x00000002
177 #define ECHOK 0x00000004
178 #define ECHONL 0x00000010
179 #define NOFLSH 0x80000000
180 #define TOSTOP 0x00400000
181 #define ECHOCTL 0x00000040
182 #define ECHOPRT 0x00000020
183 #define ECHOKE 0x00000001
184 #define FLUSHO 0x00800000
185 #define PENDIN 0x20000000
186 #define IEXTEN 0x00000400
188 /* Values for the ACTION argument to `tcflow'. */
189 #define TCOOFF 0
190 #define TCOON 1
191 #define TCIOFF 2
192 #define TCION 3
194 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
195 #define TCIFLUSH 0
196 #define TCOFLUSH 1
197 #define TCIOFLUSH 2
199 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
200 #define TCSANOW 0
201 #define TCSADRAIN 1
202 #define TCSAFLUSH 2
204 struct sgttyb {
205 char sg_ispeed;
206 char sg_ospeed;
207 char sg_erase;
208 char sg_kill;
209 short sg_flags;
212 struct tchars {
213 char t_intrc;
214 char t_quitc;
215 char t_startc;
216 char t_stopc;
217 char t_eofc;
218 char t_brkc;
221 struct ltchars {
222 char t_suspc;
223 char t_dsuspc;
224 char t_rprntc;
225 char t_flushc;
226 char t_werasc;
227 char t_lnextc;
230 /* Used for packet mode */
231 #define TIOCPKT_DATA 0
232 #define TIOCPKT_FLUSHREAD 1
233 #define TIOCPKT_FLUSHWRITE 2
234 #define TIOCPKT_STOP 4
235 #define TIOCPKT_START 8
236 #define TIOCPKT_NOSTOP 16
237 #define TIOCPKT_DOSTOP 32
239 struct winsize {
240 unsigned short ws_row;
241 unsigned short ws_col;
242 unsigned short ws_xpixel;
243 unsigned short ws_ypixel;
246 #define NCC 10
247 struct termio {
248 unsigned short c_iflag; /* input mode flags */
249 unsigned short c_oflag; /* output mode flags */
250 unsigned short c_cflag; /* control mode flags */
251 unsigned short c_lflag; /* local mode flags */
252 unsigned char c_line; /* line discipline */
253 unsigned char c_cc[NCC]; /* control characters */
256 /* c_cc characters */
257 #define _VINTR 0
258 #define _VQUIT 1
259 #define _VERASE 2
260 #define _VKILL 3
261 #define _VEOF 4
262 #define _VMIN 5
263 #define _VEOL 6
264 #define _VTIME 7
265 #define _VEOL2 8
266 #define _VSWTC 9
268 /* modem lines */
269 #define TIOCM_LE 0x001
270 #define TIOCM_DTR 0x002
271 #define TIOCM_RTS 0x004
272 #define TIOCM_ST 0x008
273 #define TIOCM_SR 0x010
274 #define TIOCM_CTS 0x020
275 #define TIOCM_CAR 0x040
276 #define TIOCM_RNG 0x080
277 #define TIOCM_DSR 0x100
278 #define TIOCM_CD TIOCM_CAR
279 #define TIOCM_RI TIOCM_RNG
281 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
282 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
284 /* line disciplines */
285 #define N_TTY 0
286 #define N_SLIP 1
287 #define N_MOUSE 2
288 #define N_PPP 3
289 #define N_STRIP 4
290 #define N_AX25 5
291 #define N_X25 6 /* X.25 async */
292 #define N_6PACK 7
293 #define N_MASC 8 /* Mobitex module */
294 #define N_R3964 9 /* Simatic R3964 module */
295 #define N_PROFIBUS_FDL 10 /* Profibus */
296 #define N_IRDA 11 /* Linux IR */
297 #define N_SMSBLOCK 12 /* SMS block mode */
298 #define N_HDLC 13 /* synchronous HDLC */
299 #define N_SYNC_PPP 14 /* synchronous PPP */
300 #define N_HCI 15 /* Bluetooth HCI UART */