--- psiconv/trunk/program/psiconv/gen_html.c 1999/12/02 17:18:55 34 +++ psiconv/trunk/program/psiconv/gen_html.c 2002/01/29 18:38:38 142 @@ -21,11 +21,15 @@ #include #include #include -#include "data.h" -#include "list.h" +#include "psiconv/data.h" +#include "psiconv/list.h" #include "gen.h" #include "psiconv.h" +#ifdef DMALLOC +#include "dmalloc.h" +#endif + /* This determines for each character how it is displayed */ static const char *char_table[0x100] = { @@ -93,7 +97,7 @@ const psiconv_color color, const psiconv_color back_color) { - struct psiconv_character_layout base_char_struct = + struct psiconv_character_layout_s base_char_struct = { NULL, /* color */ NULL, /* back_color */ @@ -102,7 +106,7 @@ psiconv_bool_false, /* bold */ psiconv_normalscript, /* super_sub */ psiconv_bool_false, /* underline */ - psiconv_bool_false, /* strike_out */ + psiconv_bool_false, /* strikethrough */ NULL, /* font */ }; base_char_struct.color = color; @@ -133,7 +137,7 @@ fputs("",of); if (old->underline) fputs("",of); - if (old->strike_out) + if (old->strikethrough) fputs("",of); if (old->super_sub == psiconv_superscript) fputs("",of); @@ -160,11 +164,11 @@ fputs("7",of); fprintf(of," COLOR=#%02x%02x%02x",new->color->red,new->color->green, new->color->blue); - if (new->font->screenfont == 1) + if (new->font->screenfont == psiconv_font_sansserif) fprintf(of," FACE=\"%s, Sans-Serif\">",new->font->name); - else if (new->font->screenfont == 2) + else if (new->font->screenfont == psiconv_font_nonprop) fprintf(of," FACE=\"%s, Monospace\">",new->font-> name); - else if (new->font->screenfont == 3) + else if (new->font->screenfont == psiconv_font_serif) fprintf(of," FACE=\"%s, Serif\">",new->font-> name); else fprintf(of," FACE=\"%s, Serif\">",new->font-> name); @@ -175,7 +179,7 @@ fputs("",of); if (new->underline) fputs("",of); - if (new->strike_out) + if (new->strikethrough) fputs("",of); if (new->super_sub == psiconv_superscript) fputs("",of); @@ -200,8 +204,8 @@ else fputs("",of); } - if (old->strike_out != new->strike_out) { - if (old->strike_out) + if (old->strikethrough != new->strikethrough) { + if (old->strikethrough) fputs("",of); else fputs("",of); @@ -279,16 +283,22 @@ fputs("

\n",of); } -int psiconv_gen_html(FILE *of,const psiconv_file file, const char *dest) +int psiconv_gen_html(const char * filename,const psiconv_file file, + const char *dest) { + FILE *of = fopen(filename,"w"); + if (! of) + return -1; + if (file->type == psiconv_word_file) { psiconv_gen_html_word(of,(psiconv_word_f) file->file); - return 0; } else if (file->type == psiconv_texted_file) { psiconv_gen_html_texted(of,(psiconv_texted_f) file->file); - return 0; - } else + } else { + fclose(of); return -1; + } + return fclose(of); } void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf) @@ -349,7 +359,7 @@ psiconv_free_character_layout(base_char); } -static struct psiconv_fileformat ff = +static struct psiconv_fileformat_s ff = { "HTML3", "HTML 3.2, not verified so probably not completely compliant",