aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-06 03:28:28 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-06 03:28:28 +0100
commitd053eb8096a790d81b67c844d918341e797c2659 (patch)
tree41493bdf9374493f0e19db9f0c4a6eb4b69d4328 /include
parent61da4d9d3249cc6001c64d371ef1bf82aeeab616 (diff)
Cleanup: use parse_size function to parse compressor options
The XZ option parser had a similar function to parse_size. This commit removes the other implementation and extends parse_size with the one missing feature, i.e. allowing a '%' suffix for a relative value. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index 5f768c1..386d8fd 100644
--- a/include/common.h
+++ b/include/common.h
@@ -164,7 +164,11 @@ sqfs_compressor_t *lzo_compressor_create(const sqfs_compressor_config_t *cfg);
an error message to stderr and returns -1 on failure, 0 on success.
The "what" string is used to prefix error messages (perror style).
+
+ If reference is non-zero, the suffix '%' can be used to compute the result as
+ a multiple of the reference value.
*/
-int parse_size(const char *what, size_t *out, const char *str);
+int parse_size(const char *what, size_t *out, const char *str,
+ size_t reference);
#endif /* COMMON_H */