www.pudn.com > helpview.zip > Hlpfile.h, change:1997-10-15,size:25919b


/* 
  
Copyright 1997 Willows Software, Inc.  
 
This library is free software; you can redistribute it and/or 
modify it under the terms of the GNU Library General Public License as 
published by the Free Software Foundation; either version 2 of the 
License, or (at your option) any later version. 
 
This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
Library General Public License for more details. 
 
You should have received a copy of the GNU Library General Public 
License along with this library; see the file COPYING.LIB.  If 
not, write to the Free Software Foundation, Inc., 675 Mass Ave, 
Cambridge, MA 02139, USA. 
 
*/ 
 
/************************************************************************* 
* 
* HLPFILE.H 
* Help data file reading routines.      
* 
* Author: Paul E. Kissel 
* 
**************************************************************************/ 
 
#ifndef HLPFILE_H                                                                                  
#define HLPFILE_H 
 
/*********************************** 
** 
**  System Includes 
** 
***********************************/ 
 
#include <windows.h> 
#include <stdlib.h> 
 
 
/************************************* 
* 
*  App. Includes 
* 
**************************************/ 
#include "general.h" 
 
 
/*********************************** 
** 
**  Shared Defines 
** 
***********************************/ 
 
/* Far pointer to a BYTE. */ 
typedef BYTE * FPBYTE; 
 
 
/****************************** In-Memory Data Structures *************************/ 
 
/*  
** Unique ID that appears in the  
** .HLP file header's MagicNumber 
** variable. 
*/ 
#define HELP_MAGIC  0x00035F3FL 
 
 
/* Help file Header record */ 
typedef struct tagHELPHEADER  
{ 
  DWORD   MagicNumber;      /* 0x00035F3F                */ 
  long    WHIFS;            /* Pointer to WHIFS header   */ 
  long    Negative1; 
  long    FileSize;         /* Size of entire .HLP File  */ 
}  
HELPHEADER; 
typedef HELPHEADER * FPHELPHEADER; 
 
 
/*  
** Pages sizes for B-Tree pages. 
*/ 
#define WHIFSPAGESIZE 1024L  /* WHIFS B-Tree page size. */ 
#define BTREEPAGESIZE 2048L  /* Page size for all other B-Trees. */ 
 
/* Standard WHIFS file's names. */ 
#define CONTEXT_FILE        "|CONTEXT"    
#define CTXOMAP_FILE        "|CTXOMAP"    
#define FONT_FILE           "|FONT"       
#define KWBTREE_FILE        "|KWBTREE"    
#define KWDATA_FILE         "|KWDATA"     
#define KWMAP_FILE          "|KWMAP"      
#define PHRASES_FILE        "|Phrases"    
#define SYSTEM_FILE         "|SYSTEM"     
#define TOPIC_FILE          "|TOPIC"      
#define TTLBTREE_FILE       "|TTLBTREE"   
#define BITMAP_FILE_PREFIX  "|bm"         
 
/* Information for a WHIF file. */ 
#define MAX_WHIF_NAME  31 
typedef struct tagWHIFFILEINFO 
{ 
  char FileName[ MAX_WHIF_NAME ]; 
  long FileOffset; 
} 
WHIFFILEINFO; 
typedef WHIFFILEINFO * FPWHIFFILEINFO; 
 
