1 /*  GRAPHITE2 LICENSING
2 
3     Copyright 2015, SIL International
4     All rights reserved.
5 
6     This library is free software; you can redistribute it and/or modify
7     it under the terms of the GNU Lesser General Public License as published
8     by the Free Software Foundation; either version 2.1 of License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14     Lesser General Public License for more details.
15 
16     You should also have received a copy of the GNU Lesser General Public
17     License along with this library in the file named "LICENSE".
18     If not, write to the Free Software Foundation, 51 Franklin Street,
19     Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
20     internet at http://www.fsf.org/licenses/lgpl.html.
21 
22 Alternatively, the contents of this file may be used under the terms of the
23 Mozilla Public License (http://mozilla.org/MPL) or the GNU General Public
24 License, as published by the Free Software Foundation, either version 2
25 of the License or (at your option) any later version.
26 */
27 
28 #pragma once
29 
30 #include <cstddef>
31 
32 namespace lz4
33 {
34 
35 // decompress an LZ4 block
36 // Parameters:
37 //      @in         -   Input buffer containing an LZ4 block.
38 //      @in_size    -   Size of the input LZ4 block in bytes.
39 //      @out        -   Output buffer to hold decompressed results.
40 //      @out_size   -   The size of the buffer pointed to by @out.
41 // Invariants:
42 //      @in         -   This buffer must be at least 1 machine word in length,
43 //                      regardless of the actual LZ4 block size.
44 //      @in_size    -   This must be at least 4 and must also be <= to the
45 //                      allocated buffer @in.
46 //      @out        -   This must be bigger than the input buffer and at least
47 //                      13 bytes.
48 //      @out_size   -   Must always be big enough to hold the expected size.
49 // Return:
50 //      -1          -  Decompression failed.
51 //      size        -  Actual number of bytes decompressed.
52 int decompress(void const *in, size_t in_size, void *out, size_t out_size);
53 
54 } // end of namespace shrinker
55