2 * Copyright 1996 Ulrich Schmid
19 const char *first_paragraph;
21 const char *next_paragraph;
22 const char *special_char;
23 const char *begin_italic;
24 const char *end_italic;
25 const char *begin_boldface;
26 const char *end_boldface;
27 const char *begin_typewriter;
28 const char *end_typewriter;
41 "<!doctype linuxdoc system>\n"
163 /***********************************************************************
168 static void print_text(const char *p)
174 for (i = 0; charmap[i].ch; i++)
175 if (*p == charmap[i].ch)
177 printf(format.special_char, charmap[i].subst);
185 /***********************************************************************
190 int main(int argc, char **argv)
194 HLPFILE_PARAGRAPH *paragraph;
199 hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : "");
201 if (!hlpfile) return(2);
204 strftime(date, sizeof(date), "%x", localtime(&t));
205 filename = strrchr(hlpfile->lpszPath, '/');
206 if (filename) filename++;
207 else filename = hlpfile->lpszPath;
210 printf(format.header1);
211 print_text(hlpfile->lpszTitle);
212 printf(format.header2, filename, date);
214 for (page = hlpfile->first_page; page; page = page->next)
216 paragraph = page->first_paragraph;
217 if (!paragraph) continue;
220 printf(format.section);
221 for (; paragraph && !paragraph->wVSpace; paragraph = paragraph->next)
222 print_text(paragraph->lpszText);
223 printf(format.first_paragraph);
225 for (; paragraph; paragraph = paragraph->next)
227 /* New line; new paragraph */
228 if (paragraph->wVSpace == 1)
229 printf(format.newline);
230 else if (paragraph->wVSpace > 1)
231 printf(format.next_paragraph);
233 if (paragraph->wFont)
234 printf(format.begin_boldface);
236 print_text(paragraph->lpszText);
238 if (paragraph->wFont)
239 printf(format.end_boldface);
248 /***********************************************************************
250 * Substitutions for some WINELIB functions
253 HFILE OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
257 if (!*path) return (HFILE) stdin;
259 file = fopen(path, "r");
260 if (!file) return HFILE_ERROR;
264 HFILE _lclose( HFILE hFile )
266 fclose((FILE*) hFile);
270 LONG _hread( HFILE hFile, SEGPTR buffer, LONG count )
272 return fread(buffer, 1, count, (FILE*) hFile);
275 HGLOBAL GlobalAlloc( WORD flags, DWORD size )
277 return (HGLOBAL) malloc(size);
280 LPVOID GlobalLock( HGLOBAL handle )
282 return (LPVOID) handle;
285 HGLOBAL GlobalFree( HGLOBAL handle )
287 free((VOID*) handle);
294 * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
297 INT lstrcmp(LPCSTR str1,LPCSTR str2)
299 return strcmp( str1, str2 );
302 INT lstrcmpi( LPCSTR str1, LPCSTR str2 )
308 if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
312 return toupper(*str1) - toupper(*str2);
315 INT lstrlen(LPCSTR str)
320 SEGPTR lstrcpy( SEGPTR target, SEGPTR source )
322 strcpy( (char *)target, (char *)source );
326 void hmemcpy(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
328 memcpy(hpvDest, hpvSource, cbCopy);
331 /* Local Variables: */
332 /* c-file-style: "GNU" */