Mercurial > projects > ldc
comparison druntime/import/stdc/posix/termios.d @ 760:6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 00:19:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
759:d3eb054172f9 | 760:6f33b427bfd1 |
---|---|
1 /** | |
2 * D header file for POSIX. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition | |
8 */ | |
9 module stdc.posix.termios; | |
10 | |
11 private import stdc.posix.config; | |
12 public import stdc.posix.sys.types; // for pid_t | |
13 | |
14 extern (C): | |
15 | |
16 // | |
17 // Required | |
18 // | |
19 /* | |
20 cc_t | |
21 speed_t | |
22 tcflag_t | |
23 | |
24 NCCS | |
25 | |
26 struct termios | |
27 { | |
28 tcflag_t c_iflag; | |
29 tcflag_t c_oflag; | |
30 tcflag_t c_cflag; | |
31 tcflag_t c_lflag; | |
32 cc_t[NCCS] c_cc; | |
33 } | |
34 | |
35 VEOF | |
36 VEOL | |
37 VERASE | |
38 VINTR | |
39 VKILL | |
40 VMIN | |
41 VQUIT | |
42 VSTART | |
43 VSTOP | |
44 VSUSP | |
45 VTIME | |
46 | |
47 BRKINT | |
48 ICRNL | |
49 IGNBRK | |
50 IGNCR | |
51 IGNPAR | |
52 INLCR | |
53 INPCK | |
54 ISTRIP | |
55 IXOFF | |
56 IXON | |
57 PARMRK | |
58 | |
59 OPOST | |
60 | |
61 B0 | |
62 B50 | |
63 B75 | |
64 B110 | |
65 B134 | |
66 B150 | |
67 B200 | |
68 B300 | |
69 B600 | |
70 B1200 | |
71 B1800 | |
72 B2400 | |
73 B4800 | |
74 B9600 | |
75 B19200 | |
76 B38400 | |
77 | |
78 CSIZE | |
79 CS5 | |
80 CS6 | |
81 CS7 | |
82 CS8 | |
83 CSTOPB | |
84 CREAD | |
85 PARENB | |
86 PARODD | |
87 HUPCL | |
88 CLOCAL | |
89 | |
90 ECHO | |
91 ECHOE | |
92 ECHOK | |
93 ECHONL | |
94 ICANON | |
95 IEXTEN | |
96 ISIG | |
97 NOFLSH | |
98 TOSTOP | |
99 | |
100 TCSANOW | |
101 TCSADRAIN | |
102 TCSAFLUSH | |
103 | |
104 TCIFLUSH | |
105 TCIOFLUSH | |
106 TCOFLUSH | |
107 | |
108 TCIOFF | |
109 TCION | |
110 TCOOFF | |
111 TCOON | |
112 | |
113 speed_t cfgetispeed(in termios*); | |
114 speed_t cfgetospeed(in termios*); | |
115 int cfsetispeed(termios*, speed_t); | |
116 int cfsetospeed(termios*, speed_t); | |
117 int tcdrain(int); | |
118 int tcflow(int, int); | |
119 int tcflush(int, int); | |
120 int tcgetattr(int, termios*); | |
121 int tcsendbreak(int, int); | |
122 int tcsetattr(int, int, in termios*); | |
123 */ | |
124 | |
125 version( darwin ) | |
126 { | |
127 alias ubyte cc_t; | |
128 alias uint speed_t; | |
129 alias uint tcflag_t; | |
130 | |
131 const NCCS = 20; | |
132 | |
133 struct termios | |
134 { | |
135 tcflag_t c_iflag; | |
136 tcflag_t c_oflag; | |
137 tcflag_t c_cflag; | |
138 tcflag_t c_lflag; | |
139 cc_t[NCCS] c_cc; | |
140 speed_t c_ispeed; | |
141 speed_t c_ospeed; | |
142 } | |
143 | |
144 const VEOF = 0; | |
145 const VEOL = 1; | |
146 const VERASE = 3; | |
147 const VINTR = 8; | |
148 const VKILL = 5; | |
149 const VMIN = 16; | |
150 const VQUIT = 9; | |
151 const VSTART = 12; | |
152 const VSTOP = 13; | |
153 const VSUSP = 10; | |
154 const VTIME = 17; | |
155 | |
156 const BRKINT = 0x0000002; | |
157 const ICRNL = 0x0000100; | |
158 const IGNBRK = 0x0000001; | |
159 const IGNCR = 0x0000080; | |
160 const IGNPAR = 0x0000004; | |
161 const INLCR = 0x0000040; | |
162 const INPCK = 0x0000010; | |
163 const ISTRIP = 0x0000020; | |
164 const IXOFF = 0x0000400; | |
165 const IXON = 0x0000200; | |
166 const PARMRK = 0x0000008; | |
167 | |
168 const OPOST = 0x0000001; | |
169 | |
170 const B0 = 0; | |
171 const B50 = 50; | |
172 const B75 = 75; | |
173 const B110 = 110; | |
174 const B134 = 134; | |
175 const B150 = 150; | |
176 const B200 = 200; | |
177 const B300 = 300; | |
178 const B600 = 600; | |
179 const B1200 = 1200; | |
180 const B1800 = 1800; | |
181 const B2400 = 2400; | |
182 const B4800 = 4800; | |
183 const B9600 = 9600; | |
184 const B19200 = 19200; | |
185 const B38400 = 38400; | |
186 | |
187 const CSIZE = 0x0000300; | |
188 const CS5 = 0x0000000; | |
189 const CS6 = 0x0000100; | |
190 const CS7 = 0x0000200; | |
191 const CS8 = 0x0000300; | |
192 const CSTOPB = 0x0000400; | |
193 const CREAD = 0x0000800; | |
194 const PARENB = 0x0001000; | |
195 const PARODD = 0x0002000; | |
196 const HUPCL = 0x0004000; | |
197 const CLOCAL = 0x0008000; | |
198 | |
199 const ECHO = 0x00000008; | |
200 const ECHOE = 0x00000002; | |
201 const ECHOK = 0x00000004; | |
202 const ECHONL = 0x00000010; | |
203 const ICANON = 0x00000100; | |
204 const IEXTEN = 0x00000400; | |
205 const ISIG = 0x00000080; | |
206 const NOFLSH = 0x80000000; | |
207 const TOSTOP = 0x00400000; | |
208 | |
209 const TCSANOW = 0; | |
210 const TCSADRAIN = 1; | |
211 const TCSAFLUSH = 2; | |
212 | |
213 const TCIFLUSH = 1; | |
214 const TCOFLUSH = 2; | |
215 const TCIOFLUSH = 3; | |
216 | |
217 const TCIOFF = 3; | |
218 const TCION = 4; | |
219 const TCOOFF = 1; | |
220 const TCOON = 2; | |
221 | |
222 speed_t cfgetispeed(in termios*); | |
223 speed_t cfgetospeed(in termios*); | |
224 int cfsetispeed(termios*, speed_t); | |
225 int cfsetospeed(termios*, speed_t); | |
226 int tcdrain(int); | |
227 int tcflow(int, int); | |
228 int tcflush(int, int); | |
229 int tcgetattr(int, termios*); | |
230 int tcsendbreak(int, int); | |
231 int tcsetattr(int, int, in termios*); | |
232 | |
233 } | |
234 else version( linux ) | |
235 { | |
236 alias ubyte cc_t; | |
237 alias uint speed_t; | |
238 alias uint tcflag_t; | |
239 | |
240 const NCCS = 32; | |
241 | |
242 struct termios | |
243 { | |
244 tcflag_t c_iflag; | |
245 tcflag_t c_oflag; | |
246 tcflag_t c_cflag; | |
247 tcflag_t c_lflag; | |
248 cc_t c_line; | |
249 cc_t[NCCS] c_cc; | |
250 speed_t c_ispeed; | |
251 speed_t c_ospeed; | |
252 } | |
253 | |
254 const VEOF = 4; | |
255 const VEOL = 11; | |
256 const VERASE = 2; | |
257 const VINTR = 0; | |
258 const VKILL = 3; | |
259 const VMIN = 6; | |
260 const VQUIT = 1; | |
261 const VSTART = 8; | |
262 const VSTOP = 9; | |
263 const VSUSP = 10; | |
264 const VTIME = 5; | |
265 | |
266 const BRKINT = 0000002; | |
267 const ICRNL = 0000400; | |
268 const IGNBRK = 0000001; | |
269 const IGNCR = 0000200; | |
270 const IGNPAR = 0000004; | |
271 const INLCR = 0000100; | |
272 const INPCK = 0000020; | |
273 const ISTRIP = 0000040; | |
274 const IXOFF = 0010000; | |
275 const IXON = 0002000; | |
276 const PARMRK = 0000010; | |
277 | |
278 const OPOST = 0000001; | |
279 | |
280 const B0 = 0000000; | |
281 const B50 = 0000001; | |
282 const B75 = 0000002; | |
283 const B110 = 0000003; | |
284 const B134 = 0000004; | |
285 const B150 = 0000005; | |
286 const B200 = 0000006; | |
287 const B300 = 0000007; | |
288 const B600 = 0000010; | |
289 const B1200 = 0000011; | |
290 const B1800 = 0000012; | |
291 const B2400 = 0000013; | |
292 const B4800 = 0000014; | |
293 const B9600 = 0000015; | |
294 const B19200 = 0000016; | |
295 const B38400 = 0000017; | |
296 | |
297 const CSIZE = 0000060; | |
298 const CS5 = 0000000; | |
299 const CS6 = 0000020; | |
300 const CS7 = 0000040; | |
301 const CS8 = 0000060; | |
302 const CSTOPB = 0000100; | |
303 const CREAD = 0000200; | |
304 const PARENB = 0000400; | |
305 const PARODD = 0001000; | |
306 const HUPCL = 0002000; | |
307 const CLOCAL = 0004000; | |
308 | |
309 const ECHO = 0000010; | |
310 const ECHOE = 0000020; | |
311 const ECHOK = 0000040; | |
312 const ECHONL = 0000100; | |
313 const ICANON = 0000002; | |
314 const IEXTEN = 0100000; | |
315 const ISIG = 0000001; | |
316 const NOFLSH = 0000200; | |
317 const TOSTOP = 0000400; | |
318 | |
319 const TCSANOW = 0; | |
320 const TCSADRAIN = 1; | |
321 const TCSAFLUSH = 2; | |
322 | |
323 const TCIFLUSH = 0; | |
324 const TCOFLUSH = 1; | |
325 const TCIOFLUSH = 2; | |
326 | |
327 const TCIOFF = 2; | |
328 const TCION = 3; | |
329 const TCOOFF = 0; | |
330 const TCOON = 1; | |
331 | |
332 speed_t cfgetispeed(in termios*); | |
333 speed_t cfgetospeed(in termios*); | |
334 int cfsetispeed(termios*, speed_t); | |
335 int cfsetospeed(termios*, speed_t); | |
336 int tcdrain(int); | |
337 int tcflow(int, int); | |
338 int tcflush(int, int); | |
339 int tcgetattr(int, termios*); | |
340 int tcsendbreak(int, int); | |
341 int tcsetattr(int, int, in termios*); | |
342 } | |
343 else version ( freebsd ) | |
344 { | |
345 alias ubyte cc_t; | |
346 alias uint speed_t; | |
347 alias uint tcflag_t; | |
348 | |
349 const NCCS = 20; | |
350 | |
351 struct termios | |
352 { | |
353 tcflag_t c_iflag; | |
354 tcflag_t c_oflag; | |
355 tcflag_t c_cflag; | |
356 tcflag_t c_lflag; | |
357 cc_t[NCCS] c_cc; | |
358 speed_t c_ispeed; | |
359 speed_t c_ospeed; | |
360 } | |
361 | |
362 const VEOF = 0; | |
363 const VEOL = 1; | |
364 const VERASE = 3; | |
365 const VINTR = 8; | |
366 const VKILL = 5; | |
367 const VMIN = 16; | |
368 const VQUIT = 9; | |
369 const VSTART = 12; | |
370 const VSTOP = 13; | |
371 const VSUSP = 10; | |
372 const VTIME = 17; | |
373 | |
374 const BRKINT = 0x0000002; | |
375 const ICRNL = 0x0000100; | |
376 const IGNBRK = 0x0000001; | |
377 const IGNCR = 0x0000080; | |
378 const IGNPAR = 0x0000004; | |
379 const INLCR = 0x0000040; | |
380 const INPCK = 0x0000010; | |
381 const ISTRIP = 0x0000020; | |
382 const IXOFF = 0x0000400; | |
383 const IXON = 0x0000200; | |
384 const PARMRK = 0x0000008; | |
385 | |
386 const OPOST = 0x0000001; | |
387 | |
388 const B0 = 0; | |
389 const B50 = 50; | |
390 const B75 = 75; | |
391 const B110 = 110; | |
392 const B134 = 134; | |
393 const B150 = 150; | |
394 const B200 = 200; | |
395 const B300 = 300; | |
396 const B600 = 600; | |
397 const B1200 = 1200; | |
398 const B1800 = 1800; | |
399 const B2400 = 2400; | |
400 const B4800 = 4800; | |
401 const B9600 = 9600; | |
402 const B19200 = 19200; | |
403 const B38400 = 38400; | |
404 | |
405 const CSIZE = 0x0000300; | |
406 const CS5 = 0x0000000; | |
407 const CS6 = 0x0000100; | |
408 const CS7 = 0x0000200; | |
409 const CS8 = 0x0000300; | |
410 const CSTOPB = 0x0000400; | |
411 const CREAD = 0x0000800; | |
412 const PARENB = 0x0001000; | |
413 const PARODD = 0x0002000; | |
414 const HUPCL = 0x0004000; | |
415 const CLOCAL = 0x0008000; | |
416 | |
417 const ECHO = 0x00000008; | |
418 const ECHOE = 0x00000002; | |
419 const ECHOK = 0x00000004; | |
420 const ECHONL = 0x00000010; | |
421 const ICANON = 0x00000100; | |
422 const IEXTEN = 0x00000400; | |
423 const ISIG = 0x00000080; | |
424 const NOFLSH = 0x80000000; | |
425 const TOSTOP = 0x00400000; | |
426 | |
427 const TCSANOW = 0; | |
428 const TCSADRAIN = 1; | |
429 const TCSAFLUSH = 2; | |
430 | |
431 const TCIFLUSH = 1; | |
432 const TCOFLUSH = 2; | |
433 const TCIOFLUSH = 3; | |
434 | |
435 const TCIOFF = 3; | |
436 const TCION = 4; | |
437 const TCOOFF = 1; | |
438 const TCOON = 2; | |
439 | |
440 speed_t cfgetispeed(in termios*); | |
441 speed_t cfgetospeed(in termios*); | |
442 int cfsetispeed(termios*, speed_t); | |
443 int cfsetospeed(termios*, speed_t); | |
444 int tcdrain(int); | |
445 int tcflow(int, int); | |
446 int tcflush(int, int); | |
447 int tcgetattr(int, termios*); | |
448 int tcsendbreak(int, int); | |
449 int tcsetattr(int, int, in termios*); | |
450 | |
451 } | |
452 | |
453 // | |
454 // XOpen (XSI) | |
455 // | |
456 /* | |
457 IXANY | |
458 | |
459 ONLCR | |
460 OCRNL | |
461 ONOCR | |
462 ONLRET | |
463 OFILL | |
464 NLDLY | |
465 NL0 | |
466 NL1 | |
467 CRDLY | |
468 CR0 | |
469 CR1 | |
470 CR2 | |
471 CR3 | |
472 TABDLY | |
473 TAB0 | |
474 TAB1 | |
475 TAB2 | |
476 TAB3 | |
477 BSDLY | |
478 BS0 | |
479 BS1 | |
480 VTDLY | |
481 VT0 | |
482 VT1 | |
483 FFDLY | |
484 FF0 | |
485 FF1 | |
486 | |
487 pid_t tcgetsid(int); | |
488 */ | |
489 | |
490 version( linux ) | |
491 { | |
492 const IXANY = 0004000; | |
493 | |
494 const ONLCR = 0000004; | |
495 const OCRNL = 0000010; | |
496 const ONOCR = 0000020; | |
497 const ONLRET = 0000040; | |
498 const OFILL = 0000100; | |
499 const NLDLY = 0000400; | |
500 const NL0 = 0000000; | |
501 const NL1 = 0000400; | |
502 const CRDLY = 0003000; | |
503 const CR0 = 0000000; | |
504 const CR1 = 0001000; | |
505 const CR2 = 0002000; | |
506 const CR3 = 0003000; | |
507 const TABDLY = 0014000; | |
508 const TAB0 = 0000000; | |
509 const TAB1 = 0004000; | |
510 const TAB2 = 0010000; | |
511 const TAB3 = 0014000; | |
512 const BSDLY = 0020000; | |
513 const BS0 = 0000000; | |
514 const BS1 = 0020000; | |
515 const VTDLY = 0040000; | |
516 const VT0 = 0000000; | |
517 const VT1 = 0040000; | |
518 const FFDLY = 0100000; | |
519 const FF0 = 0000000; | |
520 const FF1 = 0100000; | |
521 | |
522 pid_t tcgetsid(int); | |
523 } |