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. Public Function

next

Public Function
std.macho.LoadCommandIterator.next
pub fn next(it: *LoadCommandIterator) error

Params

File

macho.zig:1981
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
    pub fn next(it: *LoadCommandIterator) error{InvalidMachO}!?LoadCommand {
        if (it.next_index >= it.ncmds) return null;

        const hdr = it.r.peekStruct(load_command, .little) catch |err| switch (err) {
            error.ReadFailed => unreachable,
            error.EndOfStream => return error.InvalidMachO,
        };
        const data = it.r.take(hdr.cmdsize) catch |err| switch (err) {
            error.ReadFailed => unreachable,
            error.EndOfStream => return error.InvalidMachO,
        };

        it.next_index += 1;
        return .{ .hdr = hdr, .data = data };
    }