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/ › macho.zig › section_64
section_64
macho.section_64
pub const section_64 = extern struct
File
Code
pub const section_64 = extern struct {
sectname : [16 ]u8 ,
segname : [16 ]u8 ,
addr : u64 = 0 ,
size : u64 = 0 ,
offset : u32 = 0 ,
@"align" : u32 = 0 ,
reloff : u32 = 0 ,
nreloc : u32 = 0 ,
flags : u32 = S_REGULAR ,
reserved1 : u32 = 0 ,
reserved2 : u32 = 0 ,
reserved3 : u32 = 0 ,
pub fn sectName (sect : *const section_64 ) []const u8 {
return parseName (§ .sectname );
}
pub fn segName (sect : *const section_64 ) []const u8 {
return parseName (§ .segname );
}
pub fn @"type" (sect : section_64 ) u8 {
return @as (u8 , @truncate (sect .flags & 0xff ));
}
pub fn attrs (sect : section_64 ) u32 {
return sect .flags & 0xffffff00 ;
}
pub fn isCode (sect : section_64 ) bool {
const attr = sect .attrs ();
return attr & S_ATTR_PURE_INSTRUCTIONS != 0 or attr & S_ATTR_SOME_INSTRUCTIONS != 0 ;
}
pub fn isZerofill (sect : section_64 ) bool {
const tt = sect .type ();
return tt == S_ZEROFILL or tt == S_GB_ZEROFILL or tt == S_THREAD_LOCAL_ZEROFILL ;
}
pub fn isSymbolStubs (sect : section_64 ) bool {
const tt = sect .type ();
return tt == S_SYMBOL_STUBS ;
}
pub fn isDebug (sect : section_64 ) bool {
return sect .attrs () & S_ATTR_DEBUG != 0 ;
}
pub fn isDontDeadStrip (sect : section_64 ) bool {
return sect .attrs () & S_ATTR_NO_DEAD_STRIP != 0 ;
}
pub fn isDontDeadStripIfReferencesLive (sect : section_64 ) bool {
return sect .attrs () & S_ATTR_LIVE_SUPPORT != 0 ;
}
}