package core:compress/bzip2

⌘K
Ctrl+K
or
/

    Overview

    An implementation of the BZIP2 compression method

    The compressor is derived from libbzip2 by Julian R Seward. Its compatible license can be found in LICENSE-libbzip2

    Types

    BZip2 ¶

    BZip2 :: struct {
    	block:        [900034]u8,
    	ptr:          [900000]u32,
    	work:         [900034]u32,
    	ftab:         [65537]u32,
    	nblock:       int,
    	nblock_max:   int,
    	orig_ptr:     int,
    	n_in_use:     int,
    	n_mtf:        int,
    	in_ch:        u32,
    	in_len:       int,
    	out:          []u8,
    	out_pos:      int,
    	bits:         u64,
    	live:         uint,
    	in_use:       [256]bool,
    	unseq_to_seq: [256]u8,
    	mtf_freq:     [258]i32,
    	lengths:      [6][258]u8,
    	codes:        [6][258]u32,
    	rfreq:        [6][258]i32,
    	len_pack:     [258][3]u32,
    	selector:     [18002]u8,
    	selector_mtf: [18002]u8,
    }

    Related Procedures With Parameters

    Error ¶

    Error :: compress.Error

    Related Procedures With Returns

    Level ¶

    Level :: enum i32 {
    	Level_1 = 1, 
    	Level_2 = 2, 
    	Level_3 = 3, 
    	Level_4 = 4, 
    	Level_5 = 5, 
    	Level_6 = 6, 
    	Level_7 = 7, 
    	Level_8 = 8, 
    	Level_9 = 9, 
    	Fastest = Level_1, 
    	Default = Level_9, 
    	Best    = Level_9, 
    }

    Related Procedures With Parameters

    Constants

    BLOCK_MAGIC ¶

    BLOCK_MAGIC :: u64(0x314159265359)

    END_MAGIC ¶

    END_MAGIC :: u64(0x177245385090)

    Variables

    This section is empty.

    Procedures

    compress_bound ¶

    compress_bound :: proc(length: int) -> int {…}

    compress_to_dynamic ¶

    compress_to_dynamic :: proc(
    	output:    ^[dynamic]u8, 
    	input:     []u8, 
    	level:     Level = Level.Default, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    compress_to_slice ¶

    compress_to_slice :: proc(
    	s:             ^BZip2, 
    	output, input: []u8, 
    	level:         Level = Level.Default, 
    ) -> (written: int, err: compress.Error) {…}

    decompress_from_bytes ¶

    decompress_from_bytes :: proc(
    	output:               ^[dynamic]u8, 
    	input:                []u8, 
    	expected_output_size: int = -1, 
    	max_output_size:      int = compress.COMPRESS_OUTPUT_ALLOCATE_MAX, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    decompress_from_context ¶

    decompress_from_context :: proc(
    	z:                    ^compress.Context, 
    	expected_output_size: int = -1, 
    	max_output_size:      int = compress.COMPRESS_OUTPUT_ALLOCATE_MAX, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2026-11 (vendor "odin") Windows_amd64 @ 2026-11-08 00:08:02.025371000 +0000 UTC