]> sourceware.org Git - glibc.git/blob - bits/termios.h
Update.
[glibc.git] / bits / termios.h
1 /* termios type and macro definitions. 4.4 BSD/generic GNU version.
2 Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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 not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20 /* These macros are also defined in some <bits/ioctls.h> files (with
21 numerically identical values), but this serves to shut up cpp's
22 complaining. */
23 #ifdef __USE_BSD
24
25 #ifdef MDMBUF
26 #undef MDMBUF
27 #endif
28 #ifdef FLUSHO
29 #undef FLUSHO
30 #endif
31 #ifdef PENDIN
32 #undef PENDIN
33 #endif
34
35 #endif /* __USE_BSD */
36
37 #ifdef ECHO
38 #undef ECHO
39 #endif
40 #ifdef TOSTOP
41 #undef TOSTOP
42 #endif
43 #ifdef NOFLSH
44 #undef NOFLSH
45 #endif
46
47
48 /* These definitions match those used by the 4.4 BSD kernel.
49 If the operating system has termios system calls or ioctls that
50 correctly implement the POSIX.1 behavior, there should be a
51 system-dependent version of this file that defines `struct termios',
52 `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately. */
53
54 /* Type of terminal control flag masks. */
55 typedef unsigned long int tcflag_t;
56
57 /* Type of control characters. */
58 typedef unsigned char cc_t;
59
60 /* Type of baud rate specifiers. */
61 typedef long int speed_t;
62
63 /* Terminal control structure. */
64 struct termios
65 {
66 /* Input modes. */
67 tcflag_t c_iflag;
68 #define IGNBRK (1 << 0) /* Ignore break condition. */
69 #define BRKINT (1 << 1) /* Signal interrupt on break. */
70 #define IGNPAR (1 << 2) /* Ignore characters with parity errors. */
71 #define PARMRK (1 << 3) /* Mark parity and framing errors. */
72 #define INPCK (1 << 4) /* Enable input parity check. */
73 #define ISTRIP (1 << 5) /* Strip 8th bit off characters. */
74 #define INLCR (1 << 6) /* Map NL to CR on input. */
75 #define IGNCR (1 << 7) /* Ignore CR. */
76 #define ICRNL (1 << 8) /* Map CR to NL on input. */
77 #define IXON (1 << 9) /* Enable start/stop output control. */
78 #define IXOFF (1 << 10) /* Enable start/stop input control. */
79 #ifdef __USE_BSD
80 #define IXANY (1 << 11) /* Any character will restart after stop. */
81 #define IMAXBEL (1 << 13) /* Ring bell when input queue is full. */
82 #endif
83
84 /* Output modes. */
85 tcflag_t c_oflag;
86 #define OPOST (1 << 0) /* Perform output processing. */
87 #ifdef __USE_BSD
88 #define ONLCR (1 << 1) /* Map NL to CR-NL on output. */
89 #define OXTABS (1 << 2) /* Expand tabs to spaces. */
90 #define ONOEOT (1 << 8) /* Discard EOT (^D) on output. */
91 #endif
92
93 /* Control modes. */
94 tcflag_t c_cflag;
95 #ifdef __USE_BSD
96 #define CIGNORE (1 << 0) /* Ignore these control flags. */
97 #endif
98 #define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */
99 #define CS5 0 /* 5 bits per byte. */
100 #define CS6 (1 << 8) /* 6 bits per byte. */
101 #define CS7 (1 << 9) /* 7 bits per byte. */
102 #define CS8 (CS6|CS7) /* 8 bits per byte. */
103 #define CSTOPB (1 << 10) /* Two stop bits instead of one. */
104 #define CREAD (1 << 11) /* Enable receiver. */
105 #define PARENB (1 << 12) /* Parity enable. */
106 #define PARODD (1 << 13) /* Odd parity instead of even. */
107 #define HUPCL (1 << 14) /* Hang up on last close. */
108 #define CLOCAL (1 << 15) /* Ignore modem status lines. */
109 #ifdef __USE_BSD
110 #define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */
111 #define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */
112 #define MDMBUF (1 << 20) /* Carrier flow control of output. */
113 #endif
114
115 /* Local modes. */
116 tcflag_t c_lflag;
117 #ifdef __USE_BSD
118 #define ECHOKE (1 << 0) /* Visual erase for KILL. */
119 #endif
120 #define _ECHOE (1 << 1) /* Visual erase for ERASE. */
121 #define ECHOE _ECHOE
122 #define _ECHOK (1 << 2) /* Echo NL after KILL. */
123 #define ECHOK _ECHOK
124 #define _ECHO (1 << 3) /* Enable echo. */
125 #define ECHO _ECHO
126 #define _ECHONL (1 << 4) /* Echo NL even if ECHO is off. */
127 #define ECHONL _ECHONL
128 #ifdef __USE_BSD
129 #define ECHOPRT (1 << 5) /* Hardcopy visual erase. */
130 #define ECHOCTL (1 << 6) /* Echo control characters as ^X. */
131 #endif
132 #define _ISIG (1 << 7) /* Enable signals. */
133 #define ISIG _ISIG
134 #define _ICANON (1 << 8) /* Do erase and kill processing. */
135 #define ICANON _ICANON
136 #ifdef __USE_BSD
137 #define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */
138 #endif
139 #define _IEXTEN (1 << 10) /* Enable DISCARD and LNEXT. */
140 #define IEXTEN _IEXTEN
141 #define EXTPROC (1 << 11) /* External processing. */
142 #define _TOSTOP (1 << 22) /* Send SIGTTOU for background output. */
143 #define TOSTOP _TOSTOP
144 #ifdef __USE_BSD
145 #define FLUSHO (1 << 23) /* Output being flushed (state). */
146 #define NOKERNINFO (1 << 25) /* Disable VSTATUS. */
147 #define PENDIN (1 << 29) /* Retype pending input (state). */
148 #endif
149 #define _NOFLSH (1 << 31) /* Disable flush after interrupt. */
150 #define NOFLSH _NOFLSH
151
152 /* Control characters. */
153 #define VEOF 0 /* End-of-file character [ICANON]. */
154 #define VEOL 1 /* End-of-line character [ICANON]. */
155 #ifdef __USE_BSD
156 #define VEOL2 2 /* Second EOL character [ICANON]. */
157 #endif
158 #define VERASE 3 /* Erase character [ICANON]. */
159 #ifdef __USE_BSD
160 #define VWERASE 4 /* Word-erase character [ICANON]. */
161 #endif
162 #define VKILL 5 /* Kill-line character [ICANON]. */
163 #ifdef __USE_BSD
164 #define VREPRINT 6 /* Reprint-line character [ICANON]. */
165 #endif
166 #define VINTR 8 /* Interrupt character [ISIG]. */
167 #define VQUIT 9 /* Quit character [ISIG]. */
168 #define VSUSP 10 /* Suspend character [ISIG]. */
169 #ifdef __USE_BSD
170 #define VDSUSP 11 /* Delayed suspend character [ISIG]. */
171 #endif
172 #define VSTART 12 /* Start (X-ON) character [IXON, IXOFF]. */
173 #define VSTOP 13 /* Stop (X-OFF) character [IXON, IXOFF]. */
174 #ifdef __USE_BSD
175 #define VLNEXT 14 /* Literal-next character [IEXTEN]. */
176 #define VDISCARD 15 /* Discard character [IEXTEN]. */
177 #endif
178 #define VMIN 16 /* Minimum number of bytes read at once [!ICANON]. */
179 #define VTIME 17 /* Time-out value (tenths of a second) [!ICANON]. */
180 #ifdef __USE_BSD
181 #define VSTATUS 18 /* Status character [ICANON]. */
182 #endif
183 #define NCCS 20 /* Value duplicated in <hurd/tioctl.defs>. */
184 cc_t c_cc[NCCS];
185
186 /* Input and output baud rates. */
187 speed_t __ispeed, __ospeed;
188 #define B0 0 /* Hang up. */
189 #define B50 50 /* 50 baud. */
190 #define B75 75 /* 75 baud. */
191 #define B110 110 /* 110 baud. */
192 #define B134 134 /* 134.5 baud. */
193 #define B150 150 /* 150 baud. */
194 #define B200 200 /* 200 baud. */
195 #define B300 300 /* 300 baud. */
196 #define B600 600 /* 600 baud. */
197 #define B1200 1200 /* 1200 baud. */
198 #define B1800 1800 /* 1800 baud. */
199 #define B2400 2400 /* 2400 baud. */
200 #define B4800 4800 /* 4800 baud. */
201 #define B9600 9600 /* 9600 baud. */
202 #define B19200 19200 /* 19200 baud. */
203 #define B38400 38400 /* 38400 baud. */
204 #ifdef __USE_BSD
205 #define EXTA 19200
206 #define EXTB 38400
207 #endif
208 };
209
210 #define _IOT_termios /* Hurd ioctl type field. */ \
211 _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
212
213 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
214 #define TCSANOW 0 /* Change immediately. */
215 #define TCSADRAIN 1 /* Change when pending output is written. */
216 #define TCSAFLUSH 2 /* Flush pending input before changing. */
217 #ifdef __USE_BSD
218 #define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */
219 #endif
220
221 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
222 #define TCIFLUSH 1 /* Discard data received but not yet read. */
223 #define TCOFLUSH 2 /* Discard data written but not yet sent. */
224 #define TCIOFLUSH 3 /* Discard all pending data. */
225
226 /* Values for the ACTION argument to `tcflow'. */
227 #define TCOOFF 1 /* Suspend output. */
228 #define TCOON 2 /* Restart suspended output. */
229 #define TCIOFF 3 /* Send a STOP character. */
230 #define TCION 4 /* Send a START character. */
This page took 0.0467379999999999 seconds and 5 git commands to generate.