Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Public Function

addPrefixedPathPost

Public Function
std.Build.Cache.Manifest.addPrefixedPathPost
pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool

Low level function. prefixed_path references cloned memory. Returns whether or not prefixed_path.sub_path should be kept.

Params

File

Build/Cache.zig:1008
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
    pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool {
        assert(man.manifest_file != null);
        const gpa = man.cache.gpa;

        const gop = try man.files.getOrPutAdapted(gpa, prefixed_path, FilesAdapter{});
        errdefer _ = man.files.pop();

        if (gop.found_existing) return false;

        gop.key_ptr.* = .{
            .prefixed_path = prefixed_path,
            .max_file_size = null,
            .handle = null,
            .stat = undefined,
            .bin_digest = undefined,
            .contents = null,
        };

        man.files.lockPointers();
        defer man.files.unlockPointers();

        try man.populateFileHash(gop.key_ptr);
        return true;
    }