From d5068781ec2528f88aaa92fbc9a5b9c256d53499 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 6 May 2019 12:09:56 +0200 Subject: Implement reading and writing of compressor options - gensquashfs simply asks the backend compressor to write its options to the file and does accounting - rdsquasfs simply asks the backend compressor to transparentyl snort the options from the file - not implemented in any compressor backend yet Signed-off-by: David Oberhollenzer --- include/compress.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/compress.h b/include/compress.h index 5bb689b..a8542f2 100644 --- a/include/compress.h +++ b/include/compress.h @@ -18,6 +18,26 @@ typedef struct compressor_t compressor_t; * uncompress/extract blocks of data */ struct compressor_t { + /** + * @brief Write compressor options to the output file if necessary + * + * @param cmp A pointer to the compressor object + * @param fd The file descriptor to write to + * + * @return The number of bytes written or -1 on failure + */ + int (*write_options)(compressor_t *cmp, int fd); + + /** + * @brief Read compressor options to the input file + * + * @param cmp A pointer to the compressor object + * @param fd The file descriptor to write to + * + * @return Zero on success, -1 on failure + */ + int (*read_options)(compressor_t *cmp, int fd); + /** * @brief Compress or uncompress a chunk of data * -- cgit v1.2.3