summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-09-27 19:09:21 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-09-27 19:09:21 +0300
commit1dcecfb09b55157b8653d747963069c8bed74f04 (patch)
tree81fa1f1e8bf6871981970ca826d897db6f33527b /debug
parent5cc5064cae603b649c64c40125c7dd365de54c9d (diff)
downloadxz-1dcecfb09b55157b8653d747963069c8bed74f04.tar.gz
Some API changes, bug fixes, cleanups etc.
Diffstat (limited to 'debug')
-rw-r--r--debug/full_flush.c7
-rw-r--r--debug/known_sizes.c6
-rw-r--r--debug/memusage.c22
-rw-r--r--debug/sync_flush.c18
4 files changed, 31 insertions, 22 deletions
diff --git a/debug/full_flush.c b/debug/full_flush.c
index 5072536..3c91454 100644
--- a/debug/full_flush.c
+++ b/debug/full_flush.c
@@ -74,9 +74,14 @@ main(int argc, char **argv)
// Config
+ lzma_options_lzma opt_lzma;
+ if (lzma_lzma_preset(&opt_lzma, 0)) {
+ fprintf(stderr, "preset failed\n");
+ exit(1);
+ }
lzma_filter filters[LZMA_BLOCK_FILTERS_MAX + 1];
filters[0].id = LZMA_FILTER_LZMA2;
- filters[0].options = (void *)&lzma_preset_lzma[0];
+ filters[0].options = &opt_lzma;
filters[1].id = LZMA_VLI_UNKNOWN;
// Init
diff --git a/debug/known_sizes.c b/debug/known_sizes.c
index beb05fd..ef7472d 100644
--- a/debug/known_sizes.c
+++ b/debug/known_sizes.c
@@ -47,10 +47,14 @@ main(void)
const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin);
// Filter setup
+ lzma_options_lzma opt_lzma;
+ if (lzma_lzma_preset(&opt_lzma, 0))
+ return 1;
+
lzma_filter filters[] = {
{
.id = LZMA_FILTER_LZMA2,
- .options = (void *)(&lzma_preset_lzma[0])
+ .options = &opt_lzma
},
{
.id = LZMA_VLI_UNKNOWN
diff --git a/debug/memusage.c b/debug/memusage.c
index eaf81f9..2dbb39e 100644
--- a/debug/memusage.c
+++ b/debug/memusage.c
@@ -26,27 +26,27 @@ main(void)
lzma_init();
lzma_options_lzma lzma = {
- .dictionary_size = (1 << 27) + (1 << 26),
- .literal_context_bits = 3,
- .literal_pos_bits = 0,
- .pos_bits = 2,
- .preset_dictionary = NULL,
- .preset_dictionary_size = 0,
+ .dict_size = (1U << 27) + (1U << 26),
+ .lc = 3,
+ .lp = 0,
+ .pb = 2,
+ .preset_dict = NULL,
+ .preset_dict_size = 0,
.mode = LZMA_MODE_NORMAL,
- .fast_bytes = 48,
- .match_finder = LZMA_MF_BT4,
- .match_finder_cycles = 0,
+ .nice_len = 48,
+ .mf = LZMA_MF_BT4,
+ .depth = 0,
};
/*
lzma_options_filter filters[] = {
- { LZMA_FILTER_LZMA,
+ { LZMA_FILTER_LZMA1,
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
{ UINT64_MAX, NULL }
};
*/
lzma_filter filters[] = {
- { LZMA_FILTER_LZMA, &lzma },
+ { LZMA_FILTER_LZMA1, &lzma },
{ UINT64_MAX, NULL }
};
diff --git a/debug/sync_flush.c b/debug/sync_flush.c
index 9e140fb..a161ca3 100644
--- a/debug/sync_flush.c
+++ b/debug/sync_flush.c
@@ -74,16 +74,16 @@ main(int argc, char **argv)
// Config
lzma_options_lzma opt_lzma = {
- .dictionary_size = 1 << 16,
- .literal_context_bits = LZMA_LITERAL_CONTEXT_BITS_DEFAULT,
- .literal_pos_bits = LZMA_LITERAL_POS_BITS_DEFAULT,
- .pos_bits = LZMA_POS_BITS_DEFAULT,
- .preset_dictionary = NULL,
+ .dict_size = 1U << 16,
+ .lc = LZMA_LC_DEFAULT,
+ .lp = LZMA_LP_DEFAULT,
+ .pb = LZMA_PB_DEFAULT,
+ .preset_dict = NULL,
.persistent = true,
.mode = LZMA_MODE_NORMAL,
- .fast_bytes = 32,
- .match_finder = LZMA_MF_HC3,
- .match_finder_cycles = 0,
+ .nice_len = 32,
+ .mf = LZMA_MF_HC3,
+ .depth = 0,
};
lzma_options_delta opt_delta = {
@@ -97,7 +97,7 @@ main(int argc, char **argv)
.rle = 1, // LZMA_SUBBLOCK_RLE_OFF,
.subfilter_mode = LZMA_SUBFILTER_SET,
};
- opt_subblock.subfilter_options.id = LZMA_FILTER_LZMA;
+ opt_subblock.subfilter_options.id = LZMA_FILTER_LZMA1;
opt_subblock.subfilter_options.options = &opt_lzma;
opt_subblock.subfilter_options.id = LZMA_FILTER_DELTA;
opt_subblock.subfilter_options.options = &opt_delta;