
#include <stdio.h>
#include <stdlib.h>
#include "cvtpar.h"
#include "prsf2.h"

char fin[300], fon[300];

main(argc, argv)
	int	argc;
	char	**argv;
{
	register int c;
	static unsigned char 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);
	}
}
