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.

confPathDepToCachePath

Maker.confPathDepToCachePath
fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep: Configuration.PathDep) Path

File

lib/compiler/Maker.zig:3690

Code

fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep: Configuration.PathDep) Path {
    const sub_path = path_dep.sub.slice(c);
    return switch (path_dep.flags.base) {
        .cwd => .{
            .root_dir = .cwd(),
            .sub_path = sub_path,
        },
        .local_cache => .{
            .root_dir = graph.local_cache_root,
            .sub_path = sub_path,
        },
        .global_cache => .{
            .root_dir = graph.global_cache_root,
            .sub_path = sub_path,
        },
        .build_root => .{
            .root_dir = switch (path_dep.pkg.unwrap().?) {
                .root => graph.build_root_directory,
                _ => @panic("TODO"),
            },
            .sub_path = sub_path,
        },
        .zig_lib => .{
            .root_dir = graph.zig_lib_directory,
            .sub_path = sub_path,
        },
        .zig_exe => @panic("TODO"),
        .install_prefix => @panic("TODO"),
        .install_lib => @panic("TODO"),
        .install_bin => @panic("TODO"),
        .install_include => @panic("TODO"),
    };
}