summaryrefslogtreecommitdiff
path: root/core/tape.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/tape.zig')
-rw-r--r--core/tape.zig10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/tape.zig b/core/tape.zig
index d1e0527c..f231831d 100644
--- a/core/tape.zig
+++ b/core/tape.zig
@@ -140,6 +140,9 @@ pub const Site = enum(u16) {
/// A kitty image's medium as a terminal's emulator read it (a file, a
/// temporary file, shared memory: Term.media), its bytes or its failure.
medium,
+ /// Whether a terminal holds a kitty image after its program's output
+ /// (Pane.term_images): a screen-state replica's emulator never has one.
+ images,
};
/// What the sites return. wire.semantics hashes their shape with the
@@ -948,11 +951,11 @@ const pane_fields = walk.fieldNames(pardes.Pane);
const file_fields = walk.fieldNames(pardes.panes.File.State);
const places_fields = walk.fieldNames(pardes.panes.Places);
const view_fields = walk.fieldNames(Pardes.View);
-const Parts = [pardes_fields.len + stream_fields.len + pardes.views.max * view_fields.len + pardes.MAX_PANES * (2 + pane_fields.len + file_fields.len + places_fields.len)]u64;
+pub const Parts = [pardes_fields.len + stream_fields.len + pardes.views.max * view_fields.len + pardes.MAX_PANES * (2 + pane_fields.len + file_fields.len + places_fields.len)]u64;
/// The session's digest as one per field of the core's, its stream's, and
/// each pane's and its file's, so a divergence says where it is.
-fn digestParts(p: *const Pardes, parts: *Parts) []const u64 {
+pub fn digestParts(p: *const Pardes, parts: *Parts) []const u64 {
var n = walk.fieldDigests(Pardes, p, parts[0..pardes_fields.len]).len;
n += walk.fieldDigests(pardes.Stream, &p.stream, parts[n..][0..stream_fields.len]).len;
for (&p.views) |*slot| if (slot.*) |*v| {
@@ -974,7 +977,7 @@ fn digestParts(p: *const Pardes, parts: *Parts) []const u64 {
}
/// The fields whose digests differ, named.
-fn partsDiffer(got: []const u64, want: []const u64, a: std.mem.Allocator) []const u8 {
+pub fn partsDiffer(got: []const u64, want: []const u64, a: std.mem.Allocator) []const u8 {
var said: std.ArrayList(u8) = .empty;
if (got.len != want.len) said.print(a, "the panes there are ({d} parts, {d} recorded); ", .{ got.len, want.len }) catch {};
const n = @min(got.len, want.len);
@@ -1312,6 +1315,7 @@ pub fn recordDigest(t: *Tape) void {
t.record(.digest, []const u64, &d);
}
+
/// A core made outside the tape (a replica client's, from a dump) is the
/// one it replays into.
pub fn adoptCore(t: *Tape, p: *Pardes) void {