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 static FILE *file = 0;
255 HFILE WINAPI OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
257 file = *path ? fopen(path, "r") : stdin;
258 return file ? (HFILE)1 : HFILE_ERROR;
261 HFILE WINAPI _lclose( HFILE hFile )
267 LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count )
269 return fread(buffer, 1, count, file);
272 HGLOBAL WINAPI GlobalAlloc( UINT flags, DWORD size )
274 return (HGLOBAL) malloc(size);
277 LPVOID WINAPI GlobalLock( HGLOBAL handle )
279 return (LPVOID) handle;
282 HGLOBAL WINAPI GlobalFree( HGLOBAL handle )
284 free((VOID*) handle);
291 * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
294 INT WINAPI lstrcmp(LPCSTR str1,LPCSTR str2)
296 return strcmp( str1, str2 );
299 INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 )
305 if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
309 return toupper(*str1) - toupper(*str2);
312 INT WINAPI lstrlen(LPCSTR str)
317 LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
319 if (!src || !dst) return NULL;
324 void WINAPI hmemcpy16(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
326 memcpy(hpvDest, hpvSource, cbCopy);
329 /* Local Variables: */
330 /* c-file-style: "GNU" */