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.

initIncludeDirList

Serialize.initIncludeDirList
fn initIncludeDirList(
    s: *Serialize,
    list: []const std.Build.Module.IncludeDir,
) ![]const Configuration.Module.IncludeDir

File

lib/std/Build/Serialize.zig:1020

Code

fn initIncludeDirList(
    s: *Serialize,
    list: []const std.Build.Module.IncludeDir,
) ![]const Configuration.Module.IncludeDir {
    const result = try s.arena.alloc(Configuration.Module.IncludeDir, list.len);
    for (result, list) |*dest, src| dest.* = switch (src) {
        .path => |lp| .{ .path = try addLazyPath(s, lp) },
        .path_system => |lp| .{ .path_system = try addLazyPath(s, lp) },
        .path_after => |lp| .{ .path_after = try addLazyPath(s, lp) },
        .framework_path => |lp| .{ .framework_path = try addLazyPath(s, lp) },
        .framework_path_system => |lp| .{ .framework_path_system = try addLazyPath(s, lp) },
        .embed_path => |lp| .{ .embed_path = try addLazyPath(s, lp) },
        .other_step => |cs| .{ .path = try addLazyPath(s, cs.installed_headers_include_tree.?.getDirectory()) },
        .config_header_step => |chs| .{ .config_header_step = stepIndex(s, &chs.step) },
    };
    return result;
}