aboutsummaryrefslogtreecommitdiff
path: root/src/tui.zig
diff options
context:
space:
mode:
authorJulien Dessaux2024-11-22 09:27:23 +0100
committerJulien Dessaux2024-11-22 09:28:09 +0100
commit06468c1272035fcacf6d46a80b5738b55cffae38 (patch)
tree55ae36dc5c9d25cbf73da49c6bd6c887fe79605f /src/tui.zig
parentRemoved useless testing boilerplate (diff)
downloadzigfunge98-master.tar.gz
zigfunge98-master.tar.bz2
zigfunge98-master.zip
zig 0.12 and 0.13 changesHEADmaster
Diffstat (limited to 'src/tui.zig')
-rw-r--r--src/tui.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tui.zig b/src/tui.zig
index 8c4145f..55a848b 100644
--- a/src/tui.zig
+++ b/src/tui.zig
@@ -15,7 +15,7 @@ pub fn main() anyerror!void {
defer std.process.argsFree(gpa, args);
if (args.len < 2) {
std.debug.print("Usage: {s} <b98_file_to_run>\n", .{args[0]});
- std.os.exit(1);
+ std.posix.exit(1);
}
var file = try std.fs.cwd().openFile(args[1], .{});
@@ -29,19 +29,19 @@ pub fn main() anyerror!void {
//--- Term initialization -------------------------------------------------
try term.init(.{});
- defer term.deinit();
+ defer term.deinit() catch {};
- try std.os.sigaction(std.os.SIG.WINCH, &std.os.Sigaction{
+ try std.posix.sigaction(std.posix.SIG.WINCH, &std.posix.Sigaction{
.handler = .{ .handler = handleSigWinch },
- .mask = std.os.empty_sigset,
+ .mask = std.posix.empty_sigset,
.flags = 0,
}, null);
- var fds: [1]std.os.pollfd = undefined;
+ var fds: [1]std.posix.pollfd = undefined;
if (term.tty) |tty| {
fds[0] = .{
.fd = tty,
- .events = std.os.POLL.IN,
+ .events = std.posix.POLL.IN,
.revents = undefined,
};
}
@@ -56,7 +56,7 @@ pub fn main() anyerror!void {
var buf: [16]u8 = undefined;
var done = false;
while (!done) {
- _ = try std.os.poll(&fds, -1);
+ _ = try std.posix.poll(&fds, -1);
const read = try term.readInput(&buf);
var it = spoon.inputParser(buf[0..read]);
@@ -67,11 +67,11 @@ pub fn main() anyerror!void {
} else if (in.eqlDescription("s")) {
if (try intp.step(&ioContext)) |code| {
try term.cook();
- term.deinit();
+ term.deinit() catch {};
intp.deinit();
file.close();
std.process.argsFree(gpa, args);
- std.os.exit(@intCast(code));
+ std.posix.exit(@intCast(code));
}
try render();
}