summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-06 12:09:56 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-06 12:15:44 +0200
commitd5068781ec2528f88aaa92fbc9a5b9c256d53499 (patch)
tree8eac6ec1a02f12e71ec97b1cf66113f37df6d508 /include
parentcbcf86dde27767682483985e42f7ca49e1d3a208 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/compress.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/compress.h b/include/compress.h
index 5bb689b..a8542f2 100644
--- a/include/compress.h
+++ b/include/compress.h
@@ -19,6 +19,26 @@ typedef struct compressor_t compressor_t;
*/
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
*
* @param cmp A pointer to the compressor object