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
33 const char *first_paragraph;
35 const char *next_paragraph;
36 const char *special_char;
37 const char *begin_italic;
38 const char *end_italic;
39 const char *begin_boldface;
40 const char *end_boldface;
41 const char *begin_typewriter;
42 const char *end_typewriter;
55 "<!doctype linuxdoc system>\n"
177 /***********************************************************************
182 static void print_text(const char *p)
188 for (i = 0; charmap[i].ch; i++)
189 if (*p == charmap[i].ch)
191 printf(format.special_char, charmap[i].subst);
199 /***********************************************************************
204 int main(int argc, char **argv)
208 HLPFILE_PARAGRAPH *paragraph;
213 hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : "");
215 if (!hlpfile) return(2);
218 strftime(date, sizeof(date), "%x", localtime(&t));
219 filename = strrchr(hlpfile->lpszPath, '/');
220 if (filename) filename++;
221 else filename = hlpfile->lpszPath;
224 printf(format.header1);
225 print_text(hlpfile->lpszTitle);
226 printf(format.header2, filename, date);
228 for (page = hlpfile->first_page; page; page = page->next)
230 paragraph = page->first_paragraph;
231 if (!paragraph) continue;
234 printf(format.section);
235 for (; paragraph && !paragraph->wVSpace; paragraph = paragraph->next)
236 print_text(paragraph->lpszText);
237 printf(format.first_paragraph);
239 for (; paragraph; paragraph = paragraph->next)
241 /* New line; new paragraph */
242 if (paragraph->wVSpace == 1)
243 printf(format.newline);
244 else if (paragraph->wVSpace > 1)
245 printf(format.next_paragraph);
247 if (paragraph->wFont)
248 printf(format.begin_boldface);
250 print_text(paragraph->lpszText);
252 if (paragraph->wFont)
253 printf(format.end_boldface);
262 /***********************************************************************
264 * Substitutions for some WINELIB functions
267 static FILE *file = 0;
269 HFILE WINAPI OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
271 file = *path ? fopen(path, "r") : stdin;
272 return file ? (HFILE)1 : HFILE_ERROR;
275 HFILE WINAPI _lclose( HFILE hFile )
281 LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count )
283 return fread(buffer, 1, count, file);
286 HGLOBAL WINAPI GlobalAlloc( UINT flags, DWORD size )
288 return (HGLOBAL) malloc(size);
291 LPVOID WINAPI GlobalLock( HGLOBAL handle )
293 return (LPVOID) handle;
296 HGLOBAL WINAPI GlobalFree( HGLOBAL handle )
298 free((VOID*) handle);
305 * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
308 INT WINAPI lstrcmp(LPCSTR str1,LPCSTR str2)
310 return strcmp( str1, str2 );
313 INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 )
319 if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
323 return toupper(*str1) - toupper(*str2);
326 INT WINAPI lstrlen(LPCSTR str)
331 LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
333 if (!src || !dst) return NULL;
338 void WINAPI hmemcpy16(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
340 memcpy(hpvDest, hpvSource, cbCopy);
343 /* Local Variables: */
344 /* c-file-style: "GNU" */