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.
Zig › std/ › debug/ › Dwarf.zig › Abbrev
Abbrev
Dwarf.Abbrev
pub const Abbrev = struct
File
Code
pub const Abbrev = struct {
code : u64 ,
tag_id : u64 ,
has_children : bool ,
attrs : []Attr ,
fn deinit (abbrev : *Abbrev , gpa : Allocator ) void {
gpa .free (abbrev .attrs );
abbrev .* = undefined ;
}
const Attr = struct {
id : u64 ,
form_id : u64 ,
payload : i64 ,
};
const Table = struct {
offset : u64 ,
abbrevs : []Abbrev ,
fn deinit (table : *Table , gpa : Allocator ) void {
for (table .abbrevs ) |*abbrev | {
abbrev .deinit (gpa );
}
gpa .free (table .abbrevs );
table .* = undefined ;
}
fn get (table : *const Table , abbrev_code : u64 ) ?*const Abbrev {
return for (table .abbrevs ) |*abbrev | {
if (abbrev .code == abbrev_code ) break abbrev ;
} else null ;
}
};
}