package core:compress/lz4

⌘K
Ctrl+K
or
/

    Types

    Block_Max_Size ¶

    Block_Max_Size :: enum u8 {
    	Max_4MiB   = 0, 
    	Max_1MiB   = 1, 
    	Max_256KiB = 2, 
    	Max_64KiB  = 3, 
    }

    Frame_Flag ¶

    Frame_Flag :: enum u8 {
    	Content_Checksum   = 2, 
    	Content_Size       = 3, 
    	Block_Checksum     = 4, 
    	Independent_Blocks = 5, 
    }

    Frame_Flags ¶

    Frame_Flags :: bit_set[Frame_Flag; u8]

    Related Constants

    Frame_Options ¶

    Frame_Options :: struct {
    	block_max_size: Block_Max_Size,
    	flags:          bit_set[Frame_Flag; u8],
    	dictionary_id:  runtime.Maybe($T=u32),
    }

    Related Procedures With Parameters

    LZ4 ¶

    LZ4 :: struct {
    	head:  [65536]u32,
    	chain: [65536]u16,
    	fast:  [4096]u32,
    }

    Related Procedures With Parameters

    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, 
    	Level_10 = 10, 
    	Level_11 = 11, 
    	Level_12 = 12, 
    	Fastest  = Level_1, 
    	Default  = Level_1, 
    	Best     = Level_12, 
    }

    Related Procedures With Parameters

    Constants

    DEFAULT_FRAME_FLAGS ¶

    DEFAULT_FRAME_FLAGS: bit_set[Frame_Flag; u8] : Frame_Flags{.Content_Checksum, .Content_Size}

    FRAME_DESCRIPTOR_MAX ¶

    FRAME_DESCRIPTOR_MAX :: 2 + 8 + 4

    FRAME_HEADER_MAX ¶

    FRAME_HEADER_MAX :: 4 + 2 + 8 + 4 + 1

    FRAME_MAGIC ¶

    FRAME_MAGIC :: u32(0x184D2204)

    LEGACY_BLOCK_SIZE ¶

    LEGACY_BLOCK_SIZE :: 8 << 20

    LEGACY_MAGIC ¶

    LEGACY_MAGIC :: u32(0x184C2102)

    SKIPPABLE_MAGIC_MAX ¶

    SKIPPABLE_MAGIC_MAX :: u32(0x184D2A5F)

    SKIPPABLE_MAGIC_MIN ¶

    SKIPPABLE_MAGIC_MIN :: u32(0x184D2A50)

    Variables

    This section is empty.

    Procedures

    compress_block_bound ¶

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

    compress_block_to_dynamic ¶

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

    compress_block_to_slice ¶

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

    compress_frame_bound ¶

    compress_frame_bound :: proc(
    	length:  int, 
    	options: Frame_Options = Frame_Options{flags = DEFAULT_FRAME_FLAGS}, 
    ) -> int {…}

    compress_frame_to_dynamic ¶

    compress_frame_to_dynamic :: proc(
    	output:     ^[dynamic]u8, 
    	input:      []u8, 
    	level:      Level = Level.Default, 
    	options:    Frame_Options = Frame_Options{flags = DEFAULT_FRAME_FLAGS}, 
    	dictionary: []u8 = nil, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    compress_frame_to_slice ¶

    compress_frame_to_slice :: proc(
    	s:             ^LZ4, 
    	output, input: []u8, 
    	level:         Level = Level.Default, 
    	options:       Frame_Options = Frame_Options{flags = DEFAULT_FRAME_FLAGS}, 
    	dictionary:    []u8 = nil, 
    ) -> (written: int, err: compress.Error) {…}

    decompress_block_from_bytes ¶

    decompress_block_from_bytes :: proc(
    	output:          ^[dynamic]u8, 
    	input:           []u8, 
    	max_output_size: int, 
    	dictionary:      []u8 = nil, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    decompress_block_from_context ¶

    decompress_block_from_context :: proc(
    	z:               ^compress.Context, 
    	max_output_size: int, 
    	dictionary:      []u8 = nil, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    decompress_block_to_slice ¶

    decompress_block_to_slice :: proc(
    	output, input: []u8, 
    	dictionary:    []u8 = nil, 
    ) -> (written: int, err: compress.Error) {…}

    decompress_frame_from_bytes ¶

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

    decompress_frame_from_context ¶

    decompress_frame_from_context :: proc(
    	z:                    ^compress.Context, 
    	expected_output_size: int = -1, 
    	max_output_size:      int = compress.COMPRESS_OUTPUT_ALLOCATE_MAX, 
    	dictionary:           []u8 = nil, 
    	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-10 03:07:04.374188700 +0000 UTC