4 * Copyright 1996 Ulrich Schmid
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
;
97 struct tagHlpFilePage
* next
;
98 struct tagHlpFilePage
* prev
;
103 struct tagHlpFileFile
* file
;
109 unsigned long offset
;
119 typedef struct tagHlpFileFile
124 HLPFILE_PAGE
* first_page
;
125 HLPFILE_PAGE
* last_page
;
126 HLPFILE_MACRO
* first_macro
;
132 unsigned long contents_start
;
134 struct tagHlpFileFile
* prev
;
135 struct tagHlpFileFile
* next
;
139 unsigned short version
;
140 unsigned short flags
;
141 unsigned short tbsize
; /* topic block size */
142 unsigned short dsize
; /* decompress size */
143 unsigned short compressed
;
144 unsigned hasPhrases
; /* file has |Phrases */
145 unsigned hasPhrases40
; /* file has |PhrIndex/|PhrImage */
154 HLPFILE_WINDOWINFO
* windows
;
158 * Compare function type for HLPFILE_BPTreeSearch function.
161 * p [I] pointer to testing block (key + data)
162 * key [I] pointer to key value to look for
163 * leaf [I] whether this function called for index of leaf page
164 * next [O] pointer to pointer to next block
166 typedef int (*HLPFILE_BPTreeCompare
)(void *p
, const void *key
,
167 int leaf
, void **next
);
170 * Callback function type for HLPFILE_BPTreeEnum function.
173 * p [I] pointer to data block
174 * next [O] pointer to pointer to next block
175 * cookie [IO] cookie data
177 typedef void (*HLPFILE_BPTreeCallback
)(void *p
, void **next
, void *cookie
);
179 HLPFILE
* HLPFILE_ReadHlpFile(LPCSTR lpszPath
);
180 HLPFILE_PAGE
* HLPFILE_Contents(HLPFILE
* hlpfile
);
181 HLPFILE_PAGE
* HLPFILE_PageByHash(HLPFILE
* hlpfile
, LONG lHash
);
182 HLPFILE_PAGE
* HLPFILE_PageByMap(HLPFILE
* hlpfile
, LONG lMap
);
183 HLPFILE_PAGE
* HLPFILE_PageByOffset(HLPFILE
* hlpfile
, LONG offset
);
184 LONG
HLPFILE_Hash(LPCSTR lpszContext
);
185 void HLPFILE_FreeLink(HLPFILE_LINK
* link
);
186 void HLPFILE_FreeHlpFile(HLPFILE
*);
188 void* HLPFILE_BPTreeSearch(BYTE
*, const void*, HLPFILE_BPTreeCompare
);
189 void HLPFILE_BPTreeEnum(BYTE
*, HLPFILE_BPTreeCallback cb
, void *cookie
);