Update to LGPL v2.1.
[jlayton/glibc.git] / sysdeps / unix / bsd / sun / sunos4 / bits / termios.h
1 /* termios type and macro definitions.  SunOS 4 version.
2    Copyright (C) 1993, 1994, 1996, 1997 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 Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the 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    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18    02111-1307 USA.  */
19
20 #ifndef _TERMIOS_H
21 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
22 #endif
23
24 /* Type of terminal control flag masks.  */
25 typedef unsigned long int tcflag_t;
26
27 /* Type of control characters.  */
28 typedef unsigned char cc_t;
29
30 /* Type of baud rate specifiers.  */
31 typedef unsigned int speed_t;
32
33 /* Terminal control structure.  */
34 struct termios
35 {
36   /* Input modes.  */
37   tcflag_t c_iflag;
38 #define IGNBRK  0x0001          /* Ignore break condition.  */
39 #define BRKINT  0x0002          /* Signal interrupt on break.  */
40 #define IGNPAR  0x0004          /* Ignore characters with parity errors.  */
41 #define PARMRK  0x0008          /* Mark parity and framing errors.  */
42 #define INPCK   0x0010          /* Enable input parity check.  */
43 #define ISTRIP  0x0020          /* Strip 8th bit off characters.  */
44 #define INLCR   0x0040          /* Map NL to CR on input.  */
45 #define IGNCR   0x0080          /* Ignore CR.  */
46 #define ICRNL   0x0100          /* Map CR to NL on input.  */
47 #ifdef __USE_BSD
48 # define IUCLC  0x0200          /* Map upper case to lower case on input.  */
49 #endif
50 #define IXON    0x0400          /* Enable start/stop output control.  */
51 #define IXOFF   0x1000          /* Enable start/stop input control.  */
52 #ifdef  __USE_BSD
53 # define IXANY  0x0800          /* Any character will restart after stop.  */
54 # define IMAXBEL        0x2000          /* Ring bell when input queue is full.  */
55 #endif
56
57   /* Output modes.  */
58   tcflag_t c_oflag;
59 #define OPOST   0x0001          /* Perform output processing.  */
60 #ifdef  __USE_BSD
61 # define OLCUC  0x00000002      /* Map lower case to upper case on output.  */
62 # define ONLCR  0x00000004      /* Map NL to CR-NL on output.  */
63 # define OCRNL  0x00000008
64 # define ONOCR  0x00000010
65 # define ONLRET 0x00000020
66 # define OFILL  0x00000040
67 # define OFDEL  0x00000080
68 # define NLDLY  0x00000100
69 # define NL0    0
70 # define NL1    0x00000100
71 # define CRDLY  0x00000600
72 # define CR0    0
73 # define CR1    0x00000200
74 # define CR2    0x00000400
75 # define CR3    0x00000600
76 # define TABDLY 0x00001800
77 # define TAB0   0
78 # define TAB1   0x00000800
79 # define TAB2   0x00001000
80 # define XTABS  0x00001800
81 # define TAB3   XTABS
82 # define BSDLY  0x00002000
83 # define BS0    0
84 # define BS1    0x00002000
85 # define VTDLY  0x00004000
86 # define VT0    0
87 # define VT1    0x00004000
88 # define FFDLY  0x00008000
89 # define FF0    0
90 # define FF1    0x00008000
91 # define PAGEOUT 0x00010000
92 # define WRAP   0x00020000
93 #endif
94
95   /* Control modes.  */
96   tcflag_t c_cflag;
97 #define CSIZE   (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask).  */
98 #define CS5     0               /* 5 bits per byte.  */
99 #define CS6     0x00000010      /* 6 bits per byte.  */
100 #define CS7     0x00000020      /* 7 bits per byte.  */
101 #define CS8     0x00000030      /* 8 bits per byte.  */
102 #define CSTOPB  0x00000040      /* Two stop bits instead of one.  */
103 #define CREAD   0x00000080      /* Enable receiver.  */
104 #define PARENB  0x00000100      /* Parity enable.  */
105 #define PARODD  0x00000200      /* Odd parity instead of even.  */
106 #define HUPCL   0x00000400      /* Hang up on last close.  */
107 #define CLOCAL  0x00000800      /* Ignore modem status lines.  */
108 #ifdef  __USE_BSD
109 # define LOBLK  0x00001000
110 # define CRTSCTS        0x80000000
111 # define CIBAUD 0x000f0000      /* Mask for input speed from c_cflag.  */
112 # define CBAUD  0x0000000f      /* Mask for output speed from c_cflag.  */
113 # define IBSHIFT        16              /* Bits to shift for input speed.  */
114 #endif
115
116   /* Input and output baud rates.  These are encoded in c_cflag.  */
117 #define B0      0
118 #define B50     1
119 #define B75     2
120 #define B110    3
121 #define B134    4
122 #define B150    5
123 #define B200    6
124 #define B300    7
125 #define B600    8
126 #define B1200   9
127 #define B1800   10
128 #define B2400   11
129 #define B4800   12
130 #define B9600   13
131 #define B19200  14
132 #define B38400  15
133 #ifdef __USE_BSD
134 # define EXTA   14
135 # define EXTB   15
136 #endif
137
138   /* Local modes.  */
139   tcflag_t c_lflag;
140 #ifdef  __USE_BSD
141 # define ECHOKE 0x00000800      /* Visual erase for KILL.  */
142 #endif
143 #define ECHOE   0x00000010      /* Visual erase for ERASE.  */
144 #define ECHOK   0x00000020      /* Echo NL after KILL.  */
145 #define ECHO    0x00000008      /* Enable echo.  */
146 #define ECHONL  0x00000040      /* Echo NL even if ECHO is off.  */
147 #ifdef  __USE_BSD
148 # define ECHOPRT        0x00000400      /* Hardcopy visual erase.  */
149 # define ECHOCTL        0x00000200      /* Echo control characters as ^X.  */
150 #endif
151 #define ISIG    0x00000001      /* Enable signals.  */
152 #define ICANON  0x00000002      /* Do erase and kill processing.  */
153 #define IEXTEN  0x00008000      /* Enable DISCARD and LNEXT.  */
154 #define TOSTOP  0x00000100      /* Send SIGTTOU for background output.  */
155 #ifdef  __USE_BSD
156 # define PENDIN 0x00004000      /* Retype pending input (state).  */
157 #endif
158 #define NOFLSH  0x00000080      /* Disable flush after interrupt.  */
159
160   char c_line;                  /* Line discipline (?) */
161
162   /* Control characters.  */
163 #define VEOF    4               /* End-of-file character [ICANON].  */
164 #define VEOL    5               /* End-of-line character [ICANON].  */
165 #ifdef  __USE_BSD
166 # define VEOL2  6               /* Second EOL character [ICANON].  */
167 # define VSWTCH 7               /* ??? */
168 #endif
169 #define VERASE  2               /* Erase character [ICANON].  */
170 #ifdef  __USE_BSD
171 # define VWERASE        14              /* Word-erase character [ICANON].  */
172 #endif
173 #define VKILL   3               /* Kill-line character [ICANON].  */
174 #ifdef  __USE_BSD
175 # define VREPRINT 12            /* Reprint-line character [ICANON].  */
176 #endif
177 #define VINTR   0               /* Interrupt character [ISIG].  */
178 #define VQUIT   1               /* Quit character [ISIG].  */
179 #define VSUSP   10              /* Suspend character [ISIG].  */
180 #ifdef  __USE_BSD
181 # define VDSUSP 11              /* Delayed suspend character [ISIG].  */
182 #endif
183 #define VSTART  8               /* Start (X-ON) character [IXON, IXOFF].  */
184 #define VSTOP   9               /* Stop (X-OFF) character [IXON, IXOFF].  */
185 #ifdef  __USE_BSD
186 # define VLNEXT 15              /* Literal-next character [IEXTEN].  */
187 # define VDISCARD 13            /* Discard character [IEXTEN].  */
188 #endif
189 #define VMIN    VEOF            /* Minimum number of bytes read at once [!ICANON].  */
190 #define VTIME   VEOL            /* Time-out value (tenths of a second) [!ICANON].  */
191 #define NCCS    17
192   cc_t c_cc[NCCS];
193 };
194
195 #define _IOT_termios /* Hurd ioctl type field.  */ \
196   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
197
198 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
199 #define TCSANOW         0       /* Change immediately.  */
200 #define TCSADRAIN       1       /* Change when pending output is written.  */
201 #define TCSAFLUSH       2       /* Flush pending input before changing.  */
202
203 /* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
204 #define TCIFLUSH        0       /* Discard data received but not yet read.  */
205 #define TCOFLUSH        1       /* Discard data written but not yet sent.  */
206 #define TCIOFLUSH       2       /* Discard all pending data.  */
207
208 /* Values for the ACTION argument to `tcflow'.  */
209 #define TCOOFF  0               /* Suspend output.  */
210 #define TCOON   1               /* Restart suspended output.  */
211 #define TCIOFF  2               /* Send a STOP character.  */
212 #define TCION   3               /* Send a START character.  */