| 1 | /* termios type and macro definitions. Linux/MIPS version. |
|---|
| 2 | Copyright (C) 1993, 94, 95, 96, 97, 99 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 | typedef unsigned char cc_t; |
|---|
| 25 | typedef unsigned int speed_t; |
|---|
| 26 | typedef unsigned int tcflag_t; |
|---|
| 27 | |
|---|
| 28 | #define NCCS 32 |
|---|
| 29 | struct termios |
|---|
| 30 | { |
|---|
| 31 | tcflag_t c_iflag; /* input mode flags */ |
|---|
| 32 | tcflag_t c_oflag; /* output mode flags */ |
|---|
| 33 | tcflag_t c_cflag; /* control mode flags */ |
|---|
| 34 | tcflag_t c_lflag; /* local mode flags */ |
|---|
| 35 | cc_t c_line; /* line discipline */ |
|---|
| 36 | cc_t c_cc[NCCS]; /* control characters */ |
|---|
| 37 | }; |
|---|
| 38 | |
|---|
| 39 | /* c_cc characters */ |
|---|
| 40 | #define VINTR 0 /* Interrupt character [ISIG]. */ |
|---|
| 41 | #define VQUIT 1 /* Quit character [ISIG]. */ |
|---|
| 42 | #define VERASE 2 /* Erase character [ICANON]. */ |
|---|
| 43 | #define VKILL 3 /* Kill-line character [ICANON]. */ |
|---|
| 44 | #define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ |
|---|
| 45 | #define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ |
|---|
| 46 | #define VEOL2 6 /* Second EOL character [ICANON]. */ |
|---|
| 47 | #define VSWTC 7 |
|---|
| 48 | #define VSWTCH VSWTC |
|---|
| 49 | #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ |
|---|
| 50 | #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ |
|---|
| 51 | #define VSUSP 10 /* Suspend character [ISIG]. */ |
|---|
| 52 | /* VDSUSP is not supported on Linux. */ |
|---|
| 53 | /* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ |
|---|
| 54 | #define VREPRINT 12 /* Reprint-line character [ICANON]. */ |
|---|
| 55 | #define VDISCARD 13 /* Discard character [IEXTEN]. */ |
|---|
| 56 | #define VWERASE 14 /* Word-erase character [ICANON]. */ |
|---|
| 57 | #define VLNEXT 15 /* Literal-next character [IEXTEN]. */ |
|---|
| 58 | #define VEOF 16 /* End-of-file character [ICANON]. */ |
|---|
| 59 | #define VEOL 17 /* End-of-line character [ICANON]. */ |
|---|
| 60 | |
|---|
| 61 | /* c_iflag bits */ |
|---|
| 62 | #define IGNBRK 0000001 /* Ignore break condition. */ |
|---|
| 63 | #define BRKINT 0000002 /* Signal interrupt on break. */ |
|---|
| 64 | #define IGNPAR 0000004 /* Ignore characters with parity errors. */ |
|---|
| 65 | #define PARMRK 0000010 /* Mark parity and framing errors. */ |
|---|
| 66 | #define INPCK 0000020 /* Enable input parity check. */ |
|---|
| 67 | #define ISTRIP 0000040 /* Strip 8th bit off characters. */ |
|---|
| 68 | #define INLCR 0000100 /* Map NL to CR on input. */ |
|---|
| 69 | #define IGNCR 0000200 /* Ignore CR. */ |
|---|
| 70 | #define ICRNL 0000400 /* Map CR to NL on input. */ |
|---|
| 71 | #define IUCLC 0001000 /* Map upper case to lower case on input. */ |
|---|
| 72 | #define IXON 0002000 /* Enable start/stop output control. */ |
|---|
| 73 | #define IXANY 0004000 /* Any character will restart after stop. */ |
|---|
| 74 | #define IXOFF 0010000 /* Enable start/stop input control. */ |
|---|
| 75 | #define IMAXBEL 0020000 /* Ring bell when input queue is full. */ |
|---|
| 76 | |
|---|
| 77 | /* c_oflag bits */ |
|---|
| 78 | #define OPOST 0000001 /* Perform output processing. */ |
|---|
| 79 | #define OLCUC 0000002 /* Map lower case to upper case on output. */ |
|---|
| 80 | #define ONLCR 0000004 /* Map NL to CR-NL on output. */ |
|---|
| 81 | #define OCRNL 0000010 |
|---|
| 82 | #define ONOCR 0000020 |
|---|
| 83 | #define ONLRET 0000040 |
|---|
| 84 | #define OFILL 0000100 |
|---|
| 85 | #define OFDEL 0000200 |
|---|
| 86 | #if defined __USE_MISC || defined __USE_XOPEN |
|---|
| 87 | # define NLDLY 0000400 |
|---|
| 88 | # define NL0 0000000 |
|---|
| 89 | # define NL1 0000400 |
|---|
| 90 | # define CRDLY 0003000 |
|---|
| 91 | # define CR0 0000000 |
|---|
| 92 | # define CR1 0001000 |
|---|
| 93 | # define CR2 0002000 |
|---|
| 94 | # define CR3 0003000 |
|---|
| 95 | # define TABDLY 0014000 |
|---|
| 96 | # define TAB0 0000000 |
|---|
| 97 | # define TAB1 0004000 |
|---|
| 98 | # define TAB2 0010000 |
|---|
| 99 | # define TAB3 0014000 |
|---|
| 100 | # define BSDLY 0020000 |
|---|
| 101 | # define BS0 0000000 |
|---|
| 102 | # define BS1 0020000 |
|---|
| 103 | # define FFDLY 0100000 |
|---|
| 104 | # define FF0 0000000 |
|---|
| 105 | # define FF1 0100000 |
|---|
| 106 | #endif |
|---|
| 107 | |
|---|
| 108 | #define VTDLY 0040000 |
|---|
| 109 | #define VT0 0000000 |
|---|
| 110 | #define VT1 0040000 |
|---|
| 111 | |
|---|
| 112 | #ifdef __USE_MISC |
|---|
| 113 | # define XTABS 0014000 |
|---|
| 114 | #endif |
|---|
| 115 | |
|---|
| 116 | /* c_cflag bit meaning */ |
|---|
| 117 | #ifdef __USE_MISC |
|---|
| 118 | # define CBAUD 0010017 |
|---|
| 119 | #endif |
|---|
| 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 | #ifdef __USE_MISC |
|---|
| 137 | # define EXTA B19200 |
|---|
| 138 | # define EXTB B38400 |
|---|
| 139 | #endif |
|---|
| 140 | #define CSIZE 0000060 /* Number of bits per byte (mask). */ |
|---|
| 141 | #define CS5 0000000 /* 5 bits per byte. */ |
|---|
| 142 | #define CS6 0000020 /* 6 bits per byte. */ |
|---|
| 143 | #define CS7 0000040 /* 7 bits per byte. */ |
|---|
| 144 | #define CS8 0000060 /* 8 bits per byte. */ |
|---|
| 145 | #define CSTOPB 0000100 /* Two stop bits instead of one. */ |
|---|
| 146 | #define CREAD 0000200 /* Enable receiver. */ |
|---|
| 147 | #define PARENB 0000400 /* Parity enable. */ |
|---|
| 148 | #define PARODD 0001000 /* Odd parity instead of even. */ |
|---|
| 149 | #define HUPCL 0002000 /* Hang up on last close. */ |
|---|
| 150 | #define CLOCAL 0004000 /* Ignore modem status lines. */ |
|---|
| 151 | #ifdef __USE_MISC |
|---|
| 152 | # define CBAUDEX 0010000 |
|---|
| 153 | #endif |
|---|
| 154 | #define B57600 0010001 |
|---|
| 155 | #define B115200 0010002 |
|---|
| 156 | #define B230400 0010003 |
|---|
| 157 | #define B460800 0010004 |
|---|
| 158 | #define B500000 0010005 |
|---|
| 159 | #define B576000 0010006 |
|---|
| 160 | #define B921600 0010007 |
|---|
| 161 | #define B1000000 0010010 |
|---|
| 162 | #define B1152000 0010011 |
|---|
| 163 | #define B1500000 0010012 |
|---|
| 164 | #define B2000000 0010013 |
|---|
| 165 | #define B2500000 0010014 |
|---|
| 166 | #define B3000000 0010015 |
|---|
| 167 | #define B3500000 0010016 |
|---|
| 168 | #define B4000000 0010017 |
|---|
| 169 | #define __MAX_BAUD B4000000 |
|---|
| 170 | #ifdef __USE_MISC |
|---|
| 171 | # define CIBAUD 002003600000 /* input baud rate (not used) */ |
|---|
| 172 | # define CRTSCTS 020000000000 /* flow control */ |
|---|
| 173 | #endif |
|---|
| 174 | |
|---|
| 175 | /* c_lflag bits */ |
|---|
| 176 | #define ISIG 0000001 /* Enable signals. */ |
|---|
| 177 | #define ICANON 0000002 /* Do erase and kill processing. */ |
|---|
| 178 | #if defined __USE_MISC || defined __USE_XOPEN |
|---|
| 179 | # define XCASE 0000004 |
|---|
| 180 | #endif |
|---|
| 181 | #define ECHO 0000010 /* Enable echo. */ |
|---|
| 182 | #define ECHOE 0000020 /* Visual erase for ERASE. */ |
|---|
| 183 | #define ECHOK 0000040 /* Echo NL after KILL. */ |
|---|
| 184 | #define ECHONL 0000100 /* Echo NL even if ECHO is off. */ |
|---|
| 185 | #define NOFLSH 0000200 /* Disable flush after interrupt. */ |
|---|
| 186 | #define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ |
|---|
| 187 | #ifdef __USE_MISC |
|---|
| 188 | # define ECHOCTL 0001000 /* Echo control characters as ^X. */ |
|---|
| 189 | # define ECHOPRT 0002000 /* Hardcopy visual erase. */ |
|---|
| 190 | # define ECHOKE 0004000 /* Visual erase for KILL. */ |
|---|
| 191 | # define FLUSHO 0020000 |
|---|
| 192 | # define PENDIN 0040000 /* Retype pending input (state). */ |
|---|
| 193 | #endif |
|---|
| 194 | #define TOSTOP 0100000 /* Send SIGTTOU for background output. */ |
|---|
| 195 | #define ITOSTOP TOSTOP |
|---|
| 196 | |
|---|
| 197 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ |
|---|
| 198 | #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ |
|---|
| 199 | |
|---|
| 200 | /* tcflow() and TCXONC use these */ |
|---|
| 201 | #define TCOOFF 0 /* Suspend output. */ |
|---|
| 202 | #define TCOON 1 /* Restart suspended output. */ |
|---|
| 203 | #define TCIOFF 2 /* Send a STOP character. */ |
|---|
| 204 | #define TCION 3 /* Send a START character. */ |
|---|
| 205 | |
|---|
| 206 | /* tcflush() and TCFLSH use these */ |
|---|
| 207 | #define TCIFLUSH 0 /* Discard data received but not yet read. */ |
|---|
| 208 | #define TCOFLUSH 1 /* Discard data written but not yet sent. */ |
|---|
| 209 | #define TCIOFLUSH 2 /* Discard all pending data. */ |
|---|
| 210 | |
|---|
| 211 | /* tcsetattr uses these */ |
|---|
| 212 | #define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ |
|---|
| 213 | #define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ |
|---|
| 214 | #define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ |
|---|
| 215 | |
|---|
| 216 | #define _IOT_termios /* Hurd ioctl type field. */ \ |
|---|
| 217 | _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) |
|---|