/* WHIF info. header. */ 
typedef struct tagWHIFSHEADER 
{ 
  char    Magic[18];        /* Not exactly magic for some .MVB files   */ 
  char    Garbage[13]; 
  short   MustBeZero;       /* Probably First Leaf Page!!!             */ 
  short   NSplits;          /* Number of page split Btree has suffered */ 
  short   RootPage;         /* Page # of root page                     */ 
  short   MustBeNegOne;     /* Probably shows up when B-Tree is HUGE!! */ 
  short   TotalPages;       /* total # to 2Kb pages in Btree           */ 
  short   NLevels;          /* Number of levels in this Btree          */ 
  DWORD   TotalWHIFSEntries; 
} 
WHIFSHEADER; 
 
 
/* Information from WHIFS Section. */ 
typedef struct tagWHIFSINFO 
{ 
  WHIFSHEADER  WHIFSHeader;     /* WHIFS Header information. */ 
  DWORD        dwFileCount; 
  HGLOBAL      hFileData; 
} 
WHIFSINFO; 
typedef WHIFSINFO * FPWHIFSINFO; 
 
 
/* File Header for WHIFS files */ 
typedef struct tagFILEHEADER  
{ 
  long    FilePlusHeader;  /* File size including this header */ 
  long    FileSize;        /* File size not including header  */ 
  char    TermNull; 
} 
FILEHEADER; 
 
 
/* Keyword & TTL BTREE Headers - Slightly different than WHIFS B-tree Header. 
   Both WHIFS and Keyword B-Trees use same leaf and index node headers.    */ 
typedef struct tagBTREEHEADER 
{ 
  char    Unknown1[22]; 
  short   MustBeZero1;      /* Probably First Leaf page!!!         */ 
  short   NSplits;          /* # of page splits Btree has suffered */ 
  short   RootPage;         /* page #of root page                  */ 
  short   MustBeNegOne1; 
  short   TotalPages;       /* total # of 2Kb pages in Btree       */ 
  short   NLevels;          /* # of levels in this Btree           */ 
  DWORD   TotalBtreeEntries; 
} 
BTREEHEADER; 
 
 
/* Modified B-Tree Index header to handle a pointer to the page */ 
typedef struct tagBTREEINDEXHEADER 
{ 
  WORD    Signature;      /* Signature byte            */ 
  short   NEntries;       /* Number of entries in node */ 
}  
BTREEINDEXHEADER; 
 
 
/* Modified B-Tree Node header to handle a pointer to the page */ 
typedef struct tagBTREENODEHEADER 
{ 
  WORD    Signature;      /* Signature word            */ 
  short   NEntries;       /* Number of entries         */ 
  short   PreviousPage;   /* Index of Previous Page    */ 
  short   NextPage;       /* Index of Next Page        */ 
} 
BTREENODEHEADER; 
 
 
/* Header for |SYSTEM file */ 
typedef struct tagSYSTEMHEADER 
{ 
  BYTE    Magic;     /* 0x6C                  */ 
  BYTE    Version;   /* Version #             */ 
  BYTE    Revision;  /* Revision code         */ 
  BYTE    Always0;   /* Unknown               */ 
  WORD    Always1;   /* Always 0x0001         */ 
  DWORD   GenDate;   /* Date/Time that the help file was generated    */ 
  WORD    Flags;     /* Values seen: 0x0000 0x0004, 0x0008, 0x000A    */ 
}  
SYSTEMHEADER; 
typedef SYSTEMHEADER * FPSYSTEMHEADER; 
 
 
/*  
** SYSTEMHEADER Flags values. 
*/ 
#define NO_COMPRESSION   0x0000      /* No Compression. */ 
 
/*  
** SYSTEMHEADER Revision values. 
*/ 
#define COMPVER300     0x0F        /* Compiled with HC30. */ 
#define COMPVER310     0x15        /* Compiled with HC31. */ 
 
/*  
** Version of the compiler used.  
*/ 
typedef enum 
{ 
  COMPILER_300, 
  COMPILER_310 
} 
COMPILERVER; 
 
 
/*  
** Help compiler 3.1 system record.  
** Multiple records can be read from file. 
*/ 
typedef struct tagREADSYSTEMREC  
{ 
  WORD    RecordType;   /* Type of Data in record      */ 
  WORD    DataSize;     /* Size of RData               */ 
}  
READSYSTEMREC; 
typedef READSYSTEMREC * FPREADSYSTEMREC; 
 
 
/* Values that can be in the RecordType field of a SYSTEMREC structure. */   
#define HPJ_TITLE       0x0001      /* Title from .HPJ file            */ 
#define HPJ_COPYRIGHT   0x0002      /* Copyright notice from .HPJ file */ 
#define HPJ_CONTENTS    0x0003      /* Contents=CharOffset into |TOPIC file. */ 
#define HPJ_MACRO       0x0004      /* SData = 4 nulls if no macros    */ 
#define HPJ_ICON        0x0005      /* Alternate icon data. */ 
#define HPJ_SECWINDOW   0x0006      /* Secondary window info in .HPJ   */ 
#define HPJ_CITATION    0x0008      /* CITATION= under [OPTIONS]       */ 
 
