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 › Build › Cache › Manifest › addOpenedFile Public Function addOpenedFile Doc Source Public Function std.Build.Cache.Manifest.addOpenedFile
pub fn addOpenedFile (m : *Manifest , path : Path , handle : ?Io .File , max_file_size : ?usize ) !usize Params File Build/Cache.zig: 408
408
409
410
411
412
413
414
415
416
417
418 pub fn addOpenedFile (m : *Manifest , path : Path , handle : ?Io .File , max_file_size : ?usize ) !usize {
const gpa = m .cache .gpa ;
try m .files .ensureUnusedCapacity (gpa , 1 );
const resolved_path = try std .fs .path .resolve (gpa , &.{
path .root_dir .path orelse "." ,
path .subPathOrDot (),
});
errdefer gpa .free (resolved_path );
const prefixed_path = try m .cache .findPrefixResolved (resolved_path );
return addFileInner (m , prefixed_path , handle , max_file_size );
}
Same as
addFilePathexcept the file has already been opened.