flate.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /*
  10. * errors from deflate, deflateinit, deflateblock,
  11. * inflate, inflateinit, inflateblock.
  12. * convertable to a string by flateerr
  13. */
  14. enum
  15. {
  16. FlateOk = 0,
  17. FlateNoMem = -1,
  18. FlateInputFail = -2,
  19. FlateOutputFail = -3,
  20. FlateCorrupted = -4,
  21. FlateInternal = -5,
  22. };
  23. int deflateinit(void);
  24. int deflate(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  25. int inflateinit(void);
  26. int inflate(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  27. int inflateblock(u8 *dst, int dsize, u8 *src, int ssize);
  28. int deflateblock(u8 *dst, int dsize, u8 *src, int ssize,
  29. int level, int debug);
  30. int deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  31. int inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  32. int inflatezlibblock(u8 *dst, int dsize, u8 *src,
  33. int ssize);
  34. int deflatezlibblock(u8 *dst, int dsize, u8 *src,
  35. int ssize, int level, int debug);
  36. char *flateerr(int err);
  37. u32 *mkcrctab(u32);
  38. u32 blockcrc(u32 *tab, u32 crc, void *buf, int n);
  39. u32 adler32(u32 adler, void *buf, int n);