Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
lz4io.h
Go to the documentation of this file.
1/*
2 LZ4io.h - LZ4 File/Stream Interface
3 Copyright (C) Yann Collet 2011-2023
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 stdinmark "stdin"
43#define stdoutmark "stdout"
44#define NULL_OUTPUT "null"
45#ifdef _WIN32
46#define nulmark "nul"
47#else
48#define nulmark "/dev/null"
49#endif
50
51/* ************************************************** */
52/* ****************** Type Definitions ************** */
53/* ************************************************** */
54
56
59
60
61/* *************************************************** */
62/* ****************** Processing ********************* */
63/* *************************************************** */
64
65/* if output_filename == stdoutmark, writes to stdout */
66int LZ4IO_compressFilename(const char* input_filename, const char* output_filename, int compressionlevel, const LZ4IO_prefs_t* prefs);
67int LZ4IO_decompressFilename(const char* input_filename, const char* output_filename, const LZ4IO_prefs_t* prefs);
68
69/* if suffix == stdoutmark, writes to stdout */
70int LZ4IO_compressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix, int compressionlevel, const LZ4IO_prefs_t* prefs);
71int LZ4IO_decompressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix, const LZ4IO_prefs_t* prefs);
72
73
74/* ************************************************** */
75/* ****************** Parameters ******************** */
76/* ************************************************** */
77
78int LZ4IO_setNbWorkers(LZ4IO_prefs_t* const prefs, int nbWorkers);
80
82
83/* Default setting : passThrough = 0;
84 return : passThrough mode (0/1) */
85int LZ4IO_setPassThrough(LZ4IO_prefs_t* const prefs, int yes);
86
87/* Default setting : overwrite = 1;
88 return : overwrite mode (0/1) */
89int LZ4IO_setOverwrite(LZ4IO_prefs_t* const prefs, int yes);
90
91/* Default setting : testMode = 0;
92 return : testMode (0/1) */
93int LZ4IO_setTestMode(LZ4IO_prefs_t* const prefs, int yes);
94
95/* blockSizeID : valid values : 4-5-6-7
96 return : 0 if error, blockSize if OK */
97size_t LZ4IO_setBlockSizeID(LZ4IO_prefs_t* const prefs, unsigned blockSizeID);
98
99/* blockSize : valid values : 32 -> 4MB
100 return : 0 if error, actual blocksize if OK */
101size_t LZ4IO_setBlockSize(LZ4IO_prefs_t* const prefs, size_t blockSize);
102
103/* Default setting : independent blocks */
105int LZ4IO_setBlockMode(LZ4IO_prefs_t* const prefs, LZ4IO_blockMode_t blockMode);
106
107/* Default setting : no block checksum */
108int LZ4IO_setBlockChecksumMode(LZ4IO_prefs_t* const prefs, int xxhash);
109
110/* Default setting : stream checksum enabled */
111int LZ4IO_setStreamChecksumMode(LZ4IO_prefs_t* const prefs, int xxhash);
112
113/* Default setting : 0 (no notification) */
114int LZ4IO_setNotificationLevel(int level);
115
116/* Default setting : 0 (disabled) */
117int LZ4IO_setSparseFile(LZ4IO_prefs_t* const prefs, int enable);
118
119/* Default setting : 0 == no content size present in frame header */
120int LZ4IO_setContentSize(LZ4IO_prefs_t* const prefs, int enable);
121
122/* Default setting : 0 == src file preserved */
123void LZ4IO_setRemoveSrcFile(LZ4IO_prefs_t* const prefs, unsigned flag);
124
125/* Default setting : 0 == favor compression ratio
126 * Note : 1 only works for high compression levels (10+) */
127void LZ4IO_favorDecSpeed(LZ4IO_prefs_t* const prefs, int favor);
128
129
130/* implement --list
131 * @return 0 on success, 1 on error */
132int LZ4IO_displayCompressedFilesInfo(const char** inFileNames, size_t ifnIdx);
133
134
135#endif /* LZ4IO_H_237902873 */
int LZ4IO_setPassThrough(LZ4IO_prefs_t *const prefs, int yes)
Definition lz4io.c:254
int LZ4IO_displayCompressedFilesInfo(const char **inFileNames, size_t ifnIdx)
Definition lz4io.c:2855
int LZ4IO_setDictionaryFilename(LZ4IO_prefs_t *const prefs, const char *dictionaryFilename)
Definition lz4io.c:246
int LZ4IO_setStreamChecksumMode(LZ4IO_prefs_t *const prefs, int xxhash)
Definition lz4io.c:318
size_t LZ4IO_setBlockSizeID(LZ4IO_prefs_t *const prefs, unsigned blockSizeID)
Definition lz4io.c:275
LZ4IO_prefs_t * LZ4IO_defaultPreferences(void)
Definition lz4io.c:216
int LZ4IO_setBlockMode(LZ4IO_prefs_t *const prefs, LZ4IO_blockMode_t blockMode)
Definition lz4io.c:304
int LZ4IO_compressMultipleFilenames(const char **inFileNamesTable, int ifntSize, const char *suffix, int compressionlevel, const LZ4IO_prefs_t *prefs)
Definition lz4io.c:1531
LZ4IO_blockMode_t
Definition lz4io.h:104
@ LZ4IO_blockLinked
Definition lz4io.h:104
@ LZ4IO_blockIndependent
Definition lz4io.h:104
void LZ4IO_favorDecSpeed(LZ4IO_prefs_t *const prefs, int favor)
Definition lz4io.c:346
size_t LZ4IO_setBlockSize(LZ4IO_prefs_t *const prefs, size_t blockSize)
Definition lz4io.c:286
int LZ4IO_setOverwrite(LZ4IO_prefs_t *const prefs, int yes)
Definition lz4io.c:261
int LZ4IO_compressFilename(const char *input_filename, const char *output_filename, int compressionlevel, const LZ4IO_prefs_t *prefs)
Definition lz4io.c:1513
int LZ4IO_defaultNbWorkers(void)
Definition lz4io.c:177
int LZ4IO_setBlockChecksumMode(LZ4IO_prefs_t *const prefs, int xxhash)
Definition lz4io.c:311
int LZ4IO_setNbWorkers(LZ4IO_prefs_t *const prefs, int nbWorkers)
Definition lz4io.c:238
int LZ4IO_decompressFilename(const char *input_filename, const char *output_filename, const LZ4IO_prefs_t *prefs)
Definition lz4io.c:2493
int LZ4IO_setSparseFile(LZ4IO_prefs_t *const prefs, int enable)
Definition lz4io.c:332
void LZ4IO_setRemoveSrcFile(LZ4IO_prefs_t *const prefs, unsigned flag)
Definition lz4io.c:351
int LZ4IO_setTestMode(LZ4IO_prefs_t *const prefs, int yes)
Definition lz4io.c:268
void LZ4IO_freePreferences(LZ4IO_prefs_t *prefs)
Definition lz4io.c:211
int LZ4IO_decompressMultipleFilenames(const char **inFileNamesTable, int ifntSize, const char *suffix, const LZ4IO_prefs_t *prefs)
Definition lz4io.c:2508
int LZ4IO_setNotificationLevel(int level)
Definition lz4io.c:325
int LZ4IO_setContentSize(LZ4IO_prefs_t *const prefs, int enable)
Definition lz4io.c:339
Definition lz4io.c:193
const char * dictionaryFilename
Definition lz4io.c:206
int nbWorkers
Definition lz4io.c:208
size_t blockSize
Definition lz4io.c:198
uint compressionlevel
Definition dll.c:113