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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#![crate_type = "lib"]
#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate cfg_if;
extern crate num_traits;
#[cfg(any(feature = "bzip2", feature = "gzip"))]
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "bzip2")]
#[macro_use]
extern crate log;
#[cfg(feature = "std")]
extern crate std as core;
#[cfg(not(feature = "std"))]
#[macro_use(vec)]
extern crate alloc;
#[cfg(test)]
extern crate rand;
#[cfg(test)]
extern crate rand_xorshift;
#[cfg(test)]
extern crate simple_logger;
mod action;
mod adler32;
mod bitset;
mod bucket_sort;
mod cbuffer;
mod crc32;
mod error;
mod bitio;
mod suffix_array;
mod huffman;
mod lzss;
mod traits;
mod bzip2;
mod deflate;
mod lzhuf;
mod gzip;
mod zlib;
pub mod prelude {
pub use action::Action;
cfg_if! {
if #[cfg(feature = "bzip2")] {
pub use bzip2::decoder::BZip2Decoder;
pub use bzip2::encoder::BZip2Encoder;
pub use bzip2::error::BZip2Error;
}
}
cfg_if! {
if #[cfg(feature = "deflate")] {
pub use deflate::decoder::Deflater;
pub use deflate::encoder::Inflater;
}
}
cfg_if! {
if #[cfg(feature = "gzip")] {
pub use gzip::decoder::GZipDecoder;
pub use gzip::encoder::GZipEncoder;
}
}
cfg_if! {
if #[cfg(feature = "lzhuf")] {
pub use lzhuf::LzhufMethod;
pub use lzhuf::decoder::LzhufDecoder;
pub use lzhuf::encoder::LzhufEncoder;
}
}
cfg_if! {
if #[cfg(feature = "zlib")] {
pub use zlib::decoder::ZlibDecoder;
pub use zlib::encoder::ZlibEncoder;
}
}
cfg_if! {
if #[cfg(feature = "lzss")] {
pub use lzss::decoder::LzssDecoder;
pub use lzss::encoder::LzssEncoder;
pub use lzss::LzssCode;
}
}
pub use error::CompressionError;
pub use traits::decoder::{DecodeExt, DecodeIterator, Decoder};
pub use traits::encoder::{EncodeExt, EncodeIterator, Encoder};
}