summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 11:42:48 -0300
committerGabriel Schneider <[email protected]>2026-11-19 11:42:48 -0300
commit71d8744b41dec56d835e30f531b96fede5d610a1 (patch)
tree31e2a06fdcfd467d12454cde8be5a477765701b5 /core/builtins.zig
parenteae5736ad923731135dd35b3783c90a3358bd0fa (diff)
parent4569aefd55d04f434f2e2ed5e6e4a511a414cdc7 (diff)
downloadpardes-71d8744b41dec56d835e30f531b96fede5d610a1.tar.gz
pardes-71d8744b41dec56d835e30f531b96fede5d610a1.zip
integration: the one client loop that the soak runs, with the tape as the handle a step is given: pardes-runners-b (10b: runtime/client.zig run by the terminal's client, the window's and the soak; a client's clipboard and links its own frontend's; an input sent before it is applied) and pardes-handle-1 (the handle's steps 0 to 2: p.tape, the directory listing and the file system read through the tape they are handed), merged without a conflict; gates in the coordinator's ledger
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index 6b291628..a79e4b66 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -493,7 +493,7 @@ pub const Restore = struct {
// name. Else a label of the state file's.
var full_buf: [4096]u8 = undefined;
var label_buf: [256]u8 = undefined;
- const file = if (typed) |t| dump.restoreFile(t, c.p.settings.dump_dir.get(), &full_buf) else null;
+ const file = if (typed) |t| dump.restoreFile(c.p.tape, t, c.p.settings.dump_dir.get(), &full_buf) else null;
const name = if (file) |path| path else pardes.tape.authority(pardes.Db.labelled, .{ &c.p.db, c.p, typed, @as([]u8, &label_buf) }) orelse {
var buf: pardes.Kind.Buf(320) = .{};
return c.p.reportFailure(c.id, if (typed) |t| buf.print("Restore: no dump labelled {s}", .{t}) else "Restore: no dump yet; name one");
@@ -503,7 +503,7 @@ pub const Restore = struct {
// the host reads it only after this step, where nobody hears.
// First, so a Restore that could never happen spends no warning.
if (file) |path| {
- const bytes = @import("fs.zig").readFile(c.p.gpa, path) catch |err| {
+ const bytes = @import("fs.zig").readFile(c.p.tape, c.p.gpa, path) catch |err| {
var buf: pardes.Kind.Buf(limits.host_path_cap + 160) = .{};
var words: [128]u8 = undefined;
const why = switch (err) {
@@ -583,7 +583,7 @@ pub const Mount = struct {
// A socket path that is not there: said so (ENOENT), not a dial
// that went unanswered.
const sock_path: ?[]const u8 = if (std.mem.startsWith(u8, dial, "unix!")) dial[5..] else if (dial.len > 0 and dial[0] == '/') dial else null;
- if (sock_path) |path| if (@import("exec.zig").kindOf(path) == null) {
+ if (sock_path) |path| if (@import("exec.zig").kindOf(c.p.tape, path) == null) {
if (c.p.fs.mounts.pop()) |gone| {
c.p.gpa.free(gone.name);
c.p.gpa.free(gone.dial);
@@ -850,7 +850,7 @@ pub const Get = struct {
// edits are asked about: there would be nothing to load over them.
if (typed.len > 0) if (@import("fs.zig").localPath(path)) |local| {
var said: pardes.Kind.Buf(320) = .{};
- const kind = exec.kindOf(local);
+ const kind = exec.kindOf(c.p.tape, local);
if (kind == null or kind.? == .directory)
return c.p.reportFailure(c.id, said.print("Get: {s}: {s}", .{ path[0..@min(path.len, 256)], if (kind == null) "no such file" else "is a directory" }));
};
@@ -909,8 +909,8 @@ pub const Incl = struct {
return p.reportFailure(c.id, said.print("Incl: invalid directory: {s} is relative", .{shown}));
var home_buf: [4096]u8 = undefined;
const expanded = p.expandHome(dir_word, &home_buf);
- if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(local) != .directory)
- return p.reportFailure(c.id, if (exec.kindOf(local) != null)
+ if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(p.tape, local) != .directory)
+ return p.reportFailure(c.id, if (exec.kindOf(p.tape, local) != null)
said.print("Incl: not a directory: {s}", .{shown})
else
said.print("Incl: no such directory: {s}", .{shown}));
@@ -1321,7 +1321,7 @@ pub const Config = struct {
/// directory.
fn openConfigFile(c: Ctx, name: []const u8, path: []const u8, initial: []const u8) void {
var real_buf: [4096]u8 = undefined;
- const real = if (pardes.filesystem.resolveOs(path, &real_buf)) |r| r.path else null;
+ const real = if (pardes.filesystem.resolveOs(c.p.tape, path, &real_buf)) |r| r.path else null;
for (c.p.panes, 0..) |slot, id| {
const pane = slot orelse continue;
const f = pane.file orelse continue;