summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/imp/libc/termios/types.rs
blob: 7e672875501155cdecf12c9ed15725e595ec5cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
use super::super::c;

/// `TCSA*` values for use with [`tcsetattr`].
///
/// [`tcsetattr`]: crate::termios::tcsetattr
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[repr(i32)]
pub enum OptionalActions {
    /// `TCSANOW`—Make the change immediately.
    Now = c::TCSANOW,

    /// `TCSADRAIN`—Make the change after all output has been transmitted.
    Drain = c::TCSADRAIN,

    /// `TCSAFLUSH`—Discard any pending input and then make the change
    /// after all output has been transmitted.
    Flush = c::TCSAFLUSH,
}

/// `TC*` values for use with [`tcflush`].
///
/// [`tcflush`]: crate::termios::tcflush
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[repr(i32)]
pub enum QueueSelector {
    /// `TCIFLUSH`—Flush data received but not read.
    IFlush = c::TCIFLUSH,

    /// `TCOFLUSH`—Flush data written but not transmitted.
    OFlush = c::TCOFLUSH,

    /// `TCIOFLUSH`—`IFlush` and `OFlush` combined.
    IOFlush = c::TCIOFLUSH,
}

/// `TC*` values for use with [`tcflow`].
///
/// [`tcflow`]: crate::termios::tcflow
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[repr(i32)]
pub enum Action {
    /// `TCOOFF`—Suspend output.
    OOff = c::TCOOFF,

    /// `TCOON`—Restart suspended output.
    OOn = c::TCOON,

    /// `TCIOFF`—Transmits a STOP byte.
    IOff = c::TCIOFF,

    /// `TCION`—Transmits a START byte.
    IOn = c::TCION,
}

/// `struct termios` for use with [`tcgetattr`].
///
/// [`tcgetattr`]: crate::termios::tcgetattr
pub type Termios = c::termios;

/// `struct winsize` for use with [`tcgetwinsize`].
///
/// [`tcgetwinsize`]: crate::termios::tcgetwinsize
pub type Winsize = c::winsize;

/// `tcflag_t`—A type for the flags fields of [`Termios`].
pub type Tcflag = c::tcflag_t;

/// `speed_t`—A return type for [`cfsetspeed`] and similar.
///
/// [`cfsetspeed`]: crate::termios::cfsetspeed
pub type Speed = c::speed_t;

/// `VINTR`
pub const VINTR: usize = c::VINTR as usize;

/// `VQUIT`
pub const VQUIT: usize = c::VQUIT as usize;

/// `VERASE`
pub const VERASE: usize = c::VERASE as usize;

/// `VKILL`
pub const VKILL: usize = c::VKILL as usize;

/// `VEOF`
pub const VEOF: usize = c::VEOF as usize;

/// `VTIME`
pub const VTIME: usize = c::VTIME as usize;

/// `VMIN`
pub const VMIN: usize = c::VMIN as usize;

/// `VSWTC`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const VSWTC: usize = c::VSWTC as usize;

/// `VSTART`
pub const VSTART: usize = c::VSTART as usize;

/// `VSTOP`
pub const VSTOP: usize = c::VSTOP as usize;

/// `VSUSP`
pub const VSUSP: usize = c::VSUSP as usize;

/// `VEOL`
pub const VEOL: usize = c::VEOL as usize;

/// `VREPRINT`
pub const VREPRINT: usize = c::VREPRINT as usize;

/// `VDISCARD`
pub const VDISCARD: usize = c::VDISCARD as usize;

/// `VWERASE`
pub const VWERASE: usize = c::VWERASE as usize;

/// `VLNEXT`
pub const VLNEXT: usize = c::VLNEXT as usize;

/// `VEOL2`
pub const VEOL2: usize = c::VEOL2 as usize;

/// `IGNBRK`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IGNBRK: c::c_uint = c::IGNBRK;

/// `BRKINT`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const BRKINT: c::c_uint = c::BRKINT;

/// `IGNPAR`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IGNPAR: c::c_uint = c::IGNPAR;

/// `PARMRK`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const PARMRK: c::c_uint = c::PARMRK;

/// `INPCK`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const INPCK: c::c_uint = c::INPCK;

/// `ISTRIP`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ISTRIP: c::c_uint = c::ISTRIP;

/// `INLCR`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const INLCR: c::c_uint = c::INLCR;

