2 * Copyright 1996 Ulrich Schmid
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 const char *first_paragraph;
36 const char *next_paragraph;
37 const char *special_char;
38 const char *begin_italic;
39 const char *end_italic;
40 const char *begin_boldface;
41 const char *end_boldface;
42 const char *begin_typewriter;
43 const char *end_typewriter;
56 "<!doctype linuxdoc system>\n"
178 /***********************************************************************
183 static void print_text(const char *p)
189 for (i = 0; charmap[i].ch; i++)
190 if (*p == charmap[i].ch)
192 printf(format.special_char, charmap[i].subst);
200 /***********************************************************************
205 int main(int argc, char **argv)
209 HLPFILE_PARAGRAPH *paragraph;
214 hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : "");
216 if (!hlpfile) return 2;
219 strftime(date, sizeof(date), "%x", localtime(&t));
220 filename = strrchr(hlpfile->lpszPath, '/');
221 if (filename) filename++;
222 else filename = hlpfile->lpszPath;
225 printf(format.header1);
226 print_text(hlpfile->lpszTitle);
227 printf(format.header2, filename, date);
229 for (page = hlpfile->first_page; page; page = page->next)
231 paragraph = page->first_paragraph;
232 if (!paragraph) continue;
235 printf(format.section);
236 for (; paragraph && !paragraph->u.text.wVSpace; paragraph = paragraph->next)
237 print_text(paragraph->u.text.lpszText);
238 printf(format.first_paragraph);
240 for (; paragraph; paragraph = paragraph->next)
242 switch (paragraph->cookie)
244 case para_normal_text:
245 case para_debug_text:
246 /* New line; new paragraph */
247 if (paragraph->u.text.wVSpace == 1)
248 printf(format.newline);
249 else if (paragraph->u.text.wVSpace > 1)
250 printf(format.next_paragraph);
252 if (paragraph->u.text.wFont)
253 printf(format.begin_boldface);
255 print_text(paragraph->u.text.lpszText);
257 if (paragraph->u.text.wFont)
258 printf(format.end_boldface);
271 /***********************************************************************
273 * Substitutions for some WINELIB functions
276 static FILE *file = 0;
278 HFILE WINAPI OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
280 file = *path ? fopen(path, "r") : stdin;
281 return file ? (HFILE)1 : HFILE_ERROR;
284 HFILE WINAPI _lclose( HFILE hFile )
290 LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count )
292 return fread(buffer, 1, count, file);
295 HANDLE WINAPI GetProcessHeap(void)
300 void* WINAPI HeapAlloc( HANDLE heap, DWORD flags, DWORD size )
306 void* WINAPI HeapReAlloc( HANDLE heap, DWORD flags, void* ptr, DWORD size)
309 return realloc(ptr, size);
312 BOOL WINAPI HeapFree( HGLOBAL handle, DWORD flags, void* ptr )
318 char __wine_dbch_winhelp[] = "\003winhelp";
320 static char * const debug_channels[1] =
325 int wine_dbg_log( int cls, const char *channel, const char *func, const char *format, ... )
330 HBITMAP WINAPI CreateDIBitmap(HDC hdc, CONST BITMAPINFOHEADER* bih, DWORD a, CONST void* ptr, CONST BITMAPINFO* bi, UINT c)
335 HDC WINAPI GetDC(HWND h)
340 BOOL WINAPI DeleteObject(HGDIOBJ h)
347 * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
350 INT WINAPI lstrcmp( LPCSTR str1, LPCSTR str2 )
352 return strcmp( str1, str2 );
355 INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 )
361 if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
365 return toupper(*str1) - toupper(*str2);
368 INT WINAPI lstrlen( LPCSTR str )
373 LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
375 if (!src || !dst) return NULL;