zconf.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-1998 Jean-loup Gailly.
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* @(#) $Id$ */
  6. #ifndef _ZCONF_H
  7. #define _ZCONF_H
  8. /* The memory requirements for deflate are (in bytes):
  9. (1 << (windowBits+2)) + (1 << (memLevel+9))
  10. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  11. plus a few kilobytes for small objects. For example, if you want to reduce
  12. the default memory requirements from 256K to 128K, compile with
  13. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  14. Of course this will generally degrade compression (there's no free lunch).
  15. The memory requirements for inflate are (in bytes) 1 << windowBits
  16. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  17. for small objects.
  18. */
  19. /* Maximum value for memLevel in deflateInit2 */
  20. #ifndef MAX_MEM_LEVEL
  21. # define MAX_MEM_LEVEL 8
  22. #endif
  23. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  24. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  25. * created by gzip. (Files created by minigzip can still be extracted by
  26. * gzip.)
  27. */
  28. #ifndef MAX_WBITS
  29. # define MAX_WBITS 15 /* 32K LZ77 window */
  30. #endif
  31. /* default windowBits for decompression. MAX_WBITS is for compression only */
  32. #ifndef DEF_WBITS
  33. # define DEF_WBITS MAX_WBITS
  34. #endif
  35. /* default memLevel */
  36. #if MAX_MEM_LEVEL >= 8
  37. # define DEF_MEM_LEVEL 8
  38. #else
  39. # define DEF_MEM_LEVEL MAX_MEM_LEVEL
  40. #endif
  41. /* Type declarations */
  42. typedef unsigned char Byte; /* 8 bits */
  43. typedef unsigned int uInt; /* 16 bits or more */
  44. typedef unsigned long uLong; /* 32 bits or more */
  45. typedef void *voidp;
  46. #endif /* _ZCONF_H */