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.

CodePage

code_pages.CodePage
pub const CodePage = blk:

File

lib/compiler/resinator/code_pages.zig:180

Code

pub const CodePage = blk: {
    const field_names = @typeInfo(SupportedCodePage).@"enum".field_names ++ @typeInfo(UnsupportedCodePage).@"enum".field_names;
    const field_values = @typeInfo(SupportedCodePage).@"enum".field_values ++ @typeInfo(UnsupportedCodePage).@"enum".field_values;
    var cp_field_names: [field_names.len][]const u8 = undefined;
    var cp_field_values: [field_names.len]u16 = undefined;
    for (field_names, field_values, &cp_field_names, &cp_field_values) |field_name, field_value, *name, *val| {
        name.* = field_name;
        val.* = field_value;
    }
    break :blk @Enum(u16, .exhaustive, &cp_field_names, &cp_field_values);
}