summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-29 15:19:31 (GMT)
committerGitHub <noreply@github.com>2023-06-29 15:19:31 (GMT)
commitfd56a593b7928da636b2494b25cd7478fed78c29 (patch)
treeb815098d8bcf67f4290d3ca74132ce793503b94e /tools/src
parent8aef67f0ae3e037df22c5319eb2eac8b95521b19 (diff)
downloadhdf5-fd56a593b7928da636b2494b25cd7478fed78c29.zip
hdf5-fd56a593b7928da636b2494b25cd7478fed78c29.tar.gz
hdf5-fd56a593b7928da636b2494b25cd7478fed78c29.tar.bz2
Remove HD from C std lib file ops (#3206)
* HDfclose * HDferror * HDfeof * HDfflush * HDfopen * HDfread * HDfwrite
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5diff/ph5diff_main.c4
-rw-r--r--tools/src/h5import/h5import.c34
-rw-r--r--tools/src/h5jam/h5jam.c2
-rw-r--r--tools/src/h5jam/h5unjam.c12
-rw-r--r--tools/src/h5perf/pio_perf.c2
-rw-r--r--tools/src/h5perf/sio_perf.c4
-rw-r--r--tools/src/h5repack/h5repack_main.c12
-rw-r--r--tools/src/h5stat/h5stat.c2
8 files changed, 36 insertions, 36 deletions
diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c
index a74be6b..85197d3 100644
--- a/tools/src/h5diff/ph5diff_main.c
+++ b/tools/src/h5diff/ph5diff_main.c
@@ -210,7 +210,7 @@ ph5diff_worker(int nID)
overflow_file = NULL;
}
- HDfflush(stdout);
+ fflush(stdout);
HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
@@ -263,7 +263,7 @@ print_manager_output(void)
overflow_file = NULL;
}
- HDfflush(stdout);
+ fflush(stdout);
HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
}
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index f5197f7..609e8e0 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -375,7 +375,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
*/
if (in->inputClass == 4 /* "IN" */ || in->inputClass == 3 /* "FP" */ || in->inputClass == 7 /* "UIN" */) {
- if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) {
+ if ((strm = fopen(infile, READ_OPEN_FLAGS)) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -385,7 +385,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
else {
- if ((strm = HDfopen(infile, "r")) == NULL) {
+ if ((strm = fopen(infile, "r")) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -459,7 +459,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
error:
if (strm)
- HDfclose(strm);
+ fclose(strm);
return retval;
}
@@ -502,7 +502,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (HDfread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) {
+ if (fread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -533,7 +533,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in16++) {
- if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) {
+ if (fread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -569,7 +569,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in32++) {
- if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -606,7 +606,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in64++) {
- if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -673,7 +673,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (HDfread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) {
+ if (fread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -700,7 +700,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in16++) {
- if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) {
+ if (fread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -736,7 +736,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in32++) {
- if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -773,7 +773,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in64++) {
- if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -853,7 +853,7 @@ readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
bfp32 = (uint32_t *)in->data;
for (i = 0; i < len; i++, bfp32++) {
- if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -905,7 +905,7 @@ readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
bfp64 = (uint64_t *)in->data;
for (i = 0; i < len; i++, bfp64++) {
- if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -1462,7 +1462,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->inputArchitecture = 0; /* default to NATIVE */
- if ((strm = HDfopen(infile, "r")) == NULL) {
+ if ((strm = fopen(infile, "r")) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -2442,7 +2442,7 @@ processConfigurationFile(char *infile, struct Input *in)
error:
if (strm)
- HDfclose(strm);
+ fclose(strm);
return retval;
}
@@ -4700,14 +4700,14 @@ process(struct Options *opt)
if (in->configOptionVector[EXTERNALSTORE] == 1) {
/* creating the external file if it doesn't exist */
- if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) {
+ if ((extfile = fopen(in->externFilename, "ab")) == NULL) {
(void)fprintf(stderr, "%s", err4);
H5Pclose(proplist);
H5Sclose(dataspace);
H5Fclose(file_id);
return (-1);
}
- HDfclose(extfile);
+ fclose(extfile);
H5Pset_external(proplist, in->externFilename, (off_t)0,
numOfElements * (hsize_t)in->inputSize / 8);
}
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 04b29ea..6f318a4 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -49,7 +49,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", requir
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s -i <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--clobber]\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n");
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index 077f128..d752014 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -50,7 +50,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s -i <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --delete]\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n");
@@ -334,12 +334,12 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)
HDfseek(infid, from, SEEK_SET);
/* Read data to buffer */
- bytes_read = HDfread(buf, (size_t)1, bytes_in, infid);
- if (0 == bytes_read && HDferror(infid)) {
+ bytes_read = fread(buf, (size_t)1, bytes_in, infid);
+ if (0 == bytes_read && ferror(infid)) {
ret_value = -1;
goto done;
} /* end if */
- if (0 == bytes_read && HDfeof(infid)) {
+ if (0 == bytes_read && feof(infid)) {
goto done;
} /* end if */
@@ -352,8 +352,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)
to += (off_t)bytes_read;
/* Write nchars bytes to output file */
- bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid);
- if (bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */
+ bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid);
+ if (bytes_wrote != bytes_read || (0 == bytes_wrote && ferror(ofid))) { /* error */
ret_value = -1;
goto done;
} /* end if */
diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c
index 3e306df..b423f0d 100644
--- a/tools/src/h5perf/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
}
if (opts->output_file) {
- if ((output = HDfopen(opts->output_file, "w")) == NULL) {
+ if ((output = fopen(opts->output_file, "w")) == NULL) {
fprintf(stderr, "%s: cannot open output file\n", progname);
perror(opts->output_file);
goto finish;
diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c
index b456a4f..79d025d 100644
--- a/tools/src/h5perf/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
}
if (opts->output_file) {
- if ((output = HDfopen(opts->output_file, "w")) == NULL) {
+ if ((output = fopen(opts->output_file, "w")) == NULL) {
fprintf(stderr, "%s: cannot open output file\n", progname);
HDperror(opts->output_file);
goto finish;
@@ -1281,5 +1281,5 @@ usage(const char *prog)
printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
printf(" HDF5_PREFIX Data file prefix\n");
printf("\n");
- HDfflush(stdout);
+ fflush(stdout);
} /* end usage() */
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 7134865..c0a245a 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -392,7 +392,7 @@ read_info(const char *filename, pack_opt_t *options)
int i;
int ret_value = EXIT_SUCCESS;
- if (NULL == (fp = HDfopen(filename, "r"))) {
+ if (NULL == (fp = fopen(filename, "r"))) {
error_msg("cannot open options file %s\n", filename);
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -416,26 +416,26 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
- if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
goto done;
}
- if (HDfeof(fp))
+ if (feof(fp))
break;
}
c = '0';
/* go until end */
while (c != ' ') {
- if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
goto done;
}
comp_info[i++] = c;
- if (HDfeof(fp))
+ if (feof(fp))
break;
if (c == 10 /*eol*/)
break;
@@ -462,7 +462,7 @@ read_info(const char *filename, pack_opt_t *options)
done:
if (fp)
- HDfclose(fp);
+ fclose(fp);
return ret_value;
}
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 6744b56..a9e163a 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -207,7 +207,7 @@ leave(int ret)
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, " ERROR\n");