authorgravatar for wc3ft2@gmail.comZapolsky Anton <wc3ft2@gmail.com> 2021-12-05 00:24:55+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-12-04 16:24:55-05:00
log2dae860de3494f97c9477af9282fe0131ff5c4cb
tree85bd76fc7f54cf0a6e55435ad8e154f50e2b6e5a
parent282e2c714fe36480ac0a4bef38d6209737819229
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Added an explicit type for the termios constants (#10266)

Adds the `tcflag_t` type to the termios constants. This is made to allow bitwise operations on the termios constants without an integer cast, e.g.: ```zig var raw = try std.os.tcgetattr(std.os.STDIN_FILENO); raw.lflag &= std.os.linux.ECHO | std.os.linux.ICANON; ``` instead of ```zig var raw = try std.os.tcgetattr(std.os.STDIN_FILENO); raw.lflag &= ~@intCast(u32, std.os.linux.ECHO | std.os.linux.ICANON); ``` Contributes to #10181

3 files changed, 223 insertions(+), 222 deletions(-)

lib/std/c/darwin.zig+130-130
...@@ -1788,99 +1788,103 @@ pub const V = struct {...@@ -1788,99 +1788,103 @@ pub const V = struct {
17881788
1789pub const NCCS = 20; // 2 spares (7, 19)1789pub const NCCS = 20; // 2 spares (7, 19)
17901790
1791pub const IGNBRK = 0x00000001; // ignore BREAK condition1791pub const cc_t = u8;
1792pub const BRKINT = 0x00000002; // map BREAK to SIGINTR1792pub const speed_t = u64;
1793pub const IGNPAR = 0x00000004; // ignore (discard) parity errors1793pub const tcflag_t = u64;
1794pub const PARMRK = 0x00000008; // mark parity and framing errors1794
1795pub const INPCK = 0x00000010; // enable checking of parity errors1795pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition
1796pub const ISTRIP = 0x00000020; // strip 8th bit off chars1796pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINTR
1797pub const INLCR = 0x00000040; // map NL into CR1797pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors
1798pub const IGNCR = 0x00000080; // ignore CR1798pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors
1799pub const ICRNL = 0x00000100; // map CR to NL (ala CRMOD)1799pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors
1800pub const IXON = 0x00000200; // enable output flow control1800pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars
1801pub const IXOFF = 0x00000400; // enable input flow control1801pub const INLCR: tcflag_t = 0x00000040; // map NL into CR
1802pub const IXANY = 0x00000800; // any char will restart after stop1802pub const IGNCR: tcflag_t = 0x00000080; // ignore CR
1803pub const IMAXBEL = 0x00002000; // ring bell on input queue full1803pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD)
1804pub const IUTF8 = 0x00004000; // maintain state for UTF-8 VERASE1804pub const IXON: tcflag_t = 0x00000200; // enable output flow control
18051805pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control
1806pub const OPOST = 0x00000001; //enable following output processing1806pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop
1807pub const ONLCR = 0x00000002; // map NL to CR-NL (ala CRMOD)1807pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full
1808pub const OXTABS = 0x00000004; // expand tabs to spaces1808pub const IUTF8: tcflag_t = 0x00004000; // maintain state for UTF-8 VERASE
1809pub const ONOEOT = 0x00000008; // discard EOT's (^D) on output)1809
18101810pub const OPOST: tcflag_t = 0x00000001; //enable following output processing
1811pub const OCRNL = 0x00000010; // map CR to NL on output1811pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD)
1812pub const ONOCR = 0x00000020; // no CR output at column 01812pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces
1813pub const ONLRET = 0x00000040; // NL performs CR function1813pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output)
1814pub const OFILL = 0x00000080; // use fill characters for delay1814
1815pub const NLDLY = 0x00000300; // \n delay1815pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL on output
1816pub const TABDLY = 0x00000c04; // horizontal tab delay1816pub const ONOCR: tcflag_t = 0x00000020; // no CR output at column 0
1817pub const CRDLY = 0x00003000; // \r delay1817pub const ONLRET: tcflag_t = 0x00000040; // NL performs CR function
1818pub const FFDLY = 0x00004000; // form feed delay1818pub const OFILL: tcflag_t = 0x00000080; // use fill characters for delay
1819pub const BSDLY = 0x00008000; // \b delay1819pub const NLDLY: tcflag_t = 0x00000300; // \n delay
1820pub const VTDLY = 0x00010000; // vertical tab delay1820pub const TABDLY: tcflag_t = 0x00000c04; // horizontal tab delay
1821pub const OFDEL = 0x00020000; // fill is DEL, else NUL1821pub const CRDLY: tcflag_t = 0x00003000; // \r delay
18221822pub const FFDLY: tcflag_t = 0x00004000; // form feed delay
1823pub const NL0 = 0x00000000;1823pub const BSDLY: tcflag_t = 0x00008000; // \b delay
1824pub const NL1 = 0x00000100;1824pub const VTDLY: tcflag_t = 0x00010000; // vertical tab delay
1825pub const NL2 = 0x00000200;1825pub const OFDEL: tcflag_t = 0x00020000; // fill is DEL, else NUL
1826pub const NL3 = 0x00000300;1826
1827pub const TAB0 = 0x00000000;1827pub const NL0: tcflag_t = 0x00000000;
1828pub const TAB1 = 0x00000400;1828pub const NL1: tcflag_t = 0x00000100;
1829pub const TAB2 = 0x00000800;1829pub const NL2: tcflag_t = 0x00000200;
1830pub const TAB3 = 0x00000004;1830pub const NL3: tcflag_t = 0x00000300;
1831pub const CR0 = 0x00000000;1831pub const TAB0: tcflag_t = 0x00000000;
1832pub const CR1 = 0x00001000;1832pub const TAB1: tcflag_t = 0x00000400;
1833pub const CR2 = 0x00002000;1833pub const TAB2: tcflag_t = 0x00000800;
1834pub const CR3 = 0x00003000;1834pub const TAB3: tcflag_t = 0x00000004;
1835pub const FF0 = 0x00000000;1835pub const CR0: tcflag_t = 0x00000000;
1836pub const FF1 = 0x00004000;1836pub const CR1: tcflag_t = 0x00001000;
1837pub const BS0 = 0x00000000;1837pub const CR2: tcflag_t = 0x00002000;
1838pub const BS1 = 0x00008000;1838pub const CR3: tcflag_t = 0x00003000;
1839pub const VT0 = 0x00000000;1839pub const FF0: tcflag_t = 0x00000000;
1840pub const VT1 = 0x00010000;1840pub const FF1: tcflag_t = 0x00004000;
18411841pub const BS0: tcflag_t = 0x00000000;
1842pub const CIGNORE = 0x00000001; // ignore control flags1842pub const BS1: tcflag_t = 0x00008000;
1843pub const CSIZE = 0x00000300; // character size mask1843pub const VT0: tcflag_t = 0x00000000;
1844pub const CS5 = 0x00000000; // 5 bits (pseudo)1844pub const VT1: tcflag_t = 0x00010000;
1845pub const CS6 = 0x00000100; // 6 bits1845
1846pub const CS7 = 0x00000200; // 7 bits1846pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags
1847pub const CS8 = 0x00000300; // 8 bits1847pub const CSIZE: tcflag_t = 0x00000300; // character size mask
1848pub const CSTOPB = 0x0000040; // send 2 stop bits1848pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo)
1849pub const CREAD = 0x00000800; // enable receiver1849pub const CS6: tcflag_t = 0x00000100; // 6 bits
1850pub const PARENB = 0x00001000; // parity enable1850pub const CS7: tcflag_t = 0x00000200; // 7 bits
1851pub const PARODD = 0x00002000; // odd parity, else even1851pub const CS8: tcflag_t = 0x00000300; // 8 bits
1852pub const HUPCL = 0x00004000; // hang up on last close1852pub const CSTOPB: tcflag_t = 0x0000040; // send 2 stop bits
1853pub const CLOCAL = 0x00008000; // ignore modem status lines1853pub const CREAD: tcflag_t = 0x00000800; // enable receiver
1854pub const CCTS_OFLOW = 0x00010000; // CTS flow control of output1854pub const PARENB: tcflag_t = 0x00001000; // parity enable
1855pub const CRTSCTS = (CCTS_OFLOW | CRTS_IFLOW);1855pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even
1856pub const CRTS_IFLOW = 0x00020000; // RTS flow control of input1856pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close
1857pub const CDTR_IFLOW = 0x00040000; // DTR flow control of input1857pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines
1858pub const CDSR_OFLOW = 0x00080000; // DSR flow control of output1858pub const CCTS_OFLOW: tcflag_t = 0x00010000; // CTS flow control of output
1859pub const CCAR_OFLOW = 0x00100000; // DCD flow control of output1859pub const CRTSCTS: tcflag_t = (CCTS_OFLOW | CRTS_IFLOW);
1860pub const MDMBUF = 0x00100000; // old name for CCAR_OFLOW1860pub const CRTS_IFLOW: tcflag_t = 0x00020000; // RTS flow control of input
18611861pub const CDTR_IFLOW: tcflag_t = 0x00040000; // DTR flow control of input
1862pub const ECHOKE = 0x00000001; // visual erase for line kill1862pub const CDSR_OFLOW: tcflag_t = 0x00080000; // DSR flow control of output
1863pub const ECHOE = 0x00000002; // visually erase chars1863pub const CCAR_OFLOW: tcflag_t = 0x00100000; // DCD flow control of output
1864pub const ECHOK = 0x00000004; // echo NL after line kill1864pub const MDMBUF: tcflag_t = 0x00100000; // old name for CCAR_OFLOW
1865pub const ECHO = 0x00000008; // enable echoing1865
1866pub const ECHONL = 0x00000010; // echo NL even if ECHO is off1866pub const ECHOKE: tcflag_t = 0x00000001; // visual erase for line kill
1867pub const ECHOPRT = 0x00000020; // visual erase mode for hardcopy1867pub const ECHOE: tcflag_t = 0x00000002; // visually erase chars
1868pub const ECHOCTL = 0x00000040; // echo control chars as ^(Char)1868pub const ECHOK: tcflag_t = 0x00000004; // echo NL after line kill
1869pub const ISIG = 0x00000080; // enable signals INTR, QUIT, [D]SUSP1869pub const ECHO: tcflag_t = 0x00000008; // enable echoing
1870pub const ICANON = 0x00000100; // canonicalize input lines1870pub const ECHONL: tcflag_t = 0x00000010; // echo NL even if ECHO is off
1871pub const ALTWERASE = 0x00000200; // use alternate WERASE algorithm1871pub const ECHOPRT: tcflag_t = 0x00000020; // visual erase mode for hardcopy
1872pub const IEXTEN = 0x00000400; // enable DISCARD and LNEXT1872pub const ECHOCTL: tcflag_t = 0x00000040; // echo control chars as ^(Char)
1873pub const EXTPROC = 0x00000800; // external processing1873pub const ISIG: tcflag_t = 0x00000080; // enable signals INTR, QUIT, [D]SUSP
1874pub const TOSTOP = 0x00400000; // stop background jobs from output1874pub const ICANON: tcflag_t = 0x00000100; // canonicalize input lines
1875pub const FLUSHO = 0x00800000; // output being flushed (state)1875pub const ALTWERASE: tcflag_t = 0x00000200; // use alternate WERASE algorithm
1876pub const NOKERNINFO = 0x02000000; // no kernel output from VSTATUS1876pub const IEXTEN: tcflag_t = 0x00000400; // enable DISCARD and LNEXT
1877pub const PENDIN = 0x20000000; // XXX retype pending input (state)1877pub const EXTPROC: tcflag_t = 0x00000800; // external processing
1878pub const NOFLSH = 0x80000000; // don't flush after interrupt1878pub const TOSTOP: tcflag_t = 0x00400000; // stop background jobs from output
18791879pub const FLUSHO: tcflag_t = 0x00800000; // output being flushed (state)
1880pub const TCSANOW = 0; // make change immediate1880pub const NOKERNINFO: tcflag_t = 0x02000000; // no kernel output from VSTATUS
1881pub const TCSADRAIN = 1; // drain output, then change1881pub const PENDIN: tcflag_t = 0x20000000; // XXX retype pending input (state)
1882pub const TCSAFLUSH = 2; // drain output, flush input1882pub const NOFLSH: tcflag_t = 0x80000000; // don't flush after interrupt
1883pub const TCSASOFT = 0x10; // flag - don't alter h.w. state1883
1884pub const TCSANOW: tcflag_t = 0; // make change immediate
1885pub const TCSADRAIN: tcflag_t = 1; // drain output, then change
1886pub const TCSAFLUSH: tcflag_t = 2; // drain output, flush input
1887pub const TCSASOFT: tcflag_t = 0x10; // flag - don't alter h.w. state
1884pub const TCSA = enum(c_uint) {1888pub const TCSA = enum(c_uint) {
1885 NOW,1889 NOW,
1886 DRAIN,1890 DRAIN,
...@@ -1888,43 +1892,39 @@ pub const TCSA = enum(c_uint) {...@@ -1888,43 +1892,39 @@ pub const TCSA = enum(c_uint) {
1888 _,1892 _,
1889};1893};
18901894
1891pub const B0 = 0;1895pub const B0: tcflag_t = 0;
1892pub const B50 = 50;1896pub const B50: tcflag_t = 50;
1893pub const B75 = 75;1897pub const B75: tcflag_t = 75;
1894pub const B110 = 110;1898pub const B110: tcflag_t = 110;
1895pub const B134 = 134;1899pub const B134: tcflag_t = 134;
1896pub const B150 = 150;1900pub const B150: tcflag_t = 150;
1897pub const B200 = 200;1901pub const B200: tcflag_t = 200;
1898pub const B300 = 300;1902pub const B300: tcflag_t = 300;
1899pub const B600 = 600;1903pub const B600: tcflag_t = 600;
1900pub const B1200 = 1200;1904pub const B1200: tcflag_t = 1200;
1901pub const B1800 = 1800;1905pub const B1800: tcflag_t = 1800;
1902pub const B2400 = 2400;1906pub const B2400: tcflag_t = 2400;
1903pub const B4800 = 4800;1907pub const B4800: tcflag_t = 4800;
1904pub const B9600 = 9600;1908pub const B9600: tcflag_t = 9600;
1905pub const B19200 = 19200;1909pub const B19200: tcflag_t = 19200;
1906pub const B38400 = 38400;1910pub const B38400: tcflag_t = 38400;
1907pub const B7200 = 7200;1911pub const B7200: tcflag_t = 7200;
1908pub const B14400 = 14400;1912pub const B14400: tcflag_t = 14400;
1909pub const B28800 = 28800;1913pub const B28800: tcflag_t = 28800;
1910pub const B57600 = 57600;1914pub const B57600: tcflag_t = 57600;
1911pub const B76800 = 76800;1915pub const B76800: tcflag_t = 76800;
1912pub const B115200 = 115200;1916pub const B115200: tcflag_t = 115200;
1913pub const B230400 = 230400;1917pub const B230400: tcflag_t = 230400;
1914pub const EXTA = 19200;1918pub const EXTA: tcflag_t = 19200;
1915pub const EXTB = 38400;1919pub const EXTB: tcflag_t = 38400;
19161920
1917pub const TCIFLUSH = 1;1921pub const TCIFLUSH: tcflag_t = 1;
1918pub const TCOFLUSH = 2;1922pub const TCOFLUSH: tcflag_t = 2;
1919pub const TCIOFLUSH = 3;1923pub const TCIOFLUSH: tcflag_t = 3;
1920pub const TCOOFF = 1;1924pub const TCOOFF: tcflag_t = 1;
1921pub const TCOON = 2;1925pub const TCOON: tcflag_t = 2;
1922pub const TCIOFF = 3;1926pub const TCIOFF: tcflag_t = 3;
1923pub const TCION = 4;1927pub const TCION: tcflag_t = 4;
1924
1925pub const cc_t = u8;
1926pub const speed_t = u64;
1927pub const tcflag_t = u64;
19281928
1929pub const termios = extern struct {1929pub const termios = extern struct {
1930 iflag: tcflag_t, // input flags1930 iflag: tcflag_t, // input flags
lib/std/c/openbsd.zig+44-43
...@@ -726,56 +726,57 @@ const V = struct {...@@ -726,56 +726,57 @@ const V = struct {
726 pub const STATUS = 18; // ICANON726 pub const STATUS = 18; // ICANON
727 // 19 spare 2727 // 19 spare 2
728};728};
729
730pub const tcflag_t = c_uint;
731pub const speed_t = c_uint;
732pub const cc_t = u8;
733
729pub const NCCS = 20;734pub const NCCS = 20;
730735
731// Input flags - software input processing736// Input flags - software input processing
732pub const IGNBRK = 0x00000001; // ignore BREAK condition737pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition
733pub const BRKINT = 0x00000002; // map BREAK to SIGINT738pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINT
734pub const IGNPAR = 0x00000004; // ignore (discard) parity errors739pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors
735pub const PARMRK = 0x00000008; // mark parity and framing errors740pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors
736pub const INPCK = 0x00000010; // enable checking of parity errors741pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors
737pub const ISTRIP = 0x00000020; // strip 8th bit off chars742pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars
738pub const INLCR = 0x00000040; // map NL into CR743pub const INLCR: tcflag_t = 0x00000040; // map NL into CR
739pub const IGNCR = 0x00000080; // ignore CR744pub const IGNCR: tcflag_t = 0x00000080; // ignore CR
740pub const ICRNL = 0x00000100; // map CR to NL (ala CRMOD)745pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD)
741pub const IXON = 0x00000200; // enable output flow control746pub const IXON: tcflag_t = 0x00000200; // enable output flow control
742pub const IXOFF = 0x00000400; // enable input flow control747pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control
743pub const IXANY = 0x00000800; // any char will restart after stop748pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop
744pub const IUCLC = 0x00001000; // translate upper to lower case749pub const IUCLC: tcflag_t = 0x00001000; // translate upper to lower case
745pub const IMAXBEL = 0x00002000; // ring bell on input queue full750pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full
746751
747// Output flags - software output processing752// Output flags - software output processing
748pub const OPOST = 0x00000001; // enable following output processing753pub const OPOST: tcflag_t = 0x00000001; // enable following output processing
749pub const ONLCR = 0x00000002; // map NL to CR-NL (ala CRMOD)754pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD)
750pub const OXTABS = 0x00000004; // expand tabs to spaces755pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces
751pub const ONOEOT = 0x00000008; // discard EOT's (^D) on output756pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output
752pub const OCRNL = 0x00000010; // map CR to NL757pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL
753pub const OLCUC = 0x00000020; // translate lower case to upper case758pub const OLCUC: tcflag_t = 0x00000020; // translate lower case to upper case
754pub const ONOCR = 0x00000040; // No CR output at column 0759pub const ONOCR: tcflag_t = 0x00000040; // No CR output at column 0
755pub const ONLRET = 0x00000080; // NL performs the CR function760pub const ONLRET: tcflag_t = 0x00000080; // NL performs the CR function
756761
757// Control flags - hardware control of terminal762// Control flags - hardware control of terminal
758pub const CIGNORE = 0x00000001; // ignore control flags763pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags
759pub const CSIZE = 0x00000300; // character size mask764pub const CSIZE: tcflag_t = 0x00000300; // character size mask
760pub const CS5 = 0x00000000; // 5 bits (pseudo)765pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo)
761pub const CS6 = 0x00000100; // 6 bits766pub const CS6: tcflag_t = 0x00000100; // 6 bits
762pub const CS7 = 0x00000200; // 7 bits767pub const CS7: tcflag_t = 0x00000200; // 7 bits
763pub const CS8 = 0x00000300; // 8 bits768pub const CS8: tcflag_t = 0x00000300; // 8 bits
764pub const CSTOPB = 0x00000400; // send 2 stop bits769pub const CSTOPB: tcflag_t = 0x00000400; // send 2 stop bits
765pub const CREAD = 0x00000800; // enable receiver770pub const CREAD: tcflag_t = 0x00000800; // enable receiver
766pub const PARENB = 0x00001000; // parity enable771pub const PARENB: tcflag_t = 0x00001000; // parity enable
767pub const PARODD = 0x00002000; // odd parity, else even772pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even
768pub const HUPCL = 0x00004000; // hang up on last close773pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close
769pub const CLOCAL = 0x00008000; // ignore modem status lines774pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines
770pub const CRTSCTS = 0x00010000; // RTS/CTS full-duplex flow control775pub const CRTSCTS: tcflag_t = 0x00010000; // RTS/CTS full-duplex flow control
771pub const CRTS_IFLOW = CRTSCTS; // XXX compat776pub const CRTS_IFLOW: tcflag_t = CRTSCTS; // XXX compat
772pub const CCTS_OFLOW = CRTSCTS; // XXX compat777pub const CCTS_OFLOW: tcflag_t = CRTSCTS; // XXX compat
773pub const MDMBUF = 0x00100000; // DTR/DCD hardware flow control778pub const MDMBUF: tcflag_t = 0x00100000; // DTR/DCD hardware flow control
774pub const CHWFLOW = (MDMBUF | CRTSCTS); // all types of hw flow control779pub const CHWFLOW: tcflag_t = (MDMBUF | CRTSCTS); // all types of hw flow control
775
776pub const tcflag_t = c_uint;
777pub const speed_t = c_uint;
778pub const cc_t = u8;
779780
780pub const termios = extern struct {781pub const termios = extern struct {
781 iflag: tcflag_t, // input flags782 iflag: tcflag_t, // input flags
lib/std/os/linux.zig+49-49
...@@ -4096,55 +4096,55 @@ pub const V = switch (native_arch) {...@@ -4096,55 +4096,55 @@ pub const V = switch (native_arch) {
4096 },4096 },
4097};4097};
40984098
4099pub const IGNBRK = 1;4099pub const IGNBRK: tcflag_t = 1;
4100pub const BRKINT = 2;4100pub const BRKINT: tcflag_t = 2;
4101pub const IGNPAR = 4;4101pub const IGNPAR: tcflag_t = 4;
4102pub const PARMRK = 8;4102pub const PARMRK: tcflag_t = 8;
4103pub const INPCK = 16;4103pub const INPCK: tcflag_t = 16;
4104pub const ISTRIP = 32;4104pub const ISTRIP: tcflag_t = 32;
4105pub const INLCR = 64;4105pub const INLCR: tcflag_t = 64;
4106pub const IGNCR = 128;4106pub const IGNCR: tcflag_t = 128;
4107pub const ICRNL = 256;4107pub const ICRNL: tcflag_t = 256;
4108pub const IUCLC = 512;4108pub const IUCLC: tcflag_t = 512;
4109pub const IXON = 1024;4109pub const IXON: tcflag_t = 1024;
4110pub const IXANY = 2048;4110pub const IXANY: tcflag_t = 2048;
4111pub const IXOFF = 4096;4111pub const IXOFF: tcflag_t = 4096;
4112pub const IMAXBEL = 8192;4112pub const IMAXBEL: tcflag_t = 8192;
4113pub const IUTF8 = 16384;4113pub const IUTF8: tcflag_t = 16384;
41144114
4115pub const OPOST = 1;4115pub const OPOST: tcflag_t = 1;
4116pub const OLCUC = 2;4116pub const OLCUC: tcflag_t = 2;
4117pub const ONLCR = 4;4117pub const ONLCR: tcflag_t = 4;
4118pub const OCRNL = 8;4118pub const OCRNL: tcflag_t = 8;
4119pub const ONOCR = 16;4119pub const ONOCR: tcflag_t = 16;
4120pub const ONLRET = 32;4120pub const ONLRET: tcflag_t = 32;
4121pub const OFILL = 64;4121pub const OFILL: tcflag_t = 64;
4122pub const OFDEL = 128;4122pub const OFDEL: tcflag_t = 128;
4123pub const VTDLY = 16384;4123pub const VTDLY: tcflag_t = 16384;
4124pub const VT0 = 0;4124pub const VT0: tcflag_t = 0;
4125pub const VT1 = 16384;4125pub const VT1: tcflag_t = 16384;
41264126
4127pub const CSIZE = 48;4127pub const CSIZE: tcflag_t = 48;
4128pub const CS5 = 0;4128pub const CS5: tcflag_t = 0;
4129pub const CS6 = 16;4129pub const CS6: tcflag_t = 16;
4130pub const CS7 = 32;4130pub const CS7: tcflag_t = 32;
4131pub const CS8 = 48;4131pub const CS8: tcflag_t = 48;
4132pub const CSTOPB = 64;4132pub const CSTOPB: tcflag_t = 64;
4133pub const CREAD = 128;4133pub const CREAD: tcflag_t = 128;
4134pub const PARENB = 256;4134pub const PARENB: tcflag_t = 256;
4135pub const PARODD = 512;4135pub const PARODD: tcflag_t = 512;
4136pub const HUPCL = 1024;4136pub const HUPCL: tcflag_t = 1024;
4137pub const CLOCAL = 2048;4137pub const CLOCAL: tcflag_t = 2048;
41384138
4139pub const ISIG = 1;4139pub const ISIG: tcflag_t = 1;
4140pub const ICANON = 2;4140pub const ICANON: tcflag_t = 2;
4141pub const ECHO = 8;4141pub const ECHO: tcflag_t = 8;
4142pub const ECHOE = 16;4142pub const ECHOE: tcflag_t = 16;
4143pub const ECHOK = 32;4143pub const ECHOK: tcflag_t = 32;
4144pub const ECHONL = 64;4144pub const ECHONL: tcflag_t = 64;
4145pub const NOFLSH = 128;4145pub const NOFLSH: tcflag_t = 128;
4146pub const TOSTOP = 256;4146pub const TOSTOP: tcflag_t = 256;
4147pub const IEXTEN = 32768;4147pub const IEXTEN: tcflag_t = 32768;
41484148
4149pub const TCSA = enum(c_uint) {4149pub const TCSA = enum(c_uint) {
4150 NOW,4150 NOW,