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.

IncludeGuardFmt

ConfigHeader.IncludeGuardFmt
const IncludeGuardFmt = struct

File

lib/compiler/Maker/Step/ConfigHeader.zig:399

Code

const IncludeGuardFmt = struct {
    include_path: []const u8,
    override: ?[]const u8,

    pub fn format(this: @This(), w: *Writer) Writer.Error!void {
        if (this.override) |s| return w.writeAll(s);
        for (this.include_path) |byte| switch (byte) {
            'a'...'z' => try w.writeByte(byte - 'a' + 'A'),
            'A'...'Z', '0'...'9' => continue,
            else => try w.writeByte('_'),
        };
    }
}