InflateObject.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "main.h"
  2. #include "InflateObject.h"
  3. #include "zlib/unzip.h"
  4. int ZLIBInflate::Reset(void *strm)
  5. {
  6. return ::inflateReset((z_streamp)strm);
  7. }
  8. int ZLIBInflate::Init(void *strm,const char *version, int stream_size)
  9. {
  10. return ::inflateInit_((z_streamp)strm, version, stream_size);
  11. }
  12. int ZLIBInflate::Init2(void *strm,int windowBits,const char *version, int stream_size)
  13. {
  14. return ::inflateInit2_((z_streamp)strm, windowBits,version, stream_size);
  15. }
  16. int ZLIBInflate::Inflate(void *strm, int flush)
  17. {
  18. return ::inflate((z_streamp)strm, flush);
  19. }
  20. int ZLIBInflate::End(void *strm)
  21. {
  22. return ::inflateEnd((z_streamp)strm);
  23. }
  24. unsigned long ZLIBInflate::CRC32(unsigned long crc, const unsigned char *buf, unsigned int len)
  25. {
  26. return ::crc32(crc, buf, len);
  27. }
  28. int ZLIBInflate::deflateReset(void *strm)
  29. {
  30. return ::deflateReset((z_streamp)strm);
  31. }
  32. int ZLIBInflate::deflateInit2_(void *strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
  33. {
  34. return ::deflateInit2_((z_streamp)strm, level, method, windowBits, memLevel, strategy, version, stream_size);
  35. }
  36. int ZLIBInflate::deflateEnd(void *strm)
  37. {
  38. return ::deflateEnd((z_streamp)strm);
  39. }
  40. int ZLIBInflate::deflate(void *strm, int flush)
  41. {
  42. return ::deflate((z_streamp)strm, flush);
  43. }
  44. #ifdef CBCLASS
  45. #undef CBCLASS
  46. #endif
  47. #define CBCLASS ZLIBInflate
  48. START_DISPATCH;
  49. CB(API_INFLATE_INFLATERESET, Reset);
  50. CB(API_INFLATE_INFLATEINIT, Init);
  51. CB(API_INFLATE_INFLATEINIT2, Init2);
  52. CB(API_INFLATE_INFLATE, Inflate);
  53. CB(API_INFLATE_INFLATEEND, End);
  54. CB(API_INFLATE_CRC32, CRC32);
  55. CB(API_INFLATE_DEFLATERESET, deflateReset);
  56. CB(API_INFLATE_DEFLATEINIT2, deflateInit2_);
  57. CB(API_INFLATE_DEFLATEEND, deflateEnd);
  58. CB(API_INFLATE_DEFLATE, deflate);
  59. END_DISPATCH;