ゴミ箱
zlib.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9 
10 #ifndef BOOST_BEAST_ZLIB_ZLIB_HPP
11 #define BOOST_BEAST_ZLIB_ZLIB_HPP
12 
13 #include <boost/beast/config.hpp>
14 #include <cstdint>
15 #include <cstdlib>
16 
17 // This is a derivative work based on Zlib, copyright below:
18 /*
19  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
20 
21  This software is provided 'as-is', without any express or implied
22  warranty. In no event will the authors be held liable for any damages
23  arising from the use of this software.
24 
25  Permission is granted to anyone to use this software for any purpose,
26  including commercial applications, and to alter it and redistribute it
27  freely, subject to the following restrictions:
28 
29  1. The origin of this software must not be misrepresented; you must not
30  claim that you wrote the original software. If you use this software
31  in a product, an acknowledgment in the product documentation would be
32  appreciated but is not required.
33  2. Altered source versions must be plainly marked as such, and must not be
34  misrepresented as being the original software.
35  3. This notice may not be removed or altered from any source distribution.
36 
37  Jean-loup Gailly Mark Adler
38  jloup@gzip.org madler@alumni.caltech.edu
39 
40  The data format used by the zlib library is described by RFCs (Request for
41  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
42  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
43 */
44 
45 namespace boost {
46 namespace beast {
47 namespace zlib {
48 
49 #if !defined(__MACTYPES__)
50 typedef unsigned char Byte; /* 8 bits */
51 #endif
52 typedef unsigned int uInt; /* 16 bits or more */
53 
54 /* Possible values of the data_type field (though see inflate()) */
55 enum z_Type
56 {
57  Z_BINARY = 0,
58  Z_TEXT = 1,
60 };
61 
79 struct z_params
80 {
85  void const* next_in;
86 
91  std::size_t avail_in;
92 
95  std::size_t total_in = 0;
96 
99  void* next_out;
100 
103  std::size_t avail_out;
104 
107  std::size_t total_out = 0;
108 
109  int data_type = Z_UNKNOWN; // best guess about the data type: binary or text
110 };
111 
114 enum class Flush
115 {
116  // order matters
117 
118  none,
119  block,
120  partial,
121  sync,
122  full,
123  finish,
124  trees
125 };
126 
127 /* compression levels */
129 {
134 };
135 
140 enum class Strategy
141 {
147  normal,
148 
154  filtered,
155 
161  huffman,
162 
169  rle,
170 
176  fixed
177 };
178 
179 } // zlib
180 } // beast
181 } // boost
182 
183 #endif
184 
int data_type
Definition: zlib.hpp:109
Definition: zlib.hpp:131
Definition: async_result.hpp:20
Definition: zlib.hpp:59
Definition: zlib.hpp:79
Definition: zlib.hpp:130
std::size_t total_out
Definition: zlib.hpp:107
Definition: zlib.hpp:57
unsigned char Byte
Definition: zlib.hpp:50
unsigned int uInt
Definition: zlib.hpp:52
Definition: zlib.hpp:58
Flush
Definition: zlib.hpp:114
std::size_t total_in
Definition: zlib.hpp:95
z_Compression
Definition: zlib.hpp:128
z_Type
Definition: zlib.hpp:55
void const * next_in
Definition: zlib.hpp:85
void * next_out
Definition: zlib.hpp:99
std::size_t avail_out
Definition: zlib.hpp:103
std::size_t avail_in
Definition: zlib.hpp:91
Strategy
Definition: zlib.hpp:140