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.
fnwindowsApiWriteMarker(io: Io) WindowsApiError!void {
// Write the marker that we will use to find the beginning of the progress when clearing.
// Note: This doesn't have to use WriteConsoleW, but doing so avoids dealing with the code page.
constterminal = global_progress.terminal;
varwrite_console = windows.CONSOLE.USER_IO.WRITE(.WideCharacter);
constbuffer = [1]windows.WCHAR{windows_api_start_marker};
switch ((tryio.operate(.{ .device_io_control = .{
.file = terminal,
.code = windows.IOCTL.CONDRV.ISSUE_USER_IO,
.in = @ptrCast(&write_console.request(null, 1, .{
.{ .Size = @sizeOf(@TypeOf(buffer)), .Pointer = &buffer },
}, 0, .{})),
} })).device_io_control.u.Status) {
.SUCCESS => {},
.CANCELLED => unreachable,
else => |status| returnwindows.unexpectedStatus(status),
}
}