--- psiconv/trunk/program/extra/rewrite.c 2000/12/25 00:26:53 76 +++ psiconv/trunk/program/extra/rewrite.c 2002/01/29 18:38:38 142 @@ -28,6 +28,8 @@ psiconv_buffer buf; psiconv_file psionfile; + /* psiconv_verbosity = PSICONV_VERB_DEBUG; */ + if (argc < 3) { fprintf(stderr,"Not enough arguments\n"); exit(1); @@ -36,11 +38,11 @@ perror("Can't open file"); exit(1); } - if (!(buf=psiconv_new_buffer())) { + if (!(buf=psiconv_buffer_new())) { perror("Can't allocate buf"); exit(1); } - if ((psiconv_list_fread_all(buf,fp))) { + if ((psiconv_buffer_fread_all(buf,fp))) { perror("Can't fread file"); exit(1); } @@ -49,19 +51,22 @@ fprintf(stderr,"Parse error\n"); exit(1); } - psiconv_free_buffer(buf); + + psiconv_buffer_free(buf); buf = NULL; if (psiconv_write(&buf,psionfile)) { - fprintf(stderr,"Parse error\n"); + fprintf(stderr,"Generate error\n"); exit(1); } + psiconv_free_file(psionfile); if (!(fp = fopen(argv[2],"w"))) { perror("Can't open file"); exit(1); } - if ((psiconv_list_fwrite_all(buf,fp))) { + if ((psiconv_buffer_fwrite_all(buf,fp))) { perror("Can't fwrite file"); exit(1); } + psiconv_buffer_free(buf); exit(0); }