1 /* termios type and macro definitions. Linux version.
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA. */
20 /* Type of terminal control flag masks. */
21 typedef unsigned int tcflag_t;
23 /* Type of control characters. */
24 typedef unsigned char cc_t;
26 /* Type of baud rate specifiers. */
27 typedef unsigned int speed_t;
29 /* Terminal control structure. */
34 #define IGNBRK 0x0001 /* Ignore break condition. */
35 #define BRKINT 0x0002 /* Signal interrupt on break. */
36 #define IGNPAR 0x0004 /* Ignore characters with parity errors. */
37 #define PARMRK 0x0008 /* Mark parity and framing errors. */
38 #define INPCK 0x0010 /* Enable input parity check. */
39 #define ISTRIP 0x0020 /* Strip 8th bit off characters. */
40 #define INLCR 0x0040 /* Map NL to CR on input. */
41 #define IGNCR 0x0080 /* Ignore CR. */
42 #define ICRNL 0x0100 /* Map CR to NL on input. */
44 #define IUCLC 0x0200 /* Map upper case to lower case on input. */
46 #define IXON 0x0400 /* Enable start/stop output control. */
47 #define IXOFF 0x1000 /* Enable start/stop input control. */
49 #define IXANY 0x0800 /* Any character will restart after stop. */
50 #define IMAXBEL 0x2000 /* Ring bell when input queue is full. */
55 #define OPOST 0x0001 /* Perform output processing. */
57 #define OLCUC 0x00000002 /* Map lower case to upper case on output. */
58 #define ONLCR 0x00000004 /* Map NL to CR-NL on output. */
59 #define OCRNL 0x00000008
60 #define ONOCR 0x00000010
61 #define ONLRET 0x00000020
62 #define OFILL 0x00000040
63 #define OFDEL 0x00000080
64 #define NLDLY 0x00000100
66 #define NL1 0x00000100
67 #define CRDLY 0x00000600
69 #define CR1 0x00000200
70 #define CR2 0x00000400
71 #define CR3 0x00000600
72 #define TABDLY 0x00001800
74 #define TAB1 0x00000800
75 #define TAB2 0x00001000
76 #define XTABS 0x00001800
78 #define BSDLY 0x00002000
80 #define BS1 0x00002000
81 #define VTDLY 0x00004000
83 #define VT1 0x00004000
84 #define FFDLY 0x00008000
86 #define FF1 0x00008000
87 #define PAGEOUT 0x00010000
88 #define WRAP 0x00020000
93 #define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */
94 #define CS5 0 /* 5 bits per byte. */
95 #define CS6 0x00000010 /* 6 bits per byte. */
96 #define CS7 0x00000020 /* 7 bits per byte. */
97 #define CS8 0x00000030 /* 8 bits per byte. */
98 #define CSTOPB 0x00000040 /* Two stop bits instead of one. */
99 #define CREAD 0x00000080 /* Enable receiver. */
100 #define PARENB 0x00000100 /* Parity enable. */
101 #define PARODD 0x00000200 /* Odd parity instead of even. */
102 #define HUPCL 0x00000400 /* Hang up on last close. */
103 #define CLOCAL 0x00000800 /* Ignore modem status lines. */
105 #define CRTSCTS 0x08000000
106 #define CBAUD 0x0000000f /* Mask for speed from c_cflag. */
107 #define CBAUDEX 0x00010000 /* Mask for extended speed from c_cflag. */
110 /* Input and output baud rates. These are encoded in c_cflag. */
111 #define B0 0x000000000
112 #define B50 0x000000001
113 #define B75 0x000000002
114 #define B110 0x000000003
115 #define B134 0x000000004
116 #define B150 0x000000005
117 #define B200 0x000000006
118 #define B300 0x000000007
119 #define B600 0x000000008
120 #define B1200 0x000000009
121 #define B1800 0x00000000a
122 #define B2400 0x00000000b
123 #define B4800 0x00000000c
124 #define B9600 0x00000000d
125 #define B19200 0x00000000e
126 #define B38400 0x00000000f
128 #define EXTA 0x00000000e
129 #define EXTB 0x00000000f
131 #define B57600 0x000010001
132 #define B115200 0x000010002
133 #define B230400 0x000010003
138 #define ECHOKE 0x00000800 /* Visual erase for KILL. */
140 #define ECHOE 0x00000010 /* Visual erase for ERASE. */
141 #define ECHOK 0x00000020 /* Echo NL after KILL. */
142 #define ECHO 0x00000008 /* Enable echo. */
143 #define ECHONL 0x00000040 /* Echo NL even if ECHO is off. */
145 #define ECHOPRT 0x00000400 /* Hardcopy visual erase. */
146 #define ECHOCTL 0x00000200 /* Echo control characters as ^X. */
148 #define ISIG 0x00000001 /* Enable signals. */
149 #define ICANON 0x00000002 /* Do erase and kill processing. */
150 #define IEXTEN 0x00008000 /* Enable DISCARD and LNEXT. */
151 #define TOSTOP 0x00000100 /* Send SIGTTOU for background output. */
153 #define PENDIN 0x00004000 /* Retype pending input (state). */
155 #define NOFLSH 0x00000080 /* Disable flush after interrupt. */
157 cc_t c_line; /* Line discipline (?) */
159 /* Control characters. */
160 #define VEOF 4 /* End-of-file character [ICANON]. */
161 #define VEOL 5 /* End-of-line character [ICANON]. */
163 #define VEOL2 6 /* Second EOL character [ICANON]. */
164 #define VSWTCH 7 /* ??? */
166 #define VERASE 2 /* Erase character [ICANON]. */
168 #define VWERASE 14 /* Word-erase character [ICANON]. */
170 #define VKILL 3 /* Kill-line character [ICANON]. */
172 #define VREPRINT 12 /* Reprint-line character [ICANON]. */
174 #define VINTR 0 /* Interrupt character [ISIG]. */
175 #define VQUIT 1 /* Quit character [ISIG]. */
176 #define VSUSP 10 /* Suspend character [ISIG]. */
178 #define VDSUSP 11 /* Delayed suspend character [ISIG]. */
180 #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
181 #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
183 #define VLNEXT 15 /* Literal-next character [IEXTEN]. */
184 #define VDISCARD 13 /* Discard character [IEXTEN]. */
186 #define VMIN VEOF /* Minimum number of bytes read at once [!ICANON]. */
187 #define VTIME VEOL /* Time-out value (tenths of a second) [!ICANON]. */
192 #define _IOT_termios /* Hurd ioctl type field. */ \
193 _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
195 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
196 #define TCSANOW 0 /* Change immediately. */
197 #define TCSADRAIN 1 /* Change when pending output is written. */
198 #define TCSAFLUSH 2 /* Flush pending input before changing. */
200 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
201 #define TCIFLUSH 0 /* Discard data received but not yet read. */
202 #define TCOFLUSH 1 /* Discard data written but not yet sent. */
203 #define TCIOFLUSH 2 /* Discard all pending data. */
205 /* Values for the ACTION argument to `tcflow'. */
206 #define TCOOFF 0 /* Suspend output. */
207 #define TCOON 1 /* Restart suspended output. */
208 #define TCIOFF 2 /* Send a STOP character. */
209 #define TCION 3 /* Send a START character. */