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 › compress › lzma › Decode › Params Public Struct Params Doc Source Public Struct std.compress.lzma.Decode.Params
pub const Params = struct Fields properties : Properties dict_size : u32 unpacked_size : ?u64 Functions File compress/lzma.zig: 562
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599 pub const Params = struct {
properties : Properties ,
dict_size : u32 ,
unpacked_size : ?u64 ,
pub fn readHeader (reader : *Reader , options : Options ) !Params {
var props = try reader .takeByte ();
if (props >= 225 ) return error .CorruptInput ;
const lc : u4 = @intCast (props % 9 );
props /= 9 ;
const lp : u3 = @intCast (props % 5 );
props /= 5 ;
const pb : u3 = @intCast (props );
const dict_size_provided = try reader .takeInt (u32 , .little );
const dict_size = @max (0x1000 , dict_size_provided );
const unpacked_size = switch (options .unpacked_size ) {
.read_from_header => blk : {
const unpacked_size_provided = try reader .takeInt (u64 , .little );
const marker_mandatory = unpacked_size_provided == 0xFFFF_FFFF_FFFF_FFFF ;
break :blk if (marker_mandatory ) null else unpacked_size_provided ;
},
.read_header_but_use_provided => |x | blk : {
_ = try reader .takeInt (u64 , .little );
break :blk x ;
},
.use_provided => |x | x ,
};
return .{
.properties = .{ .lc = lc , .lp = lp , .pb = pb },
.dict_size = dict_size ,
.unpacked_size = unpacked_size ,
};
}
}