/* makeblb makeblb nevada takes nevada.lab (text file) and makes nevada.blb (binary) */ #include #include main(argc,argv) int argc; char *argv[]; { int i,j,k; char string[100],cval; FILE *fpin,*fpout; int num; unsigned int id; int color1,color2; double lat,lon; char cr=0xd; strcpy(string,argv[1]); strcat(string,".blb"); fpout=fopen(string,"wb"); if(!fpout) { printf("Could not open '%s'\n",string); exit(0); } for(i=1;i0) { printf("%c%6d",cr,num); if(fwrite((char *)&id,sizeof(int),1,fpout)<1) { printf("Write error\n\n"); exit(0); } if(fwrite((char *)&color2,sizeof(int),1,fpout)<1) { printf("Write error\n\n"); exit(0); } if(fwrite((char *)&lat,sizeof(double),1,fpout)<1) { printf("Write error\n\n"); exit(0); } if(fwrite((char *)&lon,sizeof(double),1,fpout)<1) { printf("Write error\n\n"); exit(0); } } fclose(fpin); printf("\n"); } fclose(fpout); }