home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 8.ddi / TVHELP.ZIP / TVHC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.2 KB  |  124 lines

  1. /*-----------------------------------------------------*/
  2. /*                                                     */
  3. /*   Turbo Vision 1.0                                  */
  4. /*   Turbo Vision TVHC header file                     */
  5. /*   Copyright (c) 1991 by Borland International       */
  6. /*                                                     */
  7. /*-----------------------------------------------------*/
  8.  
  9. #if !defined( __TVHC_H )
  10. #define __TVHC_H
  11.  
  12. #define Uses_fstream
  13. #define Uses_TSortedCollection
  14. #define Uses_TObject
  15. #define Uses_TPoint
  16. #include <tv.h>
  17.  
  18. #if !defined( __HELPBASE_H )
  19. #include "HelpBase.h"
  20. #endif  // __HELPBASE_H
  21.  
  22.  
  23. const MAXSIZE = 80;
  24. const MAXSTRSIZE=256;
  25. const char commandChar[] = ".";
  26. const bufferSize = 4096;
  27.  
  28. typedef enum State { undefined, wrapping, notWrapping };
  29.  
  30. class TProtectedStream : public fstream
  31. {
  32.  
  33. public:
  34.  
  35.     TProtectedStream( char *aFileName, ushort  aMode );
  36.  
  37. private:
  38.  
  39.     char  fileName[MAXSIZE];
  40.     ushort mode;
  41.  
  42. };
  43.  
  44. // Topic Reference
  45.  
  46. struct TFixUp
  47. {
  48.  
  49.     long pos;
  50.     TFixUp *next;
  51.  
  52. };
  53.  
  54. union Content
  55. {
  56.  
  57.     ushort value;
  58.     TFixUp *fixUpList;
  59.  
  60. };
  61.  
  62. struct TReference 
  63. {
  64.  
  65.     char *topic;
  66.     Boolean resolved;
  67.     Content val;
  68.  
  69. };
  70.  
  71. class TRefTable : public TSortedCollection
  72. {
  73.  
  74. public:
  75.  
  76.     TRefTable( ccIndex aLimit, ccIndex aDelta );
  77.  
  78.     virtual int compare( void *key1,void *key2 );
  79.     virtual void freeItem( void *item );
  80.     TReference *getReference( char *topic );
  81.     virtual void *keyOf( void *item );
  82.  
  83. private:
  84.  
  85.     virtual void *readItem( ipstream& ) { return 0; };
  86.     virtual void writeItem( void *, opstream& ) {};
  87.  
  88. };
  89.  
  90. struct TCrossRefNode
  91. {
  92.  
  93.     char *topic;
  94.     int offset;
  95.     uchar length;
  96.     TCrossRefNode *next;
  97.  
  98. };
  99.  
  100. class TTopicDefinition : public TObject
  101. {
  102.  
  103. public:
  104.  
  105.     TTopicDefinition(char *aTopic, ushort aValue);
  106.     ~TTopicDefinition(void);
  107.  
  108.     char *topic;
  109.     ushort value;
  110.     TTopicDefinition *next;
  111.  
  112. };
  113.  
  114. char helpName[MAXSIZE];
  115. uchar buffer[bufferSize];
  116. int ofs;
  117. TRefTable *refTable = 0;
  118. TCrossRefNode  *xRefs;
  119. char line[MAXSTRSIZE] = "";
  120. Boolean lineInBuffer = False;
  121. int lineCount = 0;
  122.  
  123. #endif  // __TVHC_H
  124.