summaryrefslogtreecommitdiffstats
path: root/tools/src/h5import/h5import.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5import/h5import.c')
-rw-r--r--tools/src/h5import/h5import.c437
1 files changed, 221 insertions, 216 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 76e78af..16c0d8c 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
const char *err7 = "Invalid type of data - %s.\n";
const char *err8 = "Invalid size of data - %s.\n";
const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n";
+ const char *err10 = "Length of output file name limited to 255 chars.\n";
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -98,6 +99,9 @@ int main(int argc, char *argv[])
(void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0);
(void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0);
+ /* Initialize the file structure to 0 */
+ HDmemset(&opt, 0, sizeof(struct Options));
+
if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) {
print_version(PROGRAMNAME);
HDexit(EXIT_SUCCESS);
@@ -112,9 +116,6 @@ int main(int argc, char *argv[])
goto err;
}
- /* Initialize the file structure to 0 */
- HDmemset(&opt, 0, sizeof(struct Options));
-
/*
* parse the command line
*/
@@ -155,6 +156,10 @@ int main(int argc, char *argv[])
break;
case 5: /* get outfile found */
+ if (HDstrlen(argv[i]) > MAX_PATH_NAME_LENGTH) {
+ (void) HDfprintf(stderr, err10, argv[i]);
+ goto err;
+ }
(void) HDstrcpy(opt.outfile, argv[i]);
outfile_named = TRUE;
break;
@@ -494,7 +499,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
return (-1);
}
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
#endif
}
break;
@@ -531,7 +536,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
#endif
}
break;
@@ -567,7 +572,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -605,7 +610,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
#endif
}
break;
@@ -701,7 +706,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
+ HDprintf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
#endif
}
break;
@@ -737,7 +742,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -775,7 +780,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
+ HDprintf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
#endif
}
break;
@@ -855,7 +860,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
+ HDprintf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
#endif
}
break;
@@ -907,7 +912,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
+ HDprintf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
#endif
}
break;
@@ -1099,7 +1104,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING\n");
+ HDprintf("processStrHDFData DATATYPE STRING\n");
#endif
if ((type_id = H5Tcopy(H5T_C_S1)) < 0)
@@ -1136,7 +1141,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
}
H5E_END_TRY;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING groups created\n");
+ HDprintf("processStrHDFData DATATYPE STRING groups created\n");
#endif
if ((space_id = H5Screate_simple(in->rank, in->sizeOfDimension, NULL)) < 0)
@@ -1149,7 +1154,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
goto out;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING ready to process strings\n");
+ HDprintf("processStrHDFData DATATYPE STRING ready to process strings\n");
#endif
line = 0;
j = 0;
@@ -1159,36 +1164,36 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
str2 = NULL;
str3 = NULL;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
#endif
/* process string to remove the first and last quote char */
str2 = strchr(str1, '"');
if (str2 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str2++;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str3 = strrchr(str2, '"');
if (str3 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str3), str3);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3);
#endif
*str3 = '\0';
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
- if(strlen(str2) > 0) {
+ if(HDstrlen(str2) > 0) {
hid_t fspace_id;
hsize_t start[1];
hsize_t count[1] = { 1 };
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
#endif
if ((fspace_id = H5Dget_space(dset_id)) < 0)
goto out;
@@ -1210,7 +1215,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
j++;
}
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING eof reached\n");
+ HDprintf("processStrHDFData DATATYPE STRING eof reached\n");
#endif
/* close */
@@ -1223,7 +1228,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
out:
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING error exit\n");
+ HDprintf("processStrHDFData DATATYPE STRING error exit\n");
#endif
/* disable error reporting */
H5E_BEGIN_TRY
@@ -1366,9 +1371,9 @@ static int allocateFloatStorage(struct Input *in)
static int processConfigurationFile(char *infile, struct Input *in)
{
FILE *strm = NULL;
- char key[255];
+ char key[MAX_PATH_NAME_LENGTH];
int kindex;
- char temp[255];
+ char temp[MAX_PATH_NAME_LENGTH];
int ival;
int scanret;
int retval = -1;
@@ -1437,7 +1442,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
in->inputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
in->inputArchitecture = 0; /* default to NATIVE */
@@ -1446,64 +1451,64 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- scanret = fscanf(strm, "%s", key);
+ scanret = fscanf(strm, "%254s", key);
if((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
- printf("\nh5dump file\n");
+ HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
- scanret = fscanf(strm, "%s", temp); /* filename */
- scanret = fscanf(strm, "%s", temp); /* start bracket */
- scanret = fscanf(strm, "%s", key); /* DATASET */
+ scanret = fscanf(strm, "%254s", temp); /* filename */
+ scanret = fscanf(strm, "%254s", temp); /* start bracket */
+ scanret = fscanf(strm, "%254s", key); /* DATASET */
while (scanret == 1) {
if(!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET key\n");
+ HDprintf("h5dump DATASET key\n");
#endif
if (in->configOptionVector[PATH] == 1) {
(void) HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
if (parsePathInfo(&in->path, temp) == -1) {
(void) HDfprintf(stderr, err3b, infile);
goto error;
}
in->configOptionVector[PATH] = 1;
- scanret = fscanf(strm, "%s", temp); /* start bracket */
+ scanret = fscanf(strm, "%254s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
} /* if(!HDstrcmp("DATASET", key)) PATH */
else if(!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE key\n");
+ HDprintf("h5dump DATATYPE key\n");
#endif
if (in->configOptionVector[INPUT_CLASS] == 1) {
(void) HDfprintf(stderr, err4a, infile);
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE %s found\n", temp);
#endif
if ((kindex = getInputClassType(in, temp)) == -1) {
(void) HDfprintf(stderr, err4b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
+ HDprintf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
#endif
in->configOptionVector[INPUT_CLASS] = 1;
@@ -1519,34 +1524,34 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->outputClass = 2;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
+ HDprintf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
#endif
if(in->inputClass == 5) { /* STRING */
int get_next_prop = 1;
in->outputClass = -1;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING found\n");
+ HDprintf("h5dump DATATYPE STRING found\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* string properties */
+ if (fscanf(strm, "%254s", temp) != 1) { /* string properties */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
while (get_next_prop) {
if(!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err19);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
#endif
if (HDstrcmp("H5T_VARIABLE;", temp)) {
char *more = temp;
@@ -1556,44 +1561,44 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
#endif
}
}
else if(!HDstrcmp("STRPAD", temp)) { /* STRPAD */
- if (fscanf(strm, "%s", temp) != 1) { /* STRPAD type */
+ if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
else if(!HDstrcmp("CSET", key)) { /* CSET */
- if (fscanf(strm, "%s", temp) != 1) { /* CSET type */
+ if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CSET %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
else if(!HDstrcmp("CTYPE", temp)) { /* CTYPE */
- if (fscanf(strm, "%s", temp) != 1) { /* CTYPE type */
+ if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -1605,9 +1610,9 @@ static int processConfigurationFile(char *infile, struct Input *in)
hsize_t temp_dims[MAX_NUM_DIMENSION];
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE key\n");
+ HDprintf("h5dump DATASPACE key\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1621,42 +1626,42 @@ static int processConfigurationFile(char *infile, struct Input *in)
else if(!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */
int icount = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE found\n");
+ HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->rank = ++icount;
@@ -1676,17 +1681,17 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
#endif
for (i = 0; i < in->rank; i++) {
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1694,41 +1699,41 @@ static int processConfigurationFile(char *infile, struct Input *in)
(void) HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("/", temp)) { /* / max dims */
if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) { /* start paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE process max dim values\n");
+ HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* max dim with optional comma */
+ if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE get max dim value\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim value\n");
#endif
if(!HDstrcmp("H5S_UNLIMITED", temp) || !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */
in->maxsizeOfDimension[i] = H5S_UNLIMITED;
@@ -1738,40 +1743,40 @@ static int processConfigurationFile(char *infile, struct Input *in)
char *more = temp;
in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10);
}
- if (fscanf(strm, "%s", temp) != 1) { /* max dim or end paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
get_next_dim = 0;
}
else { /* comma */
i++;
- if (i > MAX_NUM_DIMENSION) {
+ if (i >= MAX_NUM_DIMENSION) {
(void) HDfprintf(stderr, "Invalid value for rank.\n");
goto error;
}
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->maxsizeOfDimension[pndx]);
+ HDprintf(" %ld", in->maxsizeOfDimension[pndx]);
}
- printf("\n");
- printf("h5dump DATASPACE SIMPLE get max dim finished\n");
+ HDprintf("\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim finished\n");
#endif
} /* if(!HDstrcmp("(", key)) start paren */
else {
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
- scanret = fscanf(strm, "%s", temp); /* end bracket */
+ scanret = fscanf(strm, "%254s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
} /* if(!HDstrcmp("/", key)) max dims separator */
} /* else if(!HDstrcmp("SIMPLE", key)) */
@@ -1782,54 +1787,54 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */
else if(!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT key\n");
+ HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* CHUNKED */
+ if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if(!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */
if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
(void) HDfprintf(stderr, "Unable to allocate dynamic memory.\n");
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) { /* start paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int icount = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->configOptionVector[RANK] = 1;
@@ -1844,11 +1849,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfChunk[pndx]);
+ HDprintf(" %ld", in->sizeOfChunk[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1856,12 +1861,12 @@ static int processConfigurationFile(char *infile, struct Input *in)
(void) HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) { /* SIZE */
+ if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("SIZE", temp)) { /* SIZE */
if (fscanf(strm, "%d", (&ival)) != 1) {
@@ -1869,16 +1874,16 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
#endif
}
while (HDstrcmp("}", temp)) {
- if (fscanf(strm, "%s", temp) != 1) { /* end bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
}
in->configOptionVector[CHUNK] = 1;
@@ -1886,135 +1891,135 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */
else if(!HDstrcmp("FILTERS", key)) { /* FILTERS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS key\n");
+ HDprintf("h5dump FILTERS key\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if(!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION found\n");
+ HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* DEFLATE */
+ if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* bgin bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* LEVEL */
+ if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%d", (&ival)) != 1) {
(void) HDfprintf(stderr, "%s", err19);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
+ HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
- if (fscanf(strm, "%s", temp) != 1) { /* end bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
in->compressionType = 0; /* ONLY GZIP supported */
in->configOptionVector[COMPRESS] = 1;
}
else if(!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS CONTIGUOUS found\n");
+ HDprintf("h5dump FILTERS CONTIGUOUS found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
else if(!HDstrcmp("NONE", temp)) { /* NONE */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS NONE found\n");
+ HDprintf("h5dump FILTERS NONE found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
- if (fscanf(strm, "%s", temp) != 1) { /* end bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
}
else if(!HDstrcmp("SUBSET", key)) { /* reduce dimensions */
hsize_t temp_dims[MAX_NUM_DIMENSION];
int get_next_prop = 1;
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET key\n");
+ HDprintf("h5dump SUBSET key\n");
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
- if (fscanf(strm, "%s", temp) != 1) { /* SUBSET keyword */
+ if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
while (get_next_prop) {
if(!HDstrcmp("COUNT", temp)) { /* COUNT */
int icount = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* start paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT [%s] found\n", temp);
+ HDprintf("h5dump SUBSET COUNT [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT %s found\n", temp);
+ HDprintf("h5dump SUBSET COUNT %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2023,7 +2028,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
else { /* Dimension */
icount++;
- if (icount > MAX_NUM_DIMENSION) {
+ if (icount >= MAX_NUM_DIMENSION) {
(void) HDfprintf(stderr, "Invalid value for rank.\n");
goto error;
}
@@ -2033,44 +2038,44 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET COUNT dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("COUNT", temp)) COUNT */
if(!HDstrcmp("BLOCK", temp)) { /* BLOCK */
int icount = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* start paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK [%s] found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */
+ if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK %s found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2089,21 +2094,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("BLOCK", temp)) BLOCK */
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -2112,40 +2117,40 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("SUBSET", key)) */
else if(!HDstrcmp("DATA", key)) { /* FINSHED */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATA key\n");
+ HDprintf("h5dump DATA key\n");
#endif
scanret = 0;
break;
}
- scanret = fscanf(strm, "%s", key);
+ scanret = fscanf(strm, "%254s", key);
}
#ifdef H5DEBUGIMPORT
- printf("h5dump path");
+ HDprintf("h5dump path");
for (pndx = 0; pndx < in->path.count; pndx++) {
- printf(" : %s", in->path.group[pndx]);
- }
- printf("\n");
- printf("h5dump inputClass=%d\n", in->inputClass);
- printf("h5dump inputSize=%d\n", in->inputSize);
- printf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
- printf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
- printf("h5dump rank=%d\n", in->rank);
- printf("h5dump outputClass=%d\n", in->outputClass);
- printf("h5dump outputSize=%d\n", in->outputSize);
- printf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
- printf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
- printf("h5dump compressionType=%d\n", in->compressionType);
- printf("h5dump compressionParam=%d\n", in->compressionParam);
- printf("h5dump externFilename=%s\n", in->externFilename);
- printf("h5dump sizeOfDimensions:\n");
+ HDprintf(" : %s", in->path.group[pndx]);
+ }
+ HDprintf("\n");
+ HDprintf("h5dump inputClass=%d\n", in->inputClass);
+ HDprintf("h5dump inputSize=%d\n", in->inputSize);
+ HDprintf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
+ HDprintf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
+ HDprintf("h5dump rank=%d\n", in->rank);
+ HDprintf("h5dump outputClass=%d\n", in->outputClass);
+ HDprintf("h5dump outputSize=%d\n", in->outputSize);
+ HDprintf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
+ HDprintf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
+ HDprintf("h5dump compressionType=%d\n", in->compressionType);
+ HDprintf("h5dump compressionParam=%d\n", in->compressionParam);
+ HDprintf("h5dump externFilename=%s\n", in->externFilename);
+ HDprintf("h5dump sizeOfDimensions:\n");
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld\n", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld\n", in->sizeOfDimension[pndx]);
}
#endif
}
else {
#ifdef H5DEBUGIMPORT
- printf("original option keyword parsing\n");
+ HDprintf("original option keyword parsing\n");
#endif
while (scanret == 1) {
if ((kindex = mapKeywordToIndex(key)) == -1) {
@@ -2158,7 +2163,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
(void) HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2175,7 +2180,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2203,7 +2208,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
(void) HDfprintf(stderr, err5a, infile);
goto error;
}
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (fscanf(strm, "%254d", (&ival)) != 1) {
(void) HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -2400,7 +2405,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
default:
break;
}
- scanret = fscanf(strm, "%s", key);
+ scanret = fscanf(strm, "%254s", key);
}
/*
@@ -2571,7 +2576,7 @@ static int getOutputClass(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output class.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2655,7 +2660,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2676,7 +2681,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2697,7 +2702,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2718,7 +2723,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2739,7 +2744,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2760,7 +2765,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2781,7 +2786,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2802,7 +2807,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2823,7 +2828,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2844,7 +2849,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2865,7 +2870,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2886,7 +2891,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2907,7 +2912,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2928,7 +2933,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2949,7 +2954,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2970,7 +2975,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -3111,7 +3116,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3132,7 +3137,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3153,7 +3158,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3174,7 +3179,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3250,7 +3255,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3269,7 +3274,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3288,7 +3293,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3307,7 +3312,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3326,7 +3331,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3345,7 +3350,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3364,7 +3369,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3383,7 +3388,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3422,9 +3427,9 @@ static int getInputClassType(struct Input *in, char * buffer)
if (in->configOptionVector[OUTPUT_SIZE] == 0)
in->outputSize = in->inputSize;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
- printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
- printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
+ HDprintf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
#endif
in->inputClass = kindex;
@@ -3464,7 +3469,7 @@ static int getInputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for input byte-order.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3595,7 +3600,7 @@ static int getOutputArchitecture(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output architecture.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3627,7 +3632,7 @@ static int getOutputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output byte-order.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3658,7 +3663,7 @@ static int getCompressionType(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for compression.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3722,7 +3727,7 @@ static int getExternalFilename(struct Input *in, FILE *strm)
char temp[255];
const char *err1 = "Unable to get 'string' value.\n";
- if (fscanf(strm, "%s", temp) != 1) {
+ if (fscanf(strm, "%254s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -4631,7 +4636,7 @@ static int process(struct Options *opt)
intype = createInputDataType(in);
outtype = createOutputDataType(in);
#ifdef H5DEBUGIMPORT
- printf("process intype %ld outtype %ld\n", intype, outtype);
+ HDprintf("process intype %ld outtype %ld\n", intype, outtype);
#endif
/* create property list */