diff options
| -rw-r--r-- | core/File.zig | 2 | ||||
| -rw-r--r-- | core/Output.zig | 6 | ||||
| -rw-r--r-- | core/Plumb.zig | 3 | ||||
| -rw-r--r-- | core/Query.zig | 6 | ||||
| -rw-r--r-- | core/Store.zig | 2 | ||||
| -rw-r--r-- | core/Stream.zig | 2 | ||||
| -rw-r--r-- | core/builtins.zig | 6 | ||||
| -rw-r--r-- | core/mouse.zig | 2 | ||||
| -rw-r--r-- | core/ninep/events.zig | 2 | ||||
| -rw-r--r-- | core/ninep/tree.zig | 2 |
10 files changed, 16 insertions, 17 deletions
diff --git a/core/File.zig b/core/File.zig index 09dc44f1..820447ac 100644 --- a/core/File.zig +++ b/core/File.zig @@ -779,7 +779,7 @@ fn edit(p: *Pardes, f: *State, off: usize, len: usize, bytes_in: []const u8, who f.saved_revision = f.revision; }; // The clock the session that recorded read (core/tape.zig). - f.mtime = pardes.tape.value(.mtime, pardes.ctlfs.events.now, .{}); + f.mtime = p.tape.value(.mtime, pardes.ctlfs.events.now, .{}); if (f.highlights.len > 0) p.tree_sitter_gpa.free(f.highlights); f.highlights = &.{}; f.highlight_start = 0; diff --git a/core/Output.zig b/core/Output.zig index 1395b06f..750baf8f 100644 --- a/core/Output.zig +++ b/core/Output.zig @@ -532,7 +532,7 @@ pub fn openJumps(p: *Pardes, id: usize) !void { /// it (exec.operandAt), and a look at the line is the same (look.zig). /// Asked of the authority: the state file is its host's. pub fn openHistory(p: *Pardes, id: usize) !void { - const text = pardes.tape.authority(dumpsText, .{p}) orelse return error.NoStateFile; + const text = p.tape.authority(dumpsText, .{p}) orelse return error.NoStateFile; if (text.len == 0) return error.NoDumps; var out: std.Io.Writer.Allocating = .init(p.gpa); errdefer out.deinit(); @@ -723,7 +723,7 @@ pub fn openFonts(p: *Pardes, id: usize) !void { if (builtins.capabilities.font_picker) { // The session's machine's fonts, a question to its disk: a client's // replay takes the session's answer, never its own. - const content = try pardes.tape.site(.fonts, p.gpa, fontsListed, .{ p.gpa, p.scratch.allocator() }); + const content = try p.tape.site(.fonts, p.gpa, fontsListed, .{ p.gpa, p.scratch.allocator() }); try openStepped(p, id, .{ .cmd = .Fonts }, content); } } @@ -854,7 +854,7 @@ pub fn openConfig(p: *Pardes, id: usize) !void { try p.locations_config.write(&located.writer); try config.Runtime.writeReport(&out.writer, .{ .locations = located.written(), - .default_dump_dir = pardes.tape.authority(dumpDirectory, .{@as([]u8, &dir_buf)}), + .default_dump_dir = p.tape.authority(dumpDirectory, .{@as([]u8, &dir_buf)}), .startup_config_path = p.startupPath(), .platform = builtins.viewPlatform(p), .theme_name = p.theme().name, diff --git a/core/Plumb.zig b/core/Plumb.zig index a28ba5a8..fdb7ad8c 100644 --- a/core/Plumb.zig +++ b/core/Plumb.zig @@ -12,7 +12,6 @@ const fs = @import("fs.zig"); const look = @import("look.zig"); const layout = @import("layout.zig"); const Kind = @import("Kind.zig"); -const tape = @import("tape.zig"); const events = @import("ninep/events.zig"); const Regex = @import("regexp.zig").Regex; const Pardes = pardes.Pardes; @@ -901,7 +900,7 @@ pub fn send(p: *Pardes, from: ?usize, msg: Msg, seen: ?Seen) Sent { // whom only the authority knows (its 9P opens); with none, what the // rule set starts. const i = port orelse return .done; - if (tape.authority(portRead, .{ p, i })) { + if (p.tape.authority(portRead, .{ p, i })) { fanOut(p, i, &m); return .done; } diff --git a/core/Query.zig b/core/Query.zig index e8011a1f..ce83a6ac 100644 --- a/core/Query.zig +++ b/core/Query.zig @@ -719,7 +719,7 @@ fn startSource(p: *Pardes, id: usize, q: *Query, source: Source, owner_id: ?usiz .recent => { var out: std.Io.Writer.Allocating = .init(gpa); defer out.deinit(); - var lines = std.mem.splitScalar(u8, pardes.tape.authority(recentRows, .{ p, &out }), '\n'); + var lines = std.mem.splitScalar(u8, p.tape.authority(recentRows, .{ p, &out }), '\n'); while (lines.next()) |ln| { if (ln.len == 0) continue; const rel = relative(ln, dir); @@ -742,7 +742,7 @@ fn startSource(p: *Pardes, id: usize, q: *Query, source: Source, owner_id: ?usiz // `(closed)` and dimmer (makeNameRows): Enter brings one back // where it was. Its name alone is matched, not the word. The // session's, which a replica has from the authority. - for (pardes.tape.authority(Store.closedNames, .{p})) |c| { + for (p.tape.authority(Store.closedNames, .{p})) |c| { var buf: [4096 + 48]u8 = undefined; const row = std.fmt.bufPrint(&buf, config.pane_addr ++ "{d} {s}" ++ closed_word, .{ c.serial, relative(c.name, dir) }) catch continue; const key_at = std.mem.indexOfScalar(u8, row, ' ').? + 1; @@ -1668,7 +1668,7 @@ fn displayPreview(p: *Pardes, qid: usize, path: []const u8, at: look.Spot) void const f = &pane.file.?; if (!std.mem.eql(u8, f.path, path)) { if (exec.kindOf(p.tape, path)) |kind| if (kind != .file) return; - const bytes = pardes.tape.site(.preview, p.gpa, filesystem.read, .{ p, path }) catch return; + const bytes = p.tape.site(.preview, p.gpa, filesystem.read, .{ p, path }) catch return; if (std.mem.indexOfScalar(u8, bytes[0..@min(bytes.len, 8000)], 0) != null) { p.gpa.free(bytes); return; diff --git a/core/Store.zig b/core/Store.zig index 25b41bcb..0c46e7d9 100644 --- a/core/Store.zig +++ b/core/Store.zig @@ -192,7 +192,7 @@ pub fn closedBySerial(s: *const Store, serial: u32) ?*Closed { /// load; the keyboard on it otherwise. pub fn reopen(s: *Store, p: *Pardes, serial: u32, from: usize) bool { // This session's: a replica has the authority's (`tape.authority`). - const place = pardes.tape.authority(record, .{ s, serial }) orelse return false; + const place = p.tape.authority(record, .{ s, serial }) orelse return false; const free = p.freeSlot() orelse { p.reportError(from, "Panes", error.NoPaneSlots); return false; diff --git a/core/Stream.zig b/core/Stream.zig index d5246211..2d7cd018 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -652,7 +652,7 @@ pub fn runHere(p: *Pardes, gen: u32) void { // Its reads a site of the tape's (a 9P write's Grep or Find runs here): // a replica takes the batches the session got, as it takes a worker's // (Event.search), and reads no file. - const batches = pardes.tape.site(.search, p.gpa, searchHere, .{ p.gpa, job }); + const batches = p.tape.site(.search, p.gpa, searchHere, .{ p.gpa, job }); defer p.gpa.free(batches); for (batches) |*b| { receive(p, b); diff --git a/core/builtins.zig b/core/builtins.zig index a79e4b66..7add3d9c 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -494,7 +494,7 @@ pub const Restore = struct { var full_buf: [4096]u8 = undefined; var label_buf: [256]u8 = undefined; 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 { + const name = if (file) |path| path else c.p.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"); }; @@ -593,7 +593,7 @@ pub const Mount = struct { }; // A mount that cannot be reached is said now, and taken back, not // found out by the first look through it. - const reached = pardes.tape.site(.probe, null, @import("runtime").ninep_io.Client.probeMount, .{ c.p.gpa, dial }); + const reached = c.p.tape.site(.probe, null, @import("runtime").ninep_io.Client.probeMount, .{ c.p.gpa, dial }); reached catch |err| { if (c.p.fs.mounts.pop()) |gone| { c.p.gpa.free(gone.name); @@ -1182,7 +1182,7 @@ pub const Term = struct { if (arg.len > 0) { var why: [320]u8 = undefined; // The authority's lookup, taped, as Shell's (exec.zig). - if (pardes.tape.site(.shell, null, @import("dev").host_io.Shell.refusal, .{ arg[0..@min(arg.len, 200)], &why })) |refused| { + if (c.p.tape.site(.shell, null, @import("dev").host_io.Shell.refusal, .{ arg[0..@min(arg.len, 200)], &why })) |refused| { var said: pardes.Kind.Buf(340) = .{}; return c.p.reportFailure(c.id, said.print("Term: {s}", .{refused})); } diff --git a/core/mouse.zig b/core/mouse.zig index 8e761453..6fb97787 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -974,7 +974,7 @@ pub fn reportRange( chord_arg: ?[]const u8, ) bool { const scripted = p.panes[id] orelse return false; - if (!pardes.tape.authority(readsEvents, .{ p, id })) return false; + if (!p.tape.authority(readsEvents, .{ p, id })) return false; const is_look = cmd == config.look_cmd; const action: ctlfs.events.Action = if (is_look) (if (on_tag) .tag_look else .body_look) diff --git a/core/ninep/events.zig b/core/ninep/events.zig index 2d539cca..1e740345 100644 --- a/core/ninep/events.zig +++ b/core/ninep/events.zig @@ -158,7 +158,7 @@ pub fn announce(p: *Pardes) void { /// joined from a dump, is empty, and its step must not announce (taped /// reads, Recent's) where the session's, booted long ago, does not. fn bootFirst(p: *Pardes) void { - if (newest(p) == null and !pardes.tape.replaying()) announce(p); + if (newest(p) == null and !p.tape.replaying()) announce(p); } /// Records `<kind> <serial> <name>`. diff --git a/core/ninep/tree.zig b/core/ninep/tree.zig index 85723991..d5a6b2fe 100644 --- a/core/ninep/tree.zig +++ b/core/ninep/tree.zig @@ -1147,7 +1147,7 @@ fn readFile(p: *Pardes, req: Req, target: Target) Reply { .sessions => sessions: { if (comptime !daemon.supported) break :sessions stagedReply(p, req); // Out of the turn: the daemon answers within 2 s, or not at all. - const said = pardes.tape.site(.sessions, p.gpa, daemonList, .{p.gpa}) catch |err| break :sessions switch (err) { + const said = p.tape.site(.sessions, p.gpa, daemonList, .{p.gpa}) catch |err| break :sessions switch (err) { error.OutOfMemory => Reply.fail(req.tag, E.NOMEM), else => failText(req.tag, E.NOENT, "no pardes daemon answers"), }; |
