1/*
2  LZ4io.h - LZ4 File/Stream Interface
3  Copyright (C) Yann Collet 2011-2016
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 : https://github.com/lz4/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#ifndef LZ4IO_H_237902873
33#define LZ4IO_H_237902873
34
35/*---   Dependency   ---*/
36#include <stddef.h>   /* size_t */
37
38
39/* ************************************************** */
40/* Special input/output values                        */
41/* ************************************************** */
42#define NULL_OUTPUT "null"
43static const char stdinmark[]  = "stdin";
44static const char stdoutmark[] = "stdout";
45#ifdef _WIN32
46static const char nulmark[] = "nul";
47#else
48static const char nulmark[] = "/dev/null";
49#endif
50
51
52/* ************************************************** */
53/* ****************** Functions ********************* */
54/* ************************************************** */
55
56int LZ4IO_compressFilename  (const char* input_filename, const char* output_filename, int compressionlevel);
57int LZ4IO_decompressFilename(const char* input_filename, const char* output_filename);
58
59int LZ4IO_compressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix, int compressionlevel);
60int LZ4IO_decompressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix);
61
62
63/* ************************************************** */
64/* ****************** Parameters ******************** */
65/* ************************************************** */
66
67/* Default setting : overwrite = 1;
68   return : overwrite mode (0/1) */
69int LZ4IO_setOverwrite(int yes);
70
71/* Default setting : testMode = 0;
72   return : testMode (0/1) */
73int LZ4IO_setTestMode(int yes);
74
75/* blockSizeID : valid values : 4-5-6-7
76   return : 0 if error, blockSize if OK */
77size_t LZ4IO_setBlockSizeID(unsigned blockSizeID);
78
79/* Default setting : independent blocks */
80typedef enum { LZ4IO_blockLinked=0, LZ4IO_blockIndependent} LZ4IO_blockMode_t;
81int LZ4IO_setBlockMode(LZ4IO_blockMode_t blockMode);
82
83/* Default setting : no block checksum */
84int LZ4IO_setBlockChecksumMode(int xxhash);
85
86/* Default setting : stream checksum enabled */
87int LZ4IO_setStreamChecksumMode(int xxhash);
88
89/* Default setting : 0 (no notification) */
90int LZ4IO_setNotificationLevel(int level);
91
92/* Default setting : 0 (disabled) */
93int LZ4IO_setSparseFile(int enable);
94
95/* Default setting : 0 (disabled) */
96int LZ4IO_setContentSize(int enable);
97
98void LZ4IO_setRemoveSrcFile(unsigned flag);
99
100
101#endif  /* LZ4IO_H_237902873 */
102