libropkg: implement compressed file streams and tar-writer functionality
This commit is contained in:
39
libropkg/stream.h
Normal file
39
libropkg/stream.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef _ROPKG_STREAM_H_
|
||||
#define _ROPKG_STREAM_H_
|
||||
|
||||
#include <ropkg/stream.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct ropkg_compression_function;
|
||||
struct ropkg_compression_stream;
|
||||
|
||||
enum ropkg_stream_flags {
|
||||
ROPKG_STREAM_F_CURSOR_MOVED = 0x01u,
|
||||
};
|
||||
|
||||
struct ropkg_stream_compressor {
|
||||
const struct ropkg_compression_function *c_func;
|
||||
struct ropkg_compression_stream *c_stream;
|
||||
|
||||
size_t c_in_max, c_out_max;
|
||||
void *c_in_buf, *c_out_buf;
|
||||
size_t c_in_count;
|
||||
|
||||
size_t c_nr_written_compressed, c_nr_written_uncompressed;
|
||||
};
|
||||
|
||||
struct ropkg_stream {
|
||||
FILE *s_fp;
|
||||
enum ropkg_stream_flags s_flags;
|
||||
enum ropkg_stream_mode s_mode;
|
||||
|
||||
unsigned int s_compression_depth;
|
||||
struct ropkg_stream_compressor s_compressor;
|
||||
|
||||
size_t s_saved_cursor;
|
||||
size_t s_nr_written;
|
||||
size_t s_nr_written_compressed;
|
||||
size_t s_nr_written_uncompressed;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user