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
55 const int WR_MEM_ERROR = 1;
56 const int WR_VERSION_ERROR = 2;
57 const int WR_STREAM_ERROR = 3;
58 const int WR_DATA_ERROR = 4;
59 const int WR_NO_FLUSH = 5;
60 const int WR_BUF_ERROR = 6;
61 const int WR_STREAM_END = 7;
62 const int WR_FINISH = 8;
64 enum wrapperlib_mode { zlib_mode, bzlib_mode };
80 void set_next_in(
const char *x) {
return (this->*x_set_next_in)(x); };
81 void set_avail_in(U_I x) {
return (this->*x_set_avail_in)(x); };
82 U_I get_avail_in()
const {
return (this->*x_get_avail_in)(); };
83 U_64 get_total_in()
const {
return (this->*x_get_total_in)(); };
85 void set_next_out(
char *x) {
return (this->*x_set_next_out)(x); };
86 char *get_next_out()
const {
return (this->*x_get_next_out)(); };
87 void set_avail_out(U_I x) {
return (this->*x_set_avail_out)(x); };
88 U_I get_avail_out()
const {
return (this->*x_get_avail_out)(); };
89 U_64 get_total_out()
const {
return (this->*x_get_total_out)(); };
91 S_I compressInit(U_I compression_level) { level = compression_level;
return (this->*x_compressInit)(compression_level); };
92 S_I decompressInit() {
return (this->*x_decompressInit)(); };
93 S_I compressEnd() {
return (this->*x_compressEnd)(); };
94 S_I decompressEnd() {
return (this->*x_decompressEnd)(); };
95 S_I compress(S_I flag) {
return (this->*x_compress)(flag); };
96 S_I decompress(S_I flag) {
return (this->*x_decompress)(flag);};
98 S_I decompressReset();
109 void (
wrapperlib::*x_set_next_in)(
const char *x);
120 S_I (
wrapperlib::*x_compressInit)(U_I compression_level);
130 S_I z_compressInit(U_I compression_level);
131 S_I z_decompressInit();
133 S_I z_decompressEnd();
134 S_I z_compress(S_I flag);
135 S_I z_decompress(S_I flag);
136 void z_set_next_in(
const char *x);
137 void z_set_avail_in(U_I x);
138 U_I z_get_avail_in()
const;
139 U_64 z_get_total_in()
const;
140 void z_set_next_out(
char *x);
141 char *z_get_next_out()
const;
142 void z_set_avail_out(U_I x);
143 U_I z_get_avail_out()
const;
144 U_64 z_get_total_out()
const;
149 S_I bz_compressInit(U_I compression_level);
150 S_I bz_decompressInit();
151 S_I bz_compressEnd();
152 S_I bz_decompressEnd();
153 S_I bz_compress(S_I flag);
154 S_I bz_decompress(S_I flag);
155 void bz_set_next_in(
const char *x);
156 void bz_set_avail_in(U_I x);
157 U_I bz_get_avail_in()
const;
158 U_64 bz_get_total_in()
const;
159 void bz_set_next_out(
char *x);
160 char *bz_get_next_out()
const;
161 void bz_set_avail_out(U_I x);
162 U_I bz_get_avail_out()
const;
163 U_64 bz_get_total_out()
const;
are defined here basic integer types that tend to be portable
this class encapsulates calls to libz or libbz2