DEADSOFTWARE

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