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 library itself.

init

When connecting reader to a Writer, buffer should be empty, and Writer.buffer capacity has requirements based on Options.window_len.

Otherwise, buffer has those requirements.

Decompress.init
pub fn init(input: *Reader, buffer: []u8, options: Options) Decompress

File

lib/std/compress/zstd/Decompress.zig:94

Code

pub fn init(input: *Reader, buffer: []u8, options: Options) Decompress {
    if (buffer.len != 0) assert(buffer.len >= options.window_len + zstd.block_size_max);
    return .{
        .input = input,
        .state = .new_frame,
        .verify_checksum = options.verify_checksum,
        .window_len = options.window_len,
        .reader = .{
            .vtable = if (buffer.len == 0) &direct_vtable else &indirect_vtable,
            .buffer = buffer,
            .seek = 0,
            .end = 0,
        },
    };
}