#define MAIN_WINDOW_NAME "main" 
 
/* 
** Secondary Window Record following type 0x0006 System Record  
*/ 
typedef struct tagSECWINDOW  
{ 
  WORD    Flags;                  /* Flags (See Below).     */ 
  char    Type[MAX_SEC_TYPE];         /* Type of window.        */ 
  char    Name[MAX_SEC_NAME];         /* Window name.           */ 
  char    Caption[MAX_SEC_CAPTION];   /* Caption for window.    */ 
  WORD    X;              /* X coordinate to start at.      */ 
  WORD    Y;              /* Y coordinate to start at.      */ 
  WORD    Width;          /* Width to create for.           */ 
  WORD    Height;         /* Height to create for.          */ 
  WORD    Maximize;       /* Maximize flag.                 */ 
  BYTE    Rgb[3];         /* RGB for scrollable region. */ 
  BYTE    Unknown1; 
  BYTE    RgbNsr[3];      /* RGB for non scrollable region. */ 
  BYTE    Unknown2; 
}  
SECWINDOW; 
typedef SECWINDOW * FPSECWINDOW; 
 
 
/*  
** Values for secondary window flags.  
*/ 
#define WSYSFLAG_TYPE       0x0001  /* Type is valid.              */ 
#define WSYSFLAG_NAME       0x0002  /* Name is valid.              */ 
#define WSYSFLAG_CAPTION    0x0004  /* Caption is valid.           */ 
#define WSYSFLAG_X          0x0008  /* X is valid.                 */ 
#define WSYSFLAG_Y          0x0010  /* Y is valid.                 */ 
#define WSYSFLAG_WIDTH      0x0020  /* Width is valid.             */ 
#define WSYSFLAG_HEIGHT     0x0040  /* Height is valid.            */ 
#define WSYSFLAG_MAXIMIZE   0x0080  /* Maximize is valid.          */ 
#define WSYSFLAG_RGB        0x0100  /* Rgb is valid.               */ 
#define WSYSFLAG_RGBNSR     0x0200  /* RgbNsr is valid.            */ 
#define WSYSFLAG_TOP        0x0400  /* On top was set in HPJ file. */ 
 
/* |Phrase WHIFS file header */ 
typedef struct tagPHRASEHEADER     
{ 
  WORD    NumPhrases;     /* Number of phrases in table                     */ 
  WORD    OneHundred;     /* 0x0100                                         */ 
  long    PhrasesSize;    /* Amount of space uncompressed phrases require.  */ 
}  
PHRASEHEADER; 
typedef PHRASEHEADER * FPPHRASEHEADER; 
 
typedef char * FPPHRASEINFO; 
 
 
/* Record from |CTXOMAP file. Created from the [MAP] section of .HPJ file */ 
typedef struct tagCTXOMAPREC 
{ 
  long MapID;                /* #define topic ID used by application when calling WinHelp(). */ 
  long TopicOffset;          /* Character Offset of topic's data in the |TOPIC file. */ 
}  
CTXOMAPREC; 
typedef CTXOMAPREC * FPCTXOMAPREC; 
 
 
/*  
** Define the size of a topic block:  
** 
**   4k Topic Block - sizeof(TOPICLINK) 
*/ 
#define TOPICBLOCKSIZE  4084L 
#define TOPICBLOCKSIZEWITHHEADER  4096L 
 
