// // program to view the header of a BYU SIR image file // // Written by DGL 16 Apr 2003 // // This simple program reads the header of a BYU sir-format input file // using c++ // // should be linked with: libsir.cpp sir_ez.c sir_io.c // requires includes: libsir.h sir3.h // #include "libsir.h" // cpp interface routines #include int main(int argc, char **argv) { cout << "BYU SIR viewsirheader c++ program"; if(argc < 2) { cout << "\nusage: %s file\n\n",argv[0]; cout << " input parameters:\n"; cout << " file = input SIR file\n"; return 0; } // open input file for reading FILE *imf; imf=fopen(argv[1],"r"); if (imf == NULL ) { cout << "*** Error opening SIR file" << endl; return -1; } // read header of SIR image file struct sirheader head; /* SIR file header structure */ if (get_sir_head_file(imf, &head) < 0) { cout << "*** Error reading SIR header from file" << endl; return -1; } fclose(imf); print_sir_header(&head); return 0; }