library: client modules end in -client, like protocols end in -protocol

display-client and input-client (files and module names), so a service,
its wire contract, and its client never share a name: `display` the
service, `display-protocol` the contract, `display-client` a program's
view of it. The nine consumers' imports and their packages' declared
lists follow (regenerated from the source scan); build-support's
module_homes table carries the new names.
This commit is contained in:
Daniel Samson
2026-07-30 06:56:12 +01:00
parent 4476208361
commit e53d6ebafb
22 changed files with 36 additions and 32 deletions
+2 -2
View File
@@ -63,8 +63,8 @@ const module_homes = [_]ModuleHome{
.{ .name = "pci-class", .home = "device" },
.{ .name = "device-registry", .home = "device" },
// library/client — userspace service clients.
.{ .name = "display", .home = "client" },
.{ .name = "input", .home = "client" },
.{ .name = "display-client", .home = "client" },
.{ .name = "input-client", .home = "client" },
// library/protocol — the wire protocols.
.{ .name = "vfs-protocol", .home = "protocol" },
.{ .name = "input-protocol", .home = "protocol" },
+8 -5
View File
@@ -1,5 +1,8 @@
//! The "client" library domain (library/client): userspace-service clients —
//! they talk to services over IPC, not to the kernel.
//! they talk to services over IPC, not to the kernel. Client modules end in
//! `-client` the way wire protocols end in `-protocol`, so a service, its
//! protocol, and its client never share a name (`display` the service,
//! `display-protocol` the wire contract, `display-client` a program's view).
const std = @import("std");
@@ -10,16 +13,16 @@ pub fn build(b: *std.Build) void {
const ipc = kernel.module("ipc");
const time = kernel.module("time");
_ = b.addModule("display", .{
.root_source_file = b.path("display/display.zig"),
_ = b.addModule("display-client", .{
.root_source_file = b.path("display/display-client.zig"),
.imports = &.{
.{ .name = "ipc", .module = ipc },
.{ .name = "time", .module = time },
.{ .name = "display-protocol", .module = protocol.module("display-protocol") },
},
});
_ = b.addModule("input", .{
.root_source_file = b.path("input/input.zig"),
_ = b.addModule("input-client", .{
.root_source_file = b.path("input/input-client.zig"),
.imports = &.{
.{ .name = "ipc", .module = ipc },
.{ .name = "time", .module = time },
+2 -2
View File
@@ -17,7 +17,7 @@ pub fn build(b: *std.Build) void {
.name = "ps2-keyboard",
.root_source_file = b.path("keyboard.zig"),
.imports = &.{
"acpi-ids", "driver", "input", "input-protocol", "ipc", "logging", "memory",
"acpi-ids", "driver", "input-client", "input-protocol", "ipc", "logging", "memory",
"process", "time", "xkeyboard-config",
},
});
@@ -27,7 +27,7 @@ pub fn build(b: *std.Build) void {
.name = "ps2-mouse",
.root_source_file = b.path("mouse.zig"),
.imports = &.{
"acpi-ids", "driver", "input", "input-protocol", "ipc", "logging", "memory",
"acpi-ids", "driver", "input-client", "input-protocol", "ipc", "logging", "memory",
"process", "time",
},
});
+1 -1
View File
@@ -19,7 +19,7 @@ const device = @import("driver");
const ipc = @import("ipc");
const process = @import("process");
const time = @import("time");
const input = @import("input");
const input = @import("input-client");
const memory = @import("memory");
const logging = @import("logging");
const xkb = @import("xkeyboard-config");
+1 -1
View File
@@ -19,7 +19,7 @@ const device = @import("driver");
const ipc = @import("ipc");
const process = @import("process");
const time = @import("time");
const input = @import("input");
const input = @import("input-client");
const memory = @import("memory");
const logging = @import("logging");
const ps2 = @import("ps2-library.zig");
+4 -4
View File
@@ -10,8 +10,8 @@ pub fn build(b: *std.Build) void {
.name = "usb-hid-keyboard",
.root_source_file = b.path("keyboard.zig"),
.imports = &.{
"driver", "input", "input-protocol", "ipc", "logging", "process", "service", "usb",
"usb-abi", "xkeyboard-config",
"driver", "input-client", "input-protocol", "ipc", "logging", "process", "service",
"usb", "usb-abi", "xkeyboard-config",
},
});
b.installArtifact(usb_hid_keyboard_exe);
@@ -20,8 +20,8 @@ pub fn build(b: *std.Build) void {
.name = "usb-hid-mouse",
.root_source_file = b.path("mouse.zig"),
.imports = &.{
"driver", "input", "input-protocol", "ipc", "logging", "process", "service", "usb",
"usb-abi",
"driver", "input-client", "input-protocol", "ipc", "logging", "process", "service",
"usb", "usb-abi",
},
});
b.installArtifact(usb_hid_mouse_exe);
+1 -1
View File
@@ -18,7 +18,7 @@ const std = @import("std");
const ipc = @import("ipc");
const process = @import("process");
const service = @import("service");
const input = @import("input");
const input = @import("input-client");
const device_manager = @import("driver");
const logging = @import("logging");
const usb = @import("usb");
+1 -1
View File
@@ -14,7 +14,7 @@ const std = @import("std");
const ipc = @import("ipc");
const process = @import("process");
const service = @import("service");
const input = @import("input");
const input = @import("input-client");
const device_manager = @import("driver");
const logging = @import("logging");
const usb = @import("usb");
+3 -2
View File
@@ -10,8 +10,9 @@ pub fn build(b: *std.Build) void {
.name = "usb-xhci-bus",
.root_source_file = b.path("usb-xhci-bus.zig"),
.imports = &.{
"device-manager-protocol", "driver", "input", "ipc", "logging", "memory", "mmio",
"pci", "process", "service", "time", "usb-abi", "usb-ids", "usb-transfer-protocol",
"device-manager-protocol", "driver", "input-client", "ipc", "logging", "memory",
"mmio", "pci", "process", "service", "time", "usb-abi", "usb-ids",
"usb-transfer-protocol",
},
});
b.installArtifact(exe);
+1 -1
View File
@@ -19,7 +19,7 @@ const ipc = @import("ipc");
const process = @import("process");
const service = @import("service");
const time = @import("time");
const input = @import("input");
const input = @import("input-client");
const device_manager = @import("driver");
const memory = @import("memory");
const logging = @import("logging");
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "display-demo",
.root_source_file = b.path("display-demo.zig"),
.imports = &.{ "display", "logging", "time" },
.imports = &.{ "display-client", "logging", "time" },
});
b.installArtifact(exe);
}
@@ -11,7 +11,7 @@
//! is deliberately independent of the mouse.
const display = @import("display");
const display = @import("display-client");
const time = @import("time");
const logging = @import("logging");
pub fn main() void {
+2 -2
View File
@@ -10,8 +10,8 @@ pub fn build(b: *std.Build) void {
.name = "display",
.root_source_file = b.path("display.zig"),
.imports = &.{
"display", "display-protocol", "driver", "input", "ipc", "logging", "memory",
"scanout-protocol", "service", "thread", "time",
"display-client", "display-protocol", "driver", "input-client", "ipc", "logging",
"memory", "scanout-protocol", "service", "thread", "time",
},
.threaded = true, // real atomics/TLS (docs/threading.md)
});
+2 -2
View File
@@ -17,11 +17,11 @@
const std = @import("std");
const ipc = @import("ipc");
const input = @import("input");
const input = @import("input-client");
const Thread = @import("thread").Thread;
const service = @import("service");
const time = @import("time");
const display = @import("display");
const display = @import("display-client");
const memory = @import("memory");
const logging = @import("logging");
const compositor = @import("compositor.zig");
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "input",
.root_source_file = b.path("input.zig"),
.imports = &.{ "input", "input-protocol", "ipc", "logging", "process", "service" },
.imports = &.{ "input-client", "input-protocol", "ipc", "logging", "process", "service" },
});
b.installArtifact(exe);
}
+1 -1
View File
@@ -23,7 +23,7 @@ const std = @import("std");
const ipc = @import("ipc");
const process = @import("process");
const service = @import("service");
const input = @import("input");
const input = @import("input-client");
const logging = @import("logging");
const input_protocol = @import("input-protocol");
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "input-source",
.root_source_file = b.path("input-source.zig"),
.imports = &.{ "input", "logging", "process", "time" },
.imports = &.{ "input-client", "logging", "process", "time" },
});
b.installArtifact(exe);
}
@@ -11,7 +11,7 @@
//! decoded hardware is a follow-up (see docs/input.md).
const std = @import("std");
const input = @import("input");
const input = @import("input-client");
const process = @import("process");
const time = @import("time");
const logging = @import("logging");
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "input-test",
.root_source_file = b.path("input-test.zig"),
.imports = &.{ "input", "logging" },
.imports = &.{ "input-client", "logging" },
});
b.installArtifact(exe);
}
@@ -7,7 +7,7 @@
//! device classes to one subscription — source -> service -> subscriber, per device.
const std = @import("std");
const input = @import("input");
const input = @import("input-client");
const logging = @import("logging");
fn writeLine(comptime fmt: []const u8, arguments: anytype) void {