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.

IndexHeader

git.IndexHeader
const IndexHeader = struct

File

Code

const IndexHeader = struct {
    fan_out_table: [256]u32,

    const signature = "\xFFtOc";
    const supported_version = 2;
    const size = 4 + 4 + @sizeOf([256]u32);

    fn read(index_header: *IndexHeader, reader: *Io.Reader) !void {
        const sig = try reader.take(4);
        if (!mem.eql(u8, sig, signature)) return error.InvalidHeader;
        const version = try reader.takeInt(u32, .big);
        if (version != supported_version) return error.UnsupportedVersion;
        try reader.readSliceEndian(u32, &index_header.fan_out_table, .big);
    }
}