ZXC 0.15.0
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_opts.h File Reference

Shared option structures for the ZXC compression APIs. More...

#include <stddef.h>
#include <stdint.h>
#include "zxc_export.h"

Go to the source code of this file.

Data Structures

struct  zxc_compress_opts_t
 Options for compression. More...
 
struct  zxc_decompress_opts_t
 Options for decompression. More...
 

Typedefs

typedef void(* zxc_progress_callback_t) (uint64_t bytes_processed, uint64_t bytes_total, const void *user_data)
 Progress callback function type.
 

Functions

size_t zxc_compress_opts_size (void)
 Returns sizeof(zxc_compress_opts_t) as compiled into the library.
 
size_t zxc_decompress_opts_size (void)
 Returns sizeof(zxc_decompress_opts_t) as compiled into the library.
 

Detailed Description

Shared option structures for the ZXC compression APIs.

zxc_compress_opts_t, zxc_decompress_opts_t and zxc_progress_callback_t, shared by every public ZXC API (one-shot buffer, multi-threaded FILE* streaming, push streaming, seekable).

No need to include it directly: the API header you actually use (zxc_buffer.h, zxc_stream.h, zxc_pstream.h, ...) pulls it in.

Definition in file zxc_opts.h.

Typedef Documentation

◆ zxc_progress_callback_t

typedef void(* zxc_progress_callback_t) (uint64_t bytes_processed, uint64_t bytes_total, const void *user_data)

Progress callback function type.

Called from the writer thread after each block, or batch of blocks, is processed.

Parameters
[in]bytes_processedInput bytes processed so far.
[in]bytes_totalTotal input bytes to process (0 if unknown, e.g. stdin).
[in]user_dataContext pointer passed through from the API call.
Note
Keep it fast and non-blocking: no heavy I/O, no mutex.

Definition at line 43 of file zxc_opts.h.

Function Documentation

◆ zxc_compress_opts_size()

size_t zxc_compress_opts_size ( void  )

Returns sizeof(zxc_compress_opts_t) as compiled into the library.

Layout guard for bindings that mirror the options structs by hand (raw FFI declarations, byte-offset serialization) instead of compiling against this header. Comparing the mirrored size against this at load time turns a silent layout drift, i.e. undefined behaviour, into an explicit error.

Returns sizeof(zxc_compress_opts_t) as compiled into the library.

Public API; see zxc_buffer.h. Lets callers (other languages, or a different library version) size the options struct without knowing its layout.

Returns
Size of zxc_compress_opts_t in bytes.

Definition at line 33 of file zxc_common.c.

◆ zxc_decompress_opts_size()

size_t zxc_decompress_opts_size ( void  )

Returns sizeof(zxc_decompress_opts_t) as compiled into the library.

See also
zxc_compress_opts_size

Returns sizeof(zxc_decompress_opts_t) as compiled into the library.

Public API; see zxc_buffer.h. Lets callers (other languages, or a different library version) size the options struct without knowing its layout.

Returns
Size of zxc_decompress_opts_t in bytes.

Definition at line 43 of file zxc_common.c.