… | |
… | |
445 | fput_paragraph_layout(of, normal ? normal->paragraph : NULL, sty->paragraph); |
445 | fput_paragraph_layout(of, normal ? normal->paragraph : NULL, sty->paragraph); |
446 | fput_character_layout(of, normal ? normal->character : NULL, sty->character, wf); |
446 | fput_character_layout(of, normal ? normal->character : NULL, sty->character, wf); |
447 | fputs("}\n", of); |
447 | fputs("}\n", of); |
448 | } |
448 | } |
449 | |
449 | |
450 | static int psiconv_gen_html4(FILE * of, const psiconv_file file, |
450 | static int psiconv_gen_html4(const char *filename, const psiconv_file file, |
451 | const char *dest) |
451 | const char *dest) |
452 | { |
452 | { |
|
|
453 | FILE * of; |
453 | int i; |
454 | int i; |
454 | psiconv_paragraph para; |
455 | psiconv_paragraph para; |
455 | psiconv_word_style normal, sty; |
456 | psiconv_word_style normal, sty; |
456 | psiconv_word_f wf; |
457 | psiconv_word_f wf; |
457 | |
458 | |
458 | if (file->type == psiconv_word_file) |
459 | if (file->type == psiconv_word_file) |
459 | wf = file->file; |
460 | wf = file->file; |
460 | else { |
461 | else { |
461 | /* Fall back on the normal HTML generator */ |
462 | /* Fall back on the normal HTML generator */ |
462 | return psiconv_gen_html(of,file,dest); |
463 | return psiconv_gen_html(filename,file,dest); |
463 | } |
464 | } |
|
|
465 | |
|
|
466 | if (! (of = fopen(filename,"w"))) |
|
|
467 | return -1; |
464 | |
468 | |
465 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
469 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
466 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
470 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
467 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
471 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
468 | |
472 | |
… | |
… | |
489 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
493 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
490 | para = psiconv_list_get(wf->paragraphs, i); |
494 | para = psiconv_list_get(wf->paragraphs, i); |
491 | fput_para(of, para, wf); |
495 | fput_para(of, para, wf); |
492 | } |
496 | } |
493 | fputs("</BODY>\n</HTML>\n", of); |
497 | fputs("</BODY>\n</HTML>\n", of); |
494 | return 0; |
498 | |
|
|
499 | return fclose(of); |
495 | } |
500 | } |
496 | |
501 | |
497 | static struct psiconv_fileformat ff = |
502 | static struct psiconv_fileformat ff = |
498 | { |
503 | { |
499 | "HTML4", |
504 | "HTML4", |