aboutsummaryrefslogtreecommitdiff
path: root/include/sqfs/meta_writer.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-10 11:24:51 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-10 11:25:57 +0200
commit49c2c4a8c8a8eb32a7d5fdbf4b1eba24bb23efe7 (patch)
treef6b3b9c5222edf76137a2a227919ca98614d41e1 /include/sqfs/meta_writer.h
parent5367faefd2490e09abed41f655c3db55d36752ad (diff)
API cleanup: eliminate boolean arguments
Replace them with flag fields which can be extended in the future without breaking the ABI. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs/meta_writer.h')
-rw-r--r--include/sqfs/meta_writer.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/sqfs/meta_writer.h b/include/sqfs/meta_writer.h
index c1b2383..4351f70 100644
--- a/include/sqfs/meta_writer.h
+++ b/include/sqfs/meta_writer.h
@@ -46,6 +46,23 @@
* compressing the blocks and pre-pending a header.
*/
+/**
+ * @enum E_SQFS_META_WRITER_FLAGS
+ *
+ * @brief Possible flags for @ref sqfs_meta_writer_create.
+ */
+typedef enum {
+ /**
+ * @brief If set, keep finished blocks in memory.
+ *
+ * To write them to disk, explicitly call
+ * @ref sqfs_meta_write_write_to_file.
+ */
+ SQFS_META_WRITER_KEEP_IN_MEMORY = 0x01,
+
+ SQFS_META_WRITER_ALL_FLAGS = 0x01,
+} E_SQFS_META_WRITER_FLAGS;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -61,15 +78,14 @@ extern "C" {
*
* @param file An output file to write the data to.
* @param cmp A compressor to use.
- * @param keep_in_memory Set to true to store the compressed blocks
- * internally until they are explicilty told
- * to write them to disk.
+ * @param flags A combination of @ref E_SQFS_META_WRITER_FLAGS.
*
- * @return A pointer to a meta writer on success, NULL on allocation failure.
+ * @return A pointer to a meta writer on success, NULL on allocation failure
+ * or if an unknown flag was set.
*/
SQFS_API sqfs_meta_writer_t *sqfs_meta_writer_create(sqfs_file_t *file,
sqfs_compressor_t *cmp,
- bool keep_in_mem);
+ int flags);
/**
* @brief Destroy a meta data writer and free all memory used by it.