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 › zstd › Decompress › initFrame Private Function initFrame Doc Source Private Function std.compress.zstd.Decompress.initFrame
fn initFrame (d : *Decompress , magic : Frame .Magic ) !void Params File compress/zstd/Decompress.zig: 273
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290 fn initFrame (d : *Decompress , magic : Frame .Magic ) !void {
const in = d .input ;
switch (magic .kind () orelse return error .BadMagic ) {
.zstandard => {
const header = try Frame .Zstandard .Header .decode (in );
d .state = .{ .in_frame = .{
.frame = try Frame .init (header , d .window_len , d .verify_checksum ),
.checksum = null ,
.decompressed_size = 0 ,
.decode = .init ,
} };
},
.skippable => {
const frame_size = try in .takeInt (u32 , .little );
d .state = .{ .skipping_frame = frame_size };
},
}
}