ZXC 1.0.3
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_stream.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * ZXC - High-performance lossless compression
4 *
5 * Copyright (c) Bertrand Lebonnois and contributors.
6 */
7
34
35#ifndef ZXC_STREAM_H
36#define ZXC_STREAM_H
37
38#include <stdint.h>
39#include <stdio.h>
40
41#include "zxc_buffer.h"
42#include "zxc_export.h"
43#include "zxc_opts.h"
44#include "zxc_seekable.h"
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
55
78ZXC_EXPORT int64_t zxc_stream_compress(FILE* f_in, FILE* f_out, const zxc_cctx* cfg);
79
100ZXC_EXPORT int64_t zxc_stream_decompress(FILE* f_in, FILE* f_out, const zxc_dctx* cfg);
101
115ZXC_EXPORT int64_t zxc_stream_get_decompressed_size(FILE* f_in);
116
129ZXC_EXPORT int zxc_stream_get_frame_info(FILE* f_in, zxc_frame_info_t* info, size_t info_size);
130
144ZXC_EXPORT int zxc_stream_get_last_frame_info(FILE* f_in, uint64_t end, zxc_frame_info_t* info,
145 size_t info_size);
146
147/* ========================================================================= */
148/* Seekable FILE* open helper */
149/* ========================================================================= */
150
166ZXC_EXPORT zxc_seekable* zxc_seekable_open_file(FILE* f);
167 /* end of stream_api */
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif // ZXC_STREAM_H
struct zxc_cctx_s zxc_cctx
Opaque reusable compression context (see zxc_create_cctx).
Definition zxc_buffer.h:370
struct zxc_dctx_s zxc_dctx
Opaque reusable decompression context (see zxc_create_dctx).
Definition zxc_buffer.h:372
struct zxc_seekable_s zxc_seekable
Opaque handle for a seekable ZXC archive.
int64_t zxc_stream_decompress(FILE *f_in, FILE *f_out, const zxc_dctx *cfg)
Decompresses one file stream into another.
zxc_seekable * zxc_seekable_open_file(FILE *f)
Opens a seekable archive from a FILE*.
int64_t zxc_stream_compress(FILE *f_in, FILE *f_out, const zxc_cctx *cfg)
Compresses 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.
What a frame's header and footer declare, read without decoding.
Definition zxc_buffer.h:275
One-shot buffer compression and decompression.
Platform-specific symbol visibility macros.
Compression and decompression parameters.
Seekable compression and random-access decompression API.