Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Type Function

ProtocolInterfaces

Private Type Function
std.os.uefi.tables.boot_services.ProtocolInterfaces
fn ProtocolInterfaces(HandleType: type, Interfaces: type) type

File

os/uefi/tables/boot_services.zig:1268
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
fn ProtocolInterfaces(HandleType: type, Interfaces: type) type {
    const interfaces_type_info = @typeInfo(Interfaces);
    if (interfaces_type_info != .@"struct" or !interfaces_type_info.@"struct".is_tuple)
        @compileError("expected tuple of protocol interfaces, got " ++ @typeName(Interfaces));
    const interfaces_info = interfaces_type_info.@"struct";

    var tuple_types: [interfaces_info.field_names.len * 2 + 2]type = undefined;
    tuple_types[0] = HandleType;
    tuple_types[tuple_types.len - 1] = ?*const Guid;

    var idx = 1;
    while (idx < tuple_types.len - 1) : (idx += 2) {
        tuple_types[idx] = *const Guid;
        tuple_types[idx + 1] = *const anyopaque;
    }

    return @Tuple(tuple_types[0..]);
}