1 /*
2   LZ4io.h - LZ4 File/Stream Interface
3   Copyright (C) Yann Collet 2011-2014
4   GPL v2 License
5 
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2 of the 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
14   GNU General Public License for more details.
15 
16   You should have received a copy of the GNU General Public License along
17   with this program; if not, write to the Free Software Foundation, Inc.,
18   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 
20   You can contact the author at :
21   - LZ4 source repository : http://code.google.com/p/lz4/
22   - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
23 */
24 /*
25   Note : this is stand-alone program.
26   It is not part of LZ4 compression library, it is a user code of the LZ4 library.
27   - The license of LZ4 library is BSD.
28   - The license of xxHash library is BSD.
29   - The license of this source file is GPLv2.
30 */
31 
32 
33 /* ************************************************** */
34 /* Special input/output values                        */
35 /* ************************************************** */
36 #define NULL_OUTPUT "null"
37 static char stdinmark[] = "stdin";
38 static char stdoutmark[] = "stdout";
39 #ifdef _WIN32
40 static char nulmark[] = "nul";
41 #else
42 static char nulmark[] = "/dev/null";
43 #endif
44 
45 
46 /* ************************************************** */
47 /* ****************** Functions ********************* */
48 /* ************************************************** */
49 
50 int LZ4IO_compressFilename  (char* input_filename, char* output_filename, int compressionlevel);
51 int LZ4IO_decompressFilename(char* input_filename, char* output_filename);
52 
53 
54 /* ************************************************** */
55 /* ****************** Parameters ******************** */
56 /* ************************************************** */
57 
58 /* Default setting : overwrite = 1;
59    return : overwrite mode (0/1) */
60 int LZ4IO_setOverwrite(int yes);
61 
62 /* blockSizeID : valid values : 4-5-6-7
63    return : -1 if error, blockSize if OK */
64 int LZ4IO_setBlockSizeID(int blockSizeID);
65 
66 /* Default setting : independent blocks */
67 typedef enum { LZ4IO_blockLinked=0, LZ4IO_blockIndependent} LZ4IO_blockMode_t;
68 int LZ4IO_setBlockMode(LZ4IO_blockMode_t blockMode);
69 
70 /* Default setting : no checksum */
71 int LZ4IO_setBlockChecksumMode(int xxhash);
72 
73 /* Default setting : checksum enabled */
74 int LZ4IO_setStreamChecksumMode(int xxhash);
75 
76 /* Default setting : 0 (no notification) */
77 int LZ4IO_setNotificationLevel(int level);
78