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.

OptionalCSourceLanguage

Configuration.OptionalCSourceLanguage
pub const OptionalCSourceLanguage = enum(u3)

File

lib/std/Build/Configuration.zig:2109

Code

pub const OptionalCSourceLanguage = enum(u3) {
    c,
    cpp,
    objective_c,
    objective_cpp,
    assembly,
    assembly_with_preprocessor,
    default,

    pub fn init(x: ?std.Build.Module.CSourceLanguage) @This() {
        return switch (x orelse return .default) {
            .c => .c,
            .cpp => .cpp,
            .objective_c => .objective_c,
            .objective_cpp => .objective_cpp,
            .assembly => .assembly,
            .assembly_with_preprocessor => .assembly_with_preprocessor,
        };
    }

    pub fn get(this: @This()) ?std.Build.Module.CSourceLanguage {
        return switch (this) {
            .c => .c,
            .cpp => .cpp,
            .objective_c => .objective_c,
            .objective_cpp => .objective_cpp,
            .assembly => .assembly,
            .assembly_with_preprocessor => .assembly_with_preprocessor,
            .default => null,
        };
    }
}