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 › os › uefi › tables › boot_services › BootServices › startImage Public Function startImage Doc Source 828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856 pub fn startImage (self : *BootServices , image : Handle ) StartImageError !ImageExitData {
var exit_data_size : usize = undefined ;
var exit_data : [*]u16 = undefined ;
const exit_code = switch (self ._startImage (
image ,
&exit_data_size ,
&exit_data ,
)) {
.invalid_parameter => return error .InvalidParameter ,
.security_violation => return error .SecurityViolation ,
else => |exit_code | exit_code ,
};
if (exit_data_size == 0 ) return .{
.code = exit_code ,
.description = null ,
.data = null ,
};
const description_ptr : [*:0 ]const u16 = @ptrCast (exit_data );
const description = std .mem .sliceTo (description_ptr , 0 );
return ImageExitData {
.code = exit_code ,
.description = description ,
.data = exit_data [description .len + 1 .. exit_data_size ],
};
}