1 | // SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later |
2 | // Copyright 2015, SIL International, All rights reserved. |
3 | |
4 | |
5 | #pragma once |
6 | |
7 | #include <cstddef> |
8 | |
9 | namespace lz4 |
10 | { |
11 | |
12 | // decompress an LZ4 block |
13 | // Parameters: |
14 | // @in - Input buffer containing an LZ4 block. |
15 | // @in_size - Size of the input LZ4 block in bytes. |
16 | // @out - Output buffer to hold decompressed results. |
17 | // @out_size - The size of the buffer pointed to by @out. |
18 | // Invariants: |
19 | // @in - This buffer must be at least 1 machine word in length, |
20 | // regardless of the actual LZ4 block size. |
21 | // @in_size - This must be at least 4 and must also be <= to the |
22 | // allocated buffer @in. |
23 | // @out - This must be bigger than the input buffer and at least |
24 | // 13 bytes. |
25 | // @out_size - Must always be big enough to hold the expected size. |
26 | // Return: |
27 | // -1 - Decompression failed. |
28 | // size - Actual number of bytes decompressed. |
29 | int decompress(void const *in, size_t in_size, void *out, size_t out_size); |
30 | |
31 | } // end of namespace shrinker |
32 | |