--- psiconv/trunk/program/psiconv/gen_rtf.c 1999/10/27 15:05:03 20 +++ psiconv/trunk/program/psiconv/gen_rtf.c 2000/10/21 00:49:13 53 @@ -25,6 +25,7 @@ #include "data.h" #include "list.h" #include "gen.h" +#include "psiconv.h" /* @@ -521,13 +522,33 @@ psiconv_list_free(colors); } -void psiconv_gen_rtf(FILE * of, psiconv_file file) +static int psiconv_gen_rtf(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_rtf_word(of,(psiconv_word_f) file->file); - else if (file->type == psiconv_texted_file) + } else if (file->type == psiconv_texted_file) { psiconv_gen_rtf_texted(of,(psiconv_texted_f) file->file); - else - return; + } else { + fclose(of); + return -1; + } + return fclose(of); +} + +static struct psiconv_fileformat ff = +{ + "RTF", + "Rich Text Format (not functional yet!)", + psiconv_gen_rtf +}; + +void init_rtf(void) +{ + /* psiconv_list_add(fileformat_list,&ff); */ }