ZXC 0.15.0
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_compress_opts_t Struct Reference

Options for compression. More...

#include <zxc_opts.h>

Data Fields

int n_threads
 Worker thread count (0 = auto-detect CPU cores).
 
int level
 Compression level 1-7 (0 = default, ZXC_LEVEL_DEFAULT).
 
size_t block_size
 Block size in bytes (0 = default ZXC_BLOCK_SIZE_DEFAULT).
 
int checksum_enabled
 1 to append the block checksums and archive digest, 0 to disable.
 
int seekable
 1 to append a seek table for random-access decompression.
 
const void * dict
 Pre-trained dictionary content (NULL = none).
 
size_t dict_size
 Dictionary size in bytes (0 = none, max ZXC_DICT_SIZE_MAX).
 
const void * dict_huf
 Optional shared literal Huffman table: the 128-byte packed code-lengths header from zxc_train_dict_huf() / zxc_dict_huf() (NULL = none, ignored without dict).
 
zxc_progress_callback_t progress_cb
 Optional progress callback (NULL to disable).
 
void * user_data
 User context pointer passed to progress_cb.
 

Detailed Description

Options for compression.

Zero-initialise for safe defaults: level 0 means ZXC_LEVEL_DEFAULT (3), block_size 0 means ZXC_BLOCK_SIZE_DEFAULT, n_threads 0 means auto-detect, everything else is off.

zxc_stream_compress(f_in, f_out, &opts);
@ ZXC_LEVEL_COMPACT
Denser encoding.
int64_t zxc_stream_compress(FILE *f_in, FILE *f_out, const zxc_compress_opts_t *opts)
Compresses one file stream into another.
Options for compression.
Definition zxc_opts.h:58
int level
Compression level 1-7 (0 = default, ZXC_LEVEL_DEFAULT).
Definition zxc_opts.h:60

Definition at line 58 of file zxc_opts.h.

Field Documentation

◆ block_size

size_t zxc_compress_opts_t::block_size

Block size in bytes (0 = default ZXC_BLOCK_SIZE_DEFAULT).

Must be power of 2, [4KB - 2MB].

Definition at line 61 of file zxc_opts.h.

◆ checksum_enabled

int zxc_compress_opts_t::checksum_enabled

1 to append the block checksums and archive digest, 0 to disable.

Definition at line 63 of file zxc_opts.h.

Referenced by zxc_compress(), zxc_compress_block_at(), zxc_compress_cctx(), zxc_create_cctx(), and zxc_stream_compress().

◆ dict

const void* zxc_compress_opts_t::dict

Pre-trained dictionary content (NULL = none).

Definition at line 65 of file zxc_opts.h.

Referenced by zxc_compress(), zxc_compress_block_at(), zxc_compress_cctx(), and zxc_stream_compress().

◆ dict_huf

const void* zxc_compress_opts_t::dict_huf

Optional shared literal Huffman table: the 128-byte packed code-lengths header from zxc_train_dict_huf() / zxc_dict_huf() (NULL = none, ignored without dict).

Used at levels 6-7 only. Becomes part of the archive's dict_id binding.

Definition at line 67 of file zxc_opts.h.

◆ dict_size

size_t zxc_compress_opts_t::dict_size

Dictionary size in bytes (0 = none, max ZXC_DICT_SIZE_MAX).

Definition at line 66 of file zxc_opts.h.

◆ level

int zxc_compress_opts_t::level

Compression level 1-7 (0 = default, ZXC_LEVEL_DEFAULT).

Definition at line 60 of file zxc_opts.h.

◆ n_threads

int zxc_compress_opts_t::n_threads

Worker thread count (0 = auto-detect CPU cores).

Definition at line 59 of file zxc_opts.h.

Referenced by zxc_stream_compress().

◆ progress_cb

zxc_progress_callback_t zxc_compress_opts_t::progress_cb

Optional progress callback (NULL to disable).

Definition at line 72 of file zxc_opts.h.

Referenced by zxc_stream_compress().

◆ seekable

int zxc_compress_opts_t::seekable

1 to append a seek table for random-access decompression.

Definition at line 64 of file zxc_opts.h.

Referenced by zxc_compress(), zxc_compress_cctx(), zxc_create_cctx(), and zxc_stream_compress().

◆ user_data

void* zxc_compress_opts_t::user_data

User context pointer passed to progress_cb.

Definition at line 73 of file zxc_opts.h.

Referenced by zxc_stream_compress().


The documentation for this struct was generated from the following file: