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 › zig › Directories › getLocalCacheDirectory Private Function getLocalCacheDirectory Doc Source Private Function std.zig.Directories.getLocalCacheDirectory
fn getLocalCacheDirectory (
arena : Allocator ,
io : Io ,
cwd : []const u8 ,
global_cache : Cache .Directory ,
local_cache_strat : LocalCacheStrategy ,
) Cache .Directory Params File zig.zig: 1458
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475 fn getLocalCacheDirectory (
arena : Allocator ,
io : Io ,
cwd : []const u8 ,
global_cache : Cache .Directory ,
local_cache_strat : LocalCacheStrategy ,
) Cache .Directory {
return switch (local_cache_strat ) {
.override => |path | openUnresolved (arena , io , cwd , path , .@"local cache" ),
.search => d : {
const maybe_path = resolveSuitableLocalCacheDir (arena , io , cwd ) catch |err |
fatal ("unable to resolve zig cache directory: {t}" , .{err });
const path = maybe_path orelse break :d global_cache ;
break :d openUnresolved (arena , io , cwd , path , .@"local cache" );
},
.global => global_cache ,
};
}