flate.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma lib "libflate.a"
  2. #pragma src "/sys/src/libflate"
  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(uchar *dst, int dsize, uchar *src, int ssize);
  22. int deflateblock(uchar *dst, int dsize, uchar *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(uchar *dst, int dsize, uchar *src, int ssize);
  26. int deflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize, int level, int debug);
  27. char *flateerr(int err);
  28. ulong *mkcrctab(ulong);
  29. ulong blockcrc(ulong *tab, ulong crc, void *buf, int n);
  30. ulong adler32(ulong adler, void *buf, int n);