home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / drdobbs / 1991 / 08 / dflat5 / htree.h < prev    next >
Text File  |  1991-06-26  |  951b  |  33 lines

  1. /* ------------------- htree.h -------------------- */
  2.  
  3. typedef unsigned int BYTECOUNTER;
  4.  
  5. /* ---- Huffman tree structure ---- */
  6. struct htree    {
  7.     unsigned char ch;       /* character value             */
  8.     BYTECOUNTER cnt;        /* character frequency         */
  9.     int parent;             /* offset to parent node       */
  10.     int right;              /* offset to right child node  */
  11.     int left;               /* offset to left child node   */
  12. };
  13.  
  14. extern struct htree *ht;
  15. extern int root;
  16.  
  17. #ifdef INCLUDE_COMPRESS_HELPFILE
  18.  
  19. void buildtree(void);
  20. FILE *OpenHelpFile(void);
  21. void HelpFilePosition(long *, int *);
  22. void *GetHelpLine(char *);
  23. void SeekHelpLine(long, int);
  24.  
  25. #else
  26.  
  27. #define OpenHelpFile()        helpfp=fopen(DFLAT_APPLICATION ".TXT", "rt")
  28. #define HelpFilePosition(o,b) *o=ftell(helpfp)
  29. #define GetHelpLine(s)        fgets(s,160,helpfp)
  30. #define SeekHelpLine(o,b)     fseek(helpfp,o,0)
  31.  
  32. #endif
  33.