… | |
… | |
28 | #include "gen.h" |
28 | #include "gen.h" |
29 | #include "psiconv.h" |
29 | #include "psiconv.h" |
30 | |
30 | |
31 | #ifndef TRUE |
31 | #ifndef TRUE |
32 | #define TRUE (0==0) |
32 | #define TRUE (0==0) |
|
|
33 | #endif |
|
|
34 | |
|
|
35 | #ifdef DMALLOC |
|
|
36 | #include "dmalloc.h" |
33 | #endif |
37 | #endif |
34 | |
38 | |
35 | /* |
39 | /* |
36 | * Various string tables for HTML4 settings |
40 | * Various string tables for HTML4 settings |
37 | */ |
41 | */ |
… | |
… | |
468 | |
472 | |
469 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
473 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
470 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
474 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
471 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
475 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
472 | |
476 | |
|
|
477 | if (wf->page_sec->header->text) { |
473 | if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { |
478 | if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { |
474 | fputs(" <TITLE>", of); |
479 | fputs(" <TITLE>", of); |
475 | para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); |
480 | para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); |
476 | i = 0; |
481 | i = 0; |
477 | fput_text(of, para->text, strlen(para->text), &i); |
482 | fput_text(of, para->text, strlen(para->text), &i); |
478 | fputs("</TITLE>\n", of); |
483 | fputs("</TITLE>\n", of); |
|
|
484 | } |
479 | } |
485 | } |
480 | |
486 | |
481 | normal = wf->styles_sec->normal; |
487 | normal = wf->styles_sec->normal; |
482 | fputs(" <STYLE TYPE=\"text/css\"><!--\n", of); |
488 | fputs(" <STYLE TYPE=\"text/css\"><!--\n", of); |
483 | fprintf(of," BODY { background-color: #%02x%02x%02x }\n", |
489 | fprintf(of," BODY { background-color: #%02x%02x%02x }\n", |
… | |
… | |
488 | for (i = 0; i < psiconv_list_length(wf->styles_sec->styles); i++) { |
494 | for (i = 0; i < psiconv_list_length(wf->styles_sec->styles); i++) { |
489 | sty = psiconv_list_get(wf->styles_sec->styles, i); |
495 | sty = psiconv_list_get(wf->styles_sec->styles, i); |
490 | fput_style(of, normal, sty, wf); |
496 | fput_style(of, normal, sty, wf); |
491 | } |
497 | } |
492 | fputs(" --></STYLE>\n</HEAD>\n<BODY>\n", of); |
498 | fputs(" --></STYLE>\n</HEAD>\n<BODY>\n", of); |
|
|
499 | if (wf->page_sec->header->text) { |
493 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
500 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
494 | para = psiconv_list_get(wf->paragraphs, i); |
501 | para = psiconv_list_get(wf->paragraphs, i); |
495 | fput_para(of, para, wf); |
502 | fput_para(of, para, wf); |
|
|
503 | } |
496 | } |
504 | } |
497 | fputs("</BODY>\n</HTML>\n", of); |
505 | fputs("</BODY>\n</HTML>\n", of); |
498 | |
506 | |
499 | return fclose(of); |
507 | return fclose(of); |
500 | } |
508 | } |