4 * Copyright 1996 Ulrich Schmid
5 * 2002, 2008 Eric Pouech
6 * 2007 Kirill K. Smirnov
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 COLORREF sr_color
; /* color for scrollable region */
35 COLORREF nsr_color
; /* color for non scrollable region */
40 enum {hlp_link_link
, hlp_link_popup
, hlp_link_macro
} cookie
;
41 LPCSTR lpszString
; /* name of the file to for the link (NULL if same file) */
42 LONG lHash
; /* topic index */
43 unsigned bClrChange
: 1, /* true if the link is green & underlined */
44 wRefCount
; /* number of internal references to this object */
45 unsigned window
; /* window number for displaying the link (-1 is current) */
48 enum para_type
{para_normal_text
, para_debug_text
, para_bitmap
, para_metafile
};
50 typedef struct tagHlpFileParagraph
52 enum para_type cookie
;
66 unsigned pos
; /* 0: center, 1: left, 2: right */
75 } gfx
; /* for bitmaps and metafiles */
80 struct tagHlpFileParagraph
* next
;
83 typedef struct tagHlpFileMacro
86 struct tagHlpFileMacro
* next
;
89 typedef struct tagHlpFilePage
92 HLPFILE_PARAGRAPH
* first_paragraph
;
93 HLPFILE_MACRO
* first_macro
;
98 struct tagHlpFilePage
* next
;
99 struct tagHlpFilePage
* prev
;
104 struct tagHlpFileFile
* file
;
110 unsigned long offset
;
120 typedef struct tagHlpFileFile
123 UINT file_buffer_size
;
127 HLPFILE_PAGE
* first_page
;
128 HLPFILE_PAGE
* last_page
;
129 HLPFILE_MACRO
* first_macro
;
135 unsigned long contents_start
;
137 struct tagHlpFileFile
* prev
;
138 struct tagHlpFileFile
* next
;
142 unsigned short version
;
143 unsigned short flags
;
144 unsigned short tbsize
; /* topic block size */
145 unsigned short dsize
; /* decompress size */
146 unsigned short compressed
;
147 unsigned hasPhrases
; /* file has |Phrases */
148 unsigned hasPhrases40
; /* file has |PhrIndex/|PhrImage */
150 unsigned* phrases_offsets
;
151 char* phrases_buffer
;
164 HLPFILE_WINDOWINFO
* windows
;
169 * Compare function type for HLPFILE_BPTreeSearch function.
172 * p [I] pointer to testing block (key + data)
173 * key [I] pointer to key value to look for
174 * leaf [I] whether this function called for index of leaf page
175 * next [O] pointer to pointer to next block
177 typedef int (*HLPFILE_BPTreeCompare
)(void *p
, const void *key
,
178 int leaf
, void **next
);
181 * Callback function type for HLPFILE_BPTreeEnum function.
184 * p [I] pointer to data block
185 * next [O] pointer to pointer to next block
186 * cookie [IO] cookie data
188 typedef void (*HLPFILE_BPTreeCallback
)(void *p
, void **next
, void *cookie
);
190 HLPFILE
* HLPFILE_ReadHlpFile(LPCSTR lpszPath
);
191 HLPFILE_PAGE
* HLPFILE_Contents(HLPFILE
* hlpfile
);
192 HLPFILE_PAGE
* HLPFILE_PageByHash(HLPFILE
* hlpfile
, LONG lHash
);
193 HLPFILE_PAGE
* HLPFILE_PageByMap(HLPFILE
* hlpfile
, LONG lMap
);
194 HLPFILE_PAGE
* HLPFILE_PageByOffset(HLPFILE
* hlpfile
, LONG offset
);
195 LONG
HLPFILE_Hash(LPCSTR lpszContext
);
196 void HLPFILE_FreeLink(HLPFILE_LINK
* link
);
197 void HLPFILE_FreeHlpFile(HLPFILE
*);
199 void* HLPFILE_BPTreeSearch(BYTE
*, const void*, HLPFILE_BPTreeCompare
);
200 void HLPFILE_BPTreeEnum(BYTE
*, HLPFILE_BPTreeCallback cb
, void *cookie
);
202 BOOL
HLPFILE_BrowsePage(HLPFILE_PAGE
*);