c++: Fix crash during NRV optimization with invalid input [PR117099, PR117129]
[official-gcc.git] / libphobos / libdruntime / core / sys / posix / termios.d
blobe4a99e686513fdc1f23318ed7d9645a9d56c7836
1 /**
2 * D header file for POSIX.
4 * Copyright: Copyright Sean Kelly 2005 - 2009.
5 * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 * Authors: Sean Kelly, Alex Rønne Petersen
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8 */
10 /* Copyright Sean Kelly 2005 - 2009.
11 * Distributed under the Boost Software License, Version 1.0.
12 * (See accompanying file LICENSE or copy at
13 * http://www.boost.org/LICENSE_1_0.txt)
15 module core.sys.posix.termios;
17 import core.sys.posix.config;
18 public import core.sys.posix.sys.types; // for pid_t
20 version (OSX)
21 version = Darwin;
22 else version (iOS)
23 version = Darwin;
24 else version (TVOS)
25 version = Darwin;
26 else version (WatchOS)
27 version = Darwin;
29 version (Posix):
30 extern (C):
32 nothrow:
33 @nogc:
36 // Required
39 cc_t
40 speed_t
41 tcflag_t
43 NCCS
45 struct termios
47 tcflag_t c_iflag;
48 tcflag_t c_oflag;
49 tcflag_t c_cflag;
50 tcflag_t c_lflag;
51 cc_t[NCCS] c_cc;
54 VEOF
55 VEOL
56 VERASE
57 VINTR
58 VKILL
59 VMIN
60 VQUIT
61 VSTART
62 VSTOP
63 VSUSP
64 VTIME
66 BRKINT
67 ICRNL
68 IGNBRK
69 IGNCR
70 IGNPAR
71 INLCR
72 INPCK
73 ISTRIP
74 IXOFF
75 IXON
76 PARMRK
78 OPOST
81 B50
82 B75
83 B110
84 B134
85 B150
86 B200
87 B300
88 B600
89 B1200
90 B1800
91 B2400
92 B4800
93 B9600
94 B19200
95 B38400
97 CSIZE
98 CS5
99 CS6
102 CSTOPB
103 CREAD
104 PARENB
105 PARODD
106 HUPCL
107 CLOCAL
109 ECHO
110 ECHOE
111 ECHOK
112 ECHONL
113 ICANON
114 IEXTEN
115 ISIG
116 NOFLSH
117 TOSTOP
119 TCSANOW
120 TCSADRAIN
121 TCSAFLUSH
123 TCIFLUSH
124 TCIOFLUSH
125 TCOFLUSH
127 TCIOFF
128 TCION
129 TCOOFF
130 TCOON
133 version (linux)
135 alias ubyte cc_t;
136 alias uint speed_t;
137 alias uint tcflag_t;
139 enum NCCS = 32;
141 struct termios
143 tcflag_t c_iflag;
144 tcflag_t c_oflag;
145 tcflag_t c_cflag;
146 tcflag_t c_lflag;
147 cc_t c_line;
148 cc_t[NCCS] c_cc;
149 speed_t c_ispeed;
150 speed_t c_ospeed;
153 enum VEOF = 4;
154 enum VEOL = 11;
155 enum VERASE = 2;
156 enum VINTR = 0;
157 enum VKILL = 3;
158 enum VMIN = 6;
159 enum VQUIT = 1;
160 enum VSTART = 8;
161 enum VSTOP = 9;
162 enum VSUSP = 10;
163 enum VTIME = 5;
165 enum BRKINT = 0x0000002; // 0000002
166 enum ICRNL = 0x0000100; // 0000400
167 enum IGNBRK = 0x0000001; // 0000001
168 enum IGNCR = 0x0000080; // 0000200
169 enum IGNPAR = 0x0000004; // 0000004
170 enum INLCR = 0x0000040; // 0000100
171 enum INPCK = 0x0000010; // 0000020
172 enum ISTRIP = 0x0000020; // 0000040
173 enum IXOFF = 0x0001000; // 0010000
174 enum IXON = 0x0000400; // 0002000
175 enum PARMRK = 0x0000008; // 0000010
177 enum OPOST = 0x0000001; // 0000001
179 enum B0 = 0x0000000; // 0000000
180 enum B50 = 0x0000001; // 0000001
181 enum B75 = 0x0000002; // 0000002
182 enum B110 = 0x0000003; // 0000003
183 enum B134 = 0x0000004; // 0000004
184 enum B150 = 0x0000005; // 0000005
185 enum B200 = 0x0000006; // 0000006
186 enum B300 = 0x0000007; // 0000007
187 enum B600 = 0x0000008; // 0000010
188 enum B1200 = 0x0000009; // 0000011
189 enum B1800 = 0x000000A; // 0000012
190 enum B2400 = 0x000000B; // 0000013
191 enum B4800 = 0x000000C; // 0000014
192 enum B9600 = 0x000000D; // 0000015
193 enum B19200 = 0x000000E; // 0000016
194 enum B38400 = 0x000000F; // 0000017
196 enum CSIZE = 0x0000030; // 0000060
197 enum CS5 = 0x0000000; // 0000000
198 enum CS6 = 0x0000010; // 0000020
199 enum CS7 = 0x0000020; // 0000040
200 enum CS8 = 0x0000030; // 0000060
201 enum CSTOPB = 0x0000040; // 0000100
202 enum CREAD = 0x0000080; // 0000200
203 enum PARENB = 0x0000100; // 0000400
204 enum PARODD = 0x0000200; // 0001000
205 enum HUPCL = 0x0000400; // 0002000
206 enum CLOCAL = 0x0000800; // 0004000
208 enum ECHO = 0x0000008; // 0000010
209 enum ECHOE = 0x0000010; // 0000020
210 enum ECHOK = 0x0000020; // 0000040
211 enum ECHONL = 0x0000040; // 0000100
212 enum ICANON = 0x0000002; // 0000002
213 enum IEXTEN = 0x0008000; // 0100000
214 enum ISIG = 0x0000001; // 0000001
215 enum NOFLSH = 0x0000080; // 0000200
216 enum TOSTOP = 0x0000100; // 0000400
218 enum TCSANOW = 0;
219 enum TCSADRAIN = 1;
220 enum TCSAFLUSH = 2;
222 enum TCIFLUSH = 0;
223 enum TCOFLUSH = 1;
224 enum TCIOFLUSH = 2;
226 enum TCIOFF = 2;
227 enum TCION = 3;
228 enum TCOOFF = 0;
229 enum TCOON = 1;
231 else version (Darwin)
233 alias ubyte cc_t;
234 alias c_ulong speed_t;
235 alias c_ulong tcflag_t;
237 enum NCCS = 20;
239 struct termios
241 tcflag_t c_iflag;
242 tcflag_t c_oflag;
243 tcflag_t c_cflag;
244 tcflag_t c_lflag;
245 cc_t[NCCS] c_cc;
246 speed_t c_ispeed;
247 speed_t c_ospeed;
250 enum VEOF = 0;
251 enum VEOL = 1;
252 enum VERASE = 3;
253 enum VINTR = 8;
254 enum VKILL = 5;
255 enum VMIN = 16;
256 enum VQUIT = 9;
257 enum VSTART = 12;
258 enum VSTOP = 13;
259 enum VSUSP = 10;
260 enum VTIME = 17;
262 enum BRKINT = 0x0000002;
263 enum ICRNL = 0x0000100;
264 enum IGNBRK = 0x0000001;
265 enum IGNCR = 0x0000080;
266 enum IGNPAR = 0x0000004;
267 enum INLCR = 0x0000040;
268 enum INPCK = 0x0000010;
269 enum ISTRIP = 0x0000020;
270 enum IXOFF = 0x0000400;
271 enum IXON = 0x0000200;
272 enum PARMRK = 0x0000008;
274 enum OPOST = 0x0000001;
276 enum B0 = 0;
277 enum B50 = 50;
278 enum B75 = 75;
279 enum B110 = 110;
280 enum B134 = 134;
281 enum B150 = 150;
282 enum B200 = 200;
283 enum B300 = 300;
284 enum B600 = 600;
285 enum B1200 = 1200;
286 enum B1800 = 1800;
287 enum B2400 = 2400;
288 enum B4800 = 4800;
289 enum B9600 = 9600;
290 enum B19200 = 19200;
291 enum B38400 = 38400;
293 enum CSIZE = 0x0000300;
294 enum CS5 = 0x0000000;
295 enum CS6 = 0x0000100;
296 enum CS7 = 0x0000200;
297 enum CS8 = 0x0000300;
298 enum CSTOPB = 0x0000400;
299 enum CREAD = 0x0000800;
300 enum PARENB = 0x0001000;
301 enum PARODD = 0x0002000;
302 enum HUPCL = 0x0004000;
303 enum CLOCAL = 0x0008000;
305 enum ECHO = 0x00000008;
306 enum ECHOE = 0x00000002;
307 enum ECHOK = 0x00000004;
308 enum ECHONL = 0x00000010;
309 enum ICANON = 0x00000100;
310 enum IEXTEN = 0x00000400;
311 enum ISIG = 0x00000080;
312 enum NOFLSH = 0x80000000;
313 enum TOSTOP = 0x00400000;
315 enum TCSANOW = 0;
316 enum TCSADRAIN = 1;
317 enum TCSAFLUSH = 2;
319 enum TCIFLUSH = 1;
320 enum TCOFLUSH = 2;
321 enum TCIOFLUSH = 3;
323 enum TCIOFF = 3;
324 enum TCION = 4;
325 enum TCOOFF = 1;
326 enum TCOON = 2;
328 else version (FreeBSD)
330 alias ubyte cc_t;
331 alias uint speed_t;
332 alias uint tcflag_t;
334 enum NCCS = 20;
336 struct termios
338 tcflag_t c_iflag;
339 tcflag_t c_oflag;
340 tcflag_t c_cflag;
341 tcflag_t c_lflag;
342 cc_t[NCCS] c_cc;
343 speed_t c_ispeed;
344 speed_t c_ospeed;
347 enum VEOF = 0;
348 enum VEOL = 1;
349 enum VERASE = 3;
350 enum VINTR = 8;
351 enum VKILL = 5;
352 enum VMIN = 16;
353 enum VQUIT = 9;
354 enum VSTART = 12;
355 enum VSTOP = 13;
356 enum VSUSP = 10;
357 enum VTIME = 17;
359 enum BRKINT = 0x0000002;
360 enum ICRNL = 0x0000100;
361 enum IGNBRK = 0x0000001;
362 enum IGNCR = 0x0000080;
363 enum IGNPAR = 0x0000004;
364 enum INLCR = 0x0000040;
365 enum INPCK = 0x0000010;
366 enum ISTRIP = 0x0000020;
367 enum IXOFF = 0x0000400;
368 enum IXON = 0x0000200;
369 enum PARMRK = 0x0000008;
371 enum OPOST = 0x0000001;
373 enum B0 = 0;
374 enum B50 = 50;
375 enum B75 = 75;
376 enum B110 = 110;
377 enum B134 = 134;
378 enum B150 = 150;
379 enum B200 = 200;
380 enum B300 = 300;
381 enum B600 = 600;
382 enum B1200 = 1200;
383 enum B1800 = 1800;
384 enum B2400 = 2400;
385 enum B4800 = 4800;
386 enum B9600 = 9600;
387 enum B19200 = 19200;
388 enum B38400 = 38400;
390 enum CSIZE = 0x0000300;
391 enum CS5 = 0x0000000;
392 enum CS6 = 0x0000100;
393 enum CS7 = 0x0000200;
394 enum CS8 = 0x0000300;
395 enum CSTOPB = 0x0000400;
396 enum CREAD = 0x0000800;
397 enum PARENB = 0x0001000;
398 enum PARODD = 0x0002000;
399 enum HUPCL = 0x0004000;
400 enum CLOCAL = 0x0008000;
402 enum ECHO = 0x00000008;
403 enum ECHOE = 0x00000002;
404 enum ECHOK = 0x00000004;
405 enum ECHONL = 0x00000010;
406 enum ICANON = 0x00000100;
407 enum IEXTEN = 0x00000400;
408 enum ISIG = 0x00000080;
409 enum NOFLSH = 0x80000000;
410 enum TOSTOP = 0x00400000;
412 enum TCSANOW = 0;
413 enum TCSADRAIN = 1;
414 enum TCSAFLUSH = 2;
416 enum TCIFLUSH = 1;
417 enum TCOFLUSH = 2;
418 enum TCIOFLUSH = 3;
420 enum TCIOFF = 3;
421 enum TCION = 4;
422 enum TCOOFF = 1;
423 enum TCOON = 2;
425 else version (DragonFlyBSD)
427 alias ubyte cc_t;
428 alias uint speed_t;
429 alias uint tcflag_t;
431 enum NCCS = 20;
433 struct termios
435 tcflag_t c_iflag;
436 tcflag_t c_oflag;
437 tcflag_t c_cflag;
438 tcflag_t c_lflag;
439 cc_t[NCCS] c_cc;
440 speed_t c_ispeed;
441 speed_t c_ospeed;
444 enum VEOF = 0;
445 enum VEOL = 1;
446 enum VERASE = 3;
447 enum VINTR = 8;
448 enum VKILL = 5;
449 enum VMIN = 16;
450 enum VQUIT = 9;
451 enum VSTART = 12;
452 enum VSTOP = 13;
453 enum VSUSP = 10;
454 enum VTIME = 17;
456 enum BRKINT = 0x0000002;
457 enum ICRNL = 0x0000100;
458 enum IGNBRK = 0x0000001;
459 enum IGNCR = 0x0000080;
460 enum IGNPAR = 0x0000004;
461 enum INLCR = 0x0000040;
462 enum INPCK = 0x0000010;
463 enum ISTRIP = 0x0000020;
464 enum IXOFF = 0x0000400;
465 enum IXON = 0x0000200;
466 enum PARMRK = 0x0000008;
468 enum OPOST = 0x0000001;
470 enum B0 = 0;
471 enum B50 = 50;
472 enum B75 = 75;
473 enum B110 = 110;
474 enum B134 = 134;
475 enum B150 = 150;
476 enum B200 = 200;
477 enum B300 = 300;
478 enum B600 = 600;
479 enum B1200 = 1200;
480 enum B1800 = 1800;
481 enum B2400 = 2400;
482 enum B4800 = 4800;
483 enum B9600 = 9600;
484 enum B19200 = 19200;
485 enum B38400 = 38400;
487 enum CSIZE = 0x0000300;
488 enum CS5 = 0x0000000;
489 enum CS6 = 0x0000100;
490 enum CS7 = 0x0000200;
491 enum CS8 = 0x0000300;
492 enum CSTOPB = 0x0000400;
493 enum CREAD = 0x0000800;
494 enum PARENB = 0x0001000;
495 enum PARODD = 0x0002000;
496 enum HUPCL = 0x0004000;
497 enum CLOCAL = 0x0008000;
499 enum ECHO = 0x00000008;
500 enum ECHOE = 0x00000002;
501 enum ECHOK = 0x00000004;
502 enum ECHONL = 0x00000010;
503 enum ICANON = 0x00000100;
504 enum IEXTEN = 0x00000400;
505 enum ISIG = 0x00000080;
506 enum NOFLSH = 0x80000000;
507 enum TOSTOP = 0x00400000;
509 enum TCSANOW = 0;
510 enum TCSADRAIN = 1;
511 enum TCSAFLUSH = 2;
513 enum TCIFLUSH = 1;
514 enum TCOFLUSH = 2;
515 enum TCIOFLUSH = 3;
517 enum TCIOFF = 3;
518 enum TCION = 4;
519 enum TCOOFF = 1;
520 enum TCOON = 2;
522 else version (NetBSD)
524 alias ubyte cc_t;
525 alias uint speed_t;
526 alias uint tcflag_t;
528 enum NCCS = 20;
530 struct termios
532 tcflag_t c_iflag;
533 tcflag_t c_oflag;
534 tcflag_t c_cflag;
535 tcflag_t c_lflag;
536 cc_t[NCCS] c_cc;
537 speed_t c_ispeed;
538 speed_t c_ospeed;
541 enum VEOF = 0;
542 enum VEOL = 1;
543 enum VERASE = 3;
544 enum VINTR = 8;
545 enum VKILL = 5;
546 enum VMIN = 16;
547 enum VQUIT = 9;
548 enum VSTART = 12;
549 enum VSTOP = 13;
550 enum VSUSP = 10;
551 enum VTIME = 17;
553 enum BRKINT = 0x0000002;
554 enum ICRNL = 0x0000100;
555 enum IGNBRK = 0x0000001;
556 enum IGNCR = 0x0000080;
557 enum IGNPAR = 0x0000004;
558 enum INLCR = 0x0000040;
559 enum INPCK = 0x0000010;
560 enum ISTRIP = 0x0000020;
561 enum IXOFF = 0x0000400;
562 enum IXON = 0x0000200;
563 enum PARMRK = 0x0000008;
565 enum OPOST = 0x0000001;
567 enum B0 = 0;
568 enum B50 = 50;
569 enum B75 = 75;
570 enum B110 = 110;
571 enum B134 = 134;
572 enum B150 = 150;
573 enum B200 = 200;
574 enum B300 = 300;
575 enum B600 = 600;
576 enum B1200 = 1200;
577 enum B1800 = 1800;
578 enum B2400 = 2400;
579 enum B4800 = 4800;
580 enum B9600 = 9600;
581 enum B19200 = 19200;
582 enum B38400 = 38400;
584 enum CSIZE = 0x0000300;
585 enum CS5 = 0x0000000;
586 enum CS6 = 0x0000100;
587 enum CS7 = 0x0000200;
588 enum CS8 = 0x0000300;
589 enum CSTOPB = 0x0000400;
590 enum CREAD = 0x0000800;
591 enum PARENB = 0x0001000;
592 enum PARODD = 0x0002000;
593 enum HUPCL = 0x0004000;
594 enum CLOCAL = 0x0008000;
596 enum ECHO = 0x00000008;
597 enum ECHOE = 0x00000002;
598 enum ECHOK = 0x00000004;
599 enum ECHONL = 0x00000010;
600 enum ICANON = 0x00000100;
601 enum IEXTEN = 0x00000400;
602 enum ISIG = 0x00000080;
603 enum NOFLSH = 0x80000000;
604 enum TOSTOP = 0x00400000;
606 enum TCSANOW = 0;
607 enum TCSADRAIN = 1;
608 enum TCSAFLUSH = 2;
610 enum TCIFLUSH = 1;
611 enum TCOFLUSH = 2;
612 enum TCIOFLUSH = 3;
614 enum TCIOFF = 3;
615 enum TCION = 4;
616 enum TCOOFF = 1;
617 enum TCOON = 2;
619 else version (OpenBSD)
621 alias uint tcflag_t;
622 alias ubyte cc_t;
623 alias uint speed_t;
625 enum NCCS = 20;
627 struct termios
629 tcflag_t c_iflag;
630 tcflag_t c_oflag;
631 tcflag_t c_cflag;
632 tcflag_t c_lflag;
633 cc_t[NCCS] c_cc;
634 int c_ispeed;
635 int c_ospeed;
638 enum VEOF = 0;
639 enum VEOL = 1;
640 enum VERASE = 3;
641 enum VINTR = 8;
642 enum VKILL = 5;
643 enum VMIN = 16;
644 enum VQUIT = 9;
645 enum VSTART = 12;
646 enum VSTOP = 13;
647 enum VSUSP = 10;
648 enum VTIME = 17;
650 enum BRKINT = 0x0000002;
651 enum ICRNL = 0x0000100;
652 enum IGNBRK = 0x0000001;
653 enum IGNCR = 0x0000080;
654 enum IGNPAR = 0x0000004;
655 enum INLCR = 0x0000040;
656 enum INPCK = 0x0000010;
657 enum ISTRIP = 0x0000020;
658 enum IXOFF = 0x0000400;
659 enum IXON = 0x0000200;
660 enum PARMRK = 0x0000008;
662 enum OPOST = 0x0000001;
664 enum B0 = 0;
665 enum B50 = 50;
666 enum B75 = 75;
667 enum B110 = 110;
668 enum B134 = 134;
669 enum B150 = 150;
670 enum B200 = 200;
671 enum B300 = 300;
672 enum B600 = 600;
673 enum B1200 = 1200;
674 enum B1800 = 1800;
675 enum B2400 = 2400;
676 enum B4800 = 4800;
677 enum B9600 = 9600;
678 enum B19200 = 19200;
679 enum B38400 = 38400;
681 enum CSIZE = 0x0000300;
682 enum CS5 = 0x0000000;
683 enum CS6 = 0x0000100;
684 enum CS7 = 0x0000200;
685 enum CS8 = 0x0000300;
686 enum CSTOPB = 0x0000400;
687 enum CREAD = 0x0000800;
688 enum PARENB = 0x0001000;
689 enum PARODD = 0x0002000;
690 enum HUPCL = 0x0004000;
691 enum CLOCAL = 0x0008000;
693 enum ECHO = 0x00000008;
694 enum ECHOE = 0x00000002;
695 enum ECHOK = 0x00000004;
696 enum ECHONL = 0x00000010;
697 enum ICANON = 0x00000100;
698 enum IEXTEN = 0x00000400;
699 enum ISIG = 0x00000080;
700 enum NOFLSH = 0x80000000;
701 enum TOSTOP = 0x00400000;
703 enum TCSANOW = 0;
704 enum TCSADRAIN = 1;
705 enum TCSAFLUSH = 2;
707 enum TCIFLUSH = 1;
708 enum TCOFLUSH = 2;
709 enum TCIOFLUSH = 3;
711 enum TCIOFF = 3;
712 enum TCION = 4;
713 enum TCOOFF = 1;
714 enum TCOON = 2;
716 else version (Solaris)
718 alias tcflag_t = uint;
719 alias cc_t = ubyte;
720 alias speed_t = uint;
722 enum NCCS = 19;
724 struct termios
726 tcflag_t c_iflag; /* input modes */
727 tcflag_t c_oflag; /* output modes */
728 tcflag_t c_cflag; /* control modes */
729 tcflag_t c_lflag; /* line discipline modes */
730 cc_t[NCCS] c_cc; /* control chars */
733 /* control characters */
734 enum VINTR = 0;
735 enum VQUIT = 1;
736 enum VERASE = 2;
737 enum VKILL = 3;
738 enum VEOF = 4;
739 enum VEOL = 5;
740 enum VMIN = 4;
741 enum VTIME = 5;
742 enum VSTART = 8;
743 enum VSTOP = 9;
744 enum VSUSP = 10;
746 /* input modes */
747 enum IGNBRK = 0x000001;
748 enum BRKINT = 0x000002;
749 enum IGNPAR = 0x000004;
750 enum PARMRK = 0x000008;
751 enum INPCK = 0x000010;
752 enum ISTRIP = 0x000020;
753 enum INLCR = 0x000040;
754 enum IGNCR = 0x000080;
755 enum ICRNL = 0x000100;
756 enum IXON = 0x000400;
757 enum IXOFF = 0x001000;
759 /* output modes */
760 enum OPOST = 0x000001;
762 /* control modes */
763 enum CSIZE = 0x000030;
764 enum CS5 = 0x000000;
765 enum CS6 = 0x000010;
766 enum CS7 = 0x000020;
767 enum CS8 = 0x000030;
768 enum CSTOPB = 0x000040;
769 enum CREAD = 0x000080;
770 enum PARENB = 0x000100;
771 enum PARODD = 0x000200;
772 enum HUPCL = 0x000400;
773 enum CLOCAL = 0x000800;
775 enum CRTSCTS = 0x10000000;
777 /* line discipline 0 modes */
778 enum ISIG = 0x000001;
779 enum ICANON = 0x000002;
780 enum ECHO = 0x000008;
781 enum ECHOE = 0x000010;
782 enum ECHOK = 0x000020;
783 enum ECHONL = 0x000040;
784 enum NOFLSH = 0x000080;
785 enum TOSTOP = 0x000100;
787 enum ECHOCTL = 0x000200;
788 enum ECHOPRT = 0x000400;
789 enum ECHOKE = 0x000800;
791 enum IEXTEN = 0x008000; /* POSIX flag - enable POSIX extensions */
793 enum _TIOC = ('T'<<8);
794 enum TCSANOW = (_TIOC|14);
795 enum TCSADRAIN = (_TIOC|15);
796 enum TCSAFLUSH = (_TIOC|16);
798 /* termios option flags */
799 enum TCIFLUSH = 0; /* flush data received but not read */
800 enum TCOFLUSH = 1; /* flush data written but not transmitted */
801 enum TCIOFLUSH = 2; /* flush both data both input and output queues */
803 enum TCOOFF = 0; /* suspend output */
804 enum TCOON = 1; /* restart suspended output */
805 enum TCIOFF = 2; /* suspend input */
806 enum TCION = 3; /* restart suspended input */
808 /* Speeds */
809 enum B0 = 0;
810 enum B50 = 1;
811 enum B75 = 2;
812 enum B110 = 3;
813 enum B134 = 4;
814 enum B150 = 5;
815 enum B200 = 6;
816 enum B300 = 7;
817 enum B600 = 8;
818 enum B1200 = 9;
819 enum B1800 = 10;
820 enum B2400 = 11;
821 enum B4800 = 12;
822 enum B9600 = 13;
823 enum B19200 = 14;
824 enum B38400 = 15;
825 enum B57600 = 16;
826 enum B76800 = 17;
827 enum B115200 = 18;
828 enum B153600 = 19;
829 enum B230400 = 20;
830 enum B307200 = 21;
831 enum B460800 = 22;
832 enum B921600 = 23;
836 speed_t cfgetispeed(const scope termios*);
837 speed_t cfgetospeed(const scope termios*);
838 int cfsetispeed(termios*, speed_t);
839 int cfsetospeed(termios*, speed_t);
840 int tcdrain(int);
841 int tcflow(int, int);
842 int tcflush(int, int);
843 int tcgetattr(int, termios*);
844 int tcsendbreak(int, int);
845 int tcsetattr(int, int, const scope termios*);
848 version (CRuntime_Glibc)
850 speed_t cfgetispeed(const scope termios*);
851 speed_t cfgetospeed(const scope termios*);
852 int cfsetispeed(termios*, speed_t);
853 int cfsetospeed(termios*, speed_t);
854 int tcdrain(int);
855 int tcflow(int, int);
856 int tcflush(int, int);
857 int tcgetattr(int, termios*);
858 int tcsendbreak(int, int);
859 int tcsetattr(int, int, const scope termios*);
861 else version (Darwin)
863 speed_t cfgetispeed(const scope termios*);
864 speed_t cfgetospeed(const scope termios*);
865 int cfsetispeed(termios*, speed_t);
866 int cfsetospeed(termios*, speed_t);
867 int tcdrain(int);
868 int tcflow(int, int);
869 int tcflush(int, int);
870 int tcgetattr(int, termios*);
871 int tcsendbreak(int, int);
872 int tcsetattr(int, int, const scope termios*);
875 else version (FreeBSD)
877 speed_t cfgetispeed(const scope termios*);
878 speed_t cfgetospeed(const scope termios*);
879 int cfsetispeed(termios*, speed_t);
880 int cfsetospeed(termios*, speed_t);
881 int tcdrain(int);
882 int tcflow(int, int);
883 int tcflush(int, int);
884 int tcgetattr(int, termios*);
885 int tcsendbreak(int, int);
886 int tcsetattr(int, int, const scope termios*);
888 else version (DragonFlyBSD)
890 speed_t cfgetispeed(const scope termios*);
891 speed_t cfgetospeed(const scope termios*);
892 int cfsetispeed(termios*, speed_t);
893 int cfsetospeed(termios*, speed_t);
894 int tcdrain(int);
895 int tcflow(int, int);
896 int tcflush(int, int);
897 int tcgetattr(int, termios*);
898 int tcsendbreak(int, int);
899 int tcsetattr(int, int, const scope termios*);
901 else version (NetBSD)
903 speed_t cfgetispeed(const scope termios*);
904 speed_t cfgetospeed(const scope termios*);
905 int cfsetispeed(termios*, speed_t);
906 int cfsetospeed(termios*, speed_t);
907 int tcdrain(int);
908 int tcflow(int, int);
909 int tcflush(int, int);
910 int tcgetattr(int, termios*);
911 int tcsendbreak(int, int);
912 int tcsetattr(int, int, const scope termios*);
914 else version (OpenBSD)
916 speed_t cfgetispeed(const scope termios*);
917 speed_t cfgetospeed(const scope termios*);
918 int cfsetispeed(termios*, speed_t);
919 int cfsetospeed(termios*, speed_t);
920 int tcdrain(int);
921 int tcflow(int, int);
922 int tcflush(int, int);
923 int tcgetattr(int, termios*);
924 int tcsendbreak(int, int);
925 int tcsetattr(int, int, const scope termios*);
927 else version (Solaris)
929 speed_t cfgetospeed(const scope termios*);
930 int cfsetospeed(termios*, speed_t);
931 speed_t cfgetispeed(const scope termios*);
932 int cfsetispeed(termios*, speed_t);
933 int tcgetattr(int, termios*);
934 int tcsetattr(int, int, const scope termios*);
935 int tcsendbreak(int, int);
936 int tcdrain(int);
937 int tcflush(int, int);
938 int tcflow(int, int);
940 else version (CRuntime_UClibc)
942 speed_t cfgetispeed(const scope termios*);
943 speed_t cfgetospeed(const scope termios*);
944 int cfsetispeed(termios*, speed_t);
945 int cfsetospeed(termios*, speed_t);
946 int tcdrain(int);
947 int tcflow(int, int);
948 int tcflush(int, int);
949 int tcgetattr(int, termios*);
950 int tcsendbreak(int, int);
951 int tcsetattr(int, int, const scope termios*);
955 // XOpen (XSI)
958 IXANY
960 ONLCR
961 OCRNL
962 ONOCR
963 ONLRET
964 OFILL
965 NLDLY
968 CRDLY
973 TABDLY
974 TAB0
975 TAB1
976 TAB2
977 TAB3
978 BSDLY
981 VTDLY
984 FFDLY
988 pid_t tcgetsid(int);
991 version (CRuntime_Glibc)
993 enum IXANY = 0x0000800; // 0004000
995 enum ONLCR = 0x0000004; // 0000004
996 enum OCRNL = 0x0000008; // 0000010
997 enum ONOCR = 0x0000010; // 0000020
998 enum ONLRET = 0x0000020; // 0000040
999 enum OFILL = 0x0000040; // 0000100
1000 enum NLDLY = 0x0000100; // 0000400
1001 enum NL0 = 0x0000000; // 0000000
1002 enum NL1 = 0x0000100; // 0000400
1003 enum CRDLY = 0x0000600; // 0003000
1004 enum CR0 = 0x0000000; // 0000000
1005 enum CR1 = 0x0000200; // 0001000
1006 enum CR2 = 0x0000400; // 0002000
1007 enum CR3 = 0x0000600; // 0003000
1008 enum TABDLY = 0x0001800; // 0014000
1009 enum TAB0 = 0x0000000; // 0000000
1010 enum TAB1 = 0x0000800; // 0004000
1011 enum TAB2 = 0x0001000; // 0010000
1012 enum TAB3 = 0x0001800; // 0014000
1013 enum BSDLY = 0x0002000; // 0020000
1014 enum BS0 = 0x0000000; // 0000000
1015 enum BS1 = 0x0002000; // 0020000
1016 enum VTDLY = 0x0004000; // 0040000
1017 enum VT0 = 0x0000000; // 0000000
1018 enum VT1 = 0x0004000; // 0040000
1019 enum FFDLY = 0x0008000; // 0100000
1020 enum FF0 = 0x0000000; // 0000000
1021 enum FF1 = 0x0008000; // 0100000
1023 pid_t tcgetsid(int);
1026 else version (Darwin)
1028 enum IXANY = 0x00000800;
1030 enum ONLCR = 0x00000002;
1031 enum OCRNL = 0x00000010;
1032 enum ONOCR = 0x00000020;
1033 enum ONLRET = 0x00000040;
1034 enum OFILL = 0x00000080;
1035 enum NLDLY = 0x00000300;
1036 enum NL0 = 0x00000000;
1037 enum NL1 = 0x00000100;
1038 enum CRDLY = 0x00003000;
1039 enum CR0 = 0x00000000;
1040 enum CR1 = 0x00001000;
1041 enum CR2 = 0x00002000;
1042 enum CR3 = 0x00003000;
1043 enum TABDLY = 0x00000c04;
1044 enum TAB0 = 0x00000000;
1045 enum TAB1 = 0x00000400;
1046 enum TAB2 = 0x00000800;
1047 enum TAB3 = 0x00000004;
1048 enum BSDLY = 0x00008000;
1049 enum BS0 = 0x00000000;
1050 enum BS1 = 0x00008000;
1051 enum VTDLY = 0x00010000;
1052 enum VT0 = 0x00000000;
1053 enum VT1 = 0x00010000;
1054 enum FFDLY = 0x00004000;
1055 enum FF0 = 0x00000000;
1056 enum FF1 = 0x00004000;
1058 pid_t tcgetsid (int);
1061 else version (FreeBSD)
1063 enum IXANY = 0x00000800;
1065 enum ONLCR = 0x00000002;
1066 enum OCRNL = 0x00000010;
1067 enum ONOCR = 0x00000020;
1068 enum ONLRET = 0x00000040;
1069 //enum OFILL
1070 //enum NLDLY
1071 //enum NL0
1072 //enum NL1
1073 //enum CRDLY
1074 //enum CR0
1075 //enum CR1
1076 //enum CR2
1077 //enum CR3
1078 enum TABDLY = 0x00000004;
1079 enum TAB0 = 0x00000000;
1080 //enum TAB1
1081 //enum TAB2
1082 enum TAB3 = 0x00000004;
1083 //enum BSDLY
1084 //enum BS0
1085 //enum BS1
1086 //enum VTDLY
1087 //enum VT0
1088 //enum VT1
1089 //enum FFDLY
1090 //enum FF0
1091 //enum FF1
1093 pid_t tcgetsid(int);
1095 else version (DragonFlyBSD)
1097 enum IXANY = 0x00000800;
1099 enum ONLCR = 0x00000002;
1100 enum OCRNL = 0x00000010;
1101 enum ONOCR = 0x00000020;
1102 enum ONLRET = 0x00000040;
1103 //enum OFILL
1104 //enum NLDLY
1105 //enum NL0
1106 //enum NL1
1107 //enum CRDLY
1108 //enum CR0
1109 //enum CR1
1110 //enum CR2
1111 //enum CR3
1112 enum TABDLY = 0x00000004;
1113 enum TAB0 = 0x00000000;
1114 //enum TAB1
1115 //enum TAB2
1116 enum TAB3 = 0x00000004;
1117 //enum BSDLY
1118 //enum BS0
1119 //enum BS1
1120 //enum VTDLY
1121 //enum VT0
1122 //enum VT1
1123 //enum FFDLY
1124 //enum FF0
1125 //enum FF1
1127 pid_t tcgetsid(int);
1129 else version (NetBSD)
1131 enum IXANY = 0x00000800;
1133 enum ONLCR = 0x00000002;
1134 enum OCRNL = 0x00000010;
1135 enum ONOCR = 0x00000020;
1136 enum ONLRET = 0x00000040;
1137 //enum OFILL
1138 //enum NLDLY
1139 //enum NL0
1140 //enum NL1
1141 //enum CRDLY
1142 //enum CR0
1143 //enum CR1
1144 //enum CR2
1145 //enum CR3
1146 enum TABDLY = 0x00000004;
1147 enum TAB0 = 0x00000000;
1148 //enum TAB1
1149 //enum TAB2
1150 enum TAB3 = 0x00000004;
1151 //enum BSDLY
1152 //enum BS0
1153 //enum BS1
1154 //enum VTDLY
1155 //enum VT0
1156 //enum VT1
1157 //enum FFDLY
1158 //enum FF0
1159 //enum FF1
1161 pid_t tcgetsid(int);
1163 else version (OpenBSD)
1165 enum IXANY = 0x00000800;
1167 enum ONLCR = 0x00000002;
1168 enum OCRNL = 0x00000010;
1169 enum ONOCR = 0x00000040;
1170 enum ONLRET = 0x00000080;
1171 //enum OFILL
1172 //enum NLDLY
1173 //enum NL0
1174 //enum NL1
1175 //enum CRDLY
1176 //enum CR0
1177 //enum CR1
1178 //enum CR2
1179 //enum CR3
1180 //enum TABDLY
1181 //enum TAB0
1182 //enum TAB1
1183 //enum TAB2
1184 //enum TAB3
1185 //enum BSDLY
1186 //enum BS0
1187 //enum BS1
1188 //enum VTDLY
1189 //enum VT0
1190 //enum VT1
1191 //enum FFDLY
1192 //enum FF0
1193 //enum FF1
1195 pid_t tcgetsid(int);
1197 else version (Solaris)
1199 enum IXANY = 0x0000800;
1201 enum ONLCR = 0x0000004;
1202 enum OCRNL = 0x0000008;
1203 enum ONOCR = 0x0000010;
1204 enum ONLRET = 0x0000020;
1205 enum OFILL = 0x0000040;
1206 enum OFDEL = 0x0000080;
1207 enum NLDLY = 0x0000100;
1208 enum NL0 = 0x0000000;
1209 enum NL1 = 0x0000100;
1210 enum CRDLY = 0x0000600;
1211 enum CR0 = 0x0000000;
1212 enum CR1 = 0x0000200;
1213 enum CR2 = 0x0000400;
1214 enum CR3 = 0x0000600;
1215 enum TABDLY = 0x0001800;
1216 enum TAB0 = 0x0000000;
1217 enum TAB1 = 0x0000800;
1218 enum TAB2 = 0x0001000;
1219 enum TAB3 = 0x0001800;
1220 enum BSDLY = 0x0002000;
1221 enum BS0 = 0x0000000;
1222 enum BS1 = 0x0002000;
1223 enum VTDLY = 0x0004000;
1224 enum VT0 = 0x0000000;
1225 enum VT1 = 0x0004000;
1226 enum FFDLY = 0x0008000;
1227 enum FF0 = 0x0000000;
1228 enum FF1 = 0x0008000;
1229 enum XCASE = 0x0000004;
1231 pid_t tcgetsid(int);
1233 else version (CRuntime_UClibc)
1235 enum IXANY = 0x0000800; // 0004000
1237 enum ONLCR = 0x0000004; // 0000004
1238 enum OCRNL = 0x0000008; // 0000010
1239 enum ONOCR = 0x0000010; // 0000020
1240 enum ONLRET = 0x0000020; // 0000040
1241 enum OFILL = 0x0000040; // 0000100
1242 enum NLDLY = 0x0000100; // 0000400
1243 enum NL0 = 0x0000000; // 0000000
1244 enum NL1 = 0x0000100; // 0000400
1245 enum CRDLY = 0x0000600; // 0003000
1246 enum CR0 = 0x0000000; // 0000000
1247 enum CR1 = 0x0000200; // 0001000
1248 enum CR2 = 0x0000400; // 0002000
1249 enum CR3 = 0x0000600; // 0003000
1250 enum TABDLY = 0x0001800; // 0014000
1251 enum TAB0 = 0x0000000; // 0000000
1252 enum TAB1 = 0x0000800; // 0004000
1253 enum TAB2 = 0x0001000; // 0010000
1254 enum TAB3 = 0x0001800; // 0014000
1255 enum BSDLY = 0x0002000; // 0020000
1256 enum BS0 = 0x0000000; // 0000000
1257 enum BS1 = 0x0002000; // 0020000
1258 enum VTDLY = 0x0004000; // 0040000
1259 enum VT0 = 0x0000000; // 0000000
1260 enum VT1 = 0x0004000; // 0040000
1261 enum FFDLY = 0x0008000; // 0100000
1262 enum FF0 = 0x0000000; // 0000000
1263 enum FF1 = 0x0008000; // 0100000
1265 pid_t tcgetsid(int);