/* recprofil.c - print out record lengths in decimal */
/* prototype filter program - line (actually record) oriented */
#include <stdio.h>
#include <algol68.h>
#define BUFSIZ 32768
char buffer[BUFSIZ];
FILE	*inf;
extern int $$ferr;
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;
		IF	(feof(inf))
		THEN	break;
		FI;
		printf("%d\n",howlong);
	OD;
END
/* end: ufilter.c */
/* end: recprofil.c */
