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 library itself.

nlist_64

macho.nlist_64
pub const nlist_64 = extern struct

File

lib/std/macho.zig:852

Code

pub const nlist_64 = extern struct {
    n_strx: u32,
    n_type: packed union(u8) {
        bits: packed struct(u8) {
            ext: bool,
            type: enum(u3) {
                undf = 0,
                abs = 1,
                sect = 7,
                pbud = 6,
                indr = 5,
                _,
            },
            pext: bool,
            /// Any non-zero value indicates this is an stab, so the `stab` field should be used.
            is_stab: u3,
        },
        stab: enum(u8) {
            gsym = N_GSYM,
            fname = N_FNAME,
            fun = N_FUN,
            stsym = N_STSYM,
            lcsym = N_LCSYM,
            bnsym = N_BNSYM,
            ast = N_AST,
            opt = N_OPT,
            rsym = N_RSYM,
            sline = N_SLINE,
            ensym = N_ENSYM,
            ssym = N_SSYM,
            so = N_SO,
            oso = N_OSO,
            lsym = N_LSYM,
            bincl = N_BINCL,
            sol = N_SOL,
            params = N_PARAMS,
            version = N_VERSION,
            olevel = N_OLEVEL,
            psym = N_PSYM,
            eincl = N_EINCL,
            entry = N_ENTRY,
            lbrac = N_LBRAC,
            excl = N_EXCL,
            rbrac = N_RBRAC,
            bcomm = N_BCOMM,
            ecomm = N_ECOMM,
            ecoml = N_ECOML,
            leng = N_LENG,
            _,
        },
    },
    n_sect: u8,
    n_desc: packed struct(u16) {
        _pad0: u3 = 0,
        arm_thumb_def: bool,
        referenced_dynamically: bool,
        /// The meaning of this bit is contextual.
        /// See `N_DESC_DISCARDED` and `N_NO_DEAD_STRIP`.
        discarded_or_no_dead_strip: bool,
        weak_ref: bool,
        /// The meaning of this bit is contextual.
        /// See `N_WEAK_DEF` and `N_REF_TO_WEAK`.
        weak_def_or_ref_to_weak: bool,
        symbol_resolver: bool,
        alt_entry: bool,
        _pad2: u6 = 0,
    },
    n_value: u64,

    pub fn tentative(sym: nlist_64) bool {
        return sym.n_type.bits.type == .undf and sym.n_value != 0;
    }
}