Mon Mar 18 22:54:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
[glibc.git] / sysdeps / unix / sysv / linux / termbits.h
blobfa537ab7acc98c67fcbb4ff9493d3594363aa65f
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. */
30 struct termios
32 /* Input modes. */
33 tcflag_t c_iflag;
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. */
43 #ifdef __USE_BSD
44 #define IUCLC 0x0200 /* Map upper case to lower case on input. */
45 #endif
46 #define IXON 0x0400 /* Enable start/stop output control. */
47 #define IXOFF 0x1000 /* Enable start/stop input control. */
48 #ifdef __USE_BSD
49 #define IXANY 0x0800 /* Any character will restart after stop. */
50 #define IMAXBEL 0x2000 /* Ring bell when input queue is full. */
51 #endif
53 /* Output modes. */
54 tcflag_t c_oflag;
55 #define OPOST 0x0001 /* Perform output processing. */
56 #ifdef __USE_BSD
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
65 #define NL0 0
66 #define NL1 0x00000100
67 #define CRDLY 0x00000600
68 #define CR0 0
69 #define CR1 0x00000200
70 #define CR2 0x00000400
71 #define CR3 0x00000600
72 #define TABDLY 0x00001800
73 #define TAB0 0
74 #define TAB1 0x00000800
75 #define TAB2 0x00001000
76 #define XTABS 0x00001800
77 #define TAB3 XTABS
78 #define BSDLY 0x00002000
79 #define BS0 0
80 #define BS1 0x00002000
81 #define VTDLY 0x00004000
82 #define VT0 0
83 #define VT1 0x00004000
84 #define FFDLY 0x00008000
85 #define FF0 0
86 #define FF1 0x00008000
87 #endif
89 /* Control modes. */
90 tcflag_t c_cflag;
91 #define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */
92 #define CS5 0 /* 5 bits per byte. */
93 #define CS6 0x00000010 /* 6 bits per byte. */
94 #define CS7 0x00000020 /* 7 bits per byte. */
95 #define CS8 0x00000030 /* 8 bits per byte. */
96 #define CSTOPB 0x00000040 /* Two stop bits instead of one. */
97 #define CREAD 0x00000080 /* Enable receiver. */
98 #define PARENB 0x00000100 /* Parity enable. */
99 #define PARODD 0x00000200 /* Odd parity instead of even. */
100 #define HUPCL 0x00000400 /* Hang up on last close. */
101 #define CLOCAL 0x00000800 /* Ignore modem status lines. */
102 #ifdef __USE_BSD
103 #define CRTSCTS 0x80000000
104 #define CBAUD 0x0000000f /* Mask for speed from c_cflag. */
105 #define CBAUDEX 0x00001000 /* Mask for extended speed from c_cflag. */
106 #endif
108 /* Local modes. */
109 tcflag_t c_lflag;
110 #ifdef __USE_BSD
111 #define ECHOKE 0x00000800 /* Visual erase for KILL. */
112 #endif
113 #define ECHOE 0x00000010 /* Visual erase for ERASE. */
114 #define ECHOK 0x00000020 /* Echo NL after KILL. */
115 #define ECHO 0x00000008 /* Enable echo. */
116 #define ECHONL 0x00000040 /* Echo NL even if ECHO is off. */
117 #ifdef __USE_BSD
118 #define ECHOPRT 0x00000400 /* Hardcopy visual erase. */
119 #define ECHOCTL 0x00000200 /* Echo control characters as ^X. */
120 #endif
121 #define ISIG 0x00000001 /* Enable signals. */
122 #define ICANON 0x00000002 /* Do erase and kill processing. */
123 #define IEXTEN 0x00008000 /* Enable DISCARD and LNEXT. */
124 #define TOSTOP 0x00000100 /* Send SIGTTOU for background output. */
125 #ifdef __USE_BSD
126 #define PENDIN 0x00004000 /* Retype pending input (state). */
127 #endif
128 #define NOFLSH 0x00000080 /* Disable flush after interrupt. */
130 cc_t c_line; /* Line discipline (?) */
132 /* Control characters. */
133 #define VEOF 4 /* End-of-file character [ICANON]. */
134 #define VEOL 11 /* End-of-line character [ICANON]. */
135 #ifdef __USE_BSD
136 #define VEOL2 16 /* Second EOL character [ICANON]. */
137 #define VSWTCH 7 /* ??? */
138 #endif
139 #define VERASE 2 /* Erase character [ICANON]. */
140 #ifdef __USE_BSD
141 #define VWERASE 14 /* Word-erase character [ICANON]. */
142 #endif
143 #define VKILL 3 /* Kill-line character [ICANON]. */
144 #ifdef __USE_BSD
145 #define VREPRINT 12 /* Reprint-line character [ICANON]. */
146 #endif
147 #define VINTR 0 /* Interrupt character [ISIG]. */
148 #define VQUIT 1 /* Quit character [ISIG]. */
149 #define VSUSP 10 /* Suspend character [ISIG]. */
150 #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
151 #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
152 #ifdef __USE_BSD
153 #define VLNEXT 15 /* Literal-next character [IEXTEN]. */
154 #define VDISCARD 13 /* Discard character [IEXTEN]. */
155 #endif
156 #define VMIN 6 /* Minimum number of bytes read at once [!ICANON]. */
157 #define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
158 #define NCCS 19
159 cc_t c_cc[NCCS];
162 #define _IOT_termios /* Hurd ioctl type field. */ \
163 _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
165 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
166 #define TCSANOW 0 /* Change immediately. */
167 #define TCSADRAIN 1 /* Change when pending output is written. */
168 #define TCSAFLUSH 2 /* Flush pending input before changing. */
170 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
171 #define TCIFLUSH 0 /* Discard data received but not yet read. */
172 #define TCOFLUSH 1 /* Discard data written but not yet sent. */
173 #define TCIOFLUSH 2 /* Discard all pending data. */
175 /* Values for the ACTION argument to `tcflow'. */
176 #define TCOOFF 0 /* Suspend output. */
177 #define TCOON 1 /* Restart suspended output. */
178 #define TCIOFF 2 /* Send a STOP character. */
179 #define TCION 3 /* Send a START character. */