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 standard library.
std › Io › Dir › Reader › min_buffer_len Public Constant min_buffer_len Doc Source Public Constant std.Io.Dir.Reader.min_buffer_len
pub const min_buffer_len = switch (native_os ) File Io/Dir.zig: 108
108
109
110
111
112
113
114
115
116
117
118
119
120
121 pub const min_buffer_len = switch (native_os ) {
.linux => std .mem .alignForward (usize , @sizeOf (std .os .linux .dirent64 ), 8 ) +
std .mem .alignForward (usize , max_name_bytes , 8 ),
.windows => len : {
const max_info_len = @sizeOf (std .os .windows .FILE_BOTH_DIR_INFORMATION ) + std .os .windows .NAME_MAX * 2 ;
const info_align = @alignOf (std .os .windows .FILE_BOTH_DIR_INFORMATION );
const reserved_len = std .mem .alignForward (usize , max_name_bytes , info_align ) - max_info_len ;
break :len std .mem .alignForward (usize , reserved_len , info_align ) + max_info_len ;
},
.wasi => @sizeOf (std .os .wasi .dirent_t ) +
std .mem .alignForward (usize , max_name_bytes , @alignOf (std .os .wasi .dirent_t )),
.openbsd => std .c .S .BLKSIZE ,
else => if (builtin .link_libc ) @sizeOf (std .c .dirent ) else std .mem .alignForward (usize , max_name_bytes , @alignOf (usize )),
}
A length for
bufferthat allows all implementations to function.