summaryrefslogtreecommitdiff
path: root/lib/compression/lzxpress_huffman.h
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2023-03-28 15:42:39 +1300
committerAndrew Bartlett <abartlet@samba.org>2023-03-31 01:48:30 +0000
commit0ab5552c8c32e7d7196b5a33eaa5533ccac53d0e (patch)
tree6b8e8d8aa2a5b415e97994ea9b7149d85ec6d4ed /lib/compression/lzxpress_huffman.h
parent976dfc7585fcce594f5e77c8bb8ccc9644625f95 (diff)
downloadsamba-0ab5552c8c32e7d7196b5a33eaa5533ccac53d0e.tar.gz
lib/compression: Add helper function lzxpress_huffman_max_compressed_size()
This allows the calculation of the worst case to be shared with callers. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/compression/lzxpress_huffman.h')
-rw-r--r--lib/compression/lzxpress_huffman.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compression/lzxpress_huffman.h b/lib/compression/lzxpress_huffman.h
index 04de448bcce..232e58920f5 100644
--- a/lib/compression/lzxpress_huffman.h
+++ b/lib/compression/lzxpress_huffman.h
@@ -83,5 +83,13 @@ uint8_t *lzxpress_huffman_decompress_talloc(TALLOC_CTX *mem_ctx,
size_t input_size,
size_t output_size);
+/*
+ * lzxpress_huffman_max_compressed_size()
+ *
+ * Return the most bytes the compression can take, to allow
+ * pre-allocation.
+ */
+size_t lzxpress_huffman_max_compressed_size(size_t input_size);
+
#endif /* HAVE_LZXPRESS_HUFFMAN_H */