home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 January / VPR0101A.BIN / OLS / TAR32053 / tar32053.exe / SRC / LZW.H < prev    next >
C/C++ Source or Header  |  1999-05-23  |  2KB  |  46 lines

  1. #ifndef __DEFCONF_H
  2. #include "defconf.h"
  3. #endif
  4. /* lzw.h -- define the lzw functions.
  5.  * Copyright (C) 1992-1993 Jean-loup Gailly.
  6.  * This is free software; you can redistribute it and/or modify it under the
  7.  * terms of the GNU General Public License, see the file COPYING.
  8.  */
  9.  
  10. #if !defined(OF) && defined(lint)
  11. #  include "gzip.h"
  12. #endif
  13.  
  14. #ifndef BITS
  15. #  define BITS 16
  16. #endif
  17. #define INIT_BITS 9              /* Initial number of bits per code */
  18.  
  19. #define    LZW_MAGIC  "\037\235"   /* Magic header for lzw files, 1F 9D */
  20.  
  21. #define BIT_MASK    0x1f /* Mask for 'number of compression bits' */
  22. /* Mask 0x20 is reserved to mean a fourth header byte, and 0x40 is free.
  23.  * It's a pity that old uncompress does not check bit 0x20. That makes
  24.  * extension of the format actually undesirable because old compress
  25.  * would just crash on the new format instead of giving a meaningful
  26.  * error message. It does check the number of bits, but it's more
  27.  * helpful to say "unsupported format, get a new version" than
  28.  * "can only handle 16 bits".
  29.  */
  30.  
  31. #define BLOCK_MODE  0x80
  32. /* Block compression: if table is full and compression rate is dropping,
  33.  * clear the dictionary.
  34.  */
  35.  
  36. #define LZW_RESERVED 0x60 /* reserved bits */
  37.  
  38. #define    CLEAR  256       /* flush the dictionary */
  39. #define FIRST  (CLEAR+1) /* first free entry */
  40.  
  41. extern int maxbits;      /* max bits per code for LZW */
  42. extern int block_mode;   /* block compress mode -C compatible with 2.0 */
  43.  
  44. extern int lzw    OF((int in, int out));
  45. extern int unlzw  OF((int in, int out));
  46.