xref: /aosp_15_r20/external/lz4/programs/lz4conf.h (revision 27162e4e17433d5aa7cb38e7b6a433a09405fc7f)
1 /*
2   LZ4conf.h - compile-time parameters
3   Copyright (C) Yann Collet 2011-2024
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 #ifndef LZ4CONF_H_32432
26 #define LZ4CONF_H_32432
27 
28 
29 /* Default compression level.
30  * Can be overridden by environment variable LZ4_CLEVEL.
31  * Can be overridden at runtime using -# command */
32 #ifndef LZ4_CLEVEL_DEFAULT
33 # define LZ4_CLEVEL_DEFAULT 1
34 #endif
35 
36 /* Determines if multithreading is enabled or not
37  * Default: disabled */
38 #ifndef LZ4IO_MULTITHREAD
39 # ifdef _WIN32
40     /* Windows support Completion Ports */
41 #   define LZ4IO_MULTITHREAD 1
42 # else
43     /* Requires <pthread> support.
44      * Can't be reliably and portably tested at source code level */
45 #   define LZ4IO_MULTITHREAD 0
46 # endif
47 #endif
48 
49 /* Determines default nb of threads for compression
50  * Default value is 0, which means "auto" :
51  * nb of threads is determined from detected local cpu.
52  * Can be overriden by Environment Variable LZ4_NBWORKERS.
53  * Can be overridden at runtime using -T# command */
54 #ifndef LZ4_NBWORKERS_DEFAULT
55 # define LZ4_NBWORKERS_DEFAULT 0
56 #endif
57 
58 /* Maximum nb of compression threads selectable at runtime */
59 #ifndef LZ4_NBWORKERS_MAX
60 # define LZ4_NBWORKERS_MAX 200
61 #endif
62 
63 /* Determines default lz4 block size when none provided.
64  * Default value is 7, which represents 4 MB.
65  * Can be overridden at runtime using -B# command */
66 #ifndef LZ4_BLOCKSIZEID_DEFAULT
67 # define LZ4_BLOCKSIZEID_DEFAULT 7
68 #endif
69 
70 
71 #endif  /* LZ4CONF_H_32432 */
72