| author | |
| committer | |
| log | d7563a7753393d7f0d1af445276a64b8a55cb857 |
| tree | add529c48653e4b4525fd2fe30e0ce2503c3d703 |
| parent | 0c725a354a801c84100011db5eb53ae6c58086c9 |
| parent | ce3bd515973c45ef755da04bc83585b7ce6b87b8 |
| signature |
std.os.termios: consolidate, correct, and complete API definitions11 files changed, 1098 insertions(+), 624 deletions(-)
lib/std/c.zig+788| ... | @@ -679,6 +679,794 @@ pub const MAP = switch (native_os) { | ... | @@ -679,6 +679,794 @@ pub const MAP = switch (native_os) { |
| 679 | /// Used by libc to communicate failure. Not actually part of the underlying syscall. | 679 | /// Used by libc to communicate failure. Not actually part of the underlying syscall. |
| 680 | pub const MAP_FAILED: *anyopaque = @ptrFromInt(std.math.maxInt(usize)); | 680 | pub const MAP_FAILED: *anyopaque = @ptrFromInt(std.math.maxInt(usize)); |
| 681 | 681 | ||
| 682 | pub const cc_t = switch (native_os) { | ||
| 683 | .linux => std.os.linux.cc_t, | ||
| 684 | .macos, .ios, .tvos, .watchos, .netbsd, .openbsd => enum(u8) { | ||
| 685 | VEOF = 0, | ||
| 686 | VEOL = 1, | ||
| 687 | VEOL2 = 2, | ||
| 688 | VERASE = 3, | ||
| 689 | VWERASE = 4, | ||
| 690 | VKILL = 5, | ||
| 691 | VREPRINT = 6, | ||
| 692 | VINTR = 8, | ||
| 693 | VQUIT = 9, | ||
| 694 | VSUSP = 10, | ||
| 695 | VDSUSP = 11, | ||
| 696 | VSTART = 12, | ||
| 697 | VSTOP = 13, | ||
| 698 | VLNEXT = 14, | ||
| 699 | VDISCARD = 15, | ||
| 700 | VMIN = 16, | ||
| 701 | VTIME = 17, | ||
| 702 | VSTATUS = 18, | ||
| 703 | }, | ||
| 704 | .freebsd, .kfreebsd => enum(u8) { | ||
| 705 | VEOF = 0, | ||
| 706 | VEOL = 1, | ||
| 707 | VEOL2 = 2, | ||
| 708 | VERASE = 3, | ||
| 709 | VWERASE = 4, | ||
| 710 | VKILL = 5, | ||
| 711 | VREPRINT = 6, | ||
| 712 | VERASE2 = 7, | ||
| 713 | VINTR = 8, | ||
| 714 | VQUIT = 9, | ||
| 715 | VSUSP = 10, | ||
| 716 | VDSUSP = 11, | ||
| 717 | VSTART = 12, | ||
| 718 | VSTOP = 13, | ||
| 719 | VLNEXT = 14, | ||
| 720 | VDISCARD = 15, | ||
| 721 | VMIN = 16, | ||
| 722 | VTIME = 17, | ||
| 723 | VSTATUS = 18, | ||
| 724 | }, | ||
| 725 | .haiku => enum(u8) { | ||
| 726 | VINTR = 0, | ||
| 727 | VQUIT = 1, | ||
| 728 | VERASE = 2, | ||
| 729 | VKILL = 3, | ||
| 730 | VEOF = 4, | ||
| 731 | VEOL = 5, | ||
| 732 | VMIN = 4, | ||
| 733 | VTIME = 5, | ||
| 734 | VEOL2 = 6, | ||
| 735 | VSWTCH = 7, | ||
| 736 | VSTART = 8, | ||
| 737 | VSTOP = 9, | ||
| 738 | VSUSP = 10, | ||
| 739 | }, | ||
| 740 | .solaris, .illumos => enum(u8) { | ||
| 741 | VINTR = 0, | ||
| 742 | VQUIT = 1, | ||
| 743 | VERASE = 2, | ||
| 744 | VKILL = 3, | ||
| 745 | VEOF = 4, | ||
| 746 | VEOL = 5, | ||
| 747 | VEOL2 = 6, | ||
| 748 | VMIN = 4, | ||
| 749 | VTIME = 5, | ||
| 750 | VSWTCH = 7, | ||
| 751 | VSTART = 8, | ||
| 752 | VSTOP = 9, | ||
| 753 | VSUSP = 10, | ||
| 754 | VDSUSP = 11, | ||
| 755 | VREPRINT = 12, | ||
| 756 | VDISCARD = 13, | ||
| 757 | VWERASE = 14, | ||
| 758 | VLNEXT = 15, | ||
| 759 | VSTATUS = 16, | ||
| 760 | VERASE2 = 17, | ||
| 761 | }, | ||
| 762 | .emscripten, .wasi => enum(u8) { | ||
| 763 | VINTR = 0, | ||
| 764 | VQUIT = 1, | ||
| 765 | VERASE = 2, | ||
| 766 | VKILL = 3, | ||
| 767 | VEOF = 4, | ||
| 768 | VTIME = 5, | ||
| 769 | VMIN = 6, | ||
| 770 | VSWTC = 7, | ||
| 771 | VSTART = 8, | ||
| 772 | VSTOP = 9, | ||
| 773 | VSUSP = 10, | ||
| 774 | VEOL = 11, | ||
| 775 | VREPRINT = 12, | ||
| 776 | VDISCARD = 13, | ||
| 777 | VWERASE = 14, | ||
| 778 | VLNEXT = 15, | ||
| 779 | VEOL2 = 16, | ||
| 780 | }, | ||
| 781 | else => @compileError("target libc does not have cc_t"), | ||
| 782 | }; | ||
| 783 | |||
| 784 | pub const NCCS = switch (native_os) { | ||
| 785 | .linux => std.os.linux.NCCS, | ||
| 786 | .macos, .ios, .tvos, .watchos, .freebsd, .kfreebsd, .netbsd, .openbsd, .dragonfly => 20, | ||
| 787 | .haiku => 11, | ||
| 788 | .solaris, .illumos => 19, | ||
| 789 | .emscripten, .wasi => 32, | ||
| 790 | else => @compileError("target libc does not have NCCS"), | ||
| 791 | }; | ||
| 792 | |||
| 793 | pub const termios = switch (native_os) { | ||
| 794 | .linux => std.os.linux.termios, | ||
| 795 | .macos, .ios, .tvos, .watchos => extern struct { | ||
| 796 | iflag: tc_iflag_t, | ||
| 797 | oflag: tc_oflag_t, | ||
| 798 | cflag: tc_cflag_t, | ||
| 799 | lflag: tc_lflag_t, | ||
| 800 | cc: [NCCS]cc_t, | ||
| 801 | ispeed: speed_t align(8), | ||
| 802 | ospeed: speed_t, | ||
| 803 | }, | ||
| 804 | .freebsd, .kfreebsd, .netbsd, .dragonfly, .openbsd => extern struct { | ||
| 805 | iflag: tc_iflag_t, | ||
| 806 | oflag: tc_oflag_t, | ||
| 807 | cflag: tc_cflag_t, | ||
| 808 | lflag: tc_lflag_t, | ||
| 809 | cc: [NCCS]cc_t, | ||
| 810 | ispeed: speed_t, | ||
| 811 | ospeed: speed_t, | ||
| 812 | }, | ||
| 813 | .haiku => extern struct { | ||
| 814 | iflag: tc_iflag_t, | ||
| 815 | oflag: tc_oflag_t, | ||
| 816 | cflag: tc_cflag_t, | ||
| 817 | lflag: tc_lflag_t, | ||
| 818 | line: cc_t, | ||
| 819 | ispeed: speed_t, | ||
| 820 | ospeed: speed_t, | ||
| 821 | cc: [NCCS]cc_t, | ||
| 822 | }, | ||
| 823 | .solaris, .illumos => extern struct { | ||
| 824 | iflag: tc_iflag_t, | ||
| 825 | oflag: tc_oflag_t, | ||
| 826 | cflag: tc_cflag_t, | ||
| 827 | lflag: tc_lflag_t, | ||
| 828 | cc: [NCCS]cc_t, | ||
| 829 | }, | ||
| 830 | .emscripten, .wasi => extern struct { | ||
| 831 | iflag: tc_iflag_t, | ||
| 832 | oflag: tc_oflag_t, | ||
| 833 | cflag: tc_cflag_t, | ||
| 834 | lflag: tc_lflag_t, | ||
| 835 | line: std.c.cc_t, | ||
| 836 | cc: [NCCS]cc_t, | ||
| 837 | ispeed: speed_t, | ||
| 838 | ospeed: speed_t, | ||
| 839 | }, | ||
| 840 | else => @compileError("target libc does not have termios"), | ||
| 841 | }; | ||
| 842 | |||
| 843 | pub const tc_iflag_t = switch (native_os) { | ||
| 844 | .linux => std.os.linux.tc_iflag_t, | ||
| 845 | .macos, .ios, .tvos, .watchos => packed struct(u32) { | ||
| 846 | IGNBRK: bool = false, | ||
| 847 | BRKINT: bool = false, | ||
| 848 | IGNPAR: bool = false, | ||
| 849 | PARMRK: bool = false, | ||
| 850 | INPCK: bool = false, | ||
| 851 | ISTRIP: bool = false, | ||
| 852 | INLCR: bool = false, | ||
| 853 | IGNCR: bool = false, | ||
| 854 | ICRNL: bool = false, | ||
| 855 | IXON: bool = false, | ||
| 856 | IXOFF: bool = false, | ||
| 857 | IXANY: bool = false, | ||
| 858 | _12: u1 = 0, | ||
| 859 | IMAXBEL: bool = false, | ||
| 860 | IUTF8: bool = false, | ||
| 861 | _: u17 = 0, | ||
| 862 | }, | ||
| 863 | .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) { | ||
| 864 | IGNBRK: bool = false, | ||
| 865 | BRKINT: bool = false, | ||
| 866 | IGNPAR: bool = false, | ||
| 867 | PARMRK: bool = false, | ||
| 868 | INPCK: bool = false, | ||
| 869 | ISTRIP: bool = false, | ||
| 870 | INLCR: bool = false, | ||
| 871 | IGNCR: bool = false, | ||
| 872 | ICRNL: bool = false, | ||
| 873 | IXON: bool = false, | ||
| 874 | IXOFF: bool = false, | ||
| 875 | IXANY: bool = false, | ||
| 876 | _12: u1 = 0, | ||
| 877 | IMAXBEL: bool = false, | ||
| 878 | _: u18 = 0, | ||
| 879 | }, | ||
| 880 | .openbsd => packed struct(u32) { | ||
| 881 | IGNBRK: bool = false, | ||
| 882 | BRKINT: bool = false, | ||
| 883 | IGNPAR: bool = false, | ||
| 884 | PARMRK: bool = false, | ||
| 885 | INPCK: bool = false, | ||
| 886 | ISTRIP: bool = false, | ||
| 887 | INLCR: bool = false, | ||
| 888 | IGNCR: bool = false, | ||
| 889 | ICRNL: bool = false, | ||
| 890 | IXON: bool = false, | ||
| 891 | IXOFF: bool = false, | ||
| 892 | IXANY: bool = false, | ||
| 893 | IUCLC: bool = false, | ||
| 894 | IMAXBEL: bool = false, | ||
| 895 | _: u18 = 0, | ||
| 896 | }, | ||
| 897 | .haiku => packed struct(u32) { | ||
| 898 | IGNBRK: bool = false, | ||
| 899 | BRKINT: bool = false, | ||
| 900 | IGNPAR: bool = false, | ||
| 901 | PARMRK: bool = false, | ||
| 902 | INPCK: bool = false, | ||
| 903 | ISTRIP: bool = false, | ||
| 904 | INLCR: bool = false, | ||
| 905 | IGNCR: bool = false, | ||
| 906 | ICRNL: bool = false, | ||
| 907 | IUCLC: bool = false, | ||
| 908 | IXON: bool = false, | ||
| 909 | IXANY: bool = false, | ||
| 910 | IXOFF: bool = false, | ||
| 911 | _: u19 = 0, | ||
| 912 | }, | ||
| 913 | .solaris, .illumos => packed struct(u32) { | ||
| 914 | IGNBRK: bool = false, | ||
| 915 | BRKINT: bool = false, | ||
| 916 | IGNPAR: bool = false, | ||
| 917 | PARMRK: bool = false, | ||
| 918 | INPCK: bool = false, | ||
| 919 | ISTRIP: bool = false, | ||
| 920 | INLCR: bool = false, | ||
| 921 | IGNCR: bool = false, | ||
| 922 | ICRNL: bool = false, | ||
| 923 | IUCLC: bool = false, | ||
| 924 | IXON: bool = false, | ||
| 925 | IXANY: bool = false, | ||
| 926 | _12: u1 = 0, | ||
| 927 | IMAXBEL: bool = false, | ||
| 928 | _14: u1 = 0, | ||
| 929 | DOSMODE: bool = false, | ||
| 930 | _: u16 = 0, | ||
| 931 | }, | ||
| 932 | .emscripten, .wasi => packed struct(u32) { | ||
| 933 | IGNBRK: bool = false, | ||
| 934 | BRKINT: bool = false, | ||
| 935 | IGNPAR: bool = false, | ||
| 936 | PARMRK: bool = false, | ||
| 937 | INPCK: bool = false, | ||
| 938 | ISTRIP: bool = false, | ||
| 939 | INLCR: bool = false, | ||
| 940 | IGNCR: bool = false, | ||
| 941 | ICRNL: bool = false, | ||
| 942 | IUCLC: bool = false, | ||
| 943 | IXON: bool = false, | ||
| 944 | IXANY: bool = false, | ||
| 945 | IXOFF: bool = false, | ||
| 946 | IMAXBEL: bool = false, | ||
| 947 | IUTF8: bool = false, | ||
| 948 | _: u17 = 0, | ||
| 949 | }, | ||
| 950 | else => @compileError("target libc does not have tc_iflag_t"), | ||
| 951 | }; | ||
| 952 | |||
| 953 | pub const tc_oflag_t = switch (native_os) { | ||
| 954 | .linux => std.os.linux.tc_oflag_t, | ||
| 955 | .macos, .ios, .tvos, .watchos => packed struct(u32) { | ||
| 956 | OPOST: bool = false, | ||
| 957 | ONLCR: bool = false, | ||
| 958 | OXTABS: bool = false, | ||
| 959 | ONOEOT: bool = false, | ||
| 960 | OCRNL: bool = false, | ||
| 961 | ONOCR: bool = false, | ||
| 962 | ONLRET: bool = false, | ||
| 963 | OFILL: bool = false, | ||
| 964 | NLDLY: u2 = 0, | ||
| 965 | TABDLY: u2 = 0, | ||
| 966 | CRDLY: u2 = 0, | ||
| 967 | FFDLY: u1 = 0, | ||
| 968 | BSDLY: u1 = 0, | ||
| 969 | VTDLY: u1 = 0, | ||
| 970 | OFDEL: bool = false, | ||
| 971 | _: u14 = 0, | ||
| 972 | }, | ||
| 973 | .netbsd => packed struct(u32) { | ||
| 974 | OPOST: bool = false, | ||
| 975 | ONLCR: bool = false, | ||
| 976 | OXTABS: bool = false, | ||
| 977 | ONOEOT: bool = false, | ||
| 978 | OCRNL: bool = false, | ||
| 979 | _5: u1 = 0, | ||
| 980 | ONOCR: bool = false, | ||
| 981 | ONLRET: bool = false, | ||
| 982 | _: u24 = 0, | ||
| 983 | }, | ||
| 984 | .openbsd => packed struct(u32) { | ||
| 985 | OPOST: bool = false, | ||
| 986 | ONLCR: bool = false, | ||
| 987 | OXTABS: bool = false, | ||
| 988 | ONOEOT: bool = false, | ||
| 989 | OCRNL: bool = false, | ||
| 990 | OLCUC: bool = false, | ||
| 991 | ONOCR: bool = false, | ||
| 992 | ONLRET: bool = false, | ||
| 993 | _: u24 = 0, | ||
| 994 | }, | ||
| 995 | .freebsd, .kfreebsd, .dragonfly => packed struct(u32) { | ||
| 996 | OPOST: bool = false, | ||
| 997 | ONLCR: bool = false, | ||
| 998 | _2: u1 = 0, | ||
| 999 | ONOEOT: bool = false, | ||
| 1000 | OCRNL: bool = false, | ||
| 1001 | ONOCR: bool = false, | ||
| 1002 | ONLRET: bool = false, | ||
| 1003 | _: u25 = 0, | ||
| 1004 | }, | ||
| 1005 | .solaris, .illumos => packed struct(u32) { | ||
| 1006 | OPOST: bool = false, | ||
| 1007 | OLCUC: bool = false, | ||
| 1008 | ONLCR: bool = false, | ||
| 1009 | OCRNL: bool = false, | ||
| 1010 | ONOCR: bool = false, | ||
| 1011 | ONLRET: bool = false, | ||
| 1012 | OFILL: bool = false, | ||
| 1013 | OFDEL: bool = false, | ||
| 1014 | NLDLY: u1 = 0, | ||
| 1015 | CRDLY: u2 = 0, | ||
| 1016 | TABDLY: u2 = 0, | ||
| 1017 | BSDLY: u1 = 0, | ||
| 1018 | VTDLY: u1 = 0, | ||
| 1019 | FFDLY: u1 = 0, | ||
| 1020 | PAGEOUT: bool = false, | ||
| 1021 | WRAP: bool = false, | ||
| 1022 | _: u14 = 0, | ||
| 1023 | }, | ||
| 1024 | .haiku, .wasi, .emscripten => packed struct(u32) { | ||
| 1025 | OPOST: bool = false, | ||
| 1026 | OLCUC: bool = false, | ||
| 1027 | ONLCR: bool = false, | ||
| 1028 | OCRNL: bool = false, | ||
| 1029 | ONOCR: bool = false, | ||
| 1030 | ONLRET: bool = false, | ||
| 1031 | OFILL: bool = false, | ||
| 1032 | OFDEL: bool = false, | ||
| 1033 | NLDLY: u1 = 0, | ||
| 1034 | CRDLY: u2 = 0, | ||
| 1035 | TABDLY: u2 = 0, | ||
| 1036 | BSDLY: u1 = 0, | ||
| 1037 | VTDLY: u1 = 0, | ||
| 1038 | FFDLY: u1 = 0, | ||
| 1039 | _: u16 = 0, | ||
| 1040 | }, | ||
| 1041 | else => @compileError("target libc does not have tc_oflag_t"), | ||
| 1042 | }; | ||
| 1043 | |||
| 1044 | pub const CSIZE = switch (native_os) { | ||
| 1045 | .linux => std.os.linux.CSIZE, | ||
| 1046 | .haiku => enum(u1) { CS7, CS8 }, | ||
| 1047 | else => enum(u2) { CS5, CS6, CS7, CS8 }, | ||
| 1048 | }; | ||
| 1049 | |||
| 1050 | pub const tc_cflag_t = switch (native_os) { | ||
| 1051 | .linux => std.os.linux.tc_cflag_t, | ||
| 1052 | .macos, .ios, .tvos, .watchos => packed struct(u32) { | ||
| 1053 | CIGNORE: bool = false, | ||
| 1054 | _1: u5 = 0, | ||
| 1055 | CSTOPB: bool = false, | ||
| 1056 | _7: u1 = 0, | ||
| 1057 | CSIZE: CSIZE = .CS5, | ||
| 1058 | _10: u1 = 0, | ||
| 1059 | CREAD: bool = false, | ||
| 1060 | PARENB: bool = false, | ||
| 1061 | PARODD: bool = false, | ||
| 1062 | HUPCL: bool = false, | ||
| 1063 | CLOCAL: bool = false, | ||
| 1064 | CCTS_OFLOW: bool = false, | ||
| 1065 | CRTS_IFLOW: bool = false, | ||
| 1066 | CDTR_IFLOW: bool = false, | ||
| 1067 | CDSR_OFLOW: bool = false, | ||
| 1068 | CCAR_OFLOW: bool = false, | ||
| 1069 | _: u11 = 0, | ||
| 1070 | }, | ||
| 1071 | .freebsd, .kfreebsd => packed struct(u32) { | ||
| 1072 | CIGNORE: bool = false, | ||
| 1073 | _1: u7 = 0, | ||
| 1074 | CSIZE: CSIZE = .CS5, | ||
| 1075 | CSTOPB: bool = false, | ||
| 1076 | CREAD: bool = false, | ||
| 1077 | PARENB: bool = false, | ||
| 1078 | PARODD: bool = false, | ||
| 1079 | HUPCL: bool = false, | ||
| 1080 | CLOCAL: bool = false, | ||
| 1081 | CCTS_OFLOW: bool = false, | ||
| 1082 | CRTS_IFLOW: bool = false, | ||
| 1083 | CDTR_IFLOW: bool = false, | ||
| 1084 | CDSR_OFLOW: bool = false, | ||
| 1085 | CCAR_OFLOW: bool = false, | ||
| 1086 | CNO_RTSDTR: bool = false, | ||
| 1087 | _: u10 = 0, | ||
| 1088 | }, | ||
| 1089 | .netbsd => packed struct(u32) { | ||
| 1090 | CIGNORE: bool = false, | ||
| 1091 | _1: u7 = 0, | ||
| 1092 | CSIZE: CSIZE = .CS5, | ||
| 1093 | CSTOPB: bool = false, | ||
| 1094 | CREAD: bool = false, | ||
| 1095 | PARENB: bool = false, | ||
| 1096 | PARODD: bool = false, | ||
| 1097 | HUPCL: bool = false, | ||
| 1098 | CLOCAL: bool = false, | ||
| 1099 | CRTSCTS: bool = false, | ||
| 1100 | CDTRCTS: bool = false, | ||
| 1101 | _18: u2 = 0, | ||
| 1102 | MDMBUF: bool = false, | ||
| 1103 | _: u11 = 0, | ||
| 1104 | }, | ||
| 1105 | .dragonfly => packed struct(u32) { | ||
| 1106 | CIGNORE: bool = false, | ||
| 1107 | _1: u7 = 0, | ||
| 1108 | CSIZE: CSIZE = .CS5, | ||
| 1109 | CSTOPB: bool = false, | ||
| 1110 | CREAD: bool = false, | ||
| 1111 | PARENB: bool = false, | ||
| 1112 | PARODD: bool = false, | ||
| 1113 | HUPCL: bool = false, | ||
| 1114 | CLOCAL: bool = false, | ||
| 1115 | CCTS_OFLOW: bool = false, | ||
| 1116 | CRTS_IFLOW: bool = false, | ||
| 1117 | CDTR_IFLOW: bool = false, | ||
| 1118 | CDSR_OFLOW: bool = false, | ||
| 1119 | CCAR_OFLOW: bool = false, | ||
| 1120 | _: u11 = 0, | ||
| 1121 | }, | ||
| 1122 | .openbsd => packed struct(u32) { | ||
| 1123 | CIGNORE: bool = false, | ||
| 1124 | _1: u7 = 0, | ||
| 1125 | CSIZE: CSIZE = .CS5, | ||
| 1126 | CSTOPB: bool = false, | ||
| 1127 | CREAD: bool = false, | ||
| 1128 | PARENB: bool = false, | ||
| 1129 | PARODD: bool = false, | ||
| 1130 | HUPCL: bool = false, | ||
| 1131 | CLOCAL: bool = false, | ||
| 1132 | CRTSCTS: bool = false, | ||
| 1133 | _17: u3 = 0, | ||
| 1134 | MDMBUF: bool = false, | ||
| 1135 | _: u11 = 0, | ||
| 1136 | }, | ||
| 1137 | .haiku => packed struct(u32) { | ||
| 1138 | _0: u5 = 0, | ||
| 1139 | CSIZE: CSIZE = .CS7, | ||
| 1140 | CSTOPB: bool = false, | ||
| 1141 | CREAD: bool = false, | ||
| 1142 | PARENB: bool = false, | ||
| 1143 | PARODD: bool = false, | ||
| 1144 | HUPCL: bool = false, | ||
| 1145 | CLOCAL: bool = false, | ||
| 1146 | XLOBLK: bool = false, | ||
| 1147 | CTSFLOW: bool = false, | ||
| 1148 | RTSFLOW: bool = false, | ||
| 1149 | _: u17 = 0, | ||
| 1150 | }, | ||
| 1151 | .solaris, .illumos => packed struct(u32) { | ||
| 1152 | _0: u4 = 0, | ||
| 1153 | CSIZE: CSIZE = .CS5, | ||
| 1154 | CSTOPB: bool = false, | ||
| 1155 | CREAD: bool = false, | ||
| 1156 | PARENB: bool = false, | ||
| 1157 | PARODD: bool = false, | ||
| 1158 | HUPCL: bool = false, | ||
| 1159 | CLOCAL: bool = false, | ||
| 1160 | RCV1EN: bool = false, | ||
| 1161 | XMT1EN: bool = false, | ||
| 1162 | LOBLK: bool = false, | ||
| 1163 | XCLUDE: bool = false, | ||
| 1164 | _16: u4 = 0, | ||
| 1165 | PAREXT: bool = false, | ||
| 1166 | CBAUDEXT: bool = false, | ||
| 1167 | CIBAUDEXT: bool = false, | ||
| 1168 | _23: u7 = 0, | ||
| 1169 | CRTSXOFF: bool = false, | ||
| 1170 | CRTSCTS: bool = false, | ||
| 1171 | }, | ||
| 1172 | .wasi, .emscripten => packed struct(u32) { | ||
| 1173 | _0: u4 = 0, | ||
| 1174 | CSIZE: CSIZE = .CS5, | ||
| 1175 | CSTOPB: bool = false, | ||
| 1176 | CREAD: bool = false, | ||
| 1177 | PARENB: bool = false, | ||
| 1178 | PARODD: bool = false, | ||
| 1179 | HUPCL: bool = false, | ||
| 1180 | CLOCAL: bool = false, | ||
| 1181 | _: u20 = 0, | ||
| 1182 | }, | ||
| 1183 | else => @compileError("target libc does not have tc_cflag_t"), | ||
| 1184 | }; | ||
| 1185 | |||
| 1186 | pub const tc_lflag_t = switch (native_os) { | ||
| 1187 | .linux => std.os.linux.tc_lflag_t, | ||
| 1188 | .macos, .ios, .tvos, .watchos, .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) { | ||
| 1189 | ECHOKE: bool = false, | ||
| 1190 | ECHOE: bool = false, | ||
| 1191 | ECHOK: bool = false, | ||
| 1192 | ECHO: bool = false, | ||
| 1193 | ECHONL: bool = false, | ||
| 1194 | ECHOPRT: bool = false, | ||
| 1195 | ECHOCTL: bool = false, | ||
| 1196 | ISIG: bool = false, | ||
| 1197 | ICANON: bool = false, | ||
| 1198 | ALTWERASE: bool = false, | ||
| 1199 | IEXTEN: bool = false, | ||
| 1200 | EXTPROC: bool = false, | ||
| 1201 | _12: u10 = 0, | ||
| 1202 | TOSTOP: bool = false, | ||
| 1203 | FLUSHO: bool = false, | ||
| 1204 | _24: u1 = 0, | ||
| 1205 | NOKERNINFO: bool = false, | ||
| 1206 | _26: u3 = 0, | ||
| 1207 | PENDIN: bool = false, | ||
| 1208 | _30: u1 = 0, | ||
| 1209 | NOFLSH: bool = false, | ||
| 1210 | }, | ||
| 1211 | .openbsd => packed struct(u32) { | ||
| 1212 | ECHOKE: bool = false, | ||
| 1213 | ECHOE: bool = false, | ||
| 1214 | ECHOK: bool = false, | ||
| 1215 | ECHO: bool = false, | ||
| 1216 | ECHONL: bool = false, | ||
| 1217 | ECHOPRT: bool = false, | ||
| 1218 | ECHOCTL: bool = false, | ||
| 1219 | ISIG: bool = false, | ||
| 1220 | ICANON: bool = false, | ||
| 1221 | ALTWERASE: bool = false, | ||
| 1222 | IEXTEN: bool = false, | ||
| 1223 | EXTPROC: bool = false, | ||
| 1224 | _12: u10 = 0, | ||
| 1225 | TOSTOP: bool = false, | ||
| 1226 | FLUSHO: bool = false, | ||
| 1227 | XCASE: bool = false, | ||
| 1228 | NOKERNINFO: bool = false, | ||
| 1229 | _26: u3 = 0, | ||
| 1230 | PENDIN: bool = false, | ||
| 1231 | _30: u1 = 0, | ||
| 1232 | NOFLSH: bool = false, | ||
| 1233 | }, | ||
| 1234 | .haiku => packed struct(u32) { | ||
| 1235 | ISIG: bool = false, | ||
| 1236 | ICANON: bool = false, | ||
| 1237 | XCASE: bool = false, | ||
| 1238 | ECHO: bool = false, | ||
| 1239 | ECHOE: bool = false, | ||
| 1240 | ECHOK: bool = false, | ||
| 1241 | ECHONL: bool = false, | ||
| 1242 | NOFLSH: bool = false, | ||
| 1243 | TOSTOP: bool = false, | ||
| 1244 | IEXTEN: bool = false, | ||
| 1245 | ECHOCTL: bool = false, | ||
| 1246 | ECHOPRT: bool = false, | ||
| 1247 | ECHOKE: bool = false, | ||
| 1248 | FLUSHO: bool = false, | ||
| 1249 | PENDIN: bool = false, | ||
| 1250 | _: u17 = 0, | ||
| 1251 | }, | ||
| 1252 | .solaris, .illumos => packed struct(u32) { | ||
| 1253 | ISIG: bool = false, | ||
| 1254 | ICANON: bool = false, | ||
| 1255 | XCASE: bool = false, | ||
| 1256 | ECHO: bool = false, | ||
| 1257 | ECHOE: bool = false, | ||
| 1258 | ECHOK: bool = false, | ||
| 1259 | ECHONL: bool = false, | ||
| 1260 | NOFLSH: bool = false, | ||
| 1261 | TOSTOP: bool = false, | ||
| 1262 | ECHOCTL: bool = false, | ||
| 1263 | ECHOPRT: bool = false, | ||
| 1264 | ECHOKE: bool = false, | ||
| 1265 | DEFECHO: bool = false, | ||
| 1266 | FLUSHO: bool = false, | ||
| 1267 | PENDIN: bool = false, | ||
| 1268 | IEXTEN: bool = false, | ||
| 1269 | _: u16 = 0, | ||
| 1270 | }, | ||
| 1271 | .wasi, .emscripten => packed struct(u32) { | ||
| 1272 | ISIG: bool = false, | ||
| 1273 | ICANON: bool = false, | ||
| 1274 | _2: u1 = 0, | ||
| 1275 | ECHO: bool = false, | ||
| 1276 | ECHOE: bool = false, | ||
| 1277 | ECHOK: bool = false, | ||
| 1278 | ECHONL: bool = false, | ||
| 1279 | NOFLSH: bool = false, | ||
| 1280 | TOSTOP: bool = false, | ||
| 1281 | _9: u6 = 0, | ||
| 1282 | IEXTEN: bool = false, | ||
| 1283 | _: u16 = 0, | ||
| 1284 | }, | ||
| 1285 | else => @compileError("target libc does not have tc_lflag_t"), | ||
| 1286 | }; | ||
| 1287 | |||
| 1288 | pub const speed_t = switch (native_os) { | ||
| 1289 | .linux => std.os.linux.speed_t, | ||
| 1290 | .macos, .ios, .tvos, .watchos, .openbsd => enum(u64) { | ||
| 1291 | B0 = 0, | ||
| 1292 | B50 = 50, | ||
| 1293 | B75 = 75, | ||
| 1294 | B110 = 110, | ||
| 1295 | B134 = 134, | ||
| 1296 | B150 = 150, | ||
| 1297 | B200 = 200, | ||
| 1298 | B300 = 300, | ||
| 1299 | B600 = 600, | ||
| 1300 | B1200 = 1200, | ||
| 1301 | B1800 = 1800, | ||
| 1302 | B2400 = 2400, | ||
| 1303 | B4800 = 4800, | ||
| 1304 | B9600 = 9600, | ||
| 1305 | B19200 = 19200, | ||
| 1306 | B38400 = 38400, | ||
| 1307 | B7200 = 7200, | ||
| 1308 | B14400 = 14400, | ||
| 1309 | B28800 = 28800, | ||
| 1310 | B57600 = 57600, | ||
| 1311 | B76800 = 76800, | ||
| 1312 | B115200 = 115200, | ||
| 1313 | B230400 = 230400, | ||
| 1314 | }, | ||
| 1315 | .freebsd, .kfreebsd, .netbsd => enum(c_uint) { | ||
| 1316 | B0 = 0, | ||
| 1317 | B50 = 50, | ||
| 1318 | B75 = 75, | ||
| 1319 | B110 = 110, | ||
| 1320 | B134 = 134, | ||
| 1321 | B150 = 150, | ||
| 1322 | B200 = 200, | ||
| 1323 | B300 = 300, | ||
| 1324 | B600 = 600, | ||
| 1325 | B1200 = 1200, | ||
| 1326 | B1800 = 1800, | ||
| 1327 | B2400 = 2400, | ||
| 1328 | B4800 = 4800, | ||
| 1329 | B9600 = 9600, | ||
| 1330 | B19200 = 19200, | ||
| 1331 | B38400 = 38400, | ||
| 1332 | B7200 = 7200, | ||
| 1333 | B14400 = 14400, | ||
| 1334 | B28800 = 28800, | ||
| 1335 | B57600 = 57600, | ||
| 1336 | B76800 = 76800, | ||
| 1337 | B115200 = 115200, | ||
| 1338 | B230400 = 230400, | ||
| 1339 | B460800 = 460800, | ||
| 1340 | B500000 = 500000, | ||
| 1341 | B921600 = 921600, | ||
| 1342 | B1000000 = 1000000, | ||
| 1343 | B1500000 = 1500000, | ||
| 1344 | B2000000 = 2000000, | ||
| 1345 | B2500000 = 2500000, | ||
| 1346 | B3000000 = 3000000, | ||
| 1347 | B3500000 = 3500000, | ||
| 1348 | B4000000 = 4000000, | ||
| 1349 | }, | ||
| 1350 | .dragonfly => enum(c_uint) { | ||
| 1351 | B0 = 0, | ||
| 1352 | B50 = 50, | ||
| 1353 | B75 = 75, | ||
| 1354 | B110 = 110, | ||
| 1355 | B134 = 134, | ||
| 1356 | B150 = 150, | ||
| 1357 | B200 = 200, | ||
| 1358 | B300 = 300, | ||
| 1359 | B600 = 600, | ||
| 1360 | B1200 = 1200, | ||
| 1361 | B1800 = 1800, | ||
| 1362 | B2400 = 2400, | ||
| 1363 | B4800 = 4800, | ||
| 1364 | B9600 = 9600, | ||
| 1365 | B19200 = 19200, | ||
| 1366 | B38400 = 38400, | ||
| 1367 | B7200 = 7200, | ||
| 1368 | B14400 = 14400, | ||
| 1369 | B28800 = 28800, | ||
| 1370 | B57600 = 57600, | ||
| 1371 | B76800 = 76800, | ||
| 1372 | B115200 = 115200, | ||
| 1373 | B230400 = 230400, | ||
| 1374 | B460800 = 460800, | ||
| 1375 | B921600 = 921600, | ||
| 1376 | }, | ||
| 1377 | .haiku => enum(u8) { | ||
| 1378 | B0 = 0x00, | ||
| 1379 | B50 = 0x01, | ||
| 1380 | B75 = 0x02, | ||
| 1381 | B110 = 0x03, | ||
| 1382 | B134 = 0x04, | ||
| 1383 | B150 = 0x05, | ||
| 1384 | B200 = 0x06, | ||
| 1385 | B300 = 0x07, | ||
| 1386 | B600 = 0x08, | ||
| 1387 | B1200 = 0x09, | ||
| 1388 | B1800 = 0x0A, | ||
| 1389 | B2400 = 0x0B, | ||
| 1390 | B4800 = 0x0C, | ||
| 1391 | B9600 = 0x0D, | ||
| 1392 | B19200 = 0x0E, | ||
| 1393 | B38400 = 0x0F, | ||
| 1394 | B57600 = 0x10, | ||
| 1395 | B115200 = 0x11, | ||
| 1396 | B230400 = 0x12, | ||
| 1397 | B31250 = 0x13, | ||
| 1398 | }, | ||
| 1399 | .solaris, .illumos => enum(c_uint) { | ||
| 1400 | B0 = 0, | ||
| 1401 | B50 = 1, | ||
| 1402 | B75 = 2, | ||
| 1403 | B110 = 3, | ||
| 1404 | B134 = 4, | ||
| 1405 | B150 = 5, | ||
| 1406 | B200 = 6, | ||
| 1407 | B300 = 7, | ||
| 1408 | B600 = 8, | ||
| 1409 | B1200 = 9, | ||
| 1410 | B1800 = 10, | ||
| 1411 | B2400 = 11, | ||
| 1412 | B4800 = 12, | ||
| 1413 | B9600 = 13, | ||
| 1414 | B19200 = 14, | ||
| 1415 | B38400 = 15, | ||
| 1416 | B57600 = 16, | ||
| 1417 | B76800 = 17, | ||
| 1418 | B115200 = 18, | ||
| 1419 | B153600 = 19, | ||
| 1420 | B230400 = 20, | ||
| 1421 | B307200 = 21, | ||
| 1422 | B460800 = 22, | ||
| 1423 | B921600 = 23, | ||
| 1424 | B1000000 = 24, | ||
| 1425 | B1152000 = 25, | ||
| 1426 | B1500000 = 26, | ||
| 1427 | B2000000 = 27, | ||
| 1428 | B2500000 = 28, | ||
| 1429 | B3000000 = 29, | ||
| 1430 | B3500000 = 30, | ||
| 1431 | B4000000 = 31, | ||
| 1432 | }, | ||
| 1433 | .emscripten, .wasi => enum(u32) { | ||
| 1434 | B0 = 0o0000000, | ||
| 1435 | B50 = 0o0000001, | ||
| 1436 | B75 = 0o0000002, | ||
| 1437 | B110 = 0o0000003, | ||
| 1438 | B134 = 0o0000004, | ||
| 1439 | B150 = 0o0000005, | ||
| 1440 | B200 = 0o0000006, | ||
| 1441 | B300 = 0o0000007, | ||
| 1442 | B600 = 0o0000010, | ||
| 1443 | B1200 = 0o0000011, | ||
| 1444 | B1800 = 0o0000012, | ||
| 1445 | B2400 = 0o0000013, | ||
| 1446 | B4800 = 0o0000014, | ||
| 1447 | B9600 = 0o0000015, | ||
| 1448 | B19200 = 0o0000016, | ||
| 1449 | B38400 = 0o0000017, | ||
| 1450 | |||
| 1451 | B57600 = 0o0010001, | ||
| 1452 | B115200 = 0o0010002, | ||
| 1453 | B230400 = 0o0010003, | ||
| 1454 | B460800 = 0o0010004, | ||
| 1455 | B500000 = 0o0010005, | ||
| 1456 | B576000 = 0o0010006, | ||
| 1457 | B921600 = 0o0010007, | ||
| 1458 | B1000000 = 0o0010010, | ||
| 1459 | B1152000 = 0o0010011, | ||
| 1460 | B1500000 = 0o0010012, | ||
| 1461 | B2000000 = 0o0010013, | ||
| 1462 | B2500000 = 0o0010014, | ||
| 1463 | B3000000 = 0o0010015, | ||
| 1464 | B3500000 = 0o0010016, | ||
| 1465 | B4000000 = 0o0010017, | ||
| 1466 | }, | ||
| 1467 | else => @compileError("target libc does not have speed_t"), | ||
| 1468 | }; | ||
| 1469 | |||
| 682 | pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int; | 1470 | pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int; |
| 683 | 1471 | ||
| 684 | // Unix-like systems | 1472 | // Unix-like systems |
lib/std/c/darwin.zig-165| ... | @@ -2692,127 +2692,6 @@ pub const SHUT = struct { | ... | @@ -2692,127 +2692,6 @@ pub const SHUT = struct { |
| 2692 | pub const RDWR = 2; | 2692 | pub const RDWR = 2; |
| 2693 | }; | 2693 | }; |
| 2694 | 2694 | ||
| 2695 | // Term | ||
| 2696 | pub const V = struct { | ||
| 2697 | pub const EOF = 0; | ||
| 2698 | pub const EOL = 1; | ||
| 2699 | pub const EOL2 = 2; | ||
| 2700 | pub const ERASE = 3; | ||
| 2701 | pub const WERASE = 4; | ||
| 2702 | pub const KILL = 5; | ||
| 2703 | pub const REPRINT = 6; | ||
| 2704 | pub const INTR = 8; | ||
| 2705 | pub const QUIT = 9; | ||
| 2706 | pub const SUSP = 10; | ||
| 2707 | pub const DSUSP = 11; | ||
| 2708 | pub const START = 12; | ||
| 2709 | pub const STOP = 13; | ||
| 2710 | pub const LNEXT = 14; | ||
| 2711 | pub const DISCARD = 15; | ||
| 2712 | pub const MIN = 16; | ||
| 2713 | pub const TIME = 17; | ||
| 2714 | pub const STATUS = 18; | ||
| 2715 | }; | ||
| 2716 | |||
| 2717 | pub const NCCS = 20; // 2 spares (7, 19) | ||
| 2718 | |||
| 2719 | pub const cc_t = u8; | ||
| 2720 | pub const speed_t = u64; | ||
| 2721 | pub const tcflag_t = u64; | ||
| 2722 | |||
| 2723 | pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition | ||
| 2724 | pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINTR | ||
| 2725 | pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors | ||
| 2726 | pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors | ||
| 2727 | pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors | ||
| 2728 | pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars | ||
| 2729 | pub const INLCR: tcflag_t = 0x00000040; // map NL into CR | ||
| 2730 | pub const IGNCR: tcflag_t = 0x00000080; // ignore CR | ||
| 2731 | pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD) | ||
| 2732 | pub const IXON: tcflag_t = 0x00000200; // enable output flow control | ||
| 2733 | pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control | ||
| 2734 | pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop | ||
| 2735 | pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full | ||
| 2736 | pub const IUTF8: tcflag_t = 0x00004000; // maintain state for UTF-8 VERASE | ||
| 2737 | |||
| 2738 | pub const OPOST: tcflag_t = 0x00000001; //enable following output processing | ||
| 2739 | pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD) | ||
| 2740 | pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces | ||
| 2741 | pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output) | ||
| 2742 | |||
| 2743 | pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL on output | ||
| 2744 | pub const ONOCR: tcflag_t = 0x00000020; // no CR output at column 0 | ||
| 2745 | pub const ONLRET: tcflag_t = 0x00000040; // NL performs CR function | ||
| 2746 | pub const OFILL: tcflag_t = 0x00000080; // use fill characters for delay | ||
| 2747 | pub const NLDLY: tcflag_t = 0x00000300; // \n delay | ||
| 2748 | pub const TABDLY: tcflag_t = 0x00000c04; // horizontal tab delay | ||
| 2749 | pub const CRDLY: tcflag_t = 0x00003000; // \r delay | ||
| 2750 | pub const FFDLY: tcflag_t = 0x00004000; // form feed delay | ||
| 2751 | pub const BSDLY: tcflag_t = 0x00008000; // \b delay | ||
| 2752 | pub const VTDLY: tcflag_t = 0x00010000; // vertical tab delay | ||
| 2753 | pub const OFDEL: tcflag_t = 0x00020000; // fill is DEL, else NUL | ||
| 2754 | |||
| 2755 | pub const NL0: tcflag_t = 0x00000000; | ||
| 2756 | pub const NL1: tcflag_t = 0x00000100; | ||
| 2757 | pub const NL2: tcflag_t = 0x00000200; | ||
| 2758 | pub const NL3: tcflag_t = 0x00000300; | ||
| 2759 | pub const TAB0: tcflag_t = 0x00000000; | ||
| 2760 | pub const TAB1: tcflag_t = 0x00000400; | ||
| 2761 | pub const TAB2: tcflag_t = 0x00000800; | ||
| 2762 | pub const TAB3: tcflag_t = 0x00000004; | ||
| 2763 | pub const CR0: tcflag_t = 0x00000000; | ||
| 2764 | pub const CR1: tcflag_t = 0x00001000; | ||
| 2765 | pub const CR2: tcflag_t = 0x00002000; | ||
| 2766 | pub const CR3: tcflag_t = 0x00003000; | ||
| 2767 | pub const FF0: tcflag_t = 0x00000000; | ||
| 2768 | pub const FF1: tcflag_t = 0x00004000; | ||
| 2769 | pub const BS0: tcflag_t = 0x00000000; | ||
| 2770 | pub const BS1: tcflag_t = 0x00008000; | ||
| 2771 | pub const VT0: tcflag_t = 0x00000000; | ||
| 2772 | pub const VT1: tcflag_t = 0x00010000; | ||
| 2773 | |||
| 2774 | pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags | ||
| 2775 | pub const CSIZE: tcflag_t = 0x00000300; // character size mask | ||
| 2776 | pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo) | ||
| 2777 | pub const CS6: tcflag_t = 0x00000100; // 6 bits | ||
| 2778 | pub const CS7: tcflag_t = 0x00000200; // 7 bits | ||
| 2779 | pub const CS8: tcflag_t = 0x00000300; // 8 bits | ||
| 2780 | pub const CSTOPB: tcflag_t = 0x0000040; // send 2 stop bits | ||
| 2781 | pub const CREAD: tcflag_t = 0x00000800; // enable receiver | ||
| 2782 | pub const PARENB: tcflag_t = 0x00001000; // parity enable | ||
| 2783 | pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even | ||
| 2784 | pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close | ||
| 2785 | pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines | ||
| 2786 | pub const CCTS_OFLOW: tcflag_t = 0x00010000; // CTS flow control of output | ||
| 2787 | pub const CRTSCTS: tcflag_t = (CCTS_OFLOW | CRTS_IFLOW); | ||
| 2788 | pub const CRTS_IFLOW: tcflag_t = 0x00020000; // RTS flow control of input | ||
| 2789 | pub const CDTR_IFLOW: tcflag_t = 0x00040000; // DTR flow control of input | ||
| 2790 | pub const CDSR_OFLOW: tcflag_t = 0x00080000; // DSR flow control of output | ||
| 2791 | pub const CCAR_OFLOW: tcflag_t = 0x00100000; // DCD flow control of output | ||
| 2792 | pub const MDMBUF: tcflag_t = 0x00100000; // old name for CCAR_OFLOW | ||
| 2793 | |||
| 2794 | pub const ECHOKE: tcflag_t = 0x00000001; // visual erase for line kill | ||
| 2795 | pub const ECHOE: tcflag_t = 0x00000002; // visually erase chars | ||
| 2796 | pub const ECHOK: tcflag_t = 0x00000004; // echo NL after line kill | ||
| 2797 | pub const ECHO: tcflag_t = 0x00000008; // enable echoing | ||
| 2798 | pub const ECHONL: tcflag_t = 0x00000010; // echo NL even if ECHO is off | ||
| 2799 | pub const ECHOPRT: tcflag_t = 0x00000020; // visual erase mode for hardcopy | ||
| 2800 | pub const ECHOCTL: tcflag_t = 0x00000040; // echo control chars as ^(Char) | ||
| 2801 | pub const ISIG: tcflag_t = 0x00000080; // enable signals INTR, QUIT, [D]SUSP | ||
| 2802 | pub const ICANON: tcflag_t = 0x00000100; // canonicalize input lines | ||
| 2803 | pub const ALTWERASE: tcflag_t = 0x00000200; // use alternate WERASE algorithm | ||
| 2804 | pub const IEXTEN: tcflag_t = 0x00000400; // enable DISCARD and LNEXT | ||
| 2805 | pub const EXTPROC: tcflag_t = 0x00000800; // external processing | ||
| 2806 | pub const TOSTOP: tcflag_t = 0x00400000; // stop background jobs from output | ||
| 2807 | pub const FLUSHO: tcflag_t = 0x00800000; // output being flushed (state) | ||
| 2808 | pub const NOKERNINFO: tcflag_t = 0x02000000; // no kernel output from VSTATUS | ||
| 2809 | pub const PENDIN: tcflag_t = 0x20000000; // XXX retype pending input (state) | ||
| 2810 | pub const NOFLSH: tcflag_t = 0x80000000; // don't flush after interrupt | ||
| 2811 | |||
| 2812 | pub const TCSANOW: tcflag_t = 0; // make change immediate | ||
| 2813 | pub const TCSADRAIN: tcflag_t = 1; // drain output, then change | ||
| 2814 | pub const TCSAFLUSH: tcflag_t = 2; // drain output, flush input | ||
| 2815 | pub const TCSASOFT: tcflag_t = 0x10; // flag - don't alter h.w. state | ||
| 2816 | pub const TCSA = enum(c_uint) { | 2695 | pub const TCSA = enum(c_uint) { |
| 2817 | NOW, | 2696 | NOW, |
| 2818 | DRAIN, | 2697 | DRAIN, |
| ... | @@ -2820,50 +2699,6 @@ pub const TCSA = enum(c_uint) { | ... | @@ -2820,50 +2699,6 @@ pub const TCSA = enum(c_uint) { |
| 2820 | _, | 2699 | _, |
| 2821 | }; | 2700 | }; |
| 2822 | 2701 | ||
| 2823 | pub const B0: tcflag_t = 0; | ||
| 2824 | pub const B50: tcflag_t = 50; | ||
| 2825 | pub const B75: tcflag_t = 75; | ||
| 2826 | pub const B110: tcflag_t = 110; | ||
| 2827 | pub const B134: tcflag_t = 134; | ||
| 2828 | pub const B150: tcflag_t = 150; | ||
| 2829 | pub const B200: tcflag_t = 200; | ||
| 2830 | pub const B300: tcflag_t = 300; | ||
| 2831 | pub const B600: tcflag_t = 600; | ||
| 2832 | pub const B1200: tcflag_t = 1200; | ||
| 2833 | pub const B1800: tcflag_t = 1800; | ||
| 2834 | pub const B2400: tcflag_t = 2400; | ||
| 2835 | pub const B4800: tcflag_t = 4800; | ||
| 2836 | pub const B9600: tcflag_t = 9600; | ||
| 2837 | pub const B19200: tcflag_t = 19200; | ||
| 2838 | pub const B38400: tcflag_t = 38400; | ||
| 2839 | pub const B7200: tcflag_t = 7200; | ||
| 2840 | pub const B14400: tcflag_t = 14400; | ||
| 2841 | pub const B28800: tcflag_t = 28800; | ||
| 2842 | pub const B57600: tcflag_t = 57600; | ||
| 2843 | pub const B76800: tcflag_t = 76800; | ||
| 2844 | pub const B115200: tcflag_t = 115200; | ||
| 2845 | pub const B230400: tcflag_t = 230400; | ||
| 2846 | pub const EXTA: tcflag_t = 19200; | ||
| 2847 | pub const EXTB: tcflag_t = 38400; | ||
| 2848 | |||
| 2849 | pub const TCIFLUSH: tcflag_t = 1; | ||
| 2850 | pub const TCOFLUSH: tcflag_t = 2; | ||
| 2851 | pub const TCIOFLUSH: tcflag_t = 3; | ||
| 2852 | pub const TCOOFF: tcflag_t = 1; | ||
| 2853 | pub const TCOON: tcflag_t = 2; | ||
| 2854 | pub const TCIOFF: tcflag_t = 3; | ||
| 2855 | pub const TCION: tcflag_t = 4; | ||
| 2856 | |||
| 2857 | pub const termios = extern struct { | ||
| 2858 | iflag: tcflag_t, // input flags | ||
| 2859 | oflag: tcflag_t, // output flags | ||
| 2860 | cflag: tcflag_t, // control flags | ||
| 2861 | lflag: tcflag_t, // local flags | ||
| 2862 | cc: [NCCS]cc_t, // control chars | ||
| 2863 | ispeed: speed_t align(8), // input speed | ||
| 2864 | ospeed: speed_t, // output speed | ||
| 2865 | }; | ||
| 2866 | |||
| 2867 | pub const winsize = extern struct { | 2702 | pub const winsize = extern struct { |
| 2868 | ws_row: u16, | 2703 | ws_row: u16, |
| 2869 | ws_col: u16, | 2704 | ws_col: u16, |
lib/std/c/emscripten.zig-2| ... | @@ -72,8 +72,6 @@ pub const sigset_t = emscripten.sigset_t; | ... | @@ -72,8 +72,6 @@ pub const sigset_t = emscripten.sigset_t; |
| 72 | pub const sockaddr = emscripten.sockaddr; | 72 | pub const sockaddr = emscripten.sockaddr; |
| 73 | pub const socklen_t = emscripten.socklen_t; | 73 | pub const socklen_t = emscripten.socklen_t; |
| 74 | pub const stack_t = emscripten.stack_t; | 74 | pub const stack_t = emscripten.stack_t; |
| 75 | pub const tcflag_t = emscripten.tcflag_t; | ||
| 76 | pub const termios = emscripten.termios; | ||
| 77 | pub const time_t = emscripten.time_t; | 75 | pub const time_t = emscripten.time_t; |
| 78 | pub const timespec = emscripten.timespec; | 76 | pub const timespec = emscripten.timespec; |
| 79 | pub const timeval = emscripten.timeval; | 77 | pub const timeval = emscripten.timeval; |
lib/std/c/haiku.zig-17| ... | @@ -950,21 +950,4 @@ pub const directory_which = enum(c_int) { | ... | @@ -950,21 +950,4 @@ pub const directory_which = enum(c_int) { |
| 950 | _, | 950 | _, |
| 951 | }; | 951 | }; |
| 952 | 952 | ||
| 953 | pub const cc_t = u8; | ||
| 954 | pub const speed_t = u8; | ||
| 955 | pub const tcflag_t = u32; | ||
| 956 | |||
| 957 | pub const NCCS = 11; | ||
| 958 | |||
| 959 | pub const termios = extern struct { | ||
| 960 | c_iflag: tcflag_t, | ||
| 961 | c_oflag: tcflag_t, | ||
| 962 | c_cflag: tcflag_t, | ||
| 963 | c_lflag: tcflag_t, | ||
| 964 | c_line: cc_t, | ||
| 965 | c_ispeed: speed_t, | ||
| 966 | c_ospeed: speed_t, | ||
| 967 | cc_t: [NCCS]cc_t, | ||
| 968 | }; | ||
| 969 | |||
| 970 | pub const MSG_NOSIGNAL = 0x0800; | 953 | pub const MSG_NOSIGNAL = 0x0800; |
lib/std/c/linux.zig-2| ... | @@ -85,8 +85,6 @@ pub const sigset_t = linux.sigset_t; | ... | @@ -85,8 +85,6 @@ pub const sigset_t = linux.sigset_t; |
| 85 | pub const sockaddr = linux.sockaddr; | 85 | pub const sockaddr = linux.sockaddr; |
| 86 | pub const socklen_t = linux.socklen_t; | 86 | pub const socklen_t = linux.socklen_t; |
| 87 | pub const stack_t = linux.stack_t; | 87 | pub const stack_t = linux.stack_t; |
| 88 | pub const tcflag_t = linux.tcflag_t; | ||
| 89 | pub const termios = linux.termios; | ||
| 90 | pub const time_t = linux.time_t; | 88 | pub const time_t = linux.time_t; |
| 91 | pub const timespec = linux.timespec; | 89 | pub const timespec = linux.timespec; |
| 92 | pub const timeval = linux.timeval; | 90 | pub const timeval = linux.timeval; |
lib/std/c/netbsd.zig-121| ... | @@ -806,90 +806,6 @@ pub const T = struct { | ... | @@ -806,90 +806,6 @@ pub const T = struct { |
| 806 | pub const IOCXMTFRAME = 0x80087444; | 806 | pub const IOCXMTFRAME = 0x80087444; |
| 807 | }; | 807 | }; |
| 808 | 808 | ||
| 809 | // Term | ||
| 810 | const V = struct { | ||
| 811 | pub const EOF = 0; // ICANON | ||
| 812 | pub const EOL = 1; // ICANON | ||
| 813 | pub const EOL2 = 2; // ICANON | ||
| 814 | pub const ERASE = 3; // ICANON | ||
| 815 | pub const WERASE = 4; // ICANON | ||
| 816 | pub const KILL = 5; // ICANON | ||
| 817 | pub const REPRINT = 6; // ICANON | ||
| 818 | // 7 spare 1 | ||
| 819 | pub const INTR = 8; // ISIG | ||
| 820 | pub const QUIT = 9; // ISIG | ||
| 821 | pub const SUSP = 10; // ISIG | ||
| 822 | pub const DSUSP = 11; // ISIG | ||
| 823 | pub const START = 12; // IXON, IXOFF | ||
| 824 | pub const STOP = 13; // IXON, IXOFF | ||
| 825 | pub const LNEXT = 14; // IEXTEN | ||
| 826 | pub const DISCARD = 15; // IEXTEN | ||
| 827 | pub const MIN = 16; // !ICANON | ||
| 828 | pub const TIME = 17; // !ICANON | ||
| 829 | pub const STATUS = 18; // ICANON | ||
| 830 | // 19 spare 2 | ||
| 831 | }; | ||
| 832 | |||
| 833 | // Input flags - software input processing | ||
| 834 | pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition | ||
| 835 | pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINT | ||
| 836 | pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors | ||
| 837 | pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors | ||
| 838 | pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors | ||
| 839 | pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars | ||
| 840 | pub const INLCR: tcflag_t = 0x00000040; // map NL into CR | ||
| 841 | pub const IGNCR: tcflag_t = 0x00000080; // ignore CR | ||
| 842 | pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD) | ||
| 843 | pub const IXON: tcflag_t = 0x00000200; // enable output flow control | ||
| 844 | pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control | ||
| 845 | pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop | ||
| 846 | pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full | ||
| 847 | |||
| 848 | // Output flags - software output processing | ||
| 849 | pub const OPOST: tcflag_t = 0x00000001; // enable following output processing | ||
| 850 | pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD) | ||
| 851 | pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces | ||
| 852 | pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output | ||
| 853 | pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL | ||
| 854 | pub const ONOCR: tcflag_t = 0x00000040; // discard CR's when on column 0 | ||
| 855 | pub const ONLRET: tcflag_t = 0x00000080; // move to column 0 on CR | ||
| 856 | |||
| 857 | // Control flags - hardware control of terminal | ||
| 858 | pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags | ||
| 859 | pub const CSIZE: tcflag_t = 0x00000300; // character size mask | ||
| 860 | pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo) | ||
| 861 | pub const CS6: tcflag_t = 0x00000100; // 6 bits | ||
| 862 | pub const CS7: tcflag_t = 0x00000200; // 7 bits | ||
| 863 | pub const CS8: tcflag_t = 0x00000300; // 8 bits | ||
| 864 | pub const CSTOPB: tcflag_t = 0x00000400; // send 2 stop bits | ||
| 865 | pub const CREAD: tcflag_t = 0x00000800; // enable receiver | ||
| 866 | pub const PARENB: tcflag_t = 0x00001000; // parity enable | ||
| 867 | pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even | ||
| 868 | pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close | ||
| 869 | pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines | ||
| 870 | pub const CRTSCTS: tcflag_t = 0x00010000; // RTS/CTS full-duplex flow control | ||
| 871 | pub const CRTS_IFLOW: tcflag_t = CRTSCTS; // XXX compat | ||
| 872 | pub const CCTS_OFLOW: tcflag_t = CRTSCTS; // XXX compat | ||
| 873 | pub const CDTRCTS: tcflag_t = 0x00020000; // DTR/CTS full-duplex flow control | ||
| 874 | pub const MDMBUF: tcflag_t = 0x00100000; // DTR/DCD hardware flow control | ||
| 875 | pub const CHWFLOW: tcflag_t = (MDMBUF | CRTSCTS | CDTRCTS); // all types of hw flow control | ||
| 876 | |||
| 877 | pub const tcflag_t = c_uint; | ||
| 878 | pub const speed_t = c_uint; | ||
| 879 | pub const cc_t = u8; | ||
| 880 | |||
| 881 | pub const NCCS = 20; | ||
| 882 | |||
| 883 | pub const termios = extern struct { | ||
| 884 | iflag: tcflag_t, // input flags | ||
| 885 | oflag: tcflag_t, // output flags | ||
| 886 | cflag: tcflag_t, // control flags | ||
| 887 | lflag: tcflag_t, // local flags | ||
| 888 | cc: [NCCS]cc_t, // control chars | ||
| 889 | ispeed: c_int, // input speed | ||
| 890 | ospeed: c_int, // output speed | ||
| 891 | }; | ||
| 892 | |||
| 893 | // Commands passed to tcsetattr() for setting the termios structure. | 809 | // Commands passed to tcsetattr() for setting the termios structure. |
| 894 | pub const TCSA = struct { | 810 | pub const TCSA = struct { |
| 895 | pub const NOW = 0; // make change immediate | 811 | pub const NOW = 0; // make change immediate |
| ... | @@ -898,43 +814,6 @@ pub const TCSA = struct { | ... | @@ -898,43 +814,6 @@ pub const TCSA = struct { |
| 898 | pub const SOFT = 0x10; // flag - don't alter h.w. state | 814 | pub const SOFT = 0x10; // flag - don't alter h.w. state |
| 899 | }; | 815 | }; |
| 900 | 816 | ||
| 901 | // Standard speeds | ||
| 902 | pub const B0: c_uint = 0; | ||
| 903 | pub const B50: c_uint = 50; | ||
| 904 | pub const B75: c_uint = 75; | ||
| 905 | pub const B110: c_uint = 110; | ||
| 906 | pub const B134: c_uint = 134; | ||
| 907 | pub const B150: c_uint = 150; | ||
| 908 | pub const B200: c_uint = 200; | ||
| 909 | pub const B300: c_uint = 300; | ||
| 910 | pub const B600: c_uint = 600; | ||
| 911 | pub const B1200: c_uint = 1200; | ||
| 912 | pub const B1800: c_uint = 1800; | ||
| 913 | pub const B2400: c_uint = 2400; | ||
| 914 | pub const B4800: c_uint = 4800; | ||
| 915 | pub const B9600: c_uint = 9600; | ||
| 916 | pub const B19200: c_uint = 19200; | ||
| 917 | pub const B38400: c_uint = 38400; | ||
| 918 | pub const B7200: c_uint = 7200; | ||
| 919 | pub const B14400: c_uint = 14400; | ||
| 920 | pub const B28800: c_uint = 28800; | ||
| 921 | pub const B57600: c_uint = 57600; | ||
| 922 | pub const B76800: c_uint = 76800; | ||
| 923 | pub const B115200: c_uint = 115200; | ||
| 924 | pub const B230400: c_uint = 230400; | ||
| 925 | pub const B460800: c_uint = 460800; | ||
| 926 | pub const B500000: c_uint = 500000; | ||
| 927 | pub const B921600: c_uint = 921600; | ||
| 928 | pub const B1000000: c_uint = 1000000; | ||
| 929 | pub const B1500000: c_uint = 1500000; | ||
| 930 | pub const B2000000: c_uint = 2000000; | ||
| 931 | pub const B2500000: c_uint = 2500000; | ||
| 932 | pub const B3000000: c_uint = 3000000; | ||
| 933 | pub const B3500000: c_uint = 3500000; | ||
| 934 | pub const B4000000: c_uint = 4000000; | ||
| 935 | pub const EXTA: c_uint = 19200; | ||
| 936 | pub const EXTB: c_uint = 38400; | ||
| 937 | |||
| 938 | pub const TCIFLUSH = 1; | 817 | pub const TCIFLUSH = 1; |
| 939 | pub const TCOFLUSH = 2; | 818 | pub const TCOFLUSH = 2; |
| 940 | pub const TCIOFLUSH = 3; | 819 | pub const TCIOFLUSH = 3; |
lib/std/c/openbsd.zig-112| ... | @@ -768,91 +768,6 @@ pub const AUTH = struct { | ... | @@ -768,91 +768,6 @@ pub const AUTH = struct { |
| 768 | pub const ALLOW: c_int = (OKAY | ROOTOKAY | SECURE); | 768 | pub const ALLOW: c_int = (OKAY | ROOTOKAY | SECURE); |
| 769 | }; | 769 | }; |
| 770 | 770 | ||
| 771 | // Term | ||
| 772 | pub const V = struct { | ||
| 773 | pub const EOF = 0; // ICANON | ||
| 774 | pub const EOL = 1; // ICANON | ||
| 775 | pub const EOL2 = 2; // ICANON | ||
| 776 | pub const ERASE = 3; // ICANON | ||
| 777 | pub const WERASE = 4; // ICANON | ||
| 778 | pub const KILL = 5; // ICANON | ||
| 779 | pub const REPRINT = 6; // ICANON | ||
| 780 | // 7 spare 1 | ||
| 781 | pub const INTR = 8; // ISIG | ||
| 782 | pub const QUIT = 9; // ISIG | ||
| 783 | pub const SUSP = 10; // ISIG | ||
| 784 | pub const DSUSP = 11; // ISIG | ||
| 785 | pub const START = 12; // IXON, IXOFF | ||
| 786 | pub const STOP = 13; // IXON, IXOFF | ||
| 787 | pub const LNEXT = 14; // IEXTEN | ||
| 788 | pub const DISCARD = 15; // IEXTEN | ||
| 789 | pub const MIN = 16; // !ICANON | ||
| 790 | pub const TIME = 17; // !ICANON | ||
| 791 | pub const STATUS = 18; // ICANON | ||
| 792 | // 19 spare 2 | ||
| 793 | }; | ||
| 794 | |||
| 795 | pub const tcflag_t = c_uint; | ||
| 796 | pub const speed_t = c_uint; | ||
| 797 | pub const cc_t = u8; | ||
| 798 | |||
| 799 | pub const NCCS = 20; | ||
| 800 | |||
| 801 | // Input flags - software input processing | ||
| 802 | pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition | ||
| 803 | pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINT | ||
| 804 | pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors | ||
| 805 | pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors | ||
| 806 | pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors | ||
| 807 | pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars | ||
| 808 | pub const INLCR: tcflag_t = 0x00000040; // map NL into CR | ||
| 809 | pub const IGNCR: tcflag_t = 0x00000080; // ignore CR | ||
| 810 | pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD) | ||
| 811 | pub const IXON: tcflag_t = 0x00000200; // enable output flow control | ||
| 812 | pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control | ||
| 813 | pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop | ||
| 814 | pub const IUCLC: tcflag_t = 0x00001000; // translate upper to lower case | ||
| 815 | pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full | ||
| 816 | |||
| 817 | // Output flags - software output processing | ||
| 818 | pub const OPOST: tcflag_t = 0x00000001; // enable following output processing | ||
| 819 | pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD) | ||
| 820 | pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces | ||
| 821 | pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output | ||
| 822 | pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL | ||
| 823 | pub const OLCUC: tcflag_t = 0x00000020; // translate lower case to upper case | ||
| 824 | pub const ONOCR: tcflag_t = 0x00000040; // No CR output at column 0 | ||
| 825 | pub const ONLRET: tcflag_t = 0x00000080; // NL performs the CR function | ||
| 826 | |||
| 827 | // Control flags - hardware control of terminal | ||
| 828 | pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags | ||
| 829 | pub const CSIZE: tcflag_t = 0x00000300; // character size mask | ||
| 830 | pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo) | ||
| 831 | pub const CS6: tcflag_t = 0x00000100; // 6 bits | ||
| 832 | pub const CS7: tcflag_t = 0x00000200; // 7 bits | ||
| 833 | pub const CS8: tcflag_t = 0x00000300; // 8 bits | ||
| 834 | pub const CSTOPB: tcflag_t = 0x00000400; // send 2 stop bits | ||
| 835 | pub const CREAD: tcflag_t = 0x00000800; // enable receiver | ||
| 836 | pub const PARENB: tcflag_t = 0x00001000; // parity enable | ||
| 837 | pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even | ||
| 838 | pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close | ||
| 839 | pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines | ||
| 840 | pub const CRTSCTS: tcflag_t = 0x00010000; // RTS/CTS full-duplex flow control | ||
| 841 | pub const CRTS_IFLOW: tcflag_t = CRTSCTS; // XXX compat | ||
| 842 | pub const CCTS_OFLOW: tcflag_t = CRTSCTS; // XXX compat | ||
| 843 | pub const MDMBUF: tcflag_t = 0x00100000; // DTR/DCD hardware flow control | ||
| 844 | pub const CHWFLOW: tcflag_t = (MDMBUF | CRTSCTS); // all types of hw flow control | ||
| 845 | |||
| 846 | pub const termios = extern struct { | ||
| 847 | iflag: tcflag_t, // input flags | ||
| 848 | oflag: tcflag_t, // output flags | ||
| 849 | cflag: tcflag_t, // control flags | ||
| 850 | lflag: tcflag_t, // local flags | ||
| 851 | cc: [NCCS]cc_t, // control chars | ||
| 852 | ispeed: c_int, // input speed | ||
| 853 | ospeed: c_int, // output speed | ||
| 854 | }; | ||
| 855 | |||
| 856 | // Commands passed to tcsetattr() for setting the termios structure. | 771 | // Commands passed to tcsetattr() for setting the termios structure. |
| 857 | pub const TCSA = struct { | 772 | pub const TCSA = struct { |
| 858 | pub const NOW = 0; // make change immediate | 773 | pub const NOW = 0; // make change immediate |
| ... | @@ -861,33 +776,6 @@ pub const TCSA = struct { | ... | @@ -861,33 +776,6 @@ pub const TCSA = struct { |
| 861 | pub const SOFT = 0x10; // flag - don't alter h.w. state | 776 | pub const SOFT = 0x10; // flag - don't alter h.w. state |
| 862 | }; | 777 | }; |
| 863 | 778 | ||
| 864 | // Standard speeds | ||
| 865 | pub const B0 = 0; | ||
| 866 | pub const B50 = 50; | ||
| 867 | pub const B75 = 75; | ||
| 868 | pub const B110 = 110; | ||
| 869 | pub const B134 = 134; | ||
| 870 | pub const B150 = 150; | ||
| 871 | pub const B200 = 200; | ||
| 872 | pub const B300 = 300; | ||
| 873 | pub const B600 = 600; | ||
| 874 | pub const B1200 = 1200; | ||
| 875 | pub const B1800 = 1800; | ||
| 876 | pub const B2400 = 2400; | ||
| 877 | pub const B4800 = 4800; | ||
| 878 | pub const B9600 = 9600; | ||
| 879 | pub const B19200 = 19200; | ||
| 880 | pub const B38400 = 38400; | ||
| 881 | pub const B7200 = 7200; | ||
| 882 | pub const B14400 = 14400; | ||
| 883 | pub const B28800 = 28800; | ||
| 884 | pub const B57600 = 57600; | ||
| 885 | pub const B76800 = 76800; | ||
| 886 | pub const B115200 = 115200; | ||
| 887 | pub const B230400 = 230400; | ||
| 888 | pub const EXTA = 19200; | ||
| 889 | pub const EXTB = 38400; | ||
| 890 | |||
| 891 | pub const TCIFLUSH = 1; | 779 | pub const TCIFLUSH = 1; |
| 892 | pub const TCOFLUSH = 2; | 780 | pub const TCOFLUSH = 2; |
| 893 | pub const TCIOFLUSH = 3; | 781 | pub const TCIOFLUSH = 3; |
lib/std/c/solaris.zig-14| ... | @@ -698,20 +698,6 @@ pub const SEEK = struct { | ... | @@ -698,20 +698,6 @@ pub const SEEK = struct { |
| 698 | pub const HOLE = 4; | 698 | pub const HOLE = 4; |
| 699 | }; | 699 | }; |
| 700 | 700 | ||
| 701 | pub const tcflag_t = c_uint; | ||
| 702 | pub const cc_t = u8; | ||
| 703 | pub const speed_t = c_uint; | ||
| 704 | |||
| 705 | pub const NCCS = 19; | ||
| 706 | |||
| 707 | pub const termios = extern struct { | ||
| 708 | c_iflag: tcflag_t, | ||
| 709 | c_oflag: tcflag_t, | ||
| 710 | c_cflag: tcflag_t, | ||
| 711 | c_lflag: tcflag_t, | ||
| 712 | c_cc: [NCCS]cc_t, | ||
| 713 | }; | ||
| 714 | |||
| 715 | fn tioc(t: u16, num: u8) u16 { | 701 | fn tioc(t: u16, num: u8) u16 { |
| 716 | return (t << 8) | num; | 702 | return (t << 8) | num; |
| 717 | } | 703 | } |
lib/std/os.zig+10-2| ... | @@ -139,6 +139,7 @@ pub const W = system.W; | ... | @@ -139,6 +139,7 @@ pub const W = system.W; |
| 139 | pub const addrinfo = system.addrinfo; | 139 | pub const addrinfo = system.addrinfo; |
| 140 | pub const blkcnt_t = system.blkcnt_t; | 140 | pub const blkcnt_t = system.blkcnt_t; |
| 141 | pub const blksize_t = system.blksize_t; | 141 | pub const blksize_t = system.blksize_t; |
| 142 | pub const cc_t = system.cc_t; | ||
| 142 | pub const clock_t = system.clock_t; | 143 | pub const clock_t = system.clock_t; |
| 143 | pub const cpu_set_t = system.cpu_set_t; | 144 | pub const cpu_set_t = system.cpu_set_t; |
| 144 | pub const dev_t = system.dev_t; | 145 | pub const dev_t = system.dev_t; |
| ... | @@ -172,8 +173,6 @@ pub const sigset_t = system.sigset_t; | ... | @@ -172,8 +173,6 @@ pub const sigset_t = system.sigset_t; |
| 172 | pub const sockaddr = system.sockaddr; | 173 | pub const sockaddr = system.sockaddr; |
| 173 | pub const socklen_t = system.socklen_t; | 174 | pub const socklen_t = system.socklen_t; |
| 174 | pub const stack_t = system.stack_t; | 175 | pub const stack_t = system.stack_t; |
| 175 | pub const tcflag_t = system.tcflag_t; | ||
| 176 | pub const termios = system.termios; | ||
| 177 | pub const time_t = system.time_t; | 176 | pub const time_t = system.time_t; |
| 178 | pub const timespec = system.timespec; | 177 | pub const timespec = system.timespec; |
| 179 | pub const timestamp_t = system.timestamp_t; | 178 | pub const timestamp_t = system.timestamp_t; |
| ... | @@ -184,6 +183,15 @@ pub const uid_t = system.uid_t; | ... | @@ -184,6 +183,15 @@ pub const uid_t = system.uid_t; |
| 184 | pub const user_desc = system.user_desc; | 183 | pub const user_desc = system.user_desc; |
| 185 | pub const utsname = system.utsname; | 184 | pub const utsname = system.utsname; |
| 186 | 185 | ||
| 186 | pub const termios = system.termios; | ||
| 187 | pub const CSIZE = system.CSIZE; | ||
| 188 | pub const NCCS = system.NCCS; | ||
| 189 | pub const speed_t = system.speed_t; | ||
| 190 | pub const tc_iflag_t = system.tc_iflag_t; | ||
| 191 | pub const tc_oflag_t = system.tc_oflag_t; | ||
| 192 | pub const tc_cflag_t = system.tc_cflag_t; | ||
| 193 | pub const tc_lflag_t = system.tc_lflag_t; | ||
| 194 | |||
| 187 | pub const F_OK = system.F_OK; | 195 | pub const F_OK = system.F_OK; |
| 188 | pub const R_OK = system.R_OK; | 196 | pub const R_OK = system.R_OK; |
| 189 | pub const W_OK = system.W_OK; | 197 | pub const W_OK = system.W_OK; |
lib/std/os/emscripten.zig-17| ... | @@ -1098,23 +1098,6 @@ pub const stack_t = extern struct { | ... | @@ -1098,23 +1098,6 @@ pub const stack_t = extern struct { |
| 1098 | size: usize, | 1098 | size: usize, |
| 1099 | }; | 1099 | }; |
| 1100 | 1100 | ||
| 1101 | pub const cc_t = u8; | ||
| 1102 | pub const speed_t = u32; | ||
| 1103 | pub const tcflag_t = u32; | ||
| 1104 | |||
| 1105 | pub const NCCS = 32; | ||
| 1106 | |||
| 1107 | pub const termios = extern struct { | ||
| 1108 | iflag: tcflag_t, | ||
| 1109 | oflag: tcflag_t, | ||
| 1110 | cflag: tcflag_t, | ||
| 1111 | lflag: tcflag_t, | ||
| 1112 | line: cc_t, | ||
| 1113 | cc: [NCCS]cc_t, | ||
| 1114 | ispeed: speed_t, | ||
| 1115 | ospeed: speed_t, | ||
| 1116 | }; | ||
| 1117 | |||
| 1118 | pub const timespec = extern struct { | 1101 | pub const timespec = extern struct { |
| 1119 | tv_sec: time_t, | 1102 | tv_sec: time_t, |
| 1120 | tv_nsec: isize, | 1103 | tv_nsec: isize, |
lib/std/os/linux.zig+300-172| ... | @@ -5004,175 +5004,291 @@ pub const rusage = extern struct { | ... | @@ -5004,175 +5004,291 @@ pub const rusage = extern struct { |
| 5004 | pub const THREAD = 1; | 5004 | pub const THREAD = 1; |
| 5005 | }; | 5005 | }; |
| 5006 | 5006 | ||
| 5007 | pub const cc_t = u8; | 5007 | pub const NCCS = switch (native_arch) { |
| 5008 | pub const speed_t = u32; | 5008 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => 19, |
| 5009 | pub const tcflag_t = u32; | 5009 | else => 32, |
| 5010 | 5010 | }; | |
| 5011 | pub const NCCS = 32; | 5011 | |
| 5012 | 5012 | pub const speed_t = switch (native_arch) { | |
| 5013 | pub const B0 = 0o0000000; | 5013 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => enum(u32) { |
| 5014 | pub const B50 = 0o0000001; | 5014 | B0 = 0o0000000, |
| 5015 | pub const B75 = 0o0000002; | 5015 | B50 = 0o0000001, |
| 5016 | pub const B110 = 0o0000003; | 5016 | B75 = 0o0000002, |
| 5017 | pub const B134 = 0o0000004; | 5017 | B110 = 0o0000003, |
| 5018 | pub const B150 = 0o0000005; | 5018 | B134 = 0o0000004, |
| 5019 | pub const B200 = 0o0000006; | 5019 | B150 = 0o0000005, |
| 5020 | pub const B300 = 0o0000007; | 5020 | B200 = 0o0000006, |
| 5021 | pub const B600 = 0o0000010; | 5021 | B300 = 0o0000007, |
| 5022 | pub const B1200 = 0o0000011; | 5022 | B600 = 0o0000010, |
| 5023 | pub const B1800 = 0o0000012; | 5023 | B1200 = 0o0000011, |
| 5024 | pub const B2400 = 0o0000013; | 5024 | B1800 = 0o0000012, |
| 5025 | pub const B4800 = 0o0000014; | 5025 | B2400 = 0o0000013, |
| 5026 | pub const B9600 = 0o0000015; | 5026 | B4800 = 0o0000014, |
| 5027 | pub const B19200 = 0o0000016; | 5027 | B9600 = 0o0000015, |
| 5028 | pub const B38400 = 0o0000017; | 5028 | B19200 = 0o0000016, |
| 5029 | pub const BOTHER = 0o0010000; | 5029 | B38400 = 0o0000017, |
| 5030 | pub const B57600 = 0o0010001; | 5030 | |
| 5031 | pub const B115200 = 0o0010002; | 5031 | B57600 = 0o00020, |
| 5032 | pub const B230400 = 0o0010003; | 5032 | B115200 = 0o00021, |
| 5033 | pub const B460800 = 0o0010004; | 5033 | B230400 = 0o00022, |
| 5034 | pub const B500000 = 0o0010005; | 5034 | B460800 = 0o00023, |
| 5035 | pub const B576000 = 0o0010006; | 5035 | B500000 = 0o00024, |
| 5036 | pub const B921600 = 0o0010007; | 5036 | B576000 = 0o00025, |
| 5037 | pub const B1000000 = 0o0010010; | 5037 | B921600 = 0o00026, |
| 5038 | pub const B1152000 = 0o0010011; | 5038 | B1000000 = 0o00027, |
| 5039 | pub const B1500000 = 0o0010012; | 5039 | B1152000 = 0o00030, |
| 5040 | pub const B2000000 = 0o0010013; | 5040 | B1500000 = 0o00031, |
| 5041 | pub const B2500000 = 0o0010014; | 5041 | B2000000 = 0o00032, |
| 5042 | pub const B3000000 = 0o0010015; | 5042 | B2500000 = 0o00033, |
| 5043 | pub const B3500000 = 0o0010016; | 5043 | B3000000 = 0o00034, |
| 5044 | pub const B4000000 = 0o0010017; | 5044 | B3500000 = 0o00035, |
| 5045 | 5045 | B4000000 = 0o00036, | |
| 5046 | pub const V = switch (native_arch) { | ||
| 5047 | .powerpc, .powerpc64, .powerpc64le => struct { | ||
| 5048 | pub const INTR = 0; | ||
| 5049 | pub const QUIT = 1; | ||
| 5050 | pub const ERASE = 2; | ||
| 5051 | pub const KILL = 3; | ||
| 5052 | pub const EOF = 4; | ||
| 5053 | pub const MIN = 5; | ||
| 5054 | pub const EOL = 6; | ||
| 5055 | pub const TIME = 7; | ||
| 5056 | pub const EOL2 = 8; | ||
| 5057 | pub const SWTC = 9; | ||
| 5058 | pub const WERASE = 10; | ||
| 5059 | pub const REPRINT = 11; | ||
| 5060 | pub const SUSP = 12; | ||
| 5061 | pub const START = 13; | ||
| 5062 | pub const STOP = 14; | ||
| 5063 | pub const LNEXT = 15; | ||
| 5064 | pub const DISCARD = 16; | ||
| 5065 | }, | 5046 | }, |
| 5066 | .sparc, .sparc64 => struct { | 5047 | else => enum(u32) { |
| 5067 | pub const INTR = 0; | 5048 | B0 = 0o0000000, |
| 5068 | pub const QUIT = 1; | 5049 | B50 = 0o0000001, |
| 5069 | pub const ERASE = 2; | 5050 | B75 = 0o0000002, |
| 5070 | pub const KILL = 3; | 5051 | B110 = 0o0000003, |
| 5071 | pub const EOF = 4; | 5052 | B134 = 0o0000004, |
| 5072 | pub const EOL = 5; | 5053 | B150 = 0o0000005, |
| 5073 | pub const EOL2 = 6; | 5054 | B200 = 0o0000006, |
| 5074 | pub const SWTC = 7; | 5055 | B300 = 0o0000007, |
| 5075 | pub const START = 8; | 5056 | B600 = 0o0000010, |
| 5076 | pub const STOP = 9; | 5057 | B1200 = 0o0000011, |
| 5077 | pub const SUSP = 10; | 5058 | B1800 = 0o0000012, |
| 5078 | pub const DSUSP = 11; | 5059 | B2400 = 0o0000013, |
| 5079 | pub const REPRINT = 12; | 5060 | B4800 = 0o0000014, |
| 5080 | pub const DISCARD = 13; | 5061 | B9600 = 0o0000015, |
| 5081 | pub const WERASE = 14; | 5062 | B19200 = 0o0000016, |
| 5082 | pub const LNEXT = 15; | 5063 | B38400 = 0o0000017, |
| 5083 | pub const MIN = EOF; | 5064 | |
| 5084 | pub const TIME = EOL; | 5065 | B57600 = 0o0010001, |
| 5066 | B115200 = 0o0010002, | ||
| 5067 | B230400 = 0o0010003, | ||
| 5068 | B460800 = 0o0010004, | ||
| 5069 | B500000 = 0o0010005, | ||
| 5070 | B576000 = 0o0010006, | ||
| 5071 | B921600 = 0o0010007, | ||
| 5072 | B1000000 = 0o0010010, | ||
| 5073 | B1152000 = 0o0010011, | ||
| 5074 | B1500000 = 0o0010012, | ||
| 5075 | B2000000 = 0o0010013, | ||
| 5076 | B2500000 = 0o0010014, | ||
| 5077 | B3000000 = 0o0010015, | ||
| 5078 | B3500000 = 0o0010016, | ||
| 5079 | B4000000 = 0o0010017, | ||
| 5085 | }, | 5080 | }, |
| 5086 | .mips, .mipsel, .mips64, .mips64el => struct { | 5081 | }; |
| 5087 | pub const INTR = 0; | 5082 | |
| 5088 | pub const QUIT = 1; | 5083 | pub const tc_iflag_t = switch (native_arch) { |
| 5089 | pub const ERASE = 2; | 5084 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) { |
| 5090 | pub const KILL = 3; | 5085 | IGNBRK: bool = false, |
| 5091 | pub const MIN = 4; | 5086 | BRKINT: bool = false, |
| 5092 | pub const TIME = 5; | 5087 | IGNPAR: bool = false, |
| 5093 | pub const EOL2 = 6; | 5088 | PARMRK: bool = false, |
| 5094 | pub const SWTC = 7; | 5089 | INPCK: bool = false, |
| 5095 | pub const SWTCH = 7; | 5090 | ISTRIP: bool = false, |
| 5096 | pub const START = 8; | 5091 | INLCR: bool = false, |
| 5097 | pub const STOP = 9; | 5092 | IGNCR: bool = false, |
| 5098 | pub const SUSP = 10; | 5093 | ICRNL: bool = false, |
| 5099 | pub const REPRINT = 12; | 5094 | IXON: bool = false, |
| 5100 | pub const DISCARD = 13; | 5095 | IXOFF: bool = false, |
| 5101 | pub const WERASE = 14; | 5096 | IXANY: bool = false, |
| 5102 | pub const LNEXT = 15; | 5097 | IUCLC: bool = false, |
| 5103 | pub const EOF = 16; | 5098 | IMAXBEL: bool = false, |
| 5104 | pub const EOL = 17; | 5099 | IUTF8: bool = false, |
| 5100 | _: u17 = 0, | ||
| 5105 | }, | 5101 | }, |
| 5106 | else => struct { | 5102 | else => packed struct(u32) { |
| 5107 | pub const INTR = 0; | 5103 | IGNBRK: bool = false, |
| 5108 | pub const QUIT = 1; | 5104 | BRKINT: bool = false, |
| 5109 | pub const ERASE = 2; | 5105 | IGNPAR: bool = false, |
| 5110 | pub const KILL = 3; | 5106 | PARMRK: bool = false, |
| 5111 | pub const EOF = 4; | 5107 | INPCK: bool = false, |
| 5112 | pub const TIME = 5; | 5108 | ISTRIP: bool = false, |
| 5113 | pub const MIN = 6; | 5109 | INLCR: bool = false, |
| 5114 | pub const SWTC = 7; | 5110 | IGNCR: bool = false, |
| 5115 | pub const START = 8; | 5111 | ICRNL: bool = false, |
| 5116 | pub const STOP = 9; | 5112 | IUCLC: bool = false, |
| 5117 | pub const SUSP = 10; | 5113 | IXON: bool = false, |
| 5118 | pub const EOL = 11; | 5114 | IXANY: bool = false, |
| 5119 | pub const REPRINT = 12; | 5115 | IXOFF: bool = false, |
| 5120 | pub const DISCARD = 13; | 5116 | IMAXBEL: bool = false, |
| 5121 | pub const WERASE = 14; | 5117 | IUTF8: bool = false, |
| 5122 | pub const LNEXT = 15; | 5118 | _: u17 = 0, |
| 5123 | pub const EOL2 = 16; | 5119 | }, |
| 5120 | }; | ||
| 5121 | |||
| 5122 | pub const tc_oflag_t = switch (native_arch) { | ||
| 5123 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) { | ||
| 5124 | OPOST: bool = false, | ||
| 5125 | ONLCR: bool = false, | ||
| 5126 | OLCUC: bool = false, | ||
| 5127 | OCRNL: bool = false, | ||
| 5128 | ONOCR: bool = false, | ||
| 5129 | ONLRET: bool = false, | ||
| 5130 | OFILL: bool = false, | ||
| 5131 | OFDEL: bool = false, | ||
| 5132 | NLDLY: u2 = 0, | ||
| 5133 | TABDLY: u2 = 0, | ||
| 5134 | CRDLY: u2 = 0, | ||
| 5135 | FFDLY: u1 = 0, | ||
| 5136 | BSDLY: u1 = 0, | ||
| 5137 | VTDLY: u1 = 0, | ||
| 5138 | _: u15 = 0, | ||
| 5139 | }, | ||
| 5140 | else => packed struct(u32) { | ||
| 5141 | OPOST: bool = false, | ||
| 5142 | OLCUC: bool = false, | ||
| 5143 | ONLCR: bool = false, | ||
| 5144 | OCRNL: bool = false, | ||
| 5145 | ONOCR: bool = false, | ||
| 5146 | ONLRET: bool = false, | ||
| 5147 | OFILL: bool = false, | ||
| 5148 | OFDEL: bool = false, | ||
| 5149 | NLDLY: u1 = 0, | ||
| 5150 | CRDLY: u2 = 0, | ||
| 5151 | TABDLY: u2 = 0, | ||
| 5152 | BSDLY: u1 = 0, | ||
| 5153 | VTDLY: u1 = 0, | ||
| 5154 | FFDLY: u1 = 0, | ||
| 5155 | _: u16 = 0, | ||
| 5156 | }, | ||
| 5157 | }; | ||
| 5158 | |||
| 5159 | pub const CSIZE = enum(u2) { CS5, CS6, CS7, CS8 }; | ||
| 5160 | |||
| 5161 | pub const tc_cflag_t = switch (native_arch) { | ||
| 5162 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) { | ||
| 5163 | _0: u8 = 0, | ||
| 5164 | CSIZE: CSIZE = .CS5, | ||
| 5165 | CSTOPB: bool = false, | ||
| 5166 | CREAD: bool = false, | ||
| 5167 | PARENB: bool = false, | ||
| 5168 | PARODD: bool = false, | ||
| 5169 | HUPCL: bool = false, | ||
| 5170 | CLOCAL: bool = false, | ||
| 5171 | _: u16 = 0, | ||
| 5172 | }, | ||
| 5173 | else => packed struct(u32) { | ||
| 5174 | _0: u4 = 0, | ||
| 5175 | CSIZE: CSIZE = .CS5, | ||
| 5176 | CSTOPB: bool = false, | ||
| 5177 | CREAD: bool = false, | ||
| 5178 | PARENB: bool = false, | ||
| 5179 | PARODD: bool = false, | ||
| 5180 | HUPCL: bool = false, | ||
| 5181 | CLOCAL: bool = false, | ||
| 5182 | _: u20 = 0, | ||
| 5124 | }, | 5183 | }, |
| 5125 | }; | 5184 | }; |
| 5126 | 5185 | ||
| 5127 | pub const IGNBRK: tcflag_t = 1; | 5186 | pub const tc_lflag_t = switch (native_arch) { |
| 5128 | pub const BRKINT: tcflag_t = 2; | 5187 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) { |
| 5129 | pub const IGNPAR: tcflag_t = 4; | 5188 | _0: u1 = 0, |
| 5130 | pub const PARMRK: tcflag_t = 8; | 5189 | ECHOE: bool = false, |
| 5131 | pub const INPCK: tcflag_t = 16; | 5190 | ECHOK: bool = false, |
| 5132 | pub const ISTRIP: tcflag_t = 32; | 5191 | ECHO: bool = false, |
| 5133 | pub const INLCR: tcflag_t = 64; | 5192 | ECHONL: bool = false, |
| 5134 | pub const IGNCR: tcflag_t = 128; | 5193 | _5: u2 = 0, |
| 5135 | pub const ICRNL: tcflag_t = 256; | 5194 | ISIG: bool = false, |
| 5136 | pub const IUCLC: tcflag_t = 512; | 5195 | ICANON: bool = false, |
| 5137 | pub const IXON: tcflag_t = 1024; | 5196 | _9: u1 = 0, |
| 5138 | pub const IXANY: tcflag_t = 2048; | 5197 | IEXTEN: bool = false, |
| 5139 | pub const IXOFF: tcflag_t = 4096; | 5198 | _11: u11 = 0, |
| 5140 | pub const IMAXBEL: tcflag_t = 8192; | 5199 | TOSTOP: bool = false, |
| 5141 | pub const IUTF8: tcflag_t = 16384; | 5200 | _23: u8 = 0, |
| 5142 | 5201 | NOFLSH: bool = false, | |
| 5143 | pub const OPOST: tcflag_t = 1; | 5202 | }, |
| 5144 | pub const OLCUC: tcflag_t = 2; | 5203 | .mips, .mipsel, .mips64, .mips64el => packed struct(u32) { |
| 5145 | pub const ONLCR: tcflag_t = 4; | 5204 | ISIG: bool = false, |
| 5146 | pub const OCRNL: tcflag_t = 8; | 5205 | ICANON: bool = false, |
| 5147 | pub const ONOCR: tcflag_t = 16; | 5206 | _2: u1 = 0, |
| 5148 | pub const ONLRET: tcflag_t = 32; | 5207 | ECHO: bool = false, |
| 5149 | pub const OFILL: tcflag_t = 64; | 5208 | ECHOE: bool = false, |
| 5150 | pub const OFDEL: tcflag_t = 128; | 5209 | ECHOK: bool = false, |
| 5151 | pub const VTDLY: tcflag_t = 16384; | 5210 | ECHONL: bool = false, |
| 5152 | pub const VT0: tcflag_t = 0; | 5211 | NOFLSH: bool = false, |
| 5153 | pub const VT1: tcflag_t = 16384; | 5212 | IEXTEN: bool = false, |
| 5154 | 5213 | _9: u6 = 0, | |
| 5155 | pub const CSIZE: tcflag_t = 48; | 5214 | TOSTOP: bool = false, |
| 5156 | pub const CS5: tcflag_t = 0; | 5215 | _: u16 = 0, |
| 5157 | pub const CS6: tcflag_t = 16; | 5216 | }, |
| 5158 | pub const CS7: tcflag_t = 32; | 5217 | else => packed struct(u32) { |
| 5159 | pub const CS8: tcflag_t = 48; | 5218 | ISIG: bool = false, |
| 5160 | pub const CSTOPB: tcflag_t = 64; | 5219 | ICANON: bool = false, |
| 5161 | pub const CREAD: tcflag_t = 128; | 5220 | _2: u1 = 0, |
| 5162 | pub const PARENB: tcflag_t = 256; | 5221 | ECHO: bool = false, |
| 5163 | pub const PARODD: tcflag_t = 512; | 5222 | ECHOE: bool = false, |
| 5164 | pub const HUPCL: tcflag_t = 1024; | 5223 | ECHOK: bool = false, |
| 5165 | pub const CLOCAL: tcflag_t = 2048; | 5224 | ECHONL: bool = false, |
| 5166 | 5225 | NOFLSH: bool = false, | |
| 5167 | pub const ISIG: tcflag_t = 1; | 5226 | TOSTOP: bool = false, |
| 5168 | pub const ICANON: tcflag_t = 2; | 5227 | _9: u6 = 0, |
| 5169 | pub const ECHO: tcflag_t = 8; | 5228 | IEXTEN: bool = false, |
| 5170 | pub const ECHOE: tcflag_t = 16; | 5229 | _: u16 = 0, |
| 5171 | pub const ECHOK: tcflag_t = 32; | 5230 | }, |
| 5172 | pub const ECHONL: tcflag_t = 64; | 5231 | }; |
| 5173 | pub const NOFLSH: tcflag_t = 128; | 5232 | |
| 5174 | pub const TOSTOP: tcflag_t = 256; | 5233 | pub const cc_t = switch (native_arch) { |
| 5175 | pub const IEXTEN: tcflag_t = 32768; | 5234 | .mips, .mipsel, .mips64, .mips64el => enum(u8) { |
| 5235 | VINTR = 0, | ||
| 5236 | VQUIT = 1, | ||
| 5237 | VERASE = 2, | ||
| 5238 | VKILL = 3, | ||
| 5239 | VMIN = 4, | ||
| 5240 | VTIME = 5, | ||
| 5241 | VEOL2 = 6, | ||
| 5242 | VSWTC = 7, | ||
| 5243 | VSTART = 8, | ||
| 5244 | VSTOP = 9, | ||
| 5245 | VSUSP = 10, | ||
| 5246 | VREPRINT = 12, | ||
| 5247 | VDISCARD = 13, | ||
| 5248 | VWERASE = 14, | ||
| 5249 | VLNEXT = 15, | ||
| 5250 | VEOF = 16, | ||
| 5251 | VEOL = 17, | ||
| 5252 | }, | ||
| 5253 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => enum(u8) { | ||
| 5254 | VINTR = 0, | ||
| 5255 | VQUIT = 1, | ||
| 5256 | VERASE = 2, | ||
| 5257 | VKILL = 3, | ||
| 5258 | VEOF = 4, | ||
| 5259 | VMIN = 5, | ||
| 5260 | VEOL = 6, | ||
| 5261 | VTIME = 7, | ||
| 5262 | VEOL2 = 8, | ||
| 5263 | VSWTC = 9, | ||
| 5264 | VWERASE = 10, | ||
| 5265 | VREPRINT = 11, | ||
| 5266 | VSUSP = 12, | ||
| 5267 | VSTART = 13, | ||
| 5268 | VSTOP = 14, | ||
| 5269 | VLNEXT = 15, | ||
| 5270 | VDISCARD = 16, | ||
| 5271 | }, | ||
| 5272 | else => enum(u8) { | ||
| 5273 | VINTR = 0, | ||
| 5274 | VQUIT = 1, | ||
| 5275 | VERASE = 2, | ||
| 5276 | VKILL = 3, | ||
| 5277 | VEOF = 4, | ||
| 5278 | VTIME = 5, | ||
| 5279 | VMIN = 6, | ||
| 5280 | VSWTC = 7, | ||
| 5281 | VSTART = 8, | ||
| 5282 | VSTOP = 9, | ||
| 5283 | VSUSP = 10, | ||
| 5284 | VEOL = 11, | ||
| 5285 | VREPRINT = 12, | ||
| 5286 | VDISCARD = 13, | ||
| 5287 | VWERASE = 14, | ||
| 5288 | VLNEXT = 15, | ||
| 5289 | VEOL2 = 16, | ||
| 5290 | }, | ||
| 5291 | }; | ||
| 5176 | 5292 | ||
| 5177 | pub const TCSA = enum(c_uint) { | 5293 | pub const TCSA = enum(c_uint) { |
| 5178 | NOW, | 5294 | NOW, |
| ... | @@ -5181,15 +5297,27 @@ pub const TCSA = enum(c_uint) { | ... | @@ -5181,15 +5297,27 @@ pub const TCSA = enum(c_uint) { |
| 5181 | _, | 5297 | _, |
| 5182 | }; | 5298 | }; |
| 5183 | 5299 | ||
| 5184 | pub const termios = extern struct { | 5300 | pub const termios = switch (native_arch) { |
| 5185 | iflag: tcflag_t, | 5301 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => extern struct { |
| 5186 | oflag: tcflag_t, | 5302 | iflag: tc_iflag_t, |
| 5187 | cflag: tcflag_t, | 5303 | oflag: tc_oflag_t, |
| 5188 | lflag: tcflag_t, | 5304 | cflag: tc_cflag_t, |
| 5189 | line: cc_t, | 5305 | lflag: tc_lflag_t, |
| 5190 | cc: [NCCS]cc_t, | 5306 | cc: [NCCS]cc_t, |
| 5191 | ispeed: speed_t, | 5307 | line: cc_t, |
| 5192 | ospeed: speed_t, | 5308 | ispeed: speed_t, |
| 5309 | ospeed: speed_t, | ||
| 5310 | }, | ||
| 5311 | else => extern struct { | ||
| 5312 | iflag: tc_iflag_t, | ||
| 5313 | oflag: tc_oflag_t, | ||
| 5314 | cflag: tc_cflag_t, | ||
| 5315 | lflag: tc_lflag_t, | ||
| 5316 | line: cc_t, | ||
| 5317 | cc: [NCCS]cc_t, | ||
| 5318 | ispeed: speed_t, | ||
| 5319 | ospeed: speed_t, | ||
| 5320 | }, | ||
| 5193 | }; | 5321 | }; |
| 5194 | 5322 | ||
| 5195 | pub const SIOCGIFINDEX = 0x8933; | 5323 | pub const SIOCGIFINDEX = 0x8933; |