/* * Parse an argument string for verbosity level and set it. */ void ParseTestVerbosity(char *argv) { if (*argv == 'l') SetTestVerbosity(VERBO_LO); else if (*argv == 'm') SetTestVerbosity(VERBO_MED); else if (*argv == 'h') SetTestVerbosity(VERBO_HI); else SetTestVerbosity(atoi(argv)); }
/* * parse the command line options */ static int parse_options(int argc, char **argv) { while (--argc){ if (**(++argv) != '-'){ break; }else{ switch(*(*argv+1)){ case 'v': if (*((*argv+1)+1)) ParseTestVerbosity((*argv+1)+1); else SetTestVerbosity(VERBO_MED); break; case 'f': if (--argc < 1) { nerrors++; return(1); } if (**(++argv) == '-') { nerrors++; return(1); } paraprefix = *argv; break; case 'h': /* print help message--return with nerrors set */ return(1); default: nerrors++; return(1); } } } /*while*/ /* compose the test filenames */ { int i, n; hid_t plist; plist = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(plist, MPI_COMM_WORLD, MPI_INFO_NULL); n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */ for (i=0; i < n; i++) if (h5_fixname(FILENAME[i],plist,filenames[i],sizeof(filenames[i])) == NULL){ printf("h5_fixname failed\n"); nerrors++; return(1); } H5Pclose(plist); if (VERBOSE_MED){ printf("Test filenames are:\n"); for (i=0; i < n; i++) printf(" %s\n", filenames[i]); } } return(0); }