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

init

Public Function
std.macho.LoadCommandIterator.init
pub fn init(hdr: *const mach_header_64, cmds_buf_overlong: []const u8) error

Params

File

macho.zig:1997
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
    pub fn init(hdr: *const mach_header_64, cmds_buf_overlong: []const u8) error{InvalidMachO}!LoadCommandIterator {
        if (cmds_buf_overlong.len < hdr.sizeofcmds) return error.InvalidMachO;
        if (hdr.ncmds > 0 and hdr.sizeofcmds < @sizeOf(load_command)) return error.InvalidMachO;
        const cmds_buf = cmds_buf_overlong[0..hdr.sizeofcmds];
        return .{
            .next_index = 0,
            .ncmds = hdr.ncmds,
            .r = .fixed(cmds_buf),
        };
    }