-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathzstream_common.hpp
52 lines (35 loc) · 1.9 KB
/
zstream_common.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
zstream-cpp Library License:
--------------------------
The zlib/libpng License Copyright (c) 2003 Jonathan de Halleux.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution
Author: Jonathan de Halleux, [email protected], 2003
Gero Mueller, [email protected], 2015
*/
#ifndef ZIP_STREAM_COMMON_HPP
#define ZIP_STREAM_COMMON_HPP
#include <stdint.h>
namespace zstream {
/// Compression strategy, see zlib doc.
enum EStrategy {
StrategyFiltered = 1, StrategyHuffmanOnly = 2, DefaultStrategy = 0
};
namespace detail {
/// default gzip buffer size,
/// change this to suite your needs
const size_t default_buffer_size = 4096;
const int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
/* gzip flag byte */
const int gz_ascii_flag = 0x01; /* bit 0 set: file probably ascii text */
const int gz_head_crc = 0x02; /* bit 1 set: header CRC present */
const int gz_extra_field = 0x04; /* bit 2 set: extra field present */
const int gz_orig_name = 0x08; /* bit 3 set: original file name present */
const int gz_comment = 0x10; /* bit 4 set: file comment present */
const int gz_reserved = 0xE0; /* bits 5..7: reserved */
} // detail
} // zstream
#endif