ftp.nice.ch/pub/next/unix/audio/cmusic.bs.N.tar.gz#/src/sig/atob.c

This is atob.c in view mode; [Download] [Up]

# include <stdio.h>
# include <carl/carl.h>
# include <carl/defaults.h>
# include <sys/types.h>

/*
 * atob - reads ascii floats and writes binary floats
 */

main(argc, argv)
char *argv[];
{
	float num; 
	int err;
	int i;

	err = 0;

	if (argc > 1) {
		for (i = 1; i < argc; i++) {
			if (freopen(argv[i], "r", stdin) == NULL) {
				fputs("open: ", stderr);
				perror(argv[i]);
				err = 1;
				continue;
			}

			while (fscanf(stdin, "%f", &num) != EOF)
				putfloat(&num);

			flushfloat();
		}
	}
	else {
		while (fscanf(stdin, "%f", &num) != EOF)
			putfloat(&num);

		flushfloat();
	}

	exit(err);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.