flate.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #pragma lib "libflate.a"
  10. #pragma src "/sys/src/libflate"
  11. /*
  12. * errors from deflate, deflateinit, deflateblock,
  13. * inflate, inflateinit, inflateblock.
  14. * convertable to a string by flateerr
  15. */
  16. enum
  17. {
  18. FlateOk = 0,
  19. FlateNoMem = -1,
  20. FlateInputFail = -2,
  21. FlateOutputFail = -3,
  22. FlateCorrupted = -4,
  23. FlateInternal = -5,
  24. };
  25. int deflateinit(void);
  26. int deflate(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  27. int inflateinit(void);
  28. int inflate(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  29. int inflateblock(uchar *dst, int dsize, uchar *src, int ssize);
  30. int deflateblock(uchar *dst, int dsize, uchar *src, int ssize, int level, int debug);
  31. int deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  32. int inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  33. int inflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize);
  34. int deflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize, int level, int debug);
  35. char *flateerr(int err);
  36. ulong *mkcrctab(ulong);
  37. ulong blockcrc(ulong *tab, ulong crc, void *buf, int n);
  38. ulong adler32(ulong adler, void *buf, int n);