home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / fileutil / scan.lha / src / lh5.h < prev    next >
C/C++ Source or Header  |  1992-05-21  |  2KB  |  83 lines

  1. /* Define FIXFNAME to activate the fixfname() function that converts
  2. filename syntax to be acceptable to the host system */
  3. /* #define FIXFNAME */
  4.  
  5. /*
  6. OPEN(x)     open file x for read
  7. CREATE(x)   create file x for read/write
  8.  
  9. Files opened by OPEN() and CREATE() must be opened in
  10. binary mode (not involving any newline translation).
  11. */
  12.  
  13. #define NEED_B
  14.  
  15. /* Conventional stdio, using "b" suffix for binary open */
  16. #ifdef NEED_B
  17. #define  CREATE(x)      fopen(x, "wb")
  18. #define  OPEN(x)        fopen(x, "rb")
  19.  
  20. #else
  21. /* some systems (e.g. Ultrix) don't like a trailinb "b" */
  22. #define  CREATE(x)      fopen(x, "w")
  23. #define  OPEN(x)        fopen(x, "r")
  24. #endif
  25.  
  26. /* don't change the rest of this file */
  27. #define MEM_BLOCK_SIZE  8192
  28.  
  29. /* Functions defined by Booz */
  30.  
  31. int addbfcrc();
  32. void message();
  33. int fixfname ();
  34.  
  35. /* Standard functions */
  36.  
  37. char *malloc();
  38.  
  39. #include <stdio.h>
  40.  
  41. typedef unsigned char uchar;    /* 8 bits or more */
  42. typedef unsigned int   uint;    /* 16 bits or more */
  43. typedef unsigned short ushort;  /* 16 bits or more */
  44. typedef unsigned long  ulong;   /* 32 bits or more */
  45.  
  46. uint decode_c();
  47. uint decode_p();
  48. uint getbits();
  49. #define DICBIT    13    /* 12(-lh4-) or 13(-lh5-) */
  50. #define DICSIZ ((unsigned) 1 << DICBIT)
  51.  
  52. /* Define some things if they aren't defined in header files */
  53. #ifndef CHAR_BIT
  54. # define CHAR_BIT 8
  55. #endif
  56.  
  57. #ifndef UCHAR_MAX
  58. # define UCHAR_MAX 255
  59. #endif
  60.  
  61. /* io.c */
  62.  
  63. extern FILE *arcfile;
  64. extern ulong bitbuf;
  65. #define BITBUFSIZ (CHAR_BIT * sizeof bitbuf)
  66.  
  67. /* encode.c and decode.c */
  68.  
  69. #define MATCHBIT   8    /* bits for MAXMATCH - THRESHOLD */
  70. #define MAXMATCH 256    /* formerly F (not more than UCHAR_MAX + 1) */
  71. #define THRESHOLD  3    /* choose optimal value */
  72. #define PERC_FLAG ((unsigned) 0x8000)
  73.  
  74. /* huf.c */
  75.  
  76. #define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
  77.         /* alphabet = {0, 1, 2, ..., NC - 1} */
  78. #define CBIT 9  /* $\lfloor \log_2 NC \rfloor + 1$ */
  79. #define CODE_BIT  16  /* codeword length */
  80.  
  81. extern ushort left[], right[];
  82.  
  83.