/// `IGNCR`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IGNCR: c::c_uint = c::IGNCR;

/// `ICRNL`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ICRNL: c::c_uint = c::ICRNL;

/// `IUCLC`
#[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))]
pub const IUCLC: c::c_uint = c::IUCLC;

/// `IXON`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IXON: c::c_uint = c::IXON;

/// `IXANY`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const IXANY: c::c_uint = c::IXANY;

/// `IXOFF`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IXOFF: c::c_uint = c::IXOFF;

/// `IMAXBEL`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const IMAXBEL: c::c_uint = c::IMAXBEL;

/// `IUTF8`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const IUTF8: c::c_uint = c::IUTF8;

/// `OPOST`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const OPOST: c::c_uint = c::OPOST;

/// `OLCUC`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "redox",
)))]
pub const OLCUC: c::c_uint = c::OLCUC;

/// `ONLCR`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ONLCR: c::c_uint = c::ONLCR;

/// `OCRNL`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const OCRNL: c::c_uint = c::OCRNL;

/// `ONOCR`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ONOCR: c::c_uint = c::ONOCR;

/// `ONLRET`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ONLRET: c::c_uint = c::ONLRET;

/// `OFILL`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const OFILL: c::c_uint = c::OFILL;

/// `OFDEL`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const OFDEL: c::c_uint = c::OFDEL;

/// `NLDLY`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const NLDLY: c::c_uint = c::NLDLY;

/// `NL0`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const NL0: c::c_uint = c::NL0;

/// `NL1`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const NL1: c::c_uint = c::NL1;

/// `CRDLY`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CRDLY: c::c_uint = c::CRDLY;

/// `CR0`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CR0: c::c_uint = c::CR0;

/// `CR1`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CR1: c::c_uint = c::CR1;

/// `CR2`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CR2: c::c_uint = c::CR2;

/// `CR3`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CR3: c::c_uint = c::CR3;

/// `TABDLY`
#[cfg(not(any(
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "illumos",
    target_os = "redox",
)))]
pub const TABDLY: c::c_uint = c::TABDLY;

/// `TAB0`
#[cfg(not(any(
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const TAB0: c::c_uint = c::TAB0;

/// `TAB1`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const TAB1: c::c_uint = c::TAB1;

/// `TAB2`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const TAB2: c::c_uint = c::TAB2;

/// `TAB3`
#[cfg(not(any(
    target_env = "musl",
    target_os = "emscripten",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const TAB3: c::c_uint = c::TAB3;

/// `BSDLY`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const BSDLY: c::c_uint = c::BSDLY;

/// `BS0`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const BS0: c::c_uint = c::BS0;

/// `BS1`
#[cfg(not(any(
    target_env = "musl",
    target_os = "emscripten",
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const BS1: c::c_uint = c::BS1;

/// `FFDLY`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const FFDLY: c::c_uint = c::FFDLY;

/// `FF0`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const FF0: c::c_uint = c::FF0;

/// `FF1`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const FF1: c::c_uint = c::FF1;

/// `VTDLY`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const VTDLY: c::c_uint = c::VTDLY;

/// `VT0`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const VT0: c::c_uint = c::VT0;

/// `VT1`
#[cfg(not(any(
    target_env = "musl",
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "fuchsia",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const VT1: c::c_uint = c::VT1;

/// `B0`
pub const B0: Speed = c::B0;

/// `B50`
pub const B50: Speed = c::B50;

/// `B75`
pub const B75: Speed = c::B75;

/// `B110`
pub const B110: Speed = c::B110;

/// `B134`
pub const B134: Speed = c::B134;

/// `B150`
pub const B150: Speed = c::B150;

/// `B200`
pub const B200: Speed = c::B200;

/// `B300`
pub const B300: Speed = c::B300;

/// `B600`
pub const B600: Speed = c::B600;

/// `B1200`
pub const B1200: Speed = c::B1200;

/// `B1800`
pub const B1800: Speed = c::B1800;

/// `B2400`
pub const B2400: Speed = c::B2400;

/// `B4800`
pub const B4800: Speed = c::B4800;

/// `B9600`
pub const B9600: Speed = c::B9600;

/// `B19200`
pub const B19200: Speed = c::B19200;

/// `B38400`
pub const B38400: Speed = c::B38400;

/// `B57600`
pub const B57600: Speed = c::B57600;

/// `B115200`
pub const B115200: Speed = c::B115200;

