Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

load

Public Function
std.Build.Configuration.load
pub fn load(arena: Allocator, reader: *Io.Reader) LoadError!Configuration

Params

File

Build/Configuration.zig:3129
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
pub fn load(arena: Allocator, reader: *Io.Reader) LoadError!Configuration {
    const header = try reader.takeStruct(Header, .native);
    const result: Configuration = .{
        .string_bytes = try arena.alloc(u8, header.string_bytes_len),
        .steps = try arena.alloc(Step, header.steps_len),
        .path_deps = try arena.alloc(PathDep, header.path_deps_len),
        .unlazy_deps = try arena.alloc(String, header.unlazy_deps_len),
        .system_integrations = try arena.alloc(SystemIntegration, header.system_integrations_len),
        .available_options = try arena.alloc(AvailableOption, header.available_options_len),
        .search_prefixes = try arena.alloc(String, header.search_prefixes_len),
        .extra = try arena.alloc(u32, header.extra_len),
        .default_step = header.default_step,
        .generated_files_len = header.generated_files_len,
        .poisoned = header.flags.poisoned,
    };
    var vecs = [_][]u8{
        result.string_bytes,
        @ptrCast(result.steps),
        @ptrCast(result.path_deps),
        @ptrCast(result.unlazy_deps),
        @ptrCast(result.system_integrations),
        @ptrCast(result.available_options),
        @ptrCast(result.search_prefixes),
        @ptrCast(result.extra),
    };
    try reader.readVecAll(&vecs);
    return result;
}