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

FILE*-flavored variants of the ZXC API. More...

#include <stdint.h>
#include <stdio.h>
#include "zxc_buffer.h"
#include "zxc_export.h"
#include "zxc_opts.h"
#include "zxc_seekable.h"

Go to the source code of this file.

Functions

int64_t zxc_stream_compress (FILE *f_in, FILE *f_out, const zxc_compress_opts_t *opts)
 Compresses one file stream into another.
 
int64_t zxc_stream_decompress (FILE *f_in, FILE *f_out, const zxc_decompress_opts_t *opts)
 Decompresses one file stream into another.
 
int64_t zxc_stream_get_decompressed_size (FILE *f_in)
 Reads the original size from a ZXC file's footers, without decoding.
 
int zxc_stream_get_frame_info (FILE *f_in, zxc_frame_info_t *info, size_t info_size)
 Reads a file's frame header and footer, without decoding.
 
int zxc_stream_get_last_frame_info (FILE *f_in, uint64_t end, zxc_frame_info_t *info, size_t info_size)
 Reads the frame that ends at offset end of a file, without decoding.
 
zxc_seekable * zxc_seekable_open_file (FILE *f)
 Opens a seekable archive from a FILE*.
 

Detailed Description

FILE*-flavored variants of the ZXC API.

Every public entry point that needs <stdio.h> lives here, so kernel and freestanding builds can just leave this header out and use zxc_buffer.h, zxc_pstream.h and the storage-agnostic part of zxc_seekable.h.

Two subsystems:

  1. Multi-threaded streaming driver: FILE* in, FILE* out. A ring buffer keeps I/O off the CPU-bound work, producer-consumer style:
  2. **Seekable FILE* open helper**: wraps a FILE* into a thread-safe pread / ReadFile-backed zxc_reader_t and hands it to zxc_seekable_open_reader. See zxc_seekable_open_file.
See also
zxc_buffer.h for the simple one-shot buffer API.
zxc_pstream.h for single-threaded push-based streaming.
zxc_seekable.h for the storage-agnostic seekable reader.

Definition in file zxc_stream.h.