aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-16 19:46:46 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-17 15:27:19 +0200
commit0abe1816da2706f87432c4e04918ad0eec902479 (patch)
treebae50f863a3784ddd709911cdabac06c5e759679 /include
parent230453fc840c112bbe2c18708338fd897f1174ec (diff)
Move data writer ostream into libsquashfs
It is mainly a very thin wrapper on top of the block processor so far. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/common.h5
-rw-r--r--include/sqfs/block_processor.h21
2 files changed, 21 insertions, 5 deletions
diff --git a/include/common.h b/include/common.h
index d4827a8..8e24d03 100644
--- a/include/common.h
+++ b/include/common.h
@@ -63,11 +63,6 @@ int parse_size(const char *what, size_t *out, const char *str,
void print_size(sqfs_u64 size, char *buffer, bool round_to_int);
-sqfs_ostream_t *data_writer_ostream_create(const char *filename,
- sqfs_block_processor_t *proc,
- sqfs_inode_generic_t **inode,
- int flags);
-
/*
Parse a comma separated list (e.g. "uid=...,gid=..." of defaults for
fstree nodes. Used for command line parsing. Returns 0 on success,
diff --git a/include/sqfs/block_processor.h b/include/sqfs/block_processor.h
index a5eed33..cc40605 100644
--- a/include/sqfs/block_processor.h
+++ b/include/sqfs/block_processor.h
@@ -381,6 +381,27 @@ SQFS_API int sqfs_block_processor_finish(sqfs_block_processor_t *proc);
SQFS_API const sqfs_block_processor_stats_t
*sqfs_block_processor_get_stats(const sqfs_block_processor_t *proc);
+/**
+ * @brief Create an @ref sqfs_ostream_t that writes to a data writer
+ *
+ * @memberof sqfs_block_processor_t
+ *
+ * @param out Receives a pointer to an @ref sqfs_ostream_t on success
+ * @param filename A filename that the ostream returns when queried.
+ * @param proc A pointer to a data writer object.
+ * @param inode An optional pointer to a pointer to an inode. If not NULL, the
+ * block processor creates a file inode and stores a pointer to
+ * it here and keeps updating the inode as the file grows.
+ * @param flags A combination of @ref SQFS_BLK_FLAGS that can be used to
+ * micro manage how the data is processed.
+ *
+ * @return Zero on sucess, a negative @ref SQFS_ERROR value on failure.
+ */
+SQFS_API int sqfs_block_processor_create_ostream(sqfs_ostream_t **out,
+ const char *filename,
+ sqfs_block_processor_t *proc,
+ sqfs_inode_generic_t **inode,
+ sqfs_u32 flags);
#ifdef __cplusplus
}
#endif