This is sfprint.c in view mode; [Download] [Up]
#include "../H/NeXTsfheader.h" #include <stdio.h> #include <sys/file.h> #include <sys/types.h> #include <sys/stat.h> #include <signal.h> #include <errno.h> #define INT 2 static SFCODE ampcode = { SF_MAXAMP, sizeof(SFMAXAMP) + sizeof(SFCODE) }; main(argc,argv) int argc; char **argv; { int i,sf,result; struct stat sfst; float dur; SFHEADER sfh; char *sfname; while(--argc) { sfname = *++argv; readopensf(sfname,sf,sfh,sfst,"sfprint",result) if(result < 0) continue; printf(":::::::::::::::::::\n"); printf("%s \n:::::::::::::::::::\n" ,sfname); printsf(&sfh); dur = (float)(sfst.st_size - SIZEOF_HEADER) /(float)sfclass(&sfh)/(float)sfchans(&sfh) /sfsrate(&sfh); printf("Duration of file is %f seconds.\n",dur); close(sf); } }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.