--- psiconv/trunk/program/psiconv/gen_html.c 1999/10/27 15:05:03 20 +++ psiconv/trunk/program/psiconv/gen_html.c 2000/10/21 00:49:13 53 @@ -24,6 +24,7 @@ #include "data.h" #include "list.h" #include "gen.h" +#include "psiconv.h" /* This determines for each character how it is displayed */ static const char *char_table[0x100] = @@ -278,14 +279,22 @@ fputs("

\n",of); } -void psiconv_gen_html(FILE *of,psiconv_file file) +int psiconv_gen_html(const char * filename,const psiconv_file file, + const char *dest) { - if (file->type == psiconv_word_file) + 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); - else if (file->type == psiconv_texted_file) + } else if (file->type == psiconv_texted_file) { psiconv_gen_html_texted(of,(psiconv_texted_f) file->file); - else - return; + } else { + fclose(of); + return -1; + } + return fclose(of); } void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf) @@ -346,4 +355,14 @@ psiconv_free_character_layout(base_char); } +static struct psiconv_fileformat ff = + { + "HTML3", + "HTML 3.2, not verified so probably not completely compliant", + &psiconv_gen_html + }; +void init_html(void) +{ + psiconv_list_add(fileformat_list,&ff); +}