diff options
Diffstat (limited to 'abi/term.zig')
| -rw-r--r-- | abi/term.zig | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/abi/term.zig b/abi/term.zig index 37519309..187b99e5 100644 --- a/abi/term.zig +++ b/abi/term.zig @@ -308,6 +308,14 @@ pub const Parts = struct { /// What reading its text can fail with. pub const TextError = error{ OutOfMemory, WriteFailed, UnknownPoint }; +/// How a kitty image's medium is had (a file, a temporary file, shared +/// memory: things of the session's machine): `read(ctx)` is the emulator's +/// own read (which deletes a temporary file and unlinks shared memory), +/// its bytes `gpa`'s (core/Term.zig `media`). +pub const Media = *const fn (ctx: *const anyopaque, read: *const fn (ctx: *const anyopaque) MediumError![]u8, gpa: std.mem.Allocator) MediumError![]u8; +/// What ghostty's loader fails a medium's read with. +pub const MediumError = error{ OutOfMemory, InvalidData, UnsupportedMedium, DimensionsTooLarge, TemporaryFileNotInTempDir, TemporaryFileNotNamedCorrectly }; + /// The entries, as `term.ops` gives them. An error set named here is what /// the core's callers name (the tape's `Failure` reads `open`'s, the text /// readers' are edit.zig's); `anyerror` where the core only passes one on @@ -347,8 +355,9 @@ pub const Ops = struct { /// Its emulator made again from its own snapshot where it is (a join: /// every side does it); the snapshot's hash. reload: *const fn (s: *State) anyerror!u64, - /// Its program's kitty images by direct data alone (a replica's). - direct: *const fn (s: *State) void, + /// How every terminal in the process has a kitty image's medium from + /// now on (the core's: a recorded answer). + media: *const fn (read: Media) void, // ---- output and view ---- /// One read of its program's output (`Told` says where the tracked |
