From bfeefd0cbdbdd7e2b1712253ac81e3e8ba09283b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 8 Jun 2026 22:36:33 -0300 Subject: fixing 0.16 errors and cleanup --- src/gloves.zig | 74 ---------------------------------------------------------- src/shock.zig | 13 ----------- 2 files changed, 87 deletions(-) delete mode 100644 src/gloves.zig (limited to 'src') diff --git a/src/gloves.zig b/src/gloves.zig deleted file mode 100644 index 0ef2481..0000000 --- a/src/gloves.zig +++ /dev/null @@ -1,74 +0,0 @@ -const std = @import("std"); - -// https://github.com/ghostty-org/ghostty/blob/9fb03ba55c9e53901193187d5c43341f5b1b430d/src/pty.zig#L11 -pub const winsize = extern struct { - ws_row: u16 = 100, - ws_col: u16 = 80, - ws_xpixel: u16 = 800, - ws_ypixel: u16 = 600, -}; - -var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init; -const alloc = gpa.allocator(); -const ArrayList = std.ArrayList; - -pub fn main() !void { - // // var child = std.process.Child.init(&.{ "cat", "-" }, alloc); - // var child = std.process.Child.init(&.{"./study-samples/split"}, alloc); - // child.stdin_behavior = .Pipe; - // child.stdout_behavior = .Pipe; - // child.stderr_behavior = .Pipe; - - // var stdin_buf: [0x100]u8 = undefined; - // var stdin = std.fs.File.stdin().readerStreaming(&stdin_buf); - - // var stdout: ArrayList(u8) = .empty; - // defer stdout.deinit(alloc); - // var stderr: ArrayList(u8) = .empty; - // defer stderr.deinit(alloc); - - // try child.spawn(); - // errdefer { - // _ = child.kill() catch {}; - // } - - // var child_writer_buf: [0x100]u8 = undefined; - // var child_stdin_writer = child.stdin.?.writer(&child_writer_buf); - - // while (true) { - // if (stdin.interface.streamDelimiter(&child_stdin_writer.interface, '\n')) |_| {} else |e| { - // switch (e) { - // error.EndOfStream => { - // std.debug.print("end of stream\n", .{}); - // break; - // }, - // else => {}, - // } - // break; - // } - // _ = try child_stdin_writer.interface.writeByte('\n'); - // if (child_stdin_writer.interface.flush()) |_| {} else |_| { - // break; - // } - // } - - // child.collectOutput(alloc, &stdout, &stderr, 0x1000) catch {}; - // std.debug.print("{s}\n {s}\n", .{ stdout.items, stderr.items }); - - // const term = try child.wait(); - // switch (term) { - // .Signal => |s| { - // inline for (@typeInfo(std.os.linux.SIG).@"struct".decls) |f| { - // const field = @field(std.os.linux.SIG, f.name); - // const t = @TypeOf(field); - // if (t == comptime_int) { - // if (field == s) - // std.debug.print("Returned with Signal: {s} ({d})\n", .{ f.name, s }); - // } - // } - // }, - // else => std.debug.print("{any}\n", .{ .term = term }), - // } - - // // std.debug.print("*** If you this message alone... Something probably went wrong\nIs this leaking? {any}\n", .{gpa.detectLeaks()}); -} diff --git a/src/shock.zig b/src/shock.zig index 90e6edf..b2abba8 100644 --- a/src/shock.zig +++ b/src/shock.zig @@ -18,17 +18,6 @@ pub fn main(init: std.process.Init.Minimal) !void { defer threaded.deinit(); const io = threaded.io(); - // var evented: std.Io.Evented = undefined; - // try evented.init(alloc, .{ - // .argv0 = .init(init.args), - // .environ = init.environ, - // .backing_allocator_needs_mutex = false, - // }); - // defer evented.deinit(); - // const io = evented.io(); - - // const f = try std.Io.Dir.cwd().openFile(io, subject, .{ .mode = .read_only }); - // std.debug.print("file: {any}\n", .{f}); var child = try std.process.spawn(io, .{ .argv = &.{subject}, .stdout = .pipe, @@ -41,10 +30,8 @@ pub fn main(init: std.process.Init.Minimal) !void { std.debug.print("spawned child: {any}\n", .{child}); - // io.async(function: anytype, args: (unknown type)) var child_fut = io.async(std.process.Child.wait, .{ &child, io }); const child_out = try child_fut.await(io); - // const child_out = try child.wait(io); std.debug.print("stdout: {s}\n", .{buf}); { -- cgit v1.3