summaryrefslogtreecommitdiffstats
path: root/tools/test/h5import/h5importtest.c
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/test/h5import/h5importtest.c
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/test/h5import/h5importtest.c')
-rw-r--r--tools/test/h5import/h5importtest.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index 96da5c8..003c343 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -159,7 +159,7 @@ main(void)
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin8.txt", "w");
+ sp = fopen("txtin8.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -167,14 +167,14 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin16.txt", "w");
+ sp = fopen("txtin16.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -182,14 +182,14 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin32.txt", "w");
+ sp = fopen("txtin32.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -197,7 +197,7 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
#endif
/*-------------------------------------------------------------------------
@@ -205,17 +205,17 @@ main(void)
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin32.bin", OPEN_FLAGS);
+ sp = fopen("binin32.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp);
+ (void)fwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin32.conf", "w");
+ sp = fopen("binin32.conf", "w");
(void)fprintf(sp, "PATH /int/bin/32-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 32\n");
@@ -226,24 +226,24 @@ main(void)
(void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binuin32.bin", OPEN_FLAGS);
+ sp = fopen("binuin32.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp);
+ (void)fwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binuin32.conf", "w");
+ sp = fopen("binuin32.conf", "w");
(void)fprintf(sp, "PATH /int/buin/32-bit\n");
(void)fprintf(sp, "INPUT-CLASS UIN\n");
(void)fprintf(sp, "INPUT-SIZE 32\n");
@@ -253,24 +253,24 @@ main(void)
(void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
(void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin16.bin -c binin16.conf -o binin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin16.bin", OPEN_FLAGS);
+ sp = fopen("binin16.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp);
+ (void)fwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin16.conf", "w");
+ sp = fopen("binin16.conf", "w");
(void)fprintf(sp, "PATH /int/bin/16-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 16\n");
@@ -282,23 +282,23 @@ main(void)
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binuin16.bin", OPEN_FLAGS);
+ sp = fopen("binuin16.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp);
+ (void)fwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binuin16.conf", "w");
+ sp = fopen("binuin16.conf", "w");
(void)fprintf(sp, "PATH /int/buin/16-bit\n");
(void)fprintf(sp, "INPUT-CLASS UIN\n");
(void)fprintf(sp, "INPUT-SIZE 16\n");
@@ -310,24 +310,24 @@ main(void)
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin8.bin -c binin8.conf -o binin8.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin8.bin", OPEN_FLAGS);
+ sp = fopen("binin8.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp);
+ (void)fwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin8.conf", "w");
+ sp = fopen("binin8.conf", "w");
(void)fprintf(sp, "PATH /int/bin/8-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 8\n");
@@ -342,7 +342,7 @@ main(void)
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
(void)fprintf(sp, "COMPRESSION-PARAM 3\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
#endif /* UNICOS */
@@ -355,17 +355,17 @@ main(void)
* binary 64-bit file - rank 2 & 3
*/
- sp = HDfopen("binfp64.bin", OPEN_FLAGS);
+ sp = fopen("binfp64.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp);
+ (void)fwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binfp64.conf", "w");
+ sp = fopen("binfp64.conf", "w");
(void)fprintf(sp, "PATH /fp/bin/64-bit\n");
(void)fprintf(sp, "INPUT-CLASS FP\n");
(void)fprintf(sp, "INPUT-SIZE 64\n");
@@ -378,7 +378,7 @@ main(void)
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
(void)fprintf(sp, "COMPRESSION-PARAM 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5
@@ -389,15 +389,15 @@ main(void)
/* test CR+LF (13,10) and EOF (26) in windows */
char bin8w[4] = {13, 10, 26, 0};
- sp = HDfopen("binin8w.bin", OPEN_FLAGS);
+ sp = fopen("binin8w.bin", OPEN_FLAGS);
for (i = 0; i < 4; i++) {
char c = bin8w[i];
- if (HDfwrite(&c, sizeof(char), 1, sp) != 1)
+ if (fwrite(&c, sizeof(char), 1, sp) != 1)
printf("error writing file\n");
}
- HDfclose(sp);
+ fclose(sp);
- sp = HDfopen("binin8w.conf", "w");
+ sp = fopen("binin8w.conf", "w");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 8\n");
(void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
@@ -408,7 +408,7 @@ main(void)
(void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
(void)fprintf(sp, "DIMENSION-SIZES 4\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
}
return (EXIT_SUCCESS);
}