]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // Copyright (c) 2013-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 | // This is a derivative work based on Zlib, copyright below: | |
8 | /* | |
9 | Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler | |
10 | ||
11 | This software is provided 'as-is', without any express or implied | |
12 | warranty. In no event will the authors be held liable for any damages | |
13 | arising from the use of this software. | |
14 | ||
15 | Permission is granted to anyone to use this software for any purpose, | |
16 | including commercial applications, and to alter it and redistribute it | |
17 | freely, subject to the following restrictions: | |
18 | ||
19 | 1. The origin of this software must not be misrepresented; you must not | |
20 | claim that you wrote the original software. If you use this software | |
21 | in a product, an acknowledgment in the product documentation would be | |
22 | appreciated but is not required. | |
23 | 2. Altered source versions must be plainly marked as such, and must not be | |
24 | misrepresented as being the original software. | |
25 | 3. This notice may not be removed or altered from any source distribution. | |
26 | ||
27 | Jean-loup Gailly Mark Adler | |
28 | jloup@gzip.org madler@alumni.caltech.edu | |
29 | ||
30 | The data format used by the zlib library is described by RFCs (Request for | |
31 | Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 | |
32 | (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). | |
33 | */ | |
34 | ||
35 | #ifndef BEAST_ZLIB_ERROR_HPP | |
36 | #define BEAST_ZLIB_ERROR_HPP | |
37 | ||
38 | #include <beast/config.hpp> | |
39 | #include <beast/core/error.hpp> | |
40 | ||
41 | namespace beast { | |
42 | namespace zlib { | |
43 | ||
44 | /** Error codes returned by the codec. | |
45 | */ | |
46 | enum class error | |
47 | { | |
48 | /** Additional buffers are required. | |
49 | ||
50 | This error indicates that one or both of the buffers | |
51 | provided buffers do not have sufficient available bytes | |
52 | to make forward progress. | |
53 | ||
54 | This does not always indicate a failure condition. | |
55 | ||
56 | @note This is the same as `Z_BUF_ERROR` returned by ZLib. | |
57 | */ | |
58 | need_buffers = 1, | |
59 | ||
60 | /** End of stream reached. | |
61 | ||
62 | @note This is the same as `Z_STREAM_END` returned by ZLib. | |
63 | */ | |
64 | end_of_stream, | |
65 | ||
66 | /** Invalid stream or parameters. | |
67 | ||
68 | This error is returned when invalid parameters are passed, | |
69 | or the operation being performed is not consistent with the | |
70 | state of the stream. For example, attempting to write data | |
71 | when the end of stream is already reached. | |
72 | ||
73 | @note This is the same as `Z_STREAM_ERROR` returned by ZLib. | |
74 | */ | |
75 | stream_error, | |
76 | ||
77 | // | |
78 | // Errors generated by basic_deflate_stream | |
79 | // | |
80 | ||
81 | // | |
82 | // Errors generated by basic_inflate_stream | |
83 | // | |
84 | ||
85 | /// Invalid block type | |
86 | invalid_block_type, | |
87 | ||
88 | /// Invalid stored block length | |
89 | invalid_stored_length, | |
90 | ||
91 | /// Too many length or distance symbols | |
92 | too_many_symbols, | |
93 | ||
94 | /// Invalid code lengths | |
95 | invalid_code_lenths, | |
96 | ||
97 | /// Invalid bit length repeat | |
98 | invalid_bit_length_repeat, | |
99 | ||
100 | /// Missing end of block code | |
101 | missing_eob, | |
102 | ||
103 | /// Invalid literal/length code | |
104 | invalid_literal_length, | |
105 | ||
106 | /// Invalid distance code | |
107 | invalid_distance_code, | |
108 | ||
109 | /// Invalid distance too far back | |
110 | invalid_distance, | |
111 | ||
112 | // | |
113 | // Errors generated by inflate_table | |
114 | // | |
115 | ||
116 | /// Over-subscribed length code | |
117 | over_subscribed_length, | |
118 | ||
119 | /// Incomplete length set | |
120 | incomplete_length_set, | |
121 | ||
122 | ||
123 | ||
124 | /// general error | |
125 | general | |
126 | }; | |
127 | ||
128 | } // zlib | |
129 | } // beast | |
130 | ||
131 | #include <beast/zlib/impl/error.ipp> | |
132 | ||
133 | #endif | |
134 |