summaryrefslogtreecommitdiff
path: root/src/9p.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 20:52:50 -0300
committerGabriel Schneider <[email protected]>2026-11-18 21:22:58 -0300
commita75956bb3443aa8aac778d2ff12c42f5ef99e0e9 (patch)
tree17547cbf6606c8bd05be313cd8f835cb85d13e57 /src/9p.zig
parent5b33c88476054fffc1044fff0526f7f0b28563cf (diff)
downloadpardes-a75956bb3443aa8aac778d2ff12c42f5ef99e0e9.tar.gz
pardes-a75956bb3443aa8aac778d2ff12c42f5ef99e0e9.zip
runtime: main, daemon, upgrade, crash, addon_test, 9p_io, 9p and macos.zig into runtime/ (the reorganisation's tree, step 2a), skill.txt with main.zig, its one reader: module `runtime` (runtime/root.zig) and the core, each naming the other, a product's root (main.zig, macos.zig) a module of its own over both; the files name across by module (`@import("runtime").daemon`, `@import("core").look`), pardes.zig exporting what they name (ctl, edit_cmd, tracy, selection_pipe, and the frontends until they move); core-test and shell-test run each module's test program, so the same tests run (the ledger: every named test of every suite the base's, tui and gui); nothing else changes: frames byte-identical, the same counts (tui core-test 822/963, the one more an anonymous collector)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/9p.zig')
-rw-r--r--src/9p.zig72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/9p.zig b/src/9p.zig
deleted file mode 100644
index 61715750..00000000
--- a/src/9p.zig
+++ /dev/null
@@ -1,72 +0,0 @@
-//! The editor's 9P surface. The wire protocol, the client, the transports
-//! and the file-server engine (`cloud9.fs.Server`) live in cloud9; this
-//! module names the engine configuration Pardes builds, the editor's, and
-//! re-exports what the transports use.
-const cloud9 = @import("cloud9");
-pub const fs = cloud9.fs;
-pub const Server = cloud9.fs.Server;
-pub const header_len = cloud9.header_len;
-pub const notag = cloud9.notag;
-pub const nofid = cloud9.nofid;
-pub const max_welem = cloud9.max_welem;
-pub const Qid = cloud9.Qid;
-pub const Stat = cloud9.Stat;
-pub const Msg = cloud9.Msg;
-pub const Decoded = cloud9.Decoded;
-pub const frameLen = cloud9.frameLen;
-pub const encode = cloud9.encode;
-pub const decode = cloud9.decode;
-pub const qtdir = cloud9.qtdir;
-pub const Client = cloud9.Client;
-pub const oread = cloud9.oread;
-pub const owrite = cloud9.owrite;
-pub const ordwr = cloud9.ordwr;
-pub const otrunc = cloud9.otrunc;
-pub const errmax = cloud9.fs.errmax;
-pub const errString = cloud9.fs.errString;
-pub const msize_min = cloud9.fs.msize_min;
-
-/// The smallest msize a native listener offers (src/9p_io.zig).
-pub const min_msize: u32 = 4096;
-/// What a native listener negotiates.
-pub const msize: u32 = 65536;
-
-/// The editor's engine: native fid count, native file names, and room to
-/// park a write of any size a frame can carry -- a request that would change
-/// a pane while the editor is out in a syscall waits in the engine
-/// (src/9p_io.zig, `serve`), and a write it cannot keep would fail instead.
-/// The largest write is msize less the Twrite header, 23 bytes (the test
-/// below asks a client), one byte more than `iohdrsz` allows for.
-/// Up to 128 reads held on one connection (a follower each of the log or
-/// an event file); the next is refused `too many reads waiting: 128`. A
-/// mount (9ns) keeps a wider window, 256, so held reads never take every
-/// one of its workers.
-pub const editor: cloud9.fs.Options = .{ .fid_capacity = max_fids, .name_capacity = 255, .park_data_max = msize - 23, .slot_capacity = max_held };
-
-pub const max_held: usize = 128;
-pub const max_fids: usize = 256;
-
-const std = @import("std");
-const testing = std.testing;
-
-const Stub = struct {
- pub const Req = cloud9.fs.Req;
- pub const Reply = cloud9.fs.Reply;
-};
-
-test "9p server: the editor's engine can park the largest write a client sends" {
- var in: [4096]u8 = undefined;
- var out: [4096]u8 = undefined;
- var client: Client = .init(.{ .in = &in, .out = &out });
- client.msize = msize;
- try testing.expect(editor.park_data_max >= client.maxWrite());
-}
-
-test "9p server: the editor's capacities size the actual fid storage" {
- const Native = Server(Stub, editor);
- const NativeFids = @FieldType(Native, "fids");
- try testing.expectEqual(256, @typeInfo(NativeFids).array.len);
- try testing.expectEqual(255, @sizeOf(@FieldType(Native.Fid, "name")));
- try testing.expectEqual(256 * @sizeOf(Native.Fid), @sizeOf(NativeFids));
- try testing.expect(min_msize >= msize_min);
-}