DEADSOFTWARE

OpenBSD CommV24 fixed
[bbcp.git] / Trurl-based / _OpenBSD_ / Lin / Mod / Termios.txt
1 MODULE LinTermios ["libc.so.66.0"];
3 (*
4 A. V. Shiryaev, 2012.09
6 OpenBSD 5.2
7 32-bit
8 *)
10 CONST
11 VEOF* = 0; (* ICANON *)
12 VEOL* = 1; (* ICANON *)
13 VERASE* = 3; (* ICANON *)
14 VKILL* = 5; (* ICANON *)
15 VINTR* = 8; (* ISIG *)
16 VQUIT* = 9; (* ISIG *)
17 VSUSP* = 10; (* ISIG *)
18 VSTART* = 12; (* IXON, IXOFF *)
19 VSTOP* = 13; (* IXON, IXOFF *)
20 VMIN* = 16; (* !ICANON *)
21 VTIME* = 17; (* !ICANON *)
22 NCCS* = 20;
23 IGNBRK* = 00000001H; (* ignore BREAK condition *)
24 BRKINT* = 00000002H; (* map BREAK to SIGINT *)
25 IGNPAR* = 00000004H; (* ignore (discard) parity errors *)
26 PARMRK* = 00000008H; (* mark parity and framing errors *)
27 INPCK* = 00000010H; (* enable checking of parity errors *)
28 ISTRIP* = 00000020H; (* strip 8th bit off chars *)
29 INLCR* = 00000040H; (* map NL into CR *)
30 IGNCR* = 00000080H; (* ignore CR *)
31 ICRNL* = 00000100H; (* map CR to NL (ala CRMOD) *)
32 IXON* = 00000200H; (* enable output flow control *)
33 IXOFF* = 00000400H; (* enable input flow control *)
34 OPOST* = 00000001H; (* enable following output processing *)
35 CSIZE* = 00000300H; (* character size mask *)
36 CS5* = 00000000H; (* 5 bits (pseudo) *)
37 CS6* = 00000100H; (* 6 bits *)
38 CS7* = 00000200H; (* 7 bits *)
39 CS8* = 00000300H; (* 8 bits *)
40 CSTOPB* = 00000400H; (* send 2 stop bits *)
41 CREAD* = 00000800H; (* enable receiver *)
42 PARENB* = 00001000H; (* parity enable *)
43 PARODD* = 00002000H; (* odd parity, else even *)
44 HUPCL* = 00004000H; (* hang up on last close *)
45 CLOCAL* = 00008000H; (* ignore modem status lines *)
46 ECHOE* = 00000002H; (* visually erase chars *)
47 ECHOK* = 00000004H; (* echo NL after line kill *)
48 ECHO* = 00000008H; (* enable echoing *)
49 ECHONL* = 00000010H; (* echo NL even if ECHO is off *)
50 ISIG* = 00000080H; (* enable signals INTR, QUIT, [D]SUSP *)
51 ICANON* = 00000100H; (* canonicalize input lines *)
52 IEXTEN* = 00000400H; (* enable DISCARD and LNEXT *)
53 EXTPROC* = 00000800H; (* external processing *)
54 TOSTOP* = 00400000H; (* stop background jobs from output *)
55 NOFLSH* = 80000000H; (* don't flush after interrupt *)
56 TCSANOW* = 0; (* make change immediate *)
57 TCSADRAIN* = 1; (* drain output, then change *)
58 TCSAFLUSH* = 2; (* drain output, flush input *)
59 B0* = 0;
60 B50* = 50;
61 B75* = 75;
62 B110* = 110;
63 B134* = 134;
64 B150* = 150;
65 B200* = 200;
66 B300* = 300;
67 B600* = 600;
68 B1200* = 1200;
69 B1800* = 1800;
70 B2400* = 2400;
71 B4800* = 4800;
72 B9600* = 9600;
73 B19200* = 19200;
74 B38400* = 38400;
75 VEOL2* = 2; (* ICANON *)
76 VWERASE* = 4; (* ICANON *)
77 VREPRINT* = 6; (* ICANON *)
78 VDSUSP* = 11; (* ISIG *)
79 VLNEXT* = 14; (* IEXTEN *)
80 VDISCARD* = 15; (* IEXTEN *)
81 VSTATUS* = 18; (* ICANON *)
82 IXANY* = 00000800H; (* any char will restart after stop *)
83 IUCLC* = 00001000H; (* translate upper to lower case *)
84 IMAXBEL* = 00002000H; (* ring bell on input queue full *)
85 ONLCR* = 00000002H; (* map NL to CR-NL (ala CRMOD) *)
86 OXTABS* = 00000004H; (* expand tabs to spaces *)
87 ONOEOT* = 00000008H; (* discard EOT's (^D) on output *)
88 OCRNL* = 00000010H; (* map CR to NL *)
89 OLCUC* = 00000020H; (* translate lower case to upper case *)
90 ONOCR* = 00000040H; (* No CR output at column 0 *)
91 ONLRET* = 00000080H; (* NL performs the CR function *)
92 CIGNORE* = 00000001H; (* ignore control flags *)
93 CRTSCTS* = 00010000H; (* RTS/CTS full-duplex flow control *)
94 CRTS_IFLOW* = CRTSCTS; (* XXX compat *)
95 CCTS_OFLOW* = CRTSCTS; (* XXX compat *)
96 MDMBUF* = 00100000H; (* DTR/DCD hardware flow control *)
97 ECHOKE* = 00000001H; (* visual erase for line kill *)
98 ECHOPRT* = 00000020H; (* visual erase mode for hardcopy *)
99 ECHOCTL* = 00000040H; (* echo control chars as ^(Char) *)
100 ALTWERASE* = 00000200H; (* use alternate WERASE algorithm *)
101 FLUSHO* = 00800000H; (* output being flushed (state) *)
102 XCASE* = 01000000H; (* canonical upper/lower case *)
103 NOKERNINFO* = 02000000H; (* no kernel output from VSTATUS *)
104 PENDIN* = 20000000H; (* XXX retype pending input (state) *)
105 TCSASOFT* = 10H; (* flag - don't alter h.w. state *)
106 B7200* = 7200;
107 B14400* = 14400;
108 B28800* = 28800;
109 B57600* = 57600;
110 B76800* = 76800;
111 B115200* = 115200;
112 B230400* = 230400;
113 EXTA* = 19200;
114 EXTB* = 38400;
115 TCIFLUSH* = 1;
116 TCOFLUSH* = 2;
117 TCIOFLUSH* = 3;
118 TCOOFF* = 1;
119 TCOON* = 2;
120 TCIOFF* = 3;
121 TCION* = 4;
123 TYPE
124 tcflag_t* = INTEGER; (* unsigned int *)
125 cc_t* = SHORTCHAR; (* unsigned char *)
126 speed_t* = INTEGER; (* unsigned int *)
127 termios* = RECORD [untagged]
128 c_iflag*: tcflag_t; (* input flags *)
129 c_oflag*: tcflag_t; (* output flags *)
130 c_cflag*: tcflag_t; (* control flags *)
131 c_lflag*: tcflag_t; (* local flags *)
132 cc_t*: ARRAY [untagged] NCCS OF cc_t; (* control chars *)
133 c_ispeed*: INTEGER; (* input speed *)
134 c_ospeed*: INTEGER; (* output speed *)
135 END;
137 (* POSIX.1 *)
138 PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t;
139 PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER;
140 PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t;
141 PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER;
142 PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER;
143 PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER;
145 PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER;
146 PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER;
147 PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER;
148 PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER;
150 (* extensions *)
151 (*
152 PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER;
153 PROCEDURE [ccall] cfmakeraw* (VAR tp: termios);
154 *)
156 END LinTermios.