1
0

flate.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma lib "libflate.a"
  2. #pragma src "/sys/src/lib/flate"
  3. /*
  4. * errors from deflate, deflateinit, deflateblock,
  5. * inflate, inflateinit, inflateblock.
  6. * convertable to a string by flateerr
  7. */
  8. enum
  9. {
  10. FlateOk = 0,
  11. FlateNoMem = -1,
  12. FlateInputFail = -2,
  13. FlateOutputFail = -3,
  14. FlateCorrupted = -4,
  15. FlateInternal = -5,
  16. };
  17. int deflateinit(void);
  18. int deflate(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  19. int inflateinit(void);
  20. int inflate(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  21. int inflateblock(uint8_t *dst, int dsize, uint8_t *src, int ssize);
  22. int deflateblock(uint8_t *dst, int dsize, uint8_t *src, int ssize, int level, int debug);
  23. int deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
  24. int inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
  25. int inflatezlibblock(uint8_t *dst, int dsize, uint8_t *src, int ssize);
  26. int deflatezlibblock(uint8_t *dst, int dsize, uint8_t *src, int ssize, int level, int debug);
  27. char *flateerr(int err);
  28. uint32_t *mkcrctab(uint32_t);
  29. uint32_t blockcrc(uint32_t *tab, uint32_t crc, void *buf, int n);
  30. uint32_t adler32(uint32_t adler, void *buf, int n);