33 #ifndef WRAPPERLIB_HPP
34 #define WRAPPERLIB_HPP
36 #include "../my_config.h"
40 #if HAVE_ZLIB_H && LIBZ_AVAILABLE
44 #if HAVE_BZLIB_H && LIBBZ2_AVAILABLE
58 const int WR_MEM_ERROR = 1;
59 const int WR_VERSION_ERROR = 2;
60 const int WR_STREAM_ERROR = 3;
61 const int WR_DATA_ERROR = 4;
62 const int WR_NO_FLUSH = 5;
63 const int WR_BUF_ERROR = 6;
64 const int WR_STREAM_END = 7;
65 const int WR_FINISH = 8;
67 enum wrapperlib_mode { zlib_mode, bzlib_mode };
83 void set_next_in(
const char *x) {
return (this->*x_set_next_in)(x); };
84 void set_avail_in(U_I x) {
return (this->*x_set_avail_in)(x); };
85 U_I get_avail_in()
const {
return (this->*x_get_avail_in)(); };
86 U_64 get_total_in()
const {
return (this->*x_get_total_in)(); };
88 void set_next_out(
char *x) {
return (this->*x_set_next_out)(x); };
89 char *get_next_out()
const {
return (this->*x_get_next_out)(); };
90 void set_avail_out(U_I x) {
return (this->*x_set_avail_out)(x); };
91 U_I get_avail_out()
const {
return (this->*x_get_avail_out)(); };
92 U_64 get_total_out()
const {
return (this->*x_get_total_out)(); };
94 S_I compressInit(U_I compression_level) { level = compression_level;
return (this->*x_compressInit)(compression_level); };
95 S_I decompressInit() {
return (this->*x_decompressInit)(); };
96 S_I compressEnd() {
return (this->*x_compressEnd)(); };
97 S_I decompressEnd() {
return (this->*x_decompressEnd)(); };
98 S_I compress(S_I flag) {
return (this->*x_compress)(flag); };
99 S_I decompress(S_I flag) {
return (this->*x_decompress)(flag);};
101 S_I decompressReset();
112 void (
wrapperlib::*x_set_next_in)(
const char *x);
123 S_I (
wrapperlib::*x_compressInit)(U_I compression_level);
133 S_I z_compressInit(U_I compression_level);
134 S_I z_decompressInit();
136 S_I z_decompressEnd();
137 S_I z_compress(S_I flag);
138 S_I z_decompress(S_I flag);
139 void z_set_next_in(
const char *x);
140 void z_set_avail_in(U_I x);
141 U_I z_get_avail_in()
const;
142 U_64 z_get_total_in()
const;
143 void z_set_next_out(
char *x);
144 char *z_get_next_out()
const;
145 void z_set_avail_out(U_I x);
146 U_I z_get_avail_out()
const;
147 U_64 z_get_total_out()
const;
152 S_I bz_compressInit(U_I compression_level);
153 S_I bz_decompressInit();
154 S_I bz_compressEnd();
155 S_I bz_decompressEnd();
156 S_I bz_compress(S_I flag);
157 S_I bz_decompress(S_I flag);
158 void bz_set_next_in(
const char *x);
159 void bz_set_avail_in(U_I x);
160 U_I bz_get_avail_in()
const;
161 U_64 bz_get_total_in()
const;
162 void bz_set_next_out(
char *x);
163 char *bz_get_next_out()
const;
164 void bz_set_avail_out(U_I x);
165 U_I bz_get_avail_out()
const;
166 U_64 bz_get_total_out()
const;