diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 06:24:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 11:19:32 -0300 |
| commit | 0893d632e242553390d968751fff0e880627c34a (patch) | |
| tree | 154e40245fd97bf399efa2cc99872b5a48b1d0a0 /src/Addon.zig | |
| parent | 7ccbb0fa852e327b6663ba933f134d5013484007 (diff) | |
| download | pardes-0893d632e242553390d968751fff0e880627c34a.tar.gz pardes-0893d632e242553390d968751fff0e880627c34a.zip | |
kinds #12, ABI 2.1: pardes_addon.h grows at the ends of its records (pa_api's heap, view, exec and select, pa_paint's rail thumb, pa_ops's search, PA_WHEEL_LEFT and RIGHT) and the core reads them only from a 2.1 head: Esc goes to a 2.1 kind first, a press's drag and release stay its own and the pointer leaving is told, tick comes again on a view change, a kind's search rows, place, Exec and selection are taped, the jobs a call asks are emitted on every core from its taped outcome, a Shadow lays its tag out from the authority's prefix and keeps its tick state when it joins, a view's raster is its frontend's, and fake.c and snake.c leave Esc to the core
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Addon.zig')
| -rw-r--r-- | src/Addon.zig | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Addon.zig b/src/Addon.zig index 6955741d..9f94f1de 100644 --- a/src/Addon.zig +++ b/src/Addon.zig @@ -65,13 +65,19 @@ pub fn perform(p: *Pardes, op: Op, pane: u8, arg: []const u8) void { }; return; } - var data_buf: [4096]u8 = undefined; var words: [64]LoadedWord = undefined; var why: Why = .{}; - const l = read(dataDir(&data_buf), arg, &words, &why); + const l = readLoaded(arg, &words, &why); p.update(.{ .addon = .{ .op = op, .pane = pane, .kind = &l } }); } +/// What a load reads off the library at `path` (held): the `addon` +/// event's, for a caller that steps its core itself (a replica's authority). +pub fn readLoaded(path: []const u8, words: *[64]LoadedWord, why: *Why) Loaded { + var data_buf: [4096]u8 = undefined; + return read(dataDir(&data_buf), path, words, why); +} + /// The library at `path`, held (a second hold of the same bytes is the /// first's library) and checked: what it brings, or why not. fn read(data: []const u8, path: []const u8, words: *[64]LoadedWord, why: *Why) Loaded { @@ -327,7 +333,13 @@ pub fn loadedOf(ops: *const Kind.Ops, path: []const u8, hash: [32]u8, words: *[6 .exts = if (h.exts == null) "" else std.mem.span(h.exts), .words = words[0..head_words.len], .ops = @intFromPtr(ops), - .caps = .{ .tick = ops.tick != null, .key = ops.key != null, .mouse = ops.mouse != null, .ctl = ops.ctl != null, .jobs = ops.job_run != null, .load = ops.load != null }, + .caps = .{ + .tick = ops.tick != null, .key = ops.key != null, .mouse = ops.mouse != null, .ctl = ops.ctl != null, .jobs = ops.job_run != null, .load = ops.load != null, + // 2.1's: a library of 2.0 has no `search` to read, and Esc leaves it. + .search = h.abi & 0xffff >= 1 and ops.search != null, + .esc = h.abi & 0xffff >= 1 and ops.key != null, + .address = ops.address != null, + }, }; } |
