1
0

flate.h 1.6 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(uint8_t *dst, int dsize, uint8_t *src, int ssize);
  28. int deflateblock(uint8_t *dst, int dsize, uint8_t *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(uint8_t *dst, int dsize, uint8_t *src,
  33. int ssize);
  34. int deflatezlibblock(uint8_t *dst, int dsize, uint8_t *src,
  35. int ssize, int level, int debug);
  36. char *flateerr(int err);
  37. uint32_t *mkcrctab(uint32_t);
  38. uint32_t blockcrc(uint32_t *tab, uint32_t crc, void *buf, int n);
  39. uint32_t adler32(uint32_t adler, void *buf, int n);