flate.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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(uint8_t *dst, int dsize, uint8_t *src, int ssize);
  30. int deflateblock(uint8_t *dst, int dsize, uint8_t *src, int ssize,
  31. int level, int debug);
  32. int deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  33. int inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  34. int inflatezlibblock(uint8_t *dst, int dsize, uint8_t *src,
  35. int ssize);
  36. int deflatezlibblock(uint8_t *dst, int dsize, uint8_t *src,
  37. int ssize, int level, int debug);
  38. char *flateerr(int err);
  39. uint32_t *mkcrctab(uint32_t);
  40. uint32_t blockcrc(uint32_t *tab, uint32_t crc, void *buf, int n);
  41. uint32_t adler32(uint32_t adler, void *buf, int n);