typedef const char * (*orig_zlibVersion)(void); orig_zlibVersion zlib_zlibVersion; ZEXTERN const char * ZEXPORT zlibVersion OF((void)) { if(!zlib_zlibVersion) { zlib_zlibVersion = (orig_zlibVersion) dlsym(RTLD_NEXT,"zlibVersion"); return z_zlibVersion(void); } return zlib_zlibVersion(void); } typedef int (*orig_deflateInit_)(z_streamp strm, int level, const char *version, int stream_size); orig_deflateInit_ zlib_deflateInit_; ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)) { if(!zlib_deflateInit_) { zlib_deflateInit_ = (orig_deflateInit_) dlsym(RTLD_NEXT,"deflateInit_"); return z_deflateInit_(strm, level, version, stream_size); } return zlib_deflateInit_(strm, level, version, stream_size); } typedef int (*orig_deflateInit2_)(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size); orig_deflateInit2_ zlib_deflateInit2_; ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)) { if(!zlib_deflateInit2_) { zlib_deflateInit2_ = (orig_deflateInit2_) dlsym(RTLD_NEXT,"deflateInit2_"); return z_deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size); } return zlib_deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size); } typedef int (*orig_deflateReset)(z_streamp strm); orig_deflateReset zlib_deflateReset; ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)) { if(!zlib_deflateReset) { zlib_deflateReset = (orig_deflateReset) dlsym(RTLD_NEXT,"deflateReset"); return z_deflateReset(strm); } return zlib_deflateReset(strm); } typedef int (*orig_deflateSetDictionary)(z_streamp strm, const Bytef *dictionary, uInt dictLength); orig_deflateSetDictionary zlib_deflateSetDictionary; ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)) { if(!zlib_deflateSetDictionary) { zlib_deflateSetDictionary = (orig_deflateSetDictionary) dlsym(RTLD_NEXT,"deflateSetDictionary"); return z_deflateSetDictionary(strm, dictionary, dictLength); } return zlib_deflateSetDictionary(strm, dictionary, dictLength); } typedef int (*orig_deflate)(z_streamp strm, int flush); orig_deflate zlib_deflate; ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)) { if(!zlib_deflate) { zlib_deflate = (orig_deflate) dlsym(RTLD_NEXT,"deflate"); return z_deflate(strm, flush); } return zlib_deflate(strm, flush); } typedef int (*orig_deflateEnd)(z_streamp strm); orig_deflateEnd zlib_deflateEnd; ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)) { if(!zlib_deflateEnd) { zlib_deflateEnd = (orig_deflateEnd) dlsym(RTLD_NEXT,"deflateEnd"); return z_deflateEnd(strm); } return zlib_deflateEnd(strm); } typedef uLong (*orig_deflateBound)(z_streamp strm, uLong sourceLen); orig_deflateBound zlib_deflateBound; ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)) { if(!zlib_deflateBound) { zlib_deflateBound = (orig_deflateBound) dlsym(RTLD_NEXT,"deflateBound"); return z_deflateBound(strm, sourceLen); } return zlib_deflateBound(strm, sourceLen); } typedef int (*orig_deflateParams)(z_streamp strm, int level, int strategy); orig_deflateParams zlib_deflateParams; ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)) { if(!zlib_deflateParams) { zlib_deflateParams = (orig_deflateParams) dlsym(RTLD_NEXT,"deflateParams"); return z_deflateParams(strm, level, strategy); } return zlib_deflateParams(strm, level, strategy); } typedef int (*orig_inflateInit_)(z_streamp strm, const char *version, int stream_size); orig_inflateInit_ zlib_inflateInit_; ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)) { if(!zlib_inflateInit_) { zlib_inflateInit_ = (orig_inflateInit_) dlsym(RTLD_NEXT,"inflateInit_"); return z_inflateInit_(strm, version, stream_size); } return zlib_inflateInit_(strm, version, stream_size); } typedef int (*orig_inflateInit2_)(z_streamp strm, int windowBits, const char *version, int stream_size); orig_inflateInit2_ zlib_inflateInit2_; ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)) { if(!zlib_inflateInit2_) { zlib_inflateInit2_ = (orig_inflateInit2_) dlsym(RTLD_NEXT,"inflateInit2_"); return z_inflateInit2_(strm, windowBits, version, stream_size); } return zlib_inflateInit2_(strm, windowBits, version, stream_size); } typedef int (*orig_inflateReset)(z_streamp strm); orig_inflateReset zlib_inflateReset; ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)) { if(!zlib_inflateReset) { zlib_inflateReset = (orig_inflateReset) dlsym(RTLD_NEXT,"inflateReset"); return z_inflateReset(strm); } return zlib_inflateReset(strm); } typedef int (*orig_inflateReset2)(z_streamp strm, int windowBits); orig_inflateReset2 zlib_inflateReset2; ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)) { if(!zlib_inflateReset2) { zlib_inflateReset2 = (orig_inflateReset2) dlsym(RTLD_NEXT,"inflateReset2"); return z_inflateReset2(strm, windowBits); } return zlib_inflateReset2(strm, windowBits); } typedef int (*orig_inflateSetDictionary)(z_streamp strm, const Bytef *dictionary, uInt dictLength); orig_inflateSetDictionary zlib_inflateSetDictionary; ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)) { if(!zlib_inflateSetDictionary) { zlib_inflateSetDictionary = (orig_inflateSetDictionary) dlsym(RTLD_NEXT,"inflateSetDictionary"); return z_inflateSetDictionary(strm, dictionary, dictLength); } return zlib_inflateSetDictionary(strm, dictionary, dictLength); } typedef int (*orig_inflate)(z_streamp strm, int flush); orig_inflate zlib_inflate; ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)) { if(!zlib_inflate) { zlib_inflate = (orig_inflate) dlsym(RTLD_NEXT,"inflate"); return z_inflate(strm, flush); } return zlib_inflate(strm, flush); } typedef int (*orig_inflateEnd)(z_streamp strm); orig_inflateEnd zlib_inflateEnd; ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)) { if(!zlib_inflateEnd) { zlib_inflateEnd = (orig_inflateEnd) dlsym(RTLD_NEXT,"inflateEnd"); return z_inflateEnd(strm); } return zlib_inflateEnd(strm); } typedef int (*orig_inflateSync)(z_streamp strm); orig_inflateSync zlib_inflateSync; ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)) { if(!zlib_inflateSync) { zlib_inflateSync = (orig_inflateSync) dlsym(RTLD_NEXT,"inflateSync"); return z_inflateSync(strm); } return zlib_inflateSync(strm); } typedef int (*orig_deflateCopy)(z_streamp dest, z_streamp source); orig_deflateCopy zlib_deflateCopy; ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)) { if(!zlib_deflateCopy) { zlib_deflateCopy = (orig_deflateCopy) dlsym(RTLD_NEXT,"deflateCopy"); return z_deflateCopy(dest, source); } return zlib_deflateCopy(dest, source); } typedef int (*orig_deflateTune)(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain); orig_deflateTune zlib_deflateTune; ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)) { if(!zlib_deflateTune) { zlib_deflateTune = (orig_deflateTune) dlsym(RTLD_NEXT,"deflateTune"); return z_deflateTune(strm, good_length, max_lazy, nice_length, max_chain); } return zlib_deflateTune(strm, good_length, max_lazy, nice_length, max_chain); } typedef int (*orig_deflatePending)(z_streamp strm, unsigned *pending, int *bits); orig_deflatePending zlib_deflatePending; ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, unsigned *pending, int *bits)) { if(!zlib_deflatePending) { zlib_deflatePending = (orig_deflatePending) dlsym(RTLD_NEXT,"deflatePending"); return z_deflatePending(strm, pending, bits); } return zlib_deflatePending(strm, pending, bits); } typedef int (*orig_deflatePrime)(z_streamp strm, int bits, int value); orig_deflatePrime zlib_deflatePrime; ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)) { if(!zlib_deflatePrime) { zlib_deflatePrime = (orig_deflatePrime) dlsym(RTLD_NEXT,"deflatePrime"); return z_deflatePrime(strm, bits, value); } return zlib_deflatePrime(strm, bits, value); } typedef int (*orig_deflateSetHeader)(z_streamp strm, gz_headerp head); orig_deflateSetHeader zlib_deflateSetHeader; ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)) { if(!zlib_deflateSetHeader) { zlib_deflateSetHeader = (orig_deflateSetHeader) dlsym(RTLD_NEXT,"deflateSetHeader"); return z_deflateSetHeader(strm, head); } return zlib_deflateSetHeader(strm, head); } typedef int (*orig_inflateGetDictionary)(z_streamp strm, Bytef *dictionary, uInt *dictLength); orig_inflateGetDictionary zlib_inflateGetDictionary; ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, Bytef *dictionary, uInt *dictLength)) { if(!zlib_inflateGetDictionary) { zlib_inflateGetDictionary = (orig_inflateGetDictionary) dlsym(RTLD_NEXT,"inflateGetDictionary"); return z_inflateGetDictionary(strm, dictionary, dictLength); } return zlib_inflateGetDictionary(strm, dictionary, dictLength); } typedef int (*orig_inflateCopy)(z_streamp dest, z_streamp source); orig_inflateCopy zlib_inflateCopy; ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)) { if(!zlib_inflateCopy) { zlib_inflateCopy = (orig_inflateCopy) dlsym(RTLD_NEXT,"inflateCopy"); return z_inflateCopy(dest, source); } return zlib_inflateCopy(dest, source); } typedef long (*orig_inflateMark)(z_streamp strm); orig_inflateMark zlib_inflateMark; ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)) { if(!zlib_inflateMark) { zlib_inflateMark = (orig_inflateMark) dlsym(RTLD_NEXT,"inflateMark"); return z_inflateMark(strm); } return zlib_inflateMark(strm); } typedef int (*orig_inflatePrime)(z_streamp strm, int bits, int value); orig_inflatePrime zlib_inflatePrime; ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)) { if(!zlib_inflatePrime) { zlib_inflatePrime = (orig_inflatePrime) dlsym(RTLD_NEXT,"inflatePrime"); return z_inflatePrime(strm, bits, value); } return zlib_inflatePrime(strm, bits, value); } typedef int (*orig_inflateGetHeader)(z_streamp strm, gz_headerp head); orig_inflateGetHeader zlib_inflateGetHeader; ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)) { if(!zlib_inflateGetHeader) { zlib_inflateGetHeader = (orig_inflateGetHeader) dlsym(RTLD_NEXT,"inflateGetHeader"); return z_inflateGetHeader(strm, head); } return zlib_inflateGetHeader(strm, head); } typedef int (*orig_inflateBackInit_)(z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size); orig_inflateBackInit_ zlib_inflateBackInit_; ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)) { if(!zlib_inflateBackInit_) { zlib_inflateBackInit_ = (orig_inflateBackInit_) dlsym(RTLD_NEXT,"inflateBackInit_"); return z_inflateBackInit_(strm, windowBits, window, version, stream_size); } return zlib_inflateBackInit_(strm, windowBits, window, version, stream_size); } typedef int (*orig_inflateBack)(z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc); orig_inflateBack zlib_inflateBack; ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)) { if(!zlib_inflateBack) { zlib_inflateBack = (orig_inflateBack) dlsym(RTLD_NEXT,"inflateBack"); return z_inflateBack(strm, in, in_desc, out, out_desc); } return zlib_inflateBack(strm, in, in_desc, out, out_desc); } typedef int (*orig_inflateBackEnd)(z_streamp strm); orig_inflateBackEnd zlib_inflateBackEnd; ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)) { if(!zlib_inflateBackEnd) { zlib_inflateBackEnd = (orig_inflateBackEnd) dlsym(RTLD_NEXT,"inflateBackEnd"); return z_inflateBackEnd(strm); } return zlib_inflateBackEnd(strm); } typedef uLong (*orig_zlibCompileFlags)(void); orig_zlibCompileFlags zlib_zlibCompileFlags; ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)) { if(!zlib_zlibCompileFlags) { zlib_zlibCompileFlags = (orig_zlibCompileFlags) dlsym(RTLD_NEXT,"zlibCompileFlags"); return z_zlibCompileFlags(void); } return zlib_zlibCompileFlags(void); } typedef int (*orig_compress)(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); orig_compress zlib_compress; ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)) { if(!zlib_compress) { zlib_compress = (orig_compress) dlsym(RTLD_NEXT,"compress"); return z_compress(dest, destLen, source, sourceLen); } return zlib_compress(dest, destLen, source, sourceLen); } typedef int (*orig_compress2)(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); orig_compress2 zlib_compress2; ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)) { if(!zlib_compress2) { zlib_compress2 = (orig_compress2) dlsym(RTLD_NEXT,"compress2"); return z_compress2(dest, destLen, source, sourceLen, level); } return zlib_compress2(dest, destLen, source, sourceLen, level); } typedef uLong (*orig_compressBound)(uLong sourceLen); orig_compressBound zlib_compressBound; ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)) { if(!zlib_compressBound) { zlib_compressBound = (orig_compressBound) dlsym(RTLD_NEXT,"compressBound"); return z_compressBound(sourceLen); } return zlib_compressBound(sourceLen); } typedef int (*orig_uncompress)(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); orig_uncompress zlib_uncompress; ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)) { if(!zlib_uncompress) { zlib_uncompress = (orig_uncompress) dlsym(RTLD_NEXT,"uncompress"); return z_uncompress(dest, destLen, source, sourceLen); } return zlib_uncompress(dest, destLen, source, sourceLen); } typedef uLong (*orig_adler32)(uLong adler, const Bytef *buf, uInt len); orig_adler32 zlib_adler32; ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)) { if(!zlib_adler32) { zlib_adler32 = (orig_adler32) dlsym(RTLD_NEXT,"adler32"); return z_adler32(adler, buf, len); } return zlib_adler32(adler, buf, len); } typedef uLong (*orig_crc32)(uLong crc, const Bytef *buf, uInt len); orig_crc32 zlib_crc32; ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)) { if(!zlib_crc32) { zlib_crc32 = (orig_crc32) dlsym(RTLD_NEXT,"crc32"); return z_crc32(crc, buf, len); } return zlib_crc32(crc, buf, len); } typedef uLong (*orig_adler32_z)(uLong adler, const Bytef *buf, z_size_t len); orig_adler32_z zlib_adler32_z; ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, z_size_t len)) { if(!zlib_adler32_z) { zlib_adler32_z = (orig_adler32_z) dlsym(RTLD_NEXT,"adler32_z"); return z_adler32_z(adler, buf, len); } return zlib_adler32_z(adler, buf, len); } typedef uLong (*orig_crc32_z)(uLong crc, const Bytef *buf, z_size_t len); orig_crc32_z zlib_crc32_z; ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, z_size_t len)) { if(!zlib_crc32_z) { zlib_crc32_z = (orig_crc32_z) dlsym(RTLD_NEXT,"crc32_z"); return z_crc32_z(crc, buf, len); } return zlib_crc32_z(crc, buf, len); } typedef const z_crc_t FAR * (*orig_get_crc_table)(void); orig_get_crc_table zlib_get_crc_table; ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)) { if(!zlib_get_crc_table) { zlib_get_crc_table = (orig_get_crc_table) dlsym(RTLD_NEXT,"get_crc_table"); return z_get_crc_table(void); } return zlib_get_crc_table(void); }