| 1 |
/* |
| 2 |
* Copyright (c) 2002-2016, the original author or authors. |
| 3 |
* |
| 4 |
* This software is distributable under the BSD license. See the terms of the |
| 5 |
* BSD license in the documentation provided with this software. |
| 6 |
* |
| 7 |
* http://www.opensource.org/licenses/bsd-license.php |
| 8 |
*/ |
| 9 |
package org.jline.terminal.impl.jna.solaris; |
| 10 |
|
| 11 |
import java.util.Arrays; |
| 12 |
import java.util.EnumMap; |
| 13 |
import java.util.EnumSet; |
| 14 |
import java.util.List; |
| 15 |
|
| 16 |
import com.sun.jna.LastErrorException; |
| 17 |
import com.sun.jna.Structure; |
| 18 |
import org.jline.terminal.Attributes; |
| 19 |
import org.jline.terminal.Attributes.ControlChar; |
| 20 |
import org.jline.terminal.Attributes.ControlFlag; |
| 21 |
import org.jline.terminal.Attributes.InputFlag; |
| 22 |
import org.jline.terminal.Attributes.LocalFlag; |
| 23 |
import org.jline.terminal.Attributes.OutputFlag; |
| 24 |
import org.jline.terminal.Size; |
| 25 |
|
| 26 |
public interface CLibrary extends com.sun.jna.Library { |
| 27 |
|
| 28 |
void tcgetattr(int fd, termios termios) throws LastErrorException; |
| 29 |
|
| 30 |
void tcsetattr(int fd, int cmd, termios termios) throws LastErrorException; |
| 31 |
|
| 32 |
void ioctl(int fd, long cmd, winsize data) throws LastErrorException; |
| 33 |
|
| 34 |
// int isatty(int fd); |
| 35 |
|
| 36 |
void ttyname_r(int fd, byte[] buf, int len) throws LastErrorException; |
| 37 |
|
| 38 |
void openpty(int[] master, int[] slave, byte[] name, termios t, winsize s) throws LastErrorException; |
| 39 |
|
| 40 |
class winsize extends Structure { |
| 41 |
public short ws_row; |
| 42 |
public short ws_col; |
| 43 |
public short ws_xpixel; |
| 44 |
public short ws_ypixel; |
| 45 |
|
| 46 |
public winsize() { |
| 47 |
} |
| 48 |
|
| 49 |
public winsize(Size ws) { |
| 50 |
ws_row = (short) ws.getRows(); |
| 51 |
ws_col = (short) ws.getColumns(); |
| 52 |
} |
| 53 |
|
| 54 |
public Size toSize() { |
| 55 |
return new Size(ws_col, ws_row); |
| 56 |
} |
| 57 |
|
| 58 |
@Override |
| 59 |
protected List<String> getFieldOrder() { |
| 60 |
return Arrays.asList(// |
| 61 |
"ws_row",// |
| 62 |
"ws_col",// |
| 63 |
"ws_xpixel",// |
| 64 |
"ws_ypixel"// |
| 65 |
); |
| 66 |
} |
| 67 |
|
| 68 |
} |
| 69 |
|
| 70 |
class termios extends Structure { |
| 71 |
|
| 72 |
public int c_iflag; |
| 73 |
public int c_oflag; |
| 74 |
public int c_cflag; |
| 75 |
public int c_lflag; |
| 76 |
public byte[] c_cc = new byte[32]; |
| 77 |
|
| 78 |
@Override |
| 79 |
protected List<String> getFieldOrder() { |
| 80 |
return Arrays.asList(// |
| 81 |
"c_iflag",// |
| 82 |
"c_oflag",// |
| 83 |
"c_cflag",// |
| 84 |
"c_lflag",// |
| 85 |
"c_cc"// |
| 86 |
); |
| 87 |
} |
| 88 |
|
| 89 |
public termios() { |
| 90 |
} |
| 91 |
|
| 92 |
public termios(Attributes t) { |
| 93 |
// Input flags |
| 94 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IGNBRK), IGNBRK, c_iflag); |
| 95 |
c_iflag = setFlag(t.getInputFlag(InputFlag.BRKINT), BRKINT, c_iflag); |
| 96 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IGNPAR), IGNPAR, c_iflag); |
| 97 |
c_iflag = setFlag(t.getInputFlag(InputFlag.PARMRK), PARMRK, c_iflag); |
| 98 |
c_iflag = setFlag(t.getInputFlag(InputFlag.INPCK), INPCK, c_iflag); |
| 99 |
c_iflag = setFlag(t.getInputFlag(InputFlag.ISTRIP), ISTRIP, c_iflag); |
| 100 |
c_iflag = setFlag(t.getInputFlag(InputFlag.INLCR), INLCR, c_iflag); |
| 101 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IGNCR), IGNCR, c_iflag); |
| 102 |
c_iflag = setFlag(t.getInputFlag(InputFlag.ICRNL), ICRNL, c_iflag); |
| 103 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IXON), IXON, c_iflag); |
| 104 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IXOFF), IXOFF, c_iflag); |
| 105 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IXANY), IXANY, c_iflag); |
| 106 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IMAXBEL), IMAXBEL, c_iflag); |
| 107 |
c_iflag = setFlag(t.getInputFlag(InputFlag.IUTF8), IUTF8, c_iflag); |
| 108 |
// Output flags |
| 109 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.OPOST), OPOST, c_oflag); |
| 110 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.ONLCR), ONLCR, c_oflag); |
| 111 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.OCRNL), OCRNL, c_oflag); |
| 112 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.ONOCR), ONOCR, c_oflag); |
| 113 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.ONLRET), ONLRET, c_oflag); |
| 114 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.OFILL), OFILL, c_oflag); |
| 115 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.NLDLY), NLDLY, c_oflag); |
| 116 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.TABDLY), TABDLY, c_oflag); |
| 117 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.CRDLY), CRDLY, c_oflag); |
| 118 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.FFDLY), FFDLY, c_oflag); |
| 119 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.BSDLY), BSDLY, c_oflag); |
| 120 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.VTDLY), VTDLY, c_oflag); |
| 121 |
c_oflag = setFlag(t.getOutputFlag(OutputFlag.OFDEL), OFDEL, c_oflag); |
| 122 |
// Control flags |
| 123 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CS5), CS5, c_cflag); |
| 124 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CS6), CS6, c_cflag); |
| 125 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CS7), CS7, c_cflag); |
| 126 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CS8), CS8, c_cflag); |
| 127 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CSTOPB), CSTOPB, c_cflag); |
| 128 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CREAD), CREAD, c_cflag); |
| 129 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.PARENB), PARENB, c_cflag); |
| 130 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.PARODD), PARODD, c_cflag); |
| 131 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.HUPCL), HUPCL, c_cflag); |
| 132 |
c_cflag = setFlag(t.getControlFlag(ControlFlag.CLOCAL), CLOCAL, c_cflag); |
| 133 |
// Local flags |
| 134 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHOKE), ECHOKE, c_lflag); |
| 135 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHOE), ECHOE, c_lflag); |
| 136 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHOK), ECHOK, c_lflag); |
| 137 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHO), ECHO, c_lflag); |
| 138 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHONL), ECHONL, c_lflag); |
| 139 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHOPRT), ECHOPRT, c_lflag); |
| 140 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ECHOCTL), ECHOCTL, c_lflag); |
| 141 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ISIG), ISIG, c_lflag); |
| 142 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.ICANON), ICANON, c_lflag); |
| 143 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.IEXTEN), IEXTEN, c_lflag); |
| 144 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.EXTPROC), EXTPROC, c_lflag); |
| 145 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.TOSTOP), TOSTOP, c_lflag); |
| 146 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.FLUSHO), FLUSHO, c_lflag); |
| 147 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.PENDIN), PENDIN, c_lflag); |
| 148 |
c_lflag = setFlag(t.getLocalFlag(LocalFlag.NOFLSH), NOFLSH, c_lflag); |
| 149 |
// Control chars |
| 150 |
c_cc[VEOF] = (byte) t.getControlChar(ControlChar.VEOF); |
| 151 |
c_cc[VEOL] = (byte) t.getControlChar(ControlChar.VEOL); |
| 152 |
c_cc[VEOL2] = (byte) t.getControlChar(ControlChar.VEOL2); |
| 153 |
c_cc[VERASE] = (byte) t.getControlChar(ControlChar.VERASE); |
| 154 |
c_cc[VWERASE] = (byte) t.getControlChar(ControlChar.VWERASE); |
| 155 |
c_cc[VKILL] = (byte) t.getControlChar(ControlChar.VKILL); |
| 156 |
c_cc[VREPRINT] = (byte) t.getControlChar(ControlChar.VREPRINT); |
| 157 |
c_cc[VINTR] = (byte) t.getControlChar(ControlChar.VINTR); |
| 158 |
c_cc[VQUIT] = (byte) t.getControlChar(ControlChar.VQUIT); |
| 159 |
c_cc[VSUSP] = (byte) t.getControlChar(ControlChar.VSUSP); |
| 160 |
c_cc[VSTART] = (byte) t.getControlChar(ControlChar.VSTART); |
| 161 |
c_cc[VSTOP] = (byte) t.getControlChar(ControlChar.VSTOP); |
| 162 |
c_cc[VLNEXT] = (byte) t.getControlChar(ControlChar.VLNEXT); |
| 163 |
c_cc[VDISCARD] = (byte) t.getControlChar(ControlChar.VDISCARD); |
| 164 |
c_cc[VMIN] = (byte) t.getControlChar(ControlChar.VMIN); |
| 165 |
c_cc[VTIME] = (byte) t.getControlChar(ControlChar.VTIME); |
| 166 |
} |
| 167 |
|
| 168 |
private int setFlag(boolean flag, int value, int org) { |
| 169 |
return flag ? (org | value) : org; |
| 170 |
} |
| 171 |
|
| 172 |
public Attributes toAttributes() { |
| 173 |
Attributes attr = new Attributes(); |
| 174 |
// Input flags |
| 175 |
EnumSet<InputFlag> iflag = attr.getInputFlags(); |
| 176 |
addFlag(c_iflag, iflag, InputFlag.IGNBRK, IGNBRK); |
| 177 |
addFlag(c_iflag, iflag, InputFlag.IGNBRK, IGNBRK); |
| 178 |
addFlag(c_iflag, iflag, InputFlag.BRKINT, BRKINT); |
| 179 |
addFlag(c_iflag, iflag, InputFlag.IGNPAR, IGNPAR); |
| 180 |
addFlag(c_iflag, iflag, InputFlag.PARMRK, PARMRK); |
| 181 |
addFlag(c_iflag, iflag, InputFlag.INPCK, INPCK); |
| 182 |
addFlag(c_iflag, iflag, InputFlag.ISTRIP, ISTRIP); |
| 183 |
addFlag(c_iflag, iflag, InputFlag.INLCR, INLCR); |
| 184 |
addFlag(c_iflag, iflag, InputFlag.IGNCR, IGNCR); |
| 185 |
addFlag(c_iflag, iflag, InputFlag.ICRNL, ICRNL); |
| 186 |
addFlag(c_iflag, iflag, InputFlag.IXON, IXON); |
| 187 |
addFlag(c_iflag, iflag, InputFlag.IXOFF, IXOFF); |
| 188 |
addFlag(c_iflag, iflag, InputFlag.IXANY, IXANY); |
| 189 |
addFlag(c_iflag, iflag, InputFlag.IMAXBEL, IMAXBEL); |
| 190 |
addFlag(c_iflag, iflag, InputFlag.IUTF8, IUTF8); |
| 191 |
// Output flags |
| 192 |
EnumSet<OutputFlag> oflag = attr.getOutputFlags(); |
| 193 |
addFlag(c_oflag, oflag, OutputFlag.OPOST, OPOST); |
| 194 |
addFlag(c_oflag, oflag, OutputFlag.ONLCR, ONLCR); |
| 195 |
addFlag(c_oflag, oflag, OutputFlag.OCRNL, OCRNL); |
| 196 |
addFlag(c_oflag, oflag, OutputFlag.ONOCR, ONOCR); |
| 197 |
addFlag(c_oflag, oflag, OutputFlag.ONLRET, ONLRET); |
| 198 |
addFlag(c_oflag, oflag, OutputFlag.OFILL, OFILL); |
| 199 |
addFlag(c_oflag, oflag, OutputFlag.NLDLY, NLDLY); |
| 200 |
addFlag(c_oflag, oflag, OutputFlag.TABDLY, TABDLY); |
| 201 |
addFlag(c_oflag, oflag, OutputFlag.CRDLY, CRDLY); |
| 202 |
addFlag(c_oflag, oflag, OutputFlag.FFDLY, FFDLY); |
| 203 |
addFlag(c_oflag, oflag, OutputFlag.BSDLY, BSDLY); |
| 204 |
addFlag(c_oflag, oflag, OutputFlag.VTDLY, VTDLY); |
| 205 |
addFlag(c_oflag, oflag, OutputFlag.OFDEL, OFDEL); |
| 206 |
// Control flags |
| 207 |
EnumSet<ControlFlag> cflag = attr.getControlFlags(); |
| 208 |
addFlag(c_cflag, cflag, ControlFlag.CS5, CS5); |
| 209 |
addFlag(c_cflag, cflag, ControlFlag.CS6, CS6); |
| 210 |
addFlag(c_cflag, cflag, ControlFlag.CS7, CS7); |
| 211 |
addFlag(c_cflag, cflag, ControlFlag.CS8, CS8); |
| 212 |
addFlag(c_cflag, cflag, ControlFlag.CSTOPB, CSTOPB); |
| 213 |
addFlag(c_cflag, cflag, ControlFlag.CREAD, CREAD); |
| 214 |
addFlag(c_cflag, cflag, ControlFlag.PARENB, PARENB); |
| 215 |
addFlag(c_cflag, cflag, ControlFlag.PARODD, PARODD); |
| 216 |
addFlag(c_cflag, cflag, ControlFlag.HUPCL, HUPCL); |
| 217 |
addFlag(c_cflag, cflag, ControlFlag.CLOCAL, CLOCAL); |
| 218 |
// Local flags |
| 219 |
EnumSet<LocalFlag> lflag = attr.getLocalFlags(); |
| 220 |
addFlag(c_lflag, lflag, LocalFlag.ECHOKE, ECHOKE); |
| 221 |
addFlag(c_lflag, lflag, LocalFlag.ECHOE, ECHOE); |
| 222 |
addFlag(c_lflag, lflag, LocalFlag.ECHOK, ECHOK); |
| 223 |
addFlag(c_lflag, lflag, LocalFlag.ECHO, ECHO); |
| 224 |
addFlag(c_lflag, lflag, LocalFlag.ECHONL, ECHONL); |
| 225 |
addFlag(c_lflag, lflag, LocalFlag.ECHOPRT, ECHOPRT); |
| 226 |
addFlag(c_lflag, lflag, LocalFlag.ECHOCTL, ECHOCTL); |
| 227 |
addFlag(c_lflag, lflag, LocalFlag.ISIG, ISIG); |
| 228 |
addFlag(c_lflag, lflag, LocalFlag.ICANON, ICANON); |
| 229 |
addFlag(c_lflag, lflag, LocalFlag.IEXTEN, IEXTEN); |
| 230 |
addFlag(c_lflag, lflag, LocalFlag.EXTPROC, EXTPROC); |
| 231 |
addFlag(c_lflag, lflag, LocalFlag.TOSTOP, TOSTOP); |
| 232 |
addFlag(c_lflag, lflag, LocalFlag.FLUSHO, FLUSHO); |
| 233 |
addFlag(c_lflag, lflag, LocalFlag.PENDIN, PENDIN); |
| 234 |
addFlag(c_lflag, lflag, LocalFlag.NOFLSH, NOFLSH); |
| 235 |
// Control chars |
| 236 |
EnumMap<ControlChar, Integer> cc = attr.getControlChars(); |
| 237 |
cc.put(ControlChar.VEOF, (int) c_cc[VEOF]); |
| 238 |
cc.put(ControlChar.VEOL, (int) c_cc[VEOL]); |
| 239 |
cc.put(ControlChar.VEOL2, (int) c_cc[VEOL2]); |
| 240 |
cc.put(ControlChar.VERASE, (int) c_cc[VERASE]); |
| 241 |
cc.put(ControlChar.VWERASE, (int) c_cc[VWERASE]); |
| 242 |
cc.put(ControlChar.VKILL, (int) c_cc[VKILL]); |
| 243 |
cc.put(ControlChar.VREPRINT, (int) c_cc[VREPRINT]); |
| 244 |
cc.put(ControlChar.VINTR, (int) c_cc[VINTR]); |
| 245 |
cc.put(ControlChar.VQUIT, (int) c_cc[VQUIT]); |
| 246 |
cc.put(ControlChar.VSUSP, (int) c_cc[VSUSP]); |
| 247 |
cc.put(ControlChar.VSTART, (int) c_cc[VSTART]); |
| 248 |
cc.put(ControlChar.VSTOP, (int) c_cc[VSTOP]); |
| 249 |
cc.put(ControlChar.VLNEXT, (int) c_cc[VLNEXT]); |
| 250 |
cc.put(ControlChar.VDISCARD, (int) c_cc[VDISCARD]); |
| 251 |
cc.put(ControlChar.VMIN, (int) c_cc[VMIN]); |
| 252 |
cc.put(ControlChar.VTIME, (int) c_cc[VTIME]); |
| 253 |
// Return |
| 254 |
return attr; |
| 255 |
} |
| 256 |
|
| 257 |
private <T extends Enum<T>> void addFlag(int value, EnumSet<T> flags, T flag, int v) { |
| 258 |
if ((value & v) != 0) { |
| 259 |
flags.add(flag); |
| 260 |
} |
| 261 |
} |
| 262 |
} |
| 263 |
|
| 264 |
// CONSTANTS |
| 265 |
|
| 266 |
int _TIOC = ( 'T' << 8 ); |
| 267 |
int TIOCGWINSZ = ( _TIOC | 104 ); |
| 268 |
int TIOCSWINSZ = ( _TIOC | 103 ); |
| 269 |
|
| 270 |
int VINTR = 0; |
| 271 |
int VQUIT = 1; |
| 272 |
int VERASE = 2; |
| 273 |
int VKILL = 3; |
| 274 |
int VEOF = 4; |
| 275 |
int VTIME = 5; |
| 276 |
int VMIN = 6; |
| 277 |
int VSWTC = 7; |
| 278 |
int VSTART = 8; |
| 279 |
int VSTOP = 9; |
| 280 |
int VSUSP = 10; |
| 281 |
int VEOL = 11; |
| 282 |
int VREPRINT = 12; |
| 283 |
int VDISCARD = 13; |
| 284 |
int VWERASE = 14; |
| 285 |
int VLNEXT = 15; |
| 286 |
int VEOL2 = 16; |
| 287 |
|
| 288 |
int IGNBRK = 0x0000001; |
| 289 |
int BRKINT = 0x0000002; |
| 290 |
int IGNPAR = 0x0000004; |
| 291 |
int PARMRK = 0x0000010; |
| 292 |
int INPCK = 0x0000020; |
| 293 |
int ISTRIP = 0x0000040; |
| 294 |
int INLCR = 0x0000100; |
| 295 |
int IGNCR = 0x0000200; |
| 296 |
int ICRNL = 0x0000400; |
| 297 |
int IUCLC = 0x0001000; |
| 298 |
int IXON = 0x0002000; |
| 299 |
int IXANY = 0x0004000; |
| 300 |
int IXOFF = 0x0010000; |
| 301 |
int IMAXBEL = 0x0020000; |
| 302 |
int IUTF8 = 0x0040000; |
| 303 |
|
| 304 |
int OPOST = 0x0000001; |
| 305 |
int OLCUC = 0x0000002; |
| 306 |
int ONLCR = 0x0000004; |
| 307 |
int OCRNL = 0x0000010; |
| 308 |
int ONOCR = 0x0000020; |
| 309 |
int ONLRET = 0x0000040; |
| 310 |
int OFILL = 0x0000100; |
| 311 |
int OFDEL = 0x0000200; |
| 312 |
int NLDLY = 0x0000400; |
| 313 |
int NL0 = 0x0000000; |
| 314 |
int NL1 = 0x0000400; |
| 315 |
int CRDLY = 0x0003000; |
| 316 |
int CR0 = 0x0000000; |
| 317 |
int CR1 = 0x0001000; |
| 318 |
int CR2 = 0x0002000; |
| 319 |
int CR3 = 0x0003000; |
| 320 |
int TABDLY = 0x0014000; |
| 321 |
int TAB0 = 0x0000000; |
| 322 |
int TAB1 = 0x0004000; |
| 323 |
int TAB2 = 0x0010000; |
| 324 |
int TAB3 = 0x0014000; |
| 325 |
int XTABS = 0x0014000; |
| 326 |
int BSDLY = 0x0020000; |
| 327 |
int BS0 = 0x0000000; |
| 328 |
int BS1 = 0x0020000; |
| 329 |
int VTDLY = 0x0040000; |
| 330 |
int VT0 = 0x0000000; |
| 331 |
int VT1 = 0x0040000; |
| 332 |
int FFDLY = 0x0100000; |
| 333 |
int FF0 = 0x0000000; |
| 334 |
int FF1 = 0x0100000; |
| 335 |
|
| 336 |
int CBAUD = 0x0010017; |
| 337 |
int B0 = 0x0000000; |
| 338 |
int B50 = 0x0000001; |
| 339 |
int B75 = 0x0000002; |
| 340 |
int B110 = 0x0000003; |
| 341 |
int B134 = 0x0000004; |
| 342 |
int B150 = 0x0000005; |
| 343 |
int B200 = 0x0000006; |
| 344 |
int B300 = 0x0000007; |
| 345 |
int B600 = 0x0000010; |
| 346 |
int B1200 = 0x0000011; |
| 347 |
int B1800 = 0x0000012; |
| 348 |
int B2400 = 0x0000013; |
| 349 |
int B4800 = 0x0000014; |
| 350 |
int B9600 = 0x0000015; |
| 351 |
int B19200 = 0x0000016; |
| 352 |
int B38400 = 0x0000017; |
| 353 |
int EXTA = 0xB19200; |
| 354 |
int EXTB = 0xB38400; |
| 355 |
int CSIZE = 0x0000060; |
| 356 |
int CS5 = 0x0000000; |
| 357 |
int CS6 = 0x0000020; |
| 358 |
int CS7 = 0x0000040; |
| 359 |
int CS8 = 0x0000060; |
| 360 |
int CSTOPB = 0x0000100; |
| 361 |
int CREAD = 0x0000200; |
| 362 |
int PARENB = 0x0000400; |
| 363 |
int PARODD = 0x0001000; |
| 364 |
int HUPCL = 0x0002000; |
| 365 |
int CLOCAL = 0x0004000; |
| 366 |
|
| 367 |
int ISIG = 0x0000001; |
| 368 |
int ICANON = 0x0000002; |
| 369 |
int XCASE = 0x0000004; |
| 370 |
int ECHO = 0x0000010; |
| 371 |
int ECHOE = 0x0000020; |
| 372 |
int ECHOK = 0x0000040; |
| 373 |
int ECHONL = 0x0000100; |
| 374 |
int NOFLSH = 0x0000200; |
| 375 |
int TOSTOP = 0x0000400; |
| 376 |
int ECHOCTL = 0x0001000; |
| 377 |
int ECHOPRT = 0x0002000; |
| 378 |
int ECHOKE = 0x0004000; |
| 379 |
int FLUSHO = 0x0010000; |
| 380 |
int PENDIN = 0x0040000; |
| 381 |
int IEXTEN = 0x0100000; |
| 382 |
int EXTPROC = 0x0200000; |
| 383 |
|
| 384 |
int TCSANOW = 0x0; |
| 385 |
int TCSADRAIN = 0x1; |
| 386 |
int TCSAFLUSH = 0x2; |
| 387 |
|
| 388 |
} |