
#include <stdio.h>
#include <stdlib.h>

#include "sysdef.h"
#include "cvtpar.h"
#include "prsf2.h"

char fin[300], fon[300];

main (int argc, char **argv)
{
   int c;
   uint8 buf[160];
   FILE *fi, *fo;
   int parerr = 0;

   parsefiles(argc, argv, "bcd", "bin", 0);
   if ((fi = fopen(fin, "rb")) == NULL)
   {
      perror(fin);
      exit(1);
   }
   if ((fo = fopen(fon, "wb")) == NULL)
   {
      perror(fon);
      exit(1);
   }
   while ( (c = fgetc(fi)) != EOF )
   {
      if (!parerr && evenpar[c & 077] != (c & 0177))
      {
         parerr = 1;
         fprintf(stderr, "Parity error in %s\n", fin);
      }
      fputc(binbcd[c & 077] | c & 0200, fo);
   }
}
