DoxigAlpha

format

Format GUID into hexadecimal lowercase xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format

Function parameters

Parameters

#
writer:*std.io.Writer

A protocol is an interface identified by a GUID.

Types

#
protocol
A protocol is an interface identified by a GUID.
Status
Status codes returned by EFI interfaces
Guid
GUIDs are align(8) unless otherwise specified.
Time
This structure represents time information.
TimeCapabilities
Capabilities of the clock device

Functions in this namespace

Functions

#

Error sets in this namespace

Error Sets

#

The memory type to allocate when using the pool.

Values

#
efi_pool_memory_type
The memory type to allocate when using the pool.
pool_allocator
= @import("uefi/pool_allocator.zig").pool_allocator
raw_pool_allocator
= @import("uefi/pool_allocator.zig").raw_pool_allocator
handle
The EFI image's handle that is passed to its entry point.
system_table
A pointer to the EFI System Table that is passed to the EFI image's entry point.
cc
The calling convention used for all external functions part of the UEFI API.

Source

Implementation

#
pub fn format(self: Guid, writer: *std.io.Writer) std.io.Writer.Error!void {
    const time_low = @byteSwap(self.time_low);
    const time_mid = @byteSwap(self.time_mid);
    const time_high_and_version = @byteSwap(self.time_high_and_version);

    return writer.print("{x:0>8}-{x:0>4}-{x:0>4}-{x:0>2}{x:0>2}-{x:0>12}", .{
        std.mem.asBytes(&time_low),
        std.mem.asBytes(&time_mid),
        std.mem.asBytes(&time_high_and_version),
        std.mem.asBytes(&self.clock_seq_high_and_reserved),
        std.mem.asBytes(&self.clock_seq_low),
        std.mem.asBytes(&self.node),
    });
}