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

Storage-agnostic reader interface for seekable archives. More...

#include <zxc_seekable.h>

Data Fields

int64_t(* read_at )(void *ctx, void *dst, size_t len, uint64_t offset)
 Reads exactly len bytes at offset into dst.
 
void * ctx
 Opaque user context passed unchanged to read_at.
 
uint64_t size
 Total size of the compressed archive in bytes.
 

Detailed Description

Storage-agnostic reader interface for seekable archives.

Plugs any backend behind the seekable reader: mmap, HTTP range requests, S3, a custom VFS, kernel vfs_read. Positional reads only, no seeking state.

Thread safety
read_at MUST be safe to call concurrently under zxc_seekable_decompress_range_mt(), or when calls on one handle overlap: all of them read through it, zxc_seekable_get_block_comp_size() included.
Lifetime
ctx and the backing storage must both outlive the zxc_seekable handle (until zxc_seekable_free()).

Definition at line 120 of file zxc_seekable.h.

Field Documentation

◆ ctx

void* zxc_reader_t::ctx

Opaque user context passed unchanged to read_at.

Definition at line 135 of file zxc_seekable.h.

◆ read_at

int64_t(* zxc_reader_t::read_at) (void *ctx, void *dst, size_t len, uint64_t offset)

Reads exactly len bytes at offset into dst.

Parameters
[in,out]ctxOpaque user context (forwarded from zxc_reader_t::ctx).
[out]dstDestination buffer.
[in]lenNumber of bytes to read.
[in]offsetByte offset from the start of the archive.
Returns
Bytes read (== len on success), or a negative zxc_error_t. The seekable reader treats a short read as an error.

Definition at line 132 of file zxc_seekable.h.

Referenced by zxc_seekable_open_file(), and zxc_seekable_open_reader().

◆ size

uint64_t zxc_reader_t::size

Total size of the compressed archive in bytes.

Definition at line 138 of file zxc_seekable.h.

Referenced by zxc_seekable_open_reader().


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