Rich Felker | 45ba07f | 2016-07-03 14:12:09 -0400 | [diff] [blame] | 1 | struct termios { |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 2 | tcflag_t c_iflag; |
| 3 | tcflag_t c_oflag; |
| 4 | tcflag_t c_cflag; |
| 5 | tcflag_t c_lflag; |
| 6 | cc_t c_line; |
| 7 | cc_t c_cc[NCCS]; |
| 8 | speed_t __c_ispeed; |
| 9 | speed_t __c_ospeed; |
| 10 | }; |
| 11 | |
| 12 | #define VINTR 0 |
| 13 | #define VQUIT 1 |
| 14 | #define VERASE 2 |
| 15 | #define VKILL 3 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 16 | #define VMIN 4 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 17 | #define VTIME 5 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 18 | #define VEOL2 6 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 19 | #define VSWTC 7 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 20 | #define VSWTCH 7 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 21 | #define VSTART 8 |
| 22 | #define VSTOP 9 |
| 23 | #define VSUSP 10 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 24 | #define VREPRINT 12 |
| 25 | #define VDISCARD 13 |
| 26 | #define VWERASE 14 |
| 27 | #define VLNEXT 15 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 28 | #define VEOF 16 |
| 29 | #define VEOL 17 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 30 | |
| 31 | #define IGNBRK 0000001 |
| 32 | #define BRKINT 0000002 |
| 33 | #define IGNPAR 0000004 |
| 34 | #define PARMRK 0000010 |
| 35 | #define INPCK 0000020 |
| 36 | #define ISTRIP 0000040 |
| 37 | #define INLCR 0000100 |
| 38 | #define IGNCR 0000200 |
| 39 | #define ICRNL 0000400 |
| 40 | #define IUCLC 0001000 |
| 41 | #define IXON 0002000 |
| 42 | #define IXANY 0004000 |
| 43 | #define IXOFF 0010000 |
| 44 | #define IMAXBEL 0020000 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 45 | #define IUTF8 0040000 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 46 | |
| 47 | #define OPOST 0000001 |
| 48 | #define OLCUC 0000002 |
| 49 | #define ONLCR 0000004 |
| 50 | #define OCRNL 0000010 |
| 51 | #define ONOCR 0000020 |
| 52 | #define ONLRET 0000040 |
| 53 | #define OFILL 0000100 |
| 54 | #define OFDEL 0000200 |
| 55 | #define NLDLY 0000400 |
| 56 | #define NL0 0000000 |
| 57 | #define NL1 0000400 |
| 58 | #define CRDLY 0003000 |
| 59 | #define CR0 0000000 |
| 60 | #define CR1 0001000 |
| 61 | #define CR2 0002000 |
| 62 | #define CR3 0003000 |
| 63 | #define TABDLY 0014000 |
| 64 | #define TAB0 0000000 |
| 65 | #define TAB1 0004000 |
| 66 | #define TAB2 0010000 |
| 67 | #define TAB3 0014000 |
| 68 | #define BSDLY 0020000 |
| 69 | #define BS0 0000000 |
| 70 | #define BS1 0020000 |
| 71 | #define FFDLY 0100000 |
| 72 | #define FF0 0000000 |
| 73 | #define FF1 0100000 |
| 74 | |
| 75 | #define VTDLY 0040000 |
| 76 | #define VT0 0000000 |
| 77 | #define VT1 0040000 |
| 78 | |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 79 | #define B0 0000000 |
| 80 | #define B50 0000001 |
| 81 | #define B75 0000002 |
| 82 | #define B110 0000003 |
| 83 | #define B134 0000004 |
| 84 | #define B150 0000005 |
| 85 | #define B200 0000006 |
| 86 | #define B300 0000007 |
| 87 | #define B600 0000010 |
| 88 | #define B1200 0000011 |
| 89 | #define B1800 0000012 |
| 90 | #define B2400 0000013 |
| 91 | #define B4800 0000014 |
| 92 | #define B9600 0000015 |
| 93 | #define B19200 0000016 |
| 94 | #define B38400 0000017 |
| 95 | |
| 96 | #define B57600 0010001 |
| 97 | #define B115200 0010002 |
| 98 | #define B230400 0010003 |
| 99 | #define B460800 0010004 |
| 100 | #define B500000 0010005 |
| 101 | #define B576000 0010006 |
| 102 | #define B921600 0010007 |
| 103 | #define B1000000 0010010 |
| 104 | #define B1152000 0010011 |
| 105 | #define B1500000 0010012 |
| 106 | #define B2000000 0010013 |
| 107 | #define B2500000 0010014 |
| 108 | #define B3000000 0010015 |
| 109 | #define B3500000 0010016 |
| 110 | #define B4000000 0010017 |
| 111 | |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 112 | #define CSIZE 0000060 |
| 113 | #define CS5 0000000 |
| 114 | #define CS6 0000020 |
| 115 | #define CS7 0000040 |
| 116 | #define CS8 0000060 |
| 117 | #define CSTOPB 0000100 |
| 118 | #define CREAD 0000200 |
| 119 | #define PARENB 0000400 |
| 120 | #define PARODD 0001000 |
| 121 | #define HUPCL 0002000 |
| 122 | #define CLOCAL 0004000 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 123 | |
| 124 | #define ISIG 0000001 |
| 125 | #define ICANON 0000002 |
| 126 | #define ECHO 0000010 |
| 127 | #define ECHOE 0000020 |
| 128 | #define ECHOK 0000040 |
| 129 | #define ECHONL 0000100 |
| 130 | #define NOFLSH 0000200 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 131 | #define IEXTEN 0000400 |
Rich Felker | 144dc4f | 2012-11-23 17:23:38 -0500 | [diff] [blame] | 132 | #define TOSTOP 0100000 |
| 133 | #define ITOSTOP 0100000 |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 134 | |
| 135 | #define TCOOFF 0 |
| 136 | #define TCOON 1 |
| 137 | #define TCIOFF 2 |
| 138 | #define TCION 3 |
| 139 | |
| 140 | #define TCIFLUSH 0 |
| 141 | #define TCOFLUSH 1 |
| 142 | #define TCIOFLUSH 2 |
| 143 | |
Rich Felker | cff5747 | 2016-07-13 15:04:30 -0400 | [diff] [blame] | 144 | #define TCSANOW 0 |
| 145 | #define TCSADRAIN 1 |
| 146 | #define TCSAFLUSH 2 |
Rich Felker | a627eb3 | 2014-01-08 19:20:55 -0500 | [diff] [blame] | 147 | |
| 148 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
Szabolcs Nagy | ee9b590 | 2016-07-03 17:08:54 +0200 | [diff] [blame] | 149 | #define EXTA 0000016 |
| 150 | #define EXTB 0000017 |
| 151 | #define CBAUD 0010017 |
Rich Felker | a627eb3 | 2014-01-08 19:20:55 -0500 | [diff] [blame] | 152 | #define CBAUDEX 0010000 |
Szabolcs Nagy | ee9b590 | 2016-07-03 17:08:54 +0200 | [diff] [blame] | 153 | #define CIBAUD 002003600000 |
| 154 | #define CMSPAR 010000000000 |
| 155 | #define CRTSCTS 020000000000 |
| 156 | |
| 157 | #define XCASE 0000004 |
| 158 | #define ECHOCTL 0001000 |
| 159 | #define ECHOPRT 0002000 |
| 160 | #define ECHOKE 0004000 |
| 161 | #define FLUSHO 0020000 |
| 162 | #define PENDIN 0040000 |
Rich Felker | a627eb3 | 2014-01-08 19:20:55 -0500 | [diff] [blame] | 163 | #define EXTPROC 0200000 |
Szabolcs Nagy | ee9b590 | 2016-07-03 17:08:54 +0200 | [diff] [blame] | 164 | |
Rich Felker | a627eb3 | 2014-01-08 19:20:55 -0500 | [diff] [blame] | 165 | #define XTABS 0014000 |
Szabolcs Nagy | 9eda4dc | 2017-11-27 01:16:14 +0000 | [diff] [blame^] | 166 | #define TIOCSER_TEMT 0x01 |
Rich Felker | a627eb3 | 2014-01-08 19:20:55 -0500 | [diff] [blame] | 167 | #endif |