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 standard library.
std › Build › Configuration › ResolvedTarget › unwrapQuery Public Function unwrapQuery Doc Source 2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165 pub fn unwrapQuery (rt : *const ResolvedTarget , c : *const Configuration ) ?std .Target .Query {
const tq = rt .query .get (c ) orelse return null ;
const cpu_arch = tq .flags .cpu_arch .unwrap () orelse rt .result .get (c ).flags .cpu_arch .unwrap ().?;
return .{
.cpu_arch = cpu_arch ,
.cpu_model = switch (tq .flags .cpu_model ) {
.native => .native ,
.baseline => .baseline ,
.determined_by_arch_os => .determined_by_arch_os ,
.explicit => .{ .explicit = cpu_arch .parseCpuModel (tq .cpu_name .value .?.slice (c )).? },
},
.cpu_features_add = tq .cpu_features_add .value orelse .empty ,
.cpu_features_sub = tq .cpu_features_sub .value orelse .empty ,
.os_tag = tq .flags .os_tag .unwrap (),
.os_version_min = tq .os_version_min .u .unwrap (c ),
.os_version_max = tq .os_version_max .u .unwrap (c ),
.glibc_version = if (tq .glibc_version .value ) |s |
std .SemanticVersion .parse (s .slice (c )) catch unreachable
else
null ,
.android_api_level = tq .android_api_level .value ,
.abi = tq .flags .abi .unwrap (),
.dynamic_linker = if (tq .dynamic_linker .value ) |s | .init (s .slice (c )) else null ,
.ofmt = tq .flags .object_format .unwrap (),
};
}