… | |
… | |
24 | #include <ctype.h> |
24 | #include <ctype.h> |
25 | #include <stdlib.h> |
25 | #include <stdlib.h> |
26 | #include "data.h" |
26 | #include "data.h" |
27 | #include "list.h" |
27 | #include "list.h" |
28 | #include "gen.h" |
28 | #include "gen.h" |
|
|
29 | #include "psiconv.h" |
29 | |
30 | |
30 | #ifndef TRUE |
31 | #ifndef TRUE |
31 | #define TRUE (0==0) |
32 | #define TRUE (0==0) |
32 | #endif |
33 | #endif |
33 | |
34 | |
… | |
… | |
444 | fput_paragraph_layout(of, normal ? normal->paragraph : NULL, sty->paragraph); |
445 | fput_paragraph_layout(of, normal ? normal->paragraph : NULL, sty->paragraph); |
445 | fput_character_layout(of, normal ? normal->character : NULL, sty->character, wf); |
446 | fput_character_layout(of, normal ? normal->character : NULL, sty->character, wf); |
446 | fputs("}\n", of); |
447 | fputs("}\n", of); |
447 | } |
448 | } |
448 | |
449 | |
449 | void psiconv_gen_html4(FILE * of, psiconv_file file) |
450 | static int psiconv_gen_html4(FILE * of, const psiconv_file file, |
|
|
451 | const char *dest) |
450 | { |
452 | { |
451 | int i; |
453 | int i; |
452 | psiconv_paragraph para; |
454 | psiconv_paragraph para; |
453 | psiconv_word_style normal, sty; |
455 | psiconv_word_style normal, sty; |
454 | psiconv_word_f wf; |
456 | psiconv_word_f wf; |
455 | |
457 | |
456 | if (file->type == psiconv_word_file) |
458 | if (file->type == psiconv_word_file) |
457 | wf = file->file; |
459 | wf = file->file; |
458 | else { |
460 | else { |
459 | /* Fall back on the normal HTML generator */ |
461 | /* Fall back on the normal HTML generator */ |
460 | psiconv_gen_html(of,file); |
462 | return psiconv_gen_html(of,file,dest); |
461 | return; |
|
|
462 | } |
463 | } |
463 | |
464 | |
464 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
465 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
465 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
466 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
466 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
467 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
… | |
… | |
488 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
489 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
489 | para = psiconv_list_get(wf->paragraphs, i); |
490 | para = psiconv_list_get(wf->paragraphs, i); |
490 | fput_para(of, para, wf); |
491 | fput_para(of, para, wf); |
491 | } |
492 | } |
492 | fputs("</BODY>\n</HTML>\n", of); |
493 | fputs("</BODY>\n</HTML>\n", of); |
|
|
494 | return 0; |
493 | } |
495 | } |
494 | |
496 | |
|
|
497 | static struct psiconv_fileformat ff = |
|
|
498 | { |
|
|
499 | "HTML4", |
|
|
500 | "HTML 4.0 with cascading style sheets", |
|
|
501 | psiconv_gen_html4 |
|
|
502 | }; |
|
|
503 | |
|
|
504 | void init_html4(void) |
|
|
505 | { |
|
|
506 | psiconv_list_add(fileformat_list,&ff); |
|
|
507 | } |
|
|
508 | |