/*  
** |TOPIC Block header - Header for a block of topic data. These occur 
** in 4K increments.   
*/ 
typedef struct tagTOPICBLOCKHEADER  
{ 
  long LastTopicLink;   /* Offset of last TOPICLINK structure in previous block. */ 
  long FirstTopicLink;  /* Position of the first TOPICLINK strcuture relative to the  
                           begining of the block. */                    
  long LastTopicHeader; /* Offset of last topic header in previous block */ 
}  
TOPICBLOCKHEADER; 
 
/* Linked list record for |TOPIC file */ 
typedef struct tagTOPICLINK  
{ 
  long int TopicLinkSize; /* Size of the topiclink record ( data + topiclink structure) */ 
  long int DataLen2;      /* Length of LinkData2              */ 
  long int PrevTopicLink; /* Position of last TOPICLINK strcuture relative to the  
                             begining of its block. */ 
  long int NextTopicLink; /* Position of next TOPICLINK structure relative to the  
                             begining of its block. */ 
  long int DataLen1;      /* Length of LinkData1 + size of TOPICLINK structure. */ 
  BYTE RecordType;        /* See below. */ 
}  
TOPICLINK; 
typedef TOPICLINK * FPTOPICLINK; 
 
/* Known TOPICLINK structure record types. */ 
#define TL_TOPICHDR    0x02  /* TOPICHEADER information. */ 
#define TL_GENERAL     0x20  /* Topic information. */ 
#define TL_TABLE       0x23  /* Table.                   */ 
#define TL_SCROLL      0x25  /* Marker for a scroll position - Defined this myself. */ 
 
/* Var. type to hold one of the above values. */ 
typedef BYTE           TOPICDATATYPE;   
 
/* Topic header. LinkData1 for a TL_TOPICHDR record. */ 
typedef struct tagTOPICHEADER  
{ 
  DWORD    BlockSize;        /* Size of topic, including internal topic links.  */ 
  long int BrowsePrev;       /* Topic offset for prev topic in Browse  
                                sequence. Can be -1. */ 
  long int BrowseNext;       /* Topic offset for next topic in Browse  
                                sequence. Can be -1. */ 
  DWORD    TopicNum;         /* Index position of topic in file. 1,2,3,... */ 
  long int NonScrollOffset;  /* Offset for topiclink containing start of  
                                non-scrollable data. Can be -1. */ 
  long int ScrollOffset;     /* Offset for topiclink containing start of  
                                scrollable data. Can be -1. */           
  DWORD    NextTopic;        /* Offset for next topiclink of type 0x02. */ 
}  
TOPICHEADER; 
typedef TOPICHEADER * FPTOPICHEADER; 
         
 
typedef struct tagTOPICSTREAMSTRUCT  
{ 
  int      hHelpFile;         /* Handle to the help file. */ 
  long int TopicStart;        /* Start of |TOPIC file's topic data.  */  
  long int LastFilePos;       /* Last file position of the WHIF TOPIC file. */ 
  BOOL     bCompressed;       /* Is the help file compressed? */ 
  DWORD    dwNumBlocksInFile; /* Number of blocks in the file. */ 
 
  HGLOBAL hText;              /* Buffer to use when reading a topic's text. */ 
  DWORD   dwTextSize;         /* What is the size of the text buffer. */ 
  DWORD   dwTextUsed;         /* How much of the text buffer is being used. */ 
 
  HGLOBAL hCodes;             /* Buffer to use when reading a topic's codes. */ 
  DWORD   dwCodesSize;         /* What is the size of the codes buffer. */ 
  DWORD   dwCodesUsed;         /* How much of the codes buffer is being used. */ 
 
  long int ScrollOffset;       /* What is the offset for scrollable topic data. */ 
  BOOL     bFoundScrollOffset; /* Have we found the offset for scrollable topic data. */ 
 
  HGLOBAL  hFileDataBuffer;    /* Handle to the file data buffer. */ 
  BYTE *   fpFileDataBuffer;   /* Pointer to the file data buffer. */ 
 
  long int  BufferDataSize;     /* Size of data in file buffer.              */ 
  long int  CurrBufferPos;      /* Current position in the file data buffer. */ 
 
  DWORD dwCurrBlockNum;     /* Reading from which block number in topic data. */ 
 
  DWORD dwTargetBlockNum;    /* Which block number did we ask for initially.  */ 
  WORD wTargetBlockOffset;   /* Which block offset did we ask for initially.  */ 
 
  WORD  wTotalDataLen2;    /* For the current block, how many bytes have we read in so far 
                              for DataLen2 data of a TOPICLINK. */ 
 
  BOOL bInitScrollTopic;   /* Will the scrollable topic data be initially scrolled to 
                              a certain scroll position when the topic is first displayed. */ 
} 
TOPICSTREAMSTRUCT; 
 
 
 
