Zig 0.17.0-dev (Split by item)

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.

populateGeneratedStdIo

Run.populateGeneratedStdIo
fn populateGeneratedStdIo(
    maker: *Maker,
    conf_run: *const Configuration.Step.Run,
    cache_root: Cache.Directory,
    digest: *const Cache.HexDigest,
) !void

File

Code

fn populateGeneratedStdIo(
    maker: *Maker,
    conf_run: *const Configuration.Step.Run,
    cache_root: Cache.Directory,
    digest: *const Cache.HexDigest,
) !void {
    const conf = &maker.scanned_config.configuration;
    const graph = maker.graph;

    if (conf_run.captured_stdout.value) |captured| {
        maker.generatedPath(captured.generated_file).* = .{
            .root_dir = cache_root,
            .sub_path = try Dir.path.join(graph.arena, &.{
                "o", digest, captured.basename.slice(conf),
            }),
        };
    }

    if (conf_run.captured_stderr.value) |captured| {
        maker.generatedPath(captured.generated_file).* = .{
            .root_dir = cache_root,
            .sub_path = try Dir.path.join(graph.arena, &.{
                "o", digest, captured.basename.slice(conf),
            }),
        };
    }
}