diff options
| author | 2024-02-19 23:38:33 +0200 | |
|---|---|---|
| committer | 2024-02-19 23:38:33 +0200 | |
| commit | d5d5f7f06397d73f497d352f2f38b1a53d932b0d (patch) | |
| tree | 63e34f5f945f4ecf28f844ee02a5a0b7fc581459 /src/RawMode.zig | |
| parent | Create parent directory if doesn't exist on save (diff) | |
| download | es-d5d5f7f06397d73f497d352f2f38b1a53d932b0d.tar.gz es-d5d5f7f06397d73f497d352f2f38b1a53d932b0d.tar.xz es-d5d5f7f06397d73f497d352f2f38b1a53d932b0d.zip | |
Big update to modern zig
Diffstat (limited to 'src/RawMode.zig')
| -rw-r--r-- | src/RawMode.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/RawMode.zig b/src/RawMode.zig index 7298922..f657ac8 100644 --- a/src/RawMode.zig +++ b/src/RawMode.zig | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | const linux = std.os.linux; | 1 | const system = std.os.system; |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | const RawMode = @This(); | 4 | const RawMode = @This(); |
| @@ -14,16 +14,16 @@ pub fn init() !RawMode { | |||
| 14 | var raw = orig; | 14 | var raw = orig; |
| 15 | 15 | ||
| 16 | raw.iflag &= ~@as( | 16 | raw.iflag &= ~@as( |
| 17 | linux.tcflag_t, | 17 | system.tcflag_t, |
| 18 | linux.BRKINT | linux.ICRNL | linux.INPCK | linux.ISTRIP | linux.IXON, | 18 | system.BRKINT | system.ICRNL | system.INPCK | system.ISTRIP | system.IXON, |
| 19 | ); | 19 | ); |
| 20 | raw.lflag &= ~@as(linux.tcflag_t, linux.ECHO | linux.ICANON | linux.IEXTEN | linux.ISIG); | 20 | raw.lflag &= ~@as(system.tcflag_t, system.ECHO | system.ICANON | system.IEXTEN | system.ISIG); |
| 21 | raw.oflag &= ~@as(linux.tcflag_t, linux.OPOST); | 21 | raw.oflag &= ~@as(system.tcflag_t, system.OPOST); |
| 22 | 22 | ||
| 23 | raw.cflag |= linux.CS8; | 23 | raw.cflag |= system.CS8; |
| 24 | 24 | ||
| 25 | raw.cc[linux.V.MIN] = 0; | 25 | raw.cc[system.V.MIN] = 0; |
| 26 | raw.cc[linux.V.TIME] = 1; | 26 | raw.cc[system.V.TIME] = 1; |
| 27 | 27 | ||
| 28 | try std.os.tcsetattr(std.os.STDIN_FILENO, .FLUSH, raw); | 28 | try std.os.tcsetattr(std.os.STDIN_FILENO, .FLUSH, raw); |
| 29 | 29 | ||