/* Help file topic codes. */ 
#define TC_FONT        0x80      /* Font setting. */ 
#define TC_LINE        0x81      /* New line, but not end of paragraph. */ 
#define TC_PAR         0x82      /* End of paragraph. */ 
#define TC_TAB         0x83      /* Tab. */ 
#define TC_CHARPICT    0x86      /* Picture positioned as next character in line. */ 
#define TC_LEFTPICT    0x87      /* Picture positioned at left margin. */ 
#define TC_RIGHTPICT   0x88      /* Picture positioned at right margin. */ 
#define TC_HOTEND      0x89      /* End of a hotspot. */ 
#define TC_HOTBEG_C8   0xC8      /* Beginning of macro hotspot. */ 
#define TC_HOTBEG_CC   0xCC      /* Beginning of macro hotspot. 
                                    Text in hotspot is not underlined or colored as hotspot. */ 
#define TC_HOTBEG_2    0xE2      /* Beginning of a popup hotspot. */ 
#define TC_HOTBEG_3    0xE3      /* Beginning of a jump hotspot. */ 
#define TC_HOTBEG_6    0xE6      /* Beginning of a popup hotspot. 
                                    Text in hotspot is not underlined or colored as hotspot. */ 
#define TC_HOTBEG_7    0xE7      /* Beginning of a jump hotspot. 
                                    Text in hotspot is not underlined or colored as hotspot. */ 
#define TC_HOTBEG_A    0xEA      /* Beginning of a popup hotspot.  
                                    Topic is in another help file than the one being shown. */ 
#define TC_HOTBEG_B    0xEB      /* Beginning of a jump hotspot.  
                                    Topic is in another help file than the one being shown or 
                                    is in a secondary window in the current help file. */ 
#define TC_HOTBEG_E    0xEE      /* Beginning of a popup hotspot. 
                                    Text in hotspot is not underlined or colored as hotspot.  
                                    Topic is in another help file than the one being shown. */ 
#define TC_HOTBEG_F    0xEF      /* Beginning of a jump hotspot.  
                                    Topic is in another help file than the one being shown or 
                                    is in a secondary window in the current help file.  
                                    Only difference between 0xEB & 0xEF so far is that 0xEF 
                                    was used for a graphic and did not have underlining. */ 
