ZXC 0.15.0
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
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
75ZXC_EXPORT int64_t zxc_stream_compress(FILE* f_in, FILE* f_out, const zxc_compress_opts_t* opts);
76
95ZXC_EXPORT int64_t zxc_stream_decompress(FILE* f_in, FILE* f_out,
96 const zxc_decompress_opts_t* opts);
97
111ZXC_EXPORT int64_t zxc_stream_get_decompressed_size(FILE* f_in);
112
125ZXC_EXPORT int zxc_stream_get_frame_info(FILE* f_in, zxc_frame_info_t* info, size_t info_size);
126
140ZXC_EXPORT int zxc_stream_get_last_frame_info(FILE* f_in, uint64_t end, zxc_frame_info_t* info,
141 size_t info_size);
142
143/* ========================================================================= */
144/* Seekable FILE* open helper */
145/* ========================================================================= */
146
162ZXC_EXPORT zxc_seekable* zxc_seekable_open_file(FILE* f);
163
/* end of stream_api */
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif // ZXC_STREAM_H
struct zxc_seekable_s zxc_seekable
Opaque handle for a seekable ZXC archive.
zxc_seekable * zxc_seekable_open_file(FILE *f)
Opens a seekable archive from a FILE*.
int64_t zxc_stream_get_decompressed_size(FILE *f_in)
Reads the original size from a ZXC file's footers, without decoding.
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_compress(FILE *f_in, FILE *f_out, const zxc_compress_opts_t *opts)
Compresses one file stream into another.
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.
Options for compression.
Definition zxc_opts.h:58
Options for decompression.
Definition zxc_opts.h:86
What a frame's header and footer declare, read without decoding.
Definition zxc_buffer.h:235
One-shot buffer compression and decompression.
Platform-specific symbol visibility macros.
Shared option structures for the ZXC compression APIs.
Seekable compression and random-access decompression API.