/// `B230400`
pub const B230400: Speed = c::B230400;

/// `B460800`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))]
pub const B460800: Speed = c::B460800;

/// `B500000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B500000: Speed = c::B500000;

/// `B576000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B576000: Speed = c::B576000;

/// `B921600`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))]
pub const B921600: Speed = c::B921600;

/// `B1000000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B1000000: Speed = c::B1000000;

/// `B1152000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B1152000: Speed = c::B1152000;

/// `B1500000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B1500000: Speed = c::B1500000;

/// `B2000000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B2000000: Speed = c::B2000000;

/// `B2500000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B2500000: Speed = c::B2500000;

/// `B3000000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B3000000: Speed = c::B3000000;

/// `B3500000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B3500000: Speed = c::B3500000;

/// `B4000000`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
)))]
pub const B4000000: Speed = c::B4000000;

/// `CSIZE`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CSIZE: c::c_uint = c::CSIZE;

/// `CS5`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CS5: c::c_uint = c::CS5;

/// `CS6`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CS6: c::c_uint = c::CS6;

/// `CS7`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CS7: c::c_uint = c::CS7;

/// `CS8`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CS8: c::c_uint = c::CS8;

/// `CSTOPB`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CSTOPB: c::c_uint = c::CSTOPB;

/// `CREAD`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CREAD: c::c_uint = c::CREAD;

/// `PARENB`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const PARENB: c::c_uint = c::PARENB;

/// `PARODD`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const PARODD: c::c_uint = c::PARODD;

/// `HUPCL`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const HUPCL: c::c_uint = c::HUPCL;

/// `CLOCAL`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const CLOCAL: c::c_uint = c::CLOCAL;

/// `ISIG`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ISIG: c::c_uint = c::ISIG;

/// `ICANON`—A flag for the `c_lflag` field of [`Termios`] indicating
/// canonical mode.
pub const ICANON: Tcflag = c::ICANON;

/// `ECHO`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ECHO: c::c_uint = c::ECHO;

/// `ECHOE`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ECHOE: c::c_uint = c::ECHOE;

/// `ECHOK`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ECHOK: c::c_uint = c::ECHOK;

/// `ECHONL`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const ECHONL: c::c_uint = c::ECHONL;

/// `NOFLSH`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const NOFLSH: c::c_uint = c::NOFLSH;

/// `TOSTOP`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const TOSTOP: c::c_uint = c::TOSTOP;

/// `IEXTEN`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub const IEXTEN: c::c_uint = c::IEXTEN;

/// `EXTA`
#[cfg(not(any(
    target_os = "emscripten",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "redox",
)))]
pub const EXTA: c::c_uint = c::EXTA;

/// `EXTB`
#[cfg(not(any(
    target_os = "emscripten",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "redox",
)))]
pub const EXTB: c::c_uint = c::EXTB;

/// `CBAUD`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CBAUD: c::c_uint = c::CBAUD;

/// `CBAUDEX`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CBAUDEX: c::c_uint = c::CBAUDEX;

/// `CIBAUD`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
    target_arch = "powerpc",
    target_arch = "powerpc64",
)))]
pub const CIBAUD: c::tcflag_t = c::CIBAUD;

/// `CIBAUD`
// TODO: Upstream this.
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
pub const CIBAUD: c::tcflag_t = 0o77600000;

/// `CMSPAR`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "emscripten",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const CMSPAR: c::c_uint = c::CMSPAR;

/// `CRTSCTS`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const CRTSCTS: c::c_uint = c::CRTSCTS;

/// `XCASE`
#[cfg(any(target_arch = "s390x", target_os = "haiku"))]
pub const XCASE: c::c_uint = c::XCASE;

/// `ECHOCTL`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const ECHOCTL: c::c_uint = c::ECHOCTL;

/// `ECHOPRT`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const ECHOPRT: c::c_uint = c::ECHOPRT;

/// `ECHOKE`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const ECHOKE: c::c_uint = c::ECHOKE;

/// `FLUSHO`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const FLUSHO: c::c_uint = c::FLUSHO;

/// `PENDIN`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const PENDIN: c::c_uint = c::PENDIN;

/// `EXTPROC`
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
pub const EXTPROC: c::c_uint = c::EXTPROC;

/// `XTABS`
#[cfg(not(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "illumos",
    target_os = "ios",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "redox",
)))]
pub const XTABS: c::c_uint = c::XTABS;