aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-11-24 01:02:50 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-11-24 01:02:50 +0200
commitd0901645170b638c517f5c50866b6ef48f491c65 (patch)
tree83e4233391f110f7d23bc706d52ccb462248e365 /src/liblzma/api
parentCMake: Don't use symbol versioning with static library. (diff)
downloadxz-d0901645170b638c517f5c50866b6ef48f491c65.tar.xz
liblzma: Add new API function lzma_filters_free().
This is small but convenient and should have been added a long time ago.
Diffstat (limited to 'src/liblzma/api')
-rw-r--r--src/liblzma/api/lzma/filter.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/liblzma/api/lzma/filter.h b/src/liblzma/api/lzma/filter.h
index 5ec9976d..41c5895e 100644
--- a/src/liblzma/api/lzma/filter.h
+++ b/src/liblzma/api/lzma/filter.h
@@ -125,6 +125,27 @@ extern LZMA_API(lzma_ret) lzma_filters_copy(
/**
+ * \brief Free the options in the array of lzma_filter structures
+ *
+ * This frees the filter chain options. The filters array itself is not freed.
+ *
+ * The filters array must have at most LZMA_FILTERS_MAX + 1 elements
+ * including the terminating element which must have .id = LZMA_VLI_UNKNOWN.
+ * For all elements before the terminating element:
+ * - options will be freed using the given lzma_allocator or,
+ * if allocator is NULL, using free().
+ * - options will be set to NULL.
+ * - id will be set to LZMA_VLI_UNKNOWN.
+ *
+ * If filters is NULL, this does nothing but remember that this never frees
+ * the filters array itself.
+ */
+extern LZMA_API(void) lzma_filters_free(
+ lzma_filter *filters, const lzma_allocator *allocator)
+ lzma_nothrow;
+
+
+/**
* \brief Calculate approximate memory requirements for raw encoder
*
* This function can be used to calculate the memory requirements for