#define TC_PARD        0xFF      /* Set paragraph formatting information to default values. */ 
 
         
/* Information from |SYSTEM file. */ 
typedef struct tagSYSTEMINFO 
{ 
  COMPILERVER   CompilerVer;                /* What version of the compiler was used to build 
                                               the help file. */ 
  BOOL          bCompressed;                /* Do we have at least block compression? */ 
  DWORD         dwContentsTopic;            /* The contents topic number. */ 
  char          szContentsFile[MAX_HLPPATH];  /* The contents topic number. */ 
  HGLOBAL       hTitleText;                 /* Text for caption of help window. */ 
  HICON         hIcon;                      /* Substitute icon for help window. */ 
  HGLOBAL       hMacroData;                 /* Macro data records. */ 
  HGLOBAL       hSecondWndData;             /* Second window data records. */ 
} 
SYSTEMINFO; 
typedef SYSTEMINFO * FPSYSTEMINFO; 
 
 
/*  
** Records used to store multiple records 
** of data.  i.e. second windows, macros, etc.  
** 
*/ 
typedef struct tagSYSTEMREC  
{ 
  WORD         RecordType;   /* Type of Data in record.      */            
  WORD         DataSize;     /* Size of RData.               */ 
  HGLOBAL      hRecData;     /* Raw data (Icon, title, etc). */ 
}  
SYSTEMREC; 
typedef SYSTEMREC * FPSYSTEMREC; 
 
/* |SYSTEM record enumeration call-back function. */ 
typedef BOOL ( CALLBACK * SYSTEMRECPROC )( FPSYSTEMREC fpSysRec, LPARAM lParam ); 
 
/* Maximum length of a topic's title (127 published by microsoft). */ 
#define MAX_TOPIC_TITLE  128    
 
 
/* Length of a context string. */ 
#define MAX_CONTEXT 100 
 
/* Record for the |CONTEXT file. */ 
typedef struct tagCONTEXTREC 
{ 
  DWORD dwHashValue;         /* Topic hash value. */ 
  DWORD dwTopicCharOffset;   /* Character Offset of topic's data in the |TOPIC file. */ 
}  
CONTEXTREC; 
typedef CONTEXTREC * FPCONTEXTREC; 
 
 
/* Header for |FONT file */ 
typedef struct tagFONTHEADER  
{ 
  WORD NumFonts;           /* Number of fonts in Font List */ 
  WORD NumDescriptors;     /* Number of font descriptors   */ 
  WORD DefDescriptor;      /* Default font descriptor      */ 
  WORD DescriptorsOffset;  /* Offset to descriptor list    */ 
}  
FONTHEADER; 
 
#define FONTFACESIZE  20   /* Size of font face string in file. */ 
 
typedef struct tagFONTDESC  
{ 
  BYTE Attributes;         /* Font Attributes See values below */ 
  BYTE HalfPoints;         /* PointSize * 2                    */ 
  BYTE FontFamily;         /* Font Family. See values below    */ 
  BYTE FontName;           /* Number of font in Font List      */ 
  BYTE Unknown; 
  BYTE FGRGB[3];           /* RGB values of foreground         */ 
  BYTE BGRGB[3];           /* background RGB Values (?? Not sure */ 
}  
FONTDESC; 
 
/* Font Attributes */ 
#define FONT_NORM    0x00       /* Normal         */ 
#define FONT_BOLD    0x01       /* Bold           */ 
#define FONT_ITAL    0x02       /* Italics        */ 
#define FONT_UNDR    0x04       /* Underline      */ 
#define FONT_STRK    0x08       /* Strike Through */ 
#define FONT_DBUN    0x10       /* Dbl Underline  */ 
#define FONT_SMCP    0x20       /* Small Caps     */ 
 
/* Font Families */ 
#define FAM_MODERN   0x01 
#define FAM_ROMAN    0x02 
#define FAM_SWISS    0x03 
#define FAM_TECH     0x03 
#define FAM_NIL      0x03 
#define FAM_SCRIPT   0x04 
#define FAM_DECOR    0x05 
 
/* Font table information stored in memory. */ 
typedef struct tagFONTINFOREC 
{ 
  char szFontName[FONTFACESIZE];  /* Font face.        */ 
  BYTE Attributes;                /* Font attributes.  */ 
  BYTE PointSize;                 /* Point size.       */ 
  BYTE FontFamily;                /* Font Family.      */ 
  COLORREF fgTextColor;           /* Font foreground text color. */ 
}  
FONTLISTREC; 
typedef FONTLISTREC * FPFONTLISTREC; 
 
