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 › addFileInner Private Function addFileInner Doc Source Private Function std.Build.Cache.Manifest.addFileInner
fn addFileInner (self : *Manifest , prefixed_path : PrefixedPath , handle : ?Io .File , max_file_size : ?usize ) usize Params File Build/Cache.zig: 420
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441 fn addFileInner (self : *Manifest , prefixed_path : PrefixedPath , handle : ?Io .File , max_file_size : ?usize ) usize {
const gop = self .files .getOrPutAssumeCapacityAdapted (prefixed_path , FilesAdapter {});
if (gop .found_existing ) {
self .cache .gpa .free (prefixed_path .sub_path );
gop .key_ptr .updateMaxSize (max_file_size );
gop .key_ptr .updateHandle (handle );
return gop .index ;
}
gop .key_ptr .* = .{
.prefixed_path = prefixed_path ,
.contents = null ,
.max_file_size = max_file_size ,
.stat = undefined ,
.bin_digest = undefined ,
.handle = handle ,
};
self .hash .add (prefixed_path .prefix );
self .hash .addBytes (prefixed_path .sub_path );
return gop .index ;
}