This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
pubfnfinishBuild(ws: *WebServer, opts: struct {
fuzz: bool,
}) void {
constconfigured = &ws.configured.?;
constmaker = configured.maker;
constall_steps = maker.step_stack.keys();
if (opts.fuzz) {
switch (builtin.os.tag) {
// Current implementation depends on two things that need to be ported to Windows:
// * Memory-mapping to share data between the fuzzer and build runner.
// * COFF/PE support added to `std.debug.Info` (it needs a batching API for resolving
// many addresses to source locations).
.windows => std.process.fatal("--fuzz not yet implemented for {t}", .{builtin.os.tag}),
else => {},
}
if (@bitSizeOf(usize) != 64) {
// Current implementation depends on posix.mmap()'s second
// parameter, `length: usize`, being compatible with file system's
// u64 return value. This is not the case on 32-bit platforms.
// Affects or affected by issues #5185, #22523, and #22464.
std.process.fatal("--fuzz not yet implemented on {d}-bit platforms", .{@bitSizeOf(usize)});
}
assert(ws.fuzz == null);
ws.build_status.store(.fuzz_init, .monotonic);
ws.notifyUpdate();
ws.fuzz = Fuzz.init(maker, all_steps, ws.root_prog_node, .{ .forever = .{ .ws = ws } }) catch |err|
std.process.fatal("failed to start fuzzer: {t}", .{err});
ws.fuzz.?.start();
}
ws.build_status.store(if (maker.watch) .watchingelse .idle, .monotonic);
ws.notifyUpdate();
}