--- psiconv/trunk/program/psiconv/gen_txt.c 1999/12/02 17:18:55 34 +++ psiconv/trunk/program/psiconv/gen_txt.c 2000/12/10 16:49:40 58 @@ -21,8 +21,8 @@ #include "config.h" #include #include -#include "data.h" -#include "list.h" +#include "psiconv/data.h" +#include "psiconv/list.h" #include "gen.h" #include "psiconv.h" @@ -145,20 +145,25 @@ } } -static int psiconv_gen_txt(FILE * of, const psiconv_file file, +static int psiconv_gen_txt(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_txt_word(of,(psiconv_word_f) file->file); - return 0; } else if (file->type == psiconv_texted_file) { psiconv_gen_txt_texted(of,(psiconv_texted_f) file->file); - return 0; - } else - return 1; + } else { + fclose(of); + return -1; + } + return fclose(of); } -static struct psiconv_fileformat ff = +static struct psiconv_fileformat_s ff = { "ASCII", "Plain text without much layout",