MODULE LinTermios ["libc.so.66.0"]; (* A. V. Shiryaev, 2012.09 OpenBSD 5.2 32-bit *) CONST VEOF* = 0; (* ICANON *) VEOL* = 1; (* ICANON *) VERASE* = 3; (* ICANON *) VKILL* = 5; (* ICANON *) VINTR* = 8; (* ISIG *) VQUIT* = 9; (* ISIG *) VSUSP* = 10; (* ISIG *) VSTART* = 12; (* IXON, IXOFF *) VSTOP* = 13; (* IXON, IXOFF *) VMIN* = 16; (* !ICANON *) VTIME* = 17; (* !ICANON *) NCCS* = 20; IGNBRK* = 00000001H; (* ignore BREAK condition *) BRKINT* = 00000002H; (* map BREAK to SIGINT *) IGNPAR* = 00000004H; (* ignore (discard) parity errors *) PARMRK* = 00000008H; (* mark parity and framing errors *) INPCK* = 00000010H; (* enable checking of parity errors *) ISTRIP* = 00000020H; (* strip 8th bit off chars *) INLCR* = 00000040H; (* map NL into CR *) IGNCR* = 00000080H; (* ignore CR *) ICRNL* = 00000100H; (* map CR to NL (ala CRMOD) *) IXON* = 00000200H; (* enable output flow control *) IXOFF* = 00000400H; (* enable input flow control *) OPOST* = 00000001H; (* enable following output processing *) CSIZE* = 00000300H; (* character size mask *) CS5* = 00000000H; (* 5 bits (pseudo) *) CS6* = 00000100H; (* 6 bits *) CS7* = 00000200H; (* 7 bits *) CS8* = 00000300H; (* 8 bits *) CSTOPB* = 00000400H; (* send 2 stop bits *) CREAD* = 00000800H; (* enable receiver *) PARENB* = 00001000H; (* parity enable *) PARODD* = 00002000H; (* odd parity, else even *) HUPCL* = 00004000H; (* hang up on last close *) CLOCAL* = 00008000H; (* ignore modem status lines *) ECHOE* = 00000002H; (* visually erase chars *) ECHOK* = 00000004H; (* echo NL after line kill *) ECHO* = 00000008H; (* enable echoing *) ECHONL* = 00000010H; (* echo NL even if ECHO is off *) ISIG* = 00000080H; (* enable signals INTR, QUIT, [D]SUSP *) ICANON* = 00000100H; (* canonicalize input lines *) IEXTEN* = 00000400H; (* enable DISCARD and LNEXT *) EXTPROC* = 00000800H; (* external processing *) TOSTOP* = 00400000H; (* stop background jobs from output *) NOFLSH* = 80000000H; (* don't flush after interrupt *) TCSANOW* = 0; (* make change immediate *) TCSADRAIN* = 1; (* drain output, then change *) TCSAFLUSH* = 2; (* drain output, flush input *) B0* = 0; B50* = 50; B75* = 75; B110* = 110; B134* = 134; B150* = 150; B200* = 200; B300* = 300; B600* = 600; B1200* = 1200; B1800* = 1800; B2400* = 2400; B4800* = 4800; B9600* = 9600; B19200* = 19200; B38400* = 38400; VEOL2* = 2; (* ICANON *) VWERASE* = 4; (* ICANON *) VREPRINT* = 6; (* ICANON *) VDSUSP* = 11; (* ISIG *) VLNEXT* = 14; (* IEXTEN *) VDISCARD* = 15; (* IEXTEN *) VSTATUS* = 18; (* ICANON *) IXANY* = 00000800H; (* any char will restart after stop *) IUCLC* = 00001000H; (* translate upper to lower case *) IMAXBEL* = 00002000H; (* ring bell on input queue full *) ONLCR* = 00000002H; (* map NL to CR-NL (ala CRMOD) *) OXTABS* = 00000004H; (* expand tabs to spaces *) ONOEOT* = 00000008H; (* discard EOT's (^D) on output *) OCRNL* = 00000010H; (* map CR to NL *) OLCUC* = 00000020H; (* translate lower case to upper case *) ONOCR* = 00000040H; (* No CR output at column 0 *) ONLRET* = 00000080H; (* NL performs the CR function *) CIGNORE* = 00000001H; (* ignore control flags *) CRTSCTS* = 00010000H; (* RTS/CTS full-duplex flow control *) CRTS_IFLOW* = CRTSCTS; (* XXX compat *) CCTS_OFLOW* = CRTSCTS; (* XXX compat *) MDMBUF* = 00100000H; (* DTR/DCD hardware flow control *) ECHOKE* = 00000001H; (* visual erase for line kill *) ECHOPRT* = 00000020H; (* visual erase mode for hardcopy *) ECHOCTL* = 00000040H; (* echo control chars as ^(Char) *) ALTWERASE* = 00000200H; (* use alternate WERASE algorithm *) FLUSHO* = 00800000H; (* output being flushed (state) *) XCASE* = 01000000H; (* canonical upper/lower case *) NOKERNINFO* = 02000000H; (* no kernel output from VSTATUS *) PENDIN* = 20000000H; (* XXX retype pending input (state) *) TCSASOFT* = 10H; (* flag - don't alter h.w. state *) B7200* = 7200; B14400* = 14400; B28800* = 28800; B57600* = 57600; B76800* = 76800; B115200* = 115200; B230400* = 230400; EXTA* = 19200; EXTB* = 38400; TCIFLUSH* = 1; TCOFLUSH* = 2; TCIOFLUSH* = 3; TCOOFF* = 1; TCOON* = 2; TCIOFF* = 3; TCION* = 4; TYPE tcflag_t* = INTEGER; (* unsigned int *) cc_t* = SHORTCHAR; (* unsigned char *) speed_t* = INTEGER; (* unsigned int *) termios* = RECORD [untagged] c_iflag*: tcflag_t; (* input flags *) c_oflag*: tcflag_t; (* output flags *) c_cflag*: tcflag_t; (* control flags *) c_lflag*: tcflag_t; (* local flags *) cc_t*: ARRAY [untagged] NCCS OF cc_t; (* control chars *) c_ispeed*: INTEGER; (* input speed *) c_ospeed*: INTEGER; (* output speed *) END; (* POSIX.1 *) PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; (* extensions *) (* PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER; PROCEDURE [ccall] cfmakeraw* (VAR tp: termios); *) END LinTermios.