/* Font file information stored in memory. */ 
typedef struct tagFONTINFO 
{ 
  WORD    wFontCount; 
  HGLOBAL hFontList; 
}  
FONTINFO; 
typedef FONTINFO * FPFONTINFO; 
 
/* Keyword information. */ 
typedef struct tagKEYWORDINFO 
{ 
  DWORD   dwLastIndex;         /* Last index to keywords combo box for the 
                                  'K' keyword list. */ 
  HGLOBAL hKWBTREEInfo;        /* |KWBTREE file information.    */ 
  HGLOBAL hKWDATAInfo;         /* |KWDATA file information.    */ 
}  
KEYWORDINFO; 
 
#define MAX_KEYWORD_STRING  100 
 
 
/* Help file info stored in memory. */ 
typedef struct tagHLPFILEINFO 
{ 
  char        szFilePath[MAX_HLPPATH]; /* Help file's path.           */ 
  HELPHEADER  HelpHeader;            /* Header for help file.         */ 
  WHIFSINFO   WHIFSInfo;             /* WHIFS file information.       */ 
  SYSTEMINFO  SystemInfo;            /* |SYSTEM file information.     */ 
  HGLOBAL     hPhrasesInfo;          /* |Phrases file information.    */ 
  HGLOBAL     hCTXOMAPInfo;          /* |CTXOMAP file information.    */ 
  HGLOBAL     hTTLBTREEInfo;         /* |TTLBTREE file information.   */ 
  HGLOBAL     hContextInfo;          /* |CONTEXT file information.    */ 
  FONTINFO    FontInfo;              /* |FONT file information.       */ 
  KEYWORDINFO KeywordInfo;           /* |KWBTREE & |KWDATA file information. */ 
} 
HLPFILEINFO; 
typedef HLPFILEINFO * FPHLPFILEINFO; 
 
 
/*  
** Return values for functions.  
** 
*/ 
typedef enum 
{ 
  ERR_NOERROR, 
  ERR_MEMORY, 
  ERR_BADCODE, 
  ERR_OTHER 
} 
RETVAL; 
 
 
/*********************************** 
** 
**  Shared Function Prototypes 
** 
***********************************/ 
 
RETVAL LoadHelpFileInfo( HWND hErrorWnd, char * szFilePath, HGLOBAL * hHelpFileInfo ); 
void FreeHelpFileInfo( HGLOBAL hHelpFileInfo ); 
 
long GetWHIFSFileStart( FPWHIFSINFO fpWHIFSInfo, char * FileName ); 
 
RETVAL OpenTopicDataStream 
(  
  TOPICSTREAMSTRUCT * TopicStreamPtr,  
  HWND hErrorWnd, 
  DWORD dwTopicCharOffset,  
  FPHLPFILEINFO fpHelpFileInfo,  
  BOOL * bHasScrollDataPtr,  
  BOOL * bHasNonScrollDataPtr,  
  long int * PrevTopicCharOffsetPtr,  
  long int * NextTopicCharOffsetPtr, 
  HGLOBAL * hTopicHdrData2Ptr, 
  DWORD * dwTopicHdrData2SizePtr  
); 
void CloseTopicDataStream 
(  
  TOPICSTREAMSTRUCT * TopicStreamPtr 
); 
RETVAL ReadTopicData 
(  
  TOPICSTREAMSTRUCT * TopicStreamPtr,  
  HWND hErrorWnd, 
  TOPICDATATYPE * TopicDataTypePtr, 
  HGLOBAL * hTextPtr,  
  DWORD * dwTextSizePtr, 
  HGLOBAL * hCodesPtr, 
  BOOL * bMoreDataPtr 
); 
 
 
BOOL SetContentsTopic( HWND hWnd, HGLOBAL hHelpFileInfo, char * szContentsHelpFilePath, unsigned long int nContentsContext ); 
void GetContentsTopic( HGLOBAL hHelpFileInfo, char * szHelpFilePath, DWORD * dwTopicCharOffset ); 
 
BOOL GetSecWndNumFileData 
(   
  HWND hWnd, 
  HGLOBAL hHelpFileInfo,  
  WORD wSecWndNum, 
  char * szWndName, 
  char * szCaption, 
  WINDOWPLACEMENT * WndPlacePtr, 
  COLORREF * ScrollColorPtr, 
  COLORREF * NonScrollColorPtr, 
  BOOL  * bOnTop, 
  BOOL  * bMainWnd 
); 
BOOL GetSecWndNameFileData 
(   
  HWND hWnd, 
  HGLOBAL hHelpFileInfo,  
  char * szWndName, 
  WORD * wSecWndNumPtr, 
  char * szCaption, 
  WINDOWPLACEMENT * WndPlacePtr, 
  COLORREF * ScrollColorPtr, 
  COLORREF * NonScrollColorPtr, 
  BOOL  * bOnTop 
); 
BOOL GetMainSecWndFileData 
(   
  HWND hWnd, 
  HGLOBAL hHelpFileInfo,  
  BOOL * bUseCaptionPtr, 
  char * szCaption, 
  WINDOWPLACEMENT * WndPlacePtr, 
  COLORREF * ScrollColorPtr, 
  COLORREF * NonScrollColorPtr, 
  BOOL  * bOnTop  
); 
 
 
HGLOBAL GetTitleText( HGLOBAL hHelpFileInfo ); 
 
BOOL GetCTXOMAPOffset( HWND hErrorWnd, HGLOBAL hHelpFileInfo, long TopicID, DWORD * dwTopicCharOffset ); 
 
char * GetPhrasePtr( FPPHRASEINFO fpPhraseInfo, WORD PhraseNum, WORD * wSize ); 
 
void GetTopicTitle( HGLOBAL hHelpFileInfo, DWORD dwTopicCharOffset, char * szTopicTitle ); 
 
BOOL GetContextOffset( HWND hErrorWnd, HGLOBAL hHelpFileInfo, DWORD dwHashValue, DWORD * dwTopicCharOffset ); 
void BuildContextHashMapTable( void ); 
DWORD GetContextHashValue( char * StringPtr ); 
 
BOOL GetFontListRec( FPHLPFILEINFO fpHelpFileInfo, WORD wFontNumber, FPFONTLISTREC fpSaveRec ); 
 
RETVAL LoadPictFile( HWND hErrorWnd, FPHLPFILEINFO fpHelpFileInfo, HGLOBAL * hPictData, WORD wPictFileNum ); 
 
BOOL LoadKeywordData( HWND hErrorWnd, char chKey, HGLOBAL hHelpFileInfo ); 
void FreeKeywordData( HGLOBAL hHelpFileInfo ); 
BOOL ShowKeywords( HWND hListBox, char chKey, HGLOBAL hHelpFileInfo );  
BOOL ShowKeywordTopics( HWND hListBox, DWORD dwKeySelect, HGLOBAL hHelpFileInfo, DWORD * dwKWDATAOffset ); 
DWORD GetKeywordTopicOffset( HGLOBAL hHelpFileInfo, DWORD dwKWDATAOffset, DWORD dwTopicIndex ); 
void SetLastKeywordIndex( HGLOBAL hHelpFileInfo, DWORD dwIndex ); 
DWORD GetLastKeywordIndex( HGLOBAL hHelpFileInfo ); 
WORD GetKeyTopic( HWND hErrorWnd, HGLOBAL hHelpFileInfo, char * KeywordPtr, DWORD * dwTopicCharOffsetPtr ); 
BOOL KeywordTableExists( HGLOBAL hHelpFileInfo, char chKey ); 
 
HICON GetHelpFileIcon( HGLOBAL hHelpFileInfo ); 
 
void EnumSysRecords( SYSTEMRECPROC fpCallback, HGLOBAL hRecordBuffer, LPARAM lParam ); 
 
 
#endif