aboutsummaryrefslogtreecommitdiff
path: root/src/xz/options.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-05-23 15:12:23 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-05-23 15:12:23 +0300
commitb1edee2cdc7ef4411b1a21c07094ec763f071281 (patch)
tree41e429c0071bac8b83ddf0680100fb7880249af5 /src/xz/options.c
parentUpdated THANKS. (diff)
downloadxz-b1edee2cdc7ef4411b1a21c07094ec763f071281.tar.xz
Add support for specifying the BCJ filter start offset
in the xz command line tool.
Diffstat (limited to 'src/xz/options.c')
-rw-r--r--src/xz/options.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/xz/options.c b/src/xz/options.c
index ea52a595..69e545be 100644
--- a/src/xz/options.c
+++ b/src/xz/options.c
@@ -225,6 +225,46 @@ options_delta(const char *str)
}
+/////////
+// BCJ //
+/////////
+
+enum {
+ OPT_START_OFFSET,
+};
+
+
+static void
+set_bcj(void *options, uint32_t key, uint64_t value)
+{
+ lzma_options_bcj *opt = options;
+ switch (key) {
+ case OPT_START_OFFSET:
+ opt->start_offset = value;
+ break;
+ }
+}
+
+
+extern lzma_options_bcj *
+options_bcj(const char *str)
+{
+ static const option_map opts[] = {
+ { "start", NULL, 0, UINT32_MAX },
+ { NULL, NULL, 0, 0 }
+ };
+
+ lzma_options_bcj *options = xmalloc(sizeof(lzma_options_bcj));
+ *options = (lzma_options_bcj){
+ .start_offset = 0,
+ };
+
+ parse_options(str, opts, &set_bcj, options);
+
+ return options;
+}
+
+
//////////
// LZMA //
//////////