aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-11-28 21:02:19 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-11-28 21:02:19 +0200
commit072ebf7b1335421193ffa9d4a70d5533786b8995 (patch)
tree0545ce31198aec19fcbc98c5b9af36268d6a3b74 /src/liblzma/common
parentliblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused. (diff)
downloadxz-072ebf7b1335421193ffa9d4a70d5533786b8995.tar.xz
liblzma: Make lzma_validate_chain() available outside filter_common.c.
Diffstat (limited to 'src/liblzma/common')
-rw-r--r--src/liblzma/common/filter_common.c8
-rw-r--r--src/liblzma/common/filter_common.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/liblzma/common/filter_common.c b/src/liblzma/common/filter_common.c
index c8694e2c..fa0927cf 100644
--- a/src/liblzma/common/filter_common.c
+++ b/src/liblzma/common/filter_common.c
@@ -238,8 +238,8 @@ lzma_filters_free(lzma_filter *filters, const lzma_allocator *allocator)
}
-static lzma_ret
-validate_chain(const lzma_filter *filters, size_t *count)
+extern lzma_ret
+lzma_validate_chain(const lzma_filter *filters, size_t *count)
{
// There must be at least one filter.
if (filters == NULL || filters[0].id == LZMA_VLI_UNKNOWN)
@@ -293,7 +293,7 @@ lzma_raw_coder_init(lzma_next_coder *next, const lzma_allocator *allocator,
{
// Do some basic validation and get the number of filters.
size_t count;
- return_if_error(validate_chain(options, &count));
+ return_if_error(lzma_validate_chain(options, &count));
// Set the filter functions and copy the options pointer.
lzma_filter_info filters[LZMA_FILTERS_MAX + 1];
@@ -346,7 +346,7 @@ lzma_raw_coder_memusage(lzma_filter_find coder_find,
// The chain has to have at least one filter.
{
size_t tmp;
- if (validate_chain(filters, &tmp) != LZMA_OK)
+ if (lzma_validate_chain(filters, &tmp) != LZMA_OK)
return UINT64_MAX;
}
diff --git a/src/liblzma/common/filter_common.h b/src/liblzma/common/filter_common.h
index 9390305c..2e47bb69 100644
--- a/src/liblzma/common/filter_common.h
+++ b/src/liblzma/common/filter_common.h
@@ -35,6 +35,9 @@ typedef struct {
typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
+extern lzma_ret lzma_validate_chain(const lzma_filter *filters, size_t *count);
+
+
extern lzma_ret lzma_raw_coder_init(
lzma_next_coder *next, const lzma_allocator *allocator,
const lzma_filter *filters,