Files
zig-squashfs/src/options.zig
T
Caleb J. Gardner 5c04933520 Resetting. Again.
Getting the basics re-added
2026-06-09 22:23:54 -05:00

31 lines
991 B
Zig

//! Options for file/directory extraction.
const std = @import("std");
const Writer = std.Io.Writer;
const ExtractionOptions = @This();
/// Whether to use single threaded extraction. For finer control, create an std.Io instance.
single_threaded: bool = false,
/// Don't set the file's owner & permissions after extraction
ignore_permissions: bool = false,
/// Don't set xattr values. Currently xattrs are never set anyway.
ignore_xattr: bool = false,
/// Replace symlinks with their target.
dereference_symlinks: bool = false,
/// Verbose logging. If true, verbose_writer must be set
verbose: bool = false,
/// Where to print verbose log.
verbose_writer: ?*Writer = null,
pub const default: ExtractionOptions = .{};
pub const single_threaded_default: ExtractionOptions = .{ .single_threaded = true };
pub fn VerboseDefault(wrt: *Writer) !ExtractionOptions {
return .{
.verbose = true,
.verbose_writer = wrt,
.threads = try std.Thread.getCpuCount(),
};
}