libropkg: implement compressed file streams and tar-writer functionality

This commit is contained in:
2025-07-17 18:12:16 +01:00
parent c377871d2b
commit add651a3ed
13 changed files with 1136 additions and 0 deletions

36
libropkg/compress.h Normal file
View File

@@ -0,0 +1,36 @@
#ifndef COMPRESS_H_
#define COMPRESS_H_
#include <ropkg/compress.h>
struct ropkg_compression_function {
const char *f_name;
const char *f_extension;
enum ropkg_status (*f_buffer_size)(
enum ropkg_compression_stream_mode,
size_t *,
size_t *);
enum ropkg_status (*f_open)(
const struct ropkg_compression_function *,
enum ropkg_compression_stream_mode,
void *,
size_t,
void *,
size_t,
struct ropkg_compression_stream **);
enum ropkg_status (*f_close)(struct ropkg_compression_stream *);
enum ropkg_status (*f_process)(
struct ropkg_compression_stream *,
size_t,
enum ropkg_compression_stream_op,
size_t *);
};
struct ropkg_compression_stream {
const struct ropkg_compression_function *s_func;
enum ropkg_compression_stream_mode s_mode;
void *s_in, *s_out;
size_t s_in_max, s_out_max;
};
#endif