/* coagulate.c: read stdin into 1 BIG RECORD, then output R.VAR FD.CR */
/* used to untangle DOS etc files got from big magtape blocks */
/* prototype filter program - line (actually record) oriented */
#include <stdio.h>
#include <algol68.h>
#include <cx.h>
#include <nboff.h>
#include <fdoff.h>
#define BUFSIZ 4096
char buffer[BUFSIZ];
FILE	*inf;
FILE	*ouf;
char	*p;
extern int $dsw;
extern int $$ferr;
FDB * fdbp;
main(argc,argv)
char **argv;
BEGIN
register int	howlong;	/* char length of this record */
	IF	((inf=fopen(argv[1],"ur"))==NULL)
	THEN	error("can't find %s\7\n",argv[1]);
	FI;
	WHILE	(!feof(inf))
	DO	howlong = fget(buffer,BUFSIZ,inf);
		IF	(ferror(inf))
		THEN	error("read failure $$ferr=%oo\7\n",$$ferr);
		FI;
		FOR	(p=buffer; howlong--; p++)
		DO	putchar(*p);
		OD;
	OD;
END
/* end: ufilter.c */
/* end: coagulate.c */
