--- psiconv/trunk/program/psiconv/gen_rtf.c 1999/12/02 17:18:55 34 +++ psiconv/trunk/program/psiconv/gen_rtf.c 2000/12/10 16:49:40 58 @@ -22,8 +22,8 @@ #include "compat.h" #include #include -#include "data.h" -#include "list.h" +#include "psiconv/data.h" +#include "psiconv/list.h" #include "gen.h" #include "psiconv.h" @@ -327,11 +327,11 @@ static psiconv_character_layout gen_base_char(psiconv_list colors, psiconv_list fonts) { - struct psiconv_color white = { 0,0,0 }; - struct psiconv_color black = { 0xff,0xff,0xff }; - struct psiconv_font font = { NULL,-1 }; /* Pseudo - not added! */ + struct psiconv_color_s white = { 0,0,0 }; + struct psiconv_color_s black = { 0xff,0xff,0xff }; + struct psiconv_font_s font = { NULL,-1 }; /* Pseudo - not added! */ - struct psiconv_character_layout base_char_struct = + struct psiconv_character_layout_s base_char_struct = { &black, /* color */ &white, /* back_color */ @@ -522,19 +522,25 @@ psiconv_list_free(colors); } -static int psiconv_gen_rtf(FILE * of, const psiconv_file file, const char *dest) +static int psiconv_gen_rtf(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_rtf_word(of,(psiconv_word_f) file->file); - return 0; } else if (file->type == psiconv_texted_file) { psiconv_gen_rtf_texted(of,(psiconv_texted_f) file->file); - return 0; - } else + } else { + fclose(of); return -1; + } + return fclose(of); } -static struct psiconv_fileformat ff = +static struct psiconv_fileformat_s ff = { "RTF", "Rich Text Format (not functional yet!)", @@ -543,6 +549,6 @@ void init_rtf(void) { - psiconv_list_add(fileformat_list,&ff); + /* psiconv_list_add(fileformat_list,&ff); */ }