30 #ifndef WRAPPERLIB_HPP 31 #define WRAPPERLIB_HPP 33 #include "../my_config.h" 37 #if HAVE_ZLIB_H && LIBZ_AVAILABLE 41 #if HAVE_BZLIB_H && LIBBZ2_AVAILABLE 45 #if HAVE_LZMA_H && LIBLZMA_AVAILABLE 60 const int WR_MEM_ERROR = 1;
61 const int WR_VERSION_ERROR = 2;
62 const int WR_STREAM_ERROR = 3;
63 const int WR_DATA_ERROR = 4;
64 const int WR_NO_FLUSH = 5;
65 const int WR_BUF_ERROR = 6;
66 const int WR_STREAM_END = 7;
67 const int WR_FINISH = 8;
69 enum wrapperlib_mode { zlib_mode, bzlib_mode, xz_mode };
85 void set_next_in(
const char *x) {
return (this->*x_set_next_in)(x); };
86 void set_avail_in(U_I x) {
return (this->*x_set_avail_in)(x); };
87 U_I get_avail_in()
const {
return (this->*x_get_avail_in)(); };
88 U_64 get_total_in()
const {
return (this->*x_get_total_in)(); };
90 void set_next_out(
char *x) {
return (this->*x_set_next_out)(x); };
91 char *get_next_out()
const {
return (this->*x_get_next_out)(); };
92 void set_avail_out(U_I x) {
return (this->*x_set_avail_out)(x); };
93 U_I get_avail_out()
const {
return (this->*x_get_avail_out)(); };
94 U_64 get_total_out()
const {
return (this->*x_get_total_out)(); };
96 S_I compressInit(U_I compression_level) { level = compression_level;
return (this->*x_compressInit)(compression_level); };
97 S_I decompressInit() {
return (this->*x_decompressInit)(); };
98 S_I compressEnd() {
return (this->*x_compressEnd)(); };
99 S_I decompressEnd() {
return (this->*x_decompressEnd)(); };
100 S_I compress(S_I flag) {
return (this->*x_compress)(flag); };
101 S_I decompress(S_I flag) {
return (this->*x_decompress)(flag);};
103 S_I decompressReset();
112 #if LIBLZMA_AVAILABLE 113 lzma_stream *lzma_ptr;
118 void (
wrapperlib::*x_set_next_in)(
const char *x);
129 S_I (
wrapperlib::*x_compressInit)(U_I compression_level);
139 S_I z_compressInit(U_I compression_level);
140 S_I z_decompressInit();
142 S_I z_decompressEnd();
143 S_I z_compress(S_I flag);
144 S_I z_decompress(S_I flag);
145 void z_set_next_in(
const char *x);
146 void z_set_avail_in(U_I x);
147 U_I z_get_avail_in()
const;
148 U_64 z_get_total_in()
const;
149 void z_set_next_out(
char *x);
150 char *z_get_next_out()
const;
151 void z_set_avail_out(U_I x);
152 U_I z_get_avail_out()
const;
153 U_64 z_get_total_out()
const;
158 S_I bz_compressInit(U_I compression_level);
159 S_I bz_decompressInit();
160 S_I bz_compressEnd();
161 S_I bz_decompressEnd();
162 S_I bz_compress(S_I flag);
163 S_I bz_decompress(S_I flag);
164 void bz_set_next_in(
const char *x);
165 void bz_set_avail_in(U_I x);
166 U_I bz_get_avail_in()
const;
167 U_64 bz_get_total_in()
const;
168 void bz_set_next_out(
char *x);
169 char *bz_get_next_out()
const;
170 void bz_set_avail_out(U_I x);
171 U_I bz_get_avail_out()
const;
172 U_64 bz_get_total_out()
const;
176 #if LIBLZMA_AVAILABLE 177 S_I lzma_compressInit(U_I compression_level);
178 S_I lzma_decompressInit();
180 S_I lzma_encode(S_I flag);
181 void lzma_set_next_in(
const char *x);
182 void lzma_set_avail_in(U_I x);
183 U_I lzma_get_avail_in()
const;
184 U_64 lzma_get_total_in()
const;
185 void lzma_set_next_out(
char *x);
186 char *lzma_get_next_out()
const;
187 void lzma_set_avail_out(U_I x);
188 U_I lzma_get_avail_out()
const;
189 U_64 lzma_get_total_out()
const;
are defined here basic integer types that tend to be portable
this class encapsulates calls to libz or libbz2
this is the base class of object that can be allocated on a memory pool
libdar namespace encapsulate all libdar symbols