#include #include #include void Pervert8(char *buf) { char temp; unsigned i; for (i=0;i<4;i++) { temp=buf[i]; buf[i]=buf[7-i]; buf[7-i]=temp; } } #define PervertDouble(x) Pervert8((char*)x); // collect_bf sample_interval_in_seconds output_filename void main(int argc, char *argv[]) { double avg; double time; FILE *infile; struct stat st; unsigned numsamples; unsigned i; if (argc!=2 && argc!=3) { printf("Usage: bo_to_text input_filename [-pervert]\n"); exit(0); } if (stat(argv[1],&st)) { fprintf(stderr,"Can't stat %s\n",argv[1]); exit(-1); } if ((st.st_size/16)*16 != st.st_size) { fprintf(stderr,"%s does not contain an integral number of records\n", argv[1]); exit(-2); } numsamples = st.st_size/16; infile=fopen(argv[1],"rb"); for (i=0;i