1
0

api_inflate.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef NULLSOFT_WINAMP_API_INFLATE_H
  2. #define NULLSOFT_WINAMP_API_INFLATE_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/platform/types.h>
  5. /* TODO: this should be renamed api_zlib */
  6. class NOVTABLE api_inflate : public Dispatchable
  7. {
  8. protected:
  9. api_inflate() {}
  10. ~api_inflate() {}
  11. public:
  12. int inflateReset(void *strm);
  13. int inflateInit_(void *strm,const char *version, int stream_size);
  14. int inflateInit2_(void *strm, int windowBits, const char *version, int stream_size);
  15. int inflate(void *strm, int flush);
  16. int inflateEnd(void *strm);
  17. unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len);
  18. int deflateReset(void *strm);
  19. int deflateInit2_(void *strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size);
  20. int deflate(void *strm, int flush);
  21. int deflateEnd(void *strm);
  22. public:
  23. DISPATCH_CODES
  24. {
  25. API_INFLATE_INFLATERESET = 10,
  26. API_INFLATE_INFLATEINIT = 20,
  27. API_INFLATE_INFLATEINIT2 = 21,
  28. API_INFLATE_INFLATE = 30,
  29. API_INFLATE_INFLATEEND = 40,
  30. API_INFLATE_CRC32 = 50,
  31. API_INFLATE_DEFLATERESET = 60,
  32. API_INFLATE_DEFLATEINIT2 = 70,
  33. API_INFLATE_DEFLATE = 80,
  34. API_INFLATE_DEFLATEEND = 90,
  35. };
  36. };
  37. inline int api_inflate::inflateReset(void *strm)
  38. {
  39. return _call(API_INFLATE_INFLATERESET, (int)-4, strm);
  40. }
  41. inline int api_inflate::inflateInit_(void *strm, const char *version, int stream_size)
  42. {
  43. return _call(API_INFLATE_INFLATEINIT, (int)-4, strm, version, stream_size);
  44. }
  45. inline int api_inflate::inflateInit2_(void *strm, int windowBits, const char *version, int stream_size)
  46. {
  47. return _call(API_INFLATE_INFLATEINIT2, (int)-4, strm, windowBits, version, stream_size);
  48. }
  49. inline int api_inflate::inflate(void *strm, int flush)
  50. {
  51. return _call(API_INFLATE_INFLATE, (int)-4, strm, flush);
  52. }
  53. inline int api_inflate::inflateEnd(void *strm)
  54. {
  55. return _call(API_INFLATE_INFLATEEND, (int)-2, strm);
  56. }
  57. inline unsigned long api_inflate::crc32(unsigned long crc, const unsigned char *buf, unsigned int len)
  58. {
  59. return _call(API_INFLATE_CRC32, (unsigned long)0, crc, buf, len);
  60. }
  61. inline int api_inflate::deflateReset(void *strm)
  62. {
  63. return _call(API_INFLATE_DEFLATERESET, (unsigned long)-4, strm);
  64. }
  65. inline int api_inflate::deflateInit2_(void *strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
  66. {
  67. return _call(API_INFLATE_DEFLATEINIT2, (int)-4, strm, level, method, windowBits, memLevel, strategy, version, stream_size);
  68. }
  69. inline int api_inflate::deflateEnd(void *strm)
  70. {
  71. return _call(API_INFLATE_DEFLATEEND, (int)-2, strm);
  72. }
  73. inline int api_inflate::deflate(void *strm, int flush)
  74. {
  75. return _call(API_INFLATE_DEFLATE, (int)-4, strm, flush);
  76. }
  77. // {8A4C0BAA-83D0-440e-BB59-A5C70A92EFFF}
  78. static const GUID inflateGUID =
  79. { 0x8a4c0baa, 0x83d0, 0x440e, { 0xbb, 0x59, 0xa5, 0xc7, 0xa, 0x92, 0xef, 0xff } };
  80. #endif