1
2
3
4
5
6
7
8 #define NCC 8
9
10
11 #define VINTR 0
12 #define VQUIT 1
13 #define VERASE 2
14 #define VKILL 3
15 #define VEOF 4
16 #define VEOL 5
17 #define VEOL2 6
18 #define VMIN 4
19 #define VTIME 5
20 #define VSWTCH 7
21
22 #define CNUL 0
23 #define CDEL 0377
24
25 #define CESC '\\'
26 #define CINTR 0177
27 #define CQUIT 034
28 #define CERASE '#'
29 #define CKILL '@'
30 #define CEOF 04
31 #define CSTART 021
32 #define CSTOP 023
33 #define CSWTCH 032
34 #define CNSWTCH 0
35
36
37
38 #define IGNBRK 0000001
39 #define BRKINT 0000002
40 #define IGNPAR 0000004
41 #define PARMRK 0000010
42 #define INPCK 0000020
43 #define ISTRIP 0000040
44 #define INLCR 0000100
45 #define IGNCR 0000200
46 #define ICRNL 0000400
47 #define IUCLC 0001000
48 #define IXON 0002000
49 #define IXANY 0004000
50 #define IXOFF 0010000
51
52
53 #define OPOST 0000001
54 #define OLCUC 0000002
55 #define ONLCR 0000004
56 #define OCRNL 0000010
57 #define ONOCR 0000020
58 #define ONLRET 0000040
59 #define OFILL 0000100
60 #define OFDEL 0000200
61 #define NLDLY 0000400
62 #define NL0 0
63 #define NL1 0000400
64 #define CRDLY 0003000
65 #define CR0 0
66 #define CR1 0001000
67 #define CR2 0002000
68 #define CR3 0003000
69 #define TABDLY 0014000
70 #define TAB0 0
71 #define TAB1 0004000
72 #define TAB2 0010000
73 #define TAB3 0014000
74 #define BSDLY 0020000
75 #define BS0 0
76 #define BS1 0020000
77 #define VTDLY 0040000
78 #define VT0 0
79 #define VT1 0040000
80 #define FFDLY 0100000
81 #define FF0 0
82 #define FF1 0100000
83
84
85 #define CBAUD 0000017
86 #define B0 0
87 #define B50 0000001
88 #define B75 0000002
89 #define B110 0000003
90 #define B134 0000004
91 #define B150 0000005
92 #define B200 0000006
93 #define B300 0000007
94 #define B600 0000010
95 #define B1200 0000011
96 #define B1800 0000012
97 #define B2400 0000013
98 #define B4800 0000014
99 #define B9600 0000015
100 #define EXTA 0000016
101 #define EXTB 0000017
102 #define CSIZE 0000060
103 #define CS5 0
104 #define CS6 0000020
105 #define CS7 0000040
106 #define CS8 0000060
107 #define CSTOPB 0000100
108 #define CREAD 0000200
109 #define PARENB 0000400
110 #define PARODD 0001000
111 #define HUPCL 0002000
112 #define CLOCAL 0004000
113 #define LOBLK 0010000
114
115
116 #define ISIG 0000001
117 #define ICANON 0000002
118 #define XCASE 0000004
119 #define ECHO 0000010
120 #define ECHOE 0000020
121 #define ECHOK 0000040
122 #define ECHONL 0000100
123 #define NOFLSH 0000200
124
125 #define MULTICS_MODES 0000400
126
127 #define SSPEED 7
128
129
130
131
132 struct termio {
133 int c_iflag;
134 int c_oflag;
135 int c_cflag;
136 int c_lflag;
137 char c_line;
138 unsigned char c_cc[NCC];
139 };
140 #define IOCTYPE 0xff00
141
142 #define TIOC 0
143 #define TCGETA (TIOC|1)
144 #define TCSETA (TIOC|2)
145 #define TCSETAW (TIOC|3)
146 #define TCSETAF (TIOC|4)
147 #define TCSBRK (TIOC|5)
148 #define TCXONC (TIOC|6)
149 #define TCFLSH (TIOC|7)
150 #define TCDSET (TIOC|32)
151
152 #define FIONREAD (TIOC|64)
153
154
155 #define LDIOC ('D'<<8)
156 #define LDOPEN (LDIOC|0)
157 #define LDCLOSE (LDIOC|1)
158 #define LDCHG (LDIOC|2)
159 #define LDGETT (LDIOC|8)
160 #define LDSETT (LDIOC|9)
161
162
163
164
165 #define TERM_NONE 0
166 #define TERM_TEC 1
167 #define TERM_V61 2
168 #define TERM_V10 3
169 #define TERM_TEX 4
170 #define TERM_D40 5
171 #define TERM_H45 6
172 #define TERM_D42 7
173
174
175
176
177 #define TM_NONE 0000
178 #define TM_SNL 0001
179 #define TM_ANL 0002
180 #define TM_LCF 0004
181 #define TM_CECHO 0010
182 #define TM_CINVIS 0020
183 #define TM_SET 0200
184
185
186
187
188 struct termcb {
189 char st_flgs;
190 char st_termt;
191 char st_crow;
192 char st_ccol;
193 char st_vrow;
194 char st_lrow;
195 };
196
197