diff options
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 1576 |
1 files changed, 787 insertions, 789 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 101e230..0a6b607 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -288,11 +288,11 @@ gent_dataset(void) /* dset1 */ dims[0] = 10; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 20; j++) - dset1[i][j] = j+i; + for(i = 0; i < 10; i++) + for(j = 0; j < 20; j++) + dset1[i][j] = j + i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -301,11 +301,11 @@ gent_dataset(void) /* dset2 */ dims[0] = 30; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 30; i++) - for (j = 0; j < 20; j++) - dset2[i][j] = 0.0001*j+i; + for(i = 0; i < 30; i++) + for(j = 0; j < 20; j++) + dset2[i][j] = 0.0001 * j + i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -333,10 +333,10 @@ gent_dataset2(void) dims[0] = 10; dims[1] = 20; maxdims[0] = H5S_UNLIMITED; maxdims[1] = 20; space = H5Screate_simple(2, dims, maxdims); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, create_plist); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 20; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 20; j++) dset1[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); @@ -347,10 +347,10 @@ gent_dataset2(void) dims[0] = 30; dims[1] = 10; maxdims[0] = 30; maxdims[1] = H5S_UNLIMITED; space = H5Screate_simple(2, dims, maxdims); - dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, create_plist); + dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); - for (i = 0; i < 30; i++) - for (j = 0; j < 10; j++) + for(i = 0; i < 30; i++) + for(j = 0; j < 10; j++) dset2[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -390,7 +390,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) data[i] = i+1; + for(i = 0; i < 10; i++) data[i] = i+1; H5Awrite(attr, H5T_NATIVE_INT, data); H5Sclose(space); @@ -401,7 +401,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, ".", "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) d[i] = 0.1 * i; + for(i = 0; i < 10; i++) d[i] = 0.1 * i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space); @@ -463,9 +463,9 @@ static void gent_hardlink(void) fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(1, &dim, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 5; i++) dset[i] = i; + for(i = 0; i < 5; i++) dset[i] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); H5Sclose(space); @@ -567,7 +567,7 @@ static void gent_compound_dt(void) { /* test compound data type */ hsize_t dset3_dim[2]; - for (i = 0; i < (int)sdim; i++) { + for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); @@ -595,7 +595,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tinsert(type2, "a_name", HOFFSET(dset1_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "b_name", HOFFSET(dset1_t, b), H5T_NATIVE_FLOAT); H5Tinsert(type2, "c_name", HOFFSET(dset1_t, c), H5T_NATIVE_DOUBLE); - dataset = H5Dcreate(fid, "/dset1", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Tclose(type2); H5Tclose(type); @@ -611,7 +611,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); H5Tclose(type2); H5Tclose(type); @@ -647,16 +647,15 @@ static void gent_compound_dt(void) { /* test compound data type */ dset3_dim[0] = 3; dset3_dim[1] = 6; space3 = H5Screate_simple(2, dset3_dim, NULL); - dataset = H5Dcreate(group, "dset3", type, space3, H5P_DEFAULT); - for (i = 0; i < (int)dset3_dim[0]; i++) { - for (j = 0; j < (int)dset3_dim[1]; j++) { - for (k = 0; k < 4; k++) - dset3[i][j].a[k] = k+j+i; - for (k = 0; k < 5; k++) - for (l = 0; l < 6; l++) - dset3[i][j].b[k][l] = (float)((k+1)+l+j+i); + dataset = H5Dcreate2(group, "dset3", type, space3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < (int)dset3_dim[0]; i++) + for(j = 0; j < (int)dset3_dim[1]; j++) { + for(k = 0; k < 4; k++) + dset3[i][j].a[k] = k + j + i; + for(k = 0; k < 5; k++) + for(l = 0; l < 6; l++) + dset3[i][j].b[k][l] = (float)((k + 1) + l + j + i); } - } H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); H5Sclose(space3); H5Tclose(type); @@ -671,7 +670,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset4_t, b), H5T_NATIVE_FLOAT); - dataset = H5Dcreate(group, "dset4", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset4); H5Tclose(type); @@ -690,7 +689,7 @@ static void gent_compound_dt(void) { /* test compound data type */ type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT); - dataset = H5Dcreate(group, "dset5", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset5); H5Ldelete(group, "type4", H5P_DEFAULT); @@ -753,7 +752,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ hsize_t sdim, maxdim; sdim = 10; - for (i = 0; i < (int)sdim; i++) { + for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); @@ -786,7 +785,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32BE); H5Tinsert(type, "c_name", HOFFSET(dset1_t, c), H5T_IEEE_F64BE); - dataset = H5Dcreate(fid, "/dset1", type, space, create_plist); + dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); @@ -814,7 +813,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", type, space, create_plist); + dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT); @@ -848,7 +847,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE); H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset4", type, space, create_plist); + dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t)); H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT); @@ -868,7 +867,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE); H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset5", type, space, create_plist); + dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT); @@ -952,10 +951,10 @@ static void gent_all(void) /* dset1.1.1 */ dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) - dset1[i][j] = j*i; + dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) + dset1[i][j] = j * i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -981,8 +980,8 @@ static void gent_all(void) /* dset1.1.2 */ dims[0] = 20; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 20; i++) + dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 20; i++) dset2[i] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); H5Sclose(space); @@ -1003,9 +1002,9 @@ static void gent_all(void) /* dset2.1 */ dims[0] = 10; space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - dset2_1[i] = (float)(i*0.1+1); + dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + dset2_1[i] = (float)(i * 0.1 + 1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); @@ -1013,10 +1012,10 @@ static void gent_all(void) /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 3; i++) - for (j = 0; j < 5; j++) - dset2_2[i][j] = (float)((i+1)*j*0.1); + dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 3; i++) + for(j = 0; j < 5; j++) + dset2_2[i][j] = (float)((i + 1) * j * 0.1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); H5Sclose(space); H5Dclose(dataset); @@ -1160,7 +1159,7 @@ static void gent_many(void) sdim = 6; maxdim = H5S_UNLIMITED; space = H5Screate_simple(1, &sdim, &maxdim); - dataset = H5Dcreate(group, "dset1", type, space, create_plist); + dataset = H5Dcreate2(group, "dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); /* add attributes to dset1 */ dims[0] = 10; @@ -1182,17 +1181,17 @@ static void gent_many(void) dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, ".", "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) + for(i = 0; i < 10; i++) d[i] = 0.1 * i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space2); H5Aclose(attr); - for (j=0; j<(int)sdim; j++) { - for (i3 = 0; i3 < 2; i3++) { - for (i2 = 0; i2 < 2; i2++) { - for (i1 = 0; i1 < 2; i1++) { - for (i0 = 0; i0 < 2; i0++) { + for(j=0; j<(int)sdim; j++) { + for(i3 = 0; i3 < 2; i3++) { + for(i2 = 0; i2 < 2; i2++) { + for(i1 = 0; i1 < 2; i1++) { + for(i0 = 0; i0 < 2; i0++) { dset1[j].a[i3][i2][i1][i0] = i0+j; dset1[j].b[i3][i2][i1][i0] = (double)(i0+j); #ifdef _WIN32 @@ -1232,9 +1231,9 @@ static void gent_many(void) dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) + dataset = H5Dcreate2(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) dset2[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -1255,9 +1254,9 @@ static void gent_many(void) dims[0] = 10; dims[1] = 10; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) + dataset = H5Dcreate2(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(i = 0; i < 10; i++) + for(j = 0; j < 10; j++) dset3[i][j] = i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); @@ -1294,9 +1293,9 @@ static void gent_many(void) static hid_t mkstr(int size, H5T_str_t pad) { hid_t type; - if ((type=H5Tcopy(H5T_C_S1))<0) return -1; - if (H5Tset_size(type, (size_t)size)<0) return -1; - if (H5Tset_strpad(type, pad)<0) return -1; + if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; + if(H5Tset_size(type, (size_t)size) < 0) return -1; + if(H5Tset_strpad(type, pad) < 0) return -1; return type; } @@ -1345,7 +1344,7 @@ static void gent_str(void) { space = H5Screate_simple(2, dims1, NULL); f_type = mkstr(5, H5T_STR_NULLTERM); m_type = mkstr(3, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string1", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1); H5Tclose(m_type); H5Tclose(f_type); @@ -1356,7 +1355,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims2, NULL); f_type = mkstr(11, H5T_STR_SPACEPAD); m_type = mkstr(10, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string2", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2); H5Tclose(m_type); H5Tclose(f_type); @@ -1367,7 +1366,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims3, NULL); f_type = mkstr(8, H5T_STR_NULLPAD); m_type = mkstr(6, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string3", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3); H5Tclose(m_type); H5Tclose(f_type); @@ -1378,7 +1377,7 @@ static void gent_str(void) { space = H5Screate_simple(1, dims4, NULL); f_type = mkstr(168, H5T_STR_SPACEPAD); m_type = mkstr(21, H5T_STR_NULLTERM); - dataset = H5Dcreate(fid, "/string4", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4); H5Tclose(m_type); H5Tclose(f_type); @@ -1414,16 +1413,16 @@ static void gent_str(void) { H5Tclose(array_dt); H5Tclose(str_type); - for (i = 0; i < 3; i++) - for (j = 0; j < 6; j++) { - for (k = 0 ; k < 8; k++) - for (l = 0; l < 10; l++) - comp1[i][j].a[k][l] = (l+j+k) * (l+j+k); - for (k = 0 ; k < 12; k++) + for(i = 0; i < 3; i++) + for(j = 0; j < 6; j++) { + for(k = 0 ; k < 8; k++) + for(l = 0; l < 10; l++) + comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); + for(k = 0 ; k < 12; k++) strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); } - dataset = H5Dcreate(fid, "/comp1", f_type, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); H5Tclose(f_type); @@ -1478,7 +1477,7 @@ hsize_t sdim; /* dset1 */ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset1", fxdlenstr, space, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset1", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* add attributes to dset1 */ @@ -1502,25 +1501,25 @@ hsize_t sdim; count[0]=1; block[0]=1; - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset2", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); @@ -1533,28 +1532,28 @@ hsize_t sdim; H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD); group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset3", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0;(hsize_t) i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0;(hsize_t) i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset4", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); @@ -1566,28 +1565,28 @@ hsize_t sdim; H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD); group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset5", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); H5Gclose(group); group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate(group, "dset6", fxdlenstr, space, H5P_DEFAULT); - - for (i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of string array",i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } H5Dclose(dataset); @@ -1623,8 +1622,8 @@ static void gent_enum(void) H5Tcommit2(file, "enum normal", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(1,size,NULL); - dset = H5Dcreate(file,"table",type, space, H5P_DEFAULT); - H5Dwrite(dset,type,space,space,H5P_DEFAULT,data); + dset = H5Dcreate2(file,"table",type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dset, type, space, space, H5P_DEFAULT, data); H5Dclose(dset); H5Sclose(space); @@ -1666,7 +1665,7 @@ static void gent_objref(void) H5Oset_comment(group, ".", write_comment, H5P_DEFAULT); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu32 = (uint32_t *)((void*)wbuf), i = 0; i < SPACE1_DIM1; i++) *tu32++ = i * 3; @@ -1678,7 +1677,7 @@ static void gent_objref(void) H5Dclose(dataset); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Close Dataset */ H5Dclose(dataset); @@ -1703,7 +1702,7 @@ static void gent_objref(void) H5Gclose(group); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create reference to dataset */ H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -1771,13 +1770,13 @@ static void gent_datareg(void) sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); /* Create a dataset */ - dset2=H5Dcreate(fid1,"Dataset2",H5T_STD_U8BE,sid2,H5P_DEFAULT); + dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for(tu8=dwbuf,i=0; i<SPACE2_DIM1*SPACE2_DIM2; i++) + for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) *tu8++=i*3; /* Write selection to disk */ - H5Dwrite(dset2,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf); + H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); /* Close Dataset */ H5Dclose(dset2); @@ -1786,21 +1785,21 @@ static void gent_datareg(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); /* Create a dataset */ - dset1=H5Dcreate(fid1,"Dataset1",H5T_STD_REF_DSETREG,sid1,H5P_DEFAULT); + dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create references */ /* Select 6x6 hyperslab for first reference */ - start[0]=2; start[1]=2; - stride[0]=1; stride[1]=1; - count[0]=6; count[1]=6; - block[0]=1; block[1]=1; - H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block); + start[0] = 2; start[1] = 2; + stride[0] = 1; stride[1] = 1; + count[0] = 6; count[1] = 6; + block[0] = 1; block[1] = 1; + H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); H5Sget_select_npoints(sid2); /* Store first dataset region */ - H5Rcreate(&wbuf[0],fid1,"/Dataset2",H5R_DATASET_REGION,sid2); + H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid2); /* Select sequence of ten points for second reference */ coord1[0][0]=6; coord1[0][1]=9; @@ -1878,7 +1877,7 @@ static void gent_nestcomp(void) /* * Initialize the data */ - for (i = 0; i< 10; i++) { + for(i = 0; i< 10; i++) { s1[i].a = i; s1[i].b = (float)(i*i); s1[i].c = 1./(i+1); @@ -1925,14 +1924,14 @@ static void gent_nestcomp(void) /* * Create the dataset. */ - dataset = H5Dcreate(file, datasetname, s2_tid, space, H5P_DEFAULT); + dataset = H5Dcreate2(file, datasetname, s2_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Wtite data to the dataset; */ status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); - if (status < 0) - fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); + if(status < 0) + fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); /* * Release resources @@ -1952,7 +1951,7 @@ static void gent_opaque(void) int x; hsize_t dim = 2; - for (x = 0; x < 100; x++){ + for(x = 0; x < 100; x++){ test[x][0] = x; test[x][1] = 99 - x; } @@ -1970,13 +1969,13 @@ static void gent_opaque(void) /* * Create the memory datatype. */ - type = H5Tcreate (H5T_OPAQUE, sizeof(char)*100*2); + type = H5Tcreate(H5T_OPAQUE, sizeof(char) * 100 * 2); H5Tset_tag(type, "test opaque type"); /* * Create the dataset. */ - dataset = H5Dcreate(file, "opaque test", type, space, H5P_DEFAULT); + dataset = H5Dcreate2(file, "opaque test", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write data to the dataset; @@ -2002,31 +2001,33 @@ static void gent_bitfields(void) /* bitfield_1 */ nelmts = sizeof(buf); - if ((type=H5Tcopy(H5T_STD_B8LE))<0 || - (space=H5Screate_simple(1, &nelmts, NULL))<0 || - (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0) - goto error; - - for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i; - if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) - goto error; - if (H5Sclose(space)<0) goto error; - if (H5Tclose(type)<0) goto error; - if (H5Dclose(dset)<0) goto error; + if((type = H5Tcopy(H5T_STD_B8LE)) < 0 || + (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(i = 0; i < sizeof buf; i++) + buf[i] = (unsigned char)0xff ^ (unsigned char)i; + if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Tclose(type) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; /* bitfield_2 */ nelmts = sizeof(buf)/2; - if ((type=H5Tcopy(H5T_STD_B16LE))<0 || - (space=H5Screate_simple(1, &nelmts, NULL))<0 || - (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT))<0) - goto error; - for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i; - if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) - goto error; - if (H5Sclose(space)<0) goto error; - if (H5Tclose(type)<0) goto error; - if (H5Dclose(dset)<0) goto error; - if (H5Gclose(grp)<0) goto error; + if((type = H5Tcopy(H5T_STD_B16LE)) < 0 || + (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + for(i = 0; i < sizeof buf; i++) + buf[i] = (unsigned char)0xff ^ (unsigned char)i; + if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Tclose(type) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Gclose(grp) < 0) goto error; H5Fclose(file); error: @@ -2050,82 +2051,82 @@ static void gent_vldatatypes(void) /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { - int j; + int j; wdata[i].p = malloc((i + 1) * sizeof(int)); wdata[i].len = i + 1; - for (j = 0; j < i + 1; j++) + for(j = 0; j < i + 1; j++) ((int *)wdata[i].p)[j] = i * 10 + j; } /* write out the integers in little-endian format */ space = H5Screate_simple(SPACE1_RANK, dims, NULL); type = H5Tvlen_create(H5T_NATIVE_INT); - dset = H5Dcreate(file, "Dataset1.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { - int j; + int j; wdata[i].p = malloc((i + 1) * sizeof(float)); wdata[i].len = i + 1; - for (j = 0; j < i + 1; j++) + for(j = 0; j < i + 1; j++) ((float *)wdata[i].p)[j] = (float)(i * 10 + ((float)j) / 10.0); } /* write out the floats in little-endian format */ space = H5Screate_simple(SPACE1_RANK, dims, NULL); type = H5Tvlen_create(H5T_NATIVE_FLOAT); - dset = H5Dcreate(file, "Dataset2.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ adata.p = malloc(37 * sizeof(int)); adata.len = 37; - for (i = 0; i < 37; i++) + for(i = 0; i < 37; i++) ((int *)adata.p)[i] = i * 2; /* write out scalar VL dataset in little-endian format */ space = H5Screate_simple(0, NULL, NULL); type = H5Tvlen_create(H5T_NATIVE_INT); - dset = H5Dcreate(file, "Dataset3.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata); - assert(ret>=0); + assert(ret >= 0); ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(file); - assert(ret>=0); + assert(ret >= 0); } static void gent_vldatatypes2(void) @@ -2167,33 +2168,33 @@ static void gent_vldatatypes2(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); /* Create a VL datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); /* Create the base VL type */ - tid2 = H5Tvlen_create (tid1); + tid2 = H5Tvlen_create(tid1); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } @@ -2230,41 +2231,41 @@ static void gent_vldatatypes3(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); /* Create a VL datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); /* Create the base compound type */ tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1)); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - assert(ret>=0); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret>=0); - ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_vldatatypes4(void) @@ -2302,36 +2303,36 @@ static void gent_vldatatypes4(void) tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1)); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - assert(ret>=0); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + assert(ret >= 0); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (tid2); + tid1 = H5Tvlen_create(tid2); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } /* Generate a variable-length dataset with NULL values in it */ @@ -2361,38 +2362,38 @@ static void gent_vldatatypes5(void) } /* end for */ /* Create file */ - fid1 = H5Fcreate (FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid1>0); /* Create dataspace for datasets */ - sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL); + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); assert(sid1>0); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); assert(tid1>0); /* Create a dataset */ - dataset = H5Dcreate (fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(dataset>0); - ret = H5Dwrite (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); - ret = H5Dclose (dataset); - assert(ret>=0); + ret = H5Dclose(dataset); + assert(ret >= 0); - ret = H5Dvlen_reclaim (tid1, sid1, H5P_DEFAULT, wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); - ret = H5Tclose (tid1); - assert(ret>=0); + ret = H5Tclose(tid1); + assert(ret >= 0); ret = H5Sclose (sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose (fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array1(void) @@ -2422,21 +2423,21 @@ static void gent_array1(void) tid1 = H5Tarray_create(H5T_NATIVE_INT, ARRAY1_RANK, tdims1, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array2(void) @@ -2468,21 +2469,21 @@ static void gent_array2(void) tid = H5Tarray_create(H5T_NATIVE_INT, ARRAY2_RANK, tdims2, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid,"Dataset1",tid,sid,H5P_DEFAULT); + dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid); - assert(ret>=0); + assert(ret >= 0); } static void gent_array3(void) @@ -2519,23 +2520,23 @@ static void gent_array3(void) tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Create a dataset */ - dataset=H5Dcreate(fid,"Dataset1",tid1,sid,H5P_DEFAULT); + dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid2); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid); - assert(ret>=0); + assert(ret >= 0); } static void gent_array4(void) @@ -2572,36 +2573,36 @@ static void gent_array4(void) tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); /* Insert integer field */ - ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT); - assert(ret>=0); + ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); + assert(ret >= 0); /* Insert float field */ - ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), H5T_NATIVE_FLOAT); - assert(ret>=0); + ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close compound datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array5(void) @@ -2641,42 +2642,42 @@ static void gent_array5(void) /* Insert integer field */ ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT); - assert(ret>=0); + assert(ret >= 0); /* Create an array of floats datatype */ tid3 = H5Tarray_create(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1, NULL); /* Insert float array field */ ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), tid3); - assert(ret>=0); + assert(ret >= 0); /* Close array of floats field datatype */ - ret=H5Tclose(tid3); - assert(ret>=0); + ret = H5Tclose(tid3); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close compound datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array6(void) @@ -2714,29 +2715,29 @@ static void gent_array6(void) tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close VL datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_array7(void) @@ -2776,36 +2777,36 @@ static void gent_array7(void) tid2 = H5Tvlen_create(tid3); /* Close nested array datatype */ - ret=H5Tclose(tid3); - assert(ret>=0); + ret = H5Tclose(tid3); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); /* Close VL datatype */ - ret=H5Tclose(tid2); - assert(ret>=0); + ret = H5Tclose(tid2); + assert(ret >= 0); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Reclaim the write VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); - assert(ret>=0); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(sid1); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(fid1); - assert(ret>=0); + assert(ret >= 0); } static void gent_empty(void) @@ -2825,51 +2826,51 @@ static void gent_empty(void) /* write out an empty vlen dataset */ type = H5Tvlen_create(H5T_NATIVE_INT); - dset = H5Dcreate(file, "Dataset1.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); /* write out an empty native integer dataset dataset */ - dset = H5Dcreate(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); /* write out an empty native floating-point dataset dataset */ - dset = H5Dcreate(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); /* write out an empty array dataset */ type = H5Tarray_create(H5T_NATIVE_INT, SPACE1_RANK, dims, NULL); - dset = H5Dcreate(file, "Dataset4.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); /* write out an empty compound dataset */ type = H5Tcreate(H5T_COMPOUND,sizeof(empty_struct)); H5Tinsert(type, "a", HOFFSET(empty_struct, a),H5T_NATIVE_INT); H5Tinsert(type, "b", HOFFSET(empty_struct, b),H5T_NATIVE_FLOAT); H5Tinsert(type, "c", HOFFSET(empty_struct, c),H5T_NATIVE_CHAR); - dset = H5Dcreate(file, "Dataset5.0", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(type); - assert(ret>=0); + assert(ret >= 0); ret = H5Sclose(space); - assert(ret>=0); + assert(ret >= 0); ret = H5Fclose(file); - assert(ret>=0); + assert(ret >= 0); } static void @@ -2960,10 +2961,10 @@ void gent_split_file(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -2992,10 +2993,10 @@ void gent_family(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -3030,7 +3031,7 @@ void gent_multi(void) assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); - for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; memb_map[mt] = mt; sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); @@ -3049,10 +3050,10 @@ void gent_multi(void) dims[0] = 10; dims[1] = 15; space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 15; j++) + for(i = 0; i < 10; i++) + for(j = 0; j < 15; j++) dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -3105,11 +3106,11 @@ static void gent_vlstr(void) /* Create a VL string datatype to refer to */ tid1 = H5Tcopy (H5T_C_S1); - H5Tset_size (tid1,H5T_VARIABLE); + H5Tset_size (tid1, H5T_VARIABLE); /* Create a dataset and write VL string to it. */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); H5Dclose(dataset); /* Create a named VL string type. Change padding of datatype */ @@ -3153,7 +3154,7 @@ static void gent_char(void) sid1 = H5Screate_simple(1, dims1, NULL); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write some characters to it. */ H5Dwrite(dataset, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -3287,7 +3288,7 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); @@ -3392,10 +3393,10 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); } } @@ -3477,9 +3478,9 @@ static void write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf23[i][j][k]=n++; } } @@ -3503,9 +3504,9 @@ static void write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf33[i][j][k].a=n++; buf33[i][j][k].b=n++; } @@ -3522,11 +3523,11 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); } } @@ -3579,8 +3580,8 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for(i = 0; i < 24; i++) { + for(j = 0; j < (int)dimarray[0]; j++) { buf63[i][j]=n++; } } @@ -3594,9 +3595,9 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf73[i][j][k]=n++; buf83[i][j][k]=f++; } @@ -3731,7 +3732,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); @@ -3763,13 +3764,13 @@ static void write_dset_in(hid_t loc_id, ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; - sid = H5Screate_simple(1,dims,NULL); + sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -3836,10 +3837,10 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); } } @@ -3863,23 +3864,23 @@ static void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) { int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; - for (l = 0; l < i + 1; l++) - ((int *)buf52[i][j].p)[l] = n++; + for(l = 0; l < i + 1; l++) + ((int *)buf52[i][j].p)[l] = n++; } - } - sid = H5Screate_simple(2,dims2,NULL); + sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -3889,7 +3890,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_dset(loc_id,2,dims2,"array2D",tid,buf62); + write_dset(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -3898,9 +3899,9 @@ static void write_dset_in(hid_t loc_id, */ plist_id = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); - sid = H5Screate_simple(2,dims2,NULL); - did = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,sid,plist_id); - status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72); + sid = H5Screate_simple(2, dims2, NULL); + did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT); + status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); status = H5Pclose(plist_id); status = H5Dclose(did); status = H5Sclose(sid); @@ -3910,7 +3911,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); + write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- @@ -3933,9 +3934,9 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf23[i][j][k]=n++; } } @@ -3959,9 +3960,9 @@ static void write_dset_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf33[i][j][k].a=n++; buf33[i][j][k].b=n++; } @@ -3978,11 +3979,11 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) + if(dset_name) { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); } } @@ -4005,26 +4006,25 @@ static void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + n = 0; + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) { int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; - for (l = 0; l < i + 1; l++) - ((int *)buf53[i][j][k].p)[l] = n++; + for(l = 0; l < i + 1; l++) + ((int *)buf53[i][j][k].p)[l] = n++; } - } - } - sid = H5Screate_simple(3,dims3,NULL); + sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT); - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53); - assert(status>=0); - status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53); - assert(status>=0); + did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4034,8 +4034,8 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for(i = 0; i < 24; i++) { + for(j = 0; j < (int)dimarray[0]; j++) { buf63[i][j]=n++; } } @@ -4049,9 +4049,9 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { buf73[i][j][k]=n++; buf83[i][j][k]=f++; } @@ -4086,17 +4086,17 @@ static void gent_attr_all(void) hid_t group2_id; hid_t root_id; hid_t sid; - hsize_t dims[1]={2}; + hsize_t dims[1] = {2}; herr_t status; /* Create a file and a dataset */ - fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create a 1D dataset */ sid = H5Screate_simple(1,dims,NULL); - did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); - status = H5Sclose(sid); - assert(status>=0); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Sclose(sid); + assert(status >= 0); /* Create groups */ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4121,17 +4121,17 @@ static void gent_attr_all(void) /* Close */ status = H5Dclose(did); - assert(status>=0); + assert(status >= 0); status = H5Gclose(group_id); - assert(status>=0); + assert(status >= 0); status = H5Gclose(group2_id); - assert(status>=0); + assert(status >= 0); status = H5Gclose(root_id); - assert(status>=0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - assert(status>=0); + assert(status >= 0); } @@ -4190,26 +4190,25 @@ static int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t tid, void *buf ) { - hid_t did; - hid_t sid; - herr_t status; - - /* Create a buf space */ - sid = H5Screate_simple(rank,dims,NULL); + hid_t did; + hid_t sid; + herr_t status; - /* Create a dataset */ - did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT); + /* Create a buf space */ + sid = H5Screate_simple(rank, dims, NULL); - /* Write the buf */ - if ( buf ) - status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + /* Create a dataset */ + did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - /* Close */ - status = H5Dclose(did); - status = H5Sclose(sid); + /* Write the buf */ + if(buf) + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - return status; + /* Close */ + status = H5Dclose(did); + status = H5Sclose(sid); + return status; } @@ -4256,26 +4255,26 @@ static void gent_compound_complex(void) int m, n, o; /* Array init loop vars */ /* Initialize the data in the arrays/datastructure */ - for (m = 0; m< F41_LENGTH; m++) { + for(m = 0; m< F41_LENGTH; m++) { Array1[m].a = m; - for (n = 0; n < F41_DIMb; n++) { + for(n = 0; n < F41_DIMb; n++) { Array1[m].b[n] = quote[n]; } - for (n = 0; n < F41_ARRAY_DIMc; n++) { + for(n = 0; n < F41_ARRAY_DIMc; n++) { Array1[m].c[n] = chararray[n]; } - for (n = 0; n < F41_ARRAY_DIMd1; n++) { - for (o = 0; o < F41_ARRAY_DIMd2; o++){ + for(n = 0; n < F41_ARRAY_DIMd1; n++) { + for(o = 0; o < F41_ARRAY_DIMd2; o++){ Array1[m].d[n][o] = m + n + o; } } Array1[m].e = (float)( m * .96 ); - for (n = 0; n < F41_ARRAY_DIMf; n++) { + for(n = 0; n < F41_ARRAY_DIMf; n++) { Array1[m].f[n] = ( m * 1024.9637 ); } @@ -4284,110 +4283,110 @@ static void gent_compound_complex(void) /* Create the dataspace */ dataspace = H5Screate_simple(F41_RANK, dim, NULL); - assert (dataspace >= 0); + assert(dataspace >= 0); /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert (datafile >= 0); + assert(datafile >= 0); /* Copy the array data type for the string array */ array_tid = H5Tcopy (H5T_C_S1); - assert (array_tid >= 0); + assert(array_tid >= 0); /* Set the string array size to Variable */ status = H5Tset_size (array_tid,H5T_VARIABLE); - assert (status >= 0); + assert(status >= 0); /* Create the array data type for the string array */ str_array_id = H5Tarray_create(array_tid, F41_ARRAY_RANK, array_dimb, NULL); - assert (str_array_id >= 0); + assert(str_array_id >= 0); /* Copy the array data type for the character array */ array1_tid = H5Tcopy (H5T_C_S1); - assert (array1_tid >= 0); + assert(array1_tid >= 0); /* Set the character array size */ status = H5Tset_size (array1_tid, F41_ARRAY_DIMc); - assert (status >= 0); + assert(status >= 0); /* Create the array data type for the character array */ array2_tid = H5Tarray_create(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd, NULL); - assert (array2_tid >= 0); + assert(array2_tid >= 0); /* Create the array data type for the character array */ array4_tid = H5Tarray_create(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf, NULL); - assert (array4_tid >= 0); + assert(array4_tid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate (H5T_COMPOUND, sizeof(Array1Struct)); - assert (Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", HOFFSET(Array1Struct, a), H5T_NATIVE_INT); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", HOFFSET(Array1Struct, b), str_array_id); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", HOFFSET(Array1Struct, c), array1_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", HOFFSET(Array1Struct, d), array2_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", HOFFSET(Array1Struct, f), array4_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); - assert (status >= 0); + assert(status >= 0); /* Create the dataset */ - dataset = H5Dcreate(datafile, F41_DATASETNAME, Array1Structid, - dataspace, H5P_DEFAULT); + dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - assert (status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array1_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array2_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(array4_tid); - assert (status >= 0); + assert(status >= 0); status = H5Tclose(str_array_id); - assert (status >= 0); + assert(status >= 0); status = H5Sclose(dataspace); - assert (status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - assert (status >= 0); + assert(status >= 0); status = H5Fclose(datafile); - assert (status >= 0); + assert(status >= 0); } @@ -4437,7 +4436,7 @@ static void gent_named_dtype_attr(void) */ /* Create dataset */ - did = H5Dcreate(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did > 0); /* Create attribute on dataset */ @@ -4471,24 +4470,24 @@ static void gent_named_dtype_attr(void) */ /* Close attribute */ - ret=H5Aclose(aid); - assert(ret>=0); + ret = H5Aclose(aid); + assert(ret >= 0); /* Close dataset */ - ret=H5Dclose(did); - assert(ret>=0); + ret = H5Dclose(did); + assert(ret >= 0); /* Close dataspace */ - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); /* Close datatype */ - ret=H5Tclose(tid); - assert(ret>=0); + ret = H5Tclose(tid); + assert(ret >= 0); /* Close file */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -4511,7 +4510,7 @@ static void gent_null_space(void) space = H5Screate(H5S_NULL); /* dataset */ - dataset = H5Dcreate(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* nothing should be written */ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); @@ -4543,26 +4542,27 @@ int make_dset(hid_t loc_id, hid_t dcpl, void *buf) { - hid_t dsid; + hid_t dsid; - /* create the dataset */ - if((dsid = H5Dcreate (loc_id,name,tid,sid,dcpl))<0) - return -1; + /* create the dataset */ + if((dsid = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + return -1; - /* write */ - if(H5Dwrite(dsid,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) - goto out; + /* write */ + if(H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto out; - /* close */ - if(H5Dclose(dsid)<0) - return -1; + /* close */ + if(H5Dclose(dsid) < 0) + return -1; - return 0; - out: - H5E_BEGIN_TRY { - H5Dclose(dsid); - } H5E_END_TRY; - return -1; + return 0; + +out: + H5E_BEGIN_TRY { + H5Dclose(dsid); + } H5E_END_TRY; + return -1; } @@ -4588,27 +4588,27 @@ make_external(hid_t fid) cur_size[0] = max_size[0] = 100; size = (max_size[0]*sizeof(int)/2); - dcpl=H5Pcreate(H5P_DATASET_CREATE); - ret=H5Pset_external(dcpl,"ext1.bin",(off_t)0,size); - assert(ret>=0); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); + assert(ret >= 0); - ret=H5Pset_external(dcpl,"ext2.bin",(off_t)0,size); - assert(ret>=0); + ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); + assert(ret >= 0); - sid=H5Screate_simple(1, cur_size, max_size); - assert(ret>=0); + sid = H5Screate_simple(1, cur_size, max_size); + assert(ret >= 0); - dsid=H5Dcreate(fid, "external", H5T_NATIVE_INT, sid, dcpl); - assert(ret>=0); + dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + assert(ret >= 0); H5Dclose(dsid); - assert(ret>=0); + assert(ret >= 0); H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -4633,8 +4633,8 @@ static void gent_filters(void) int buf1[DIM1][DIM2]; int i, j, n, ret; - for (i=n=0; i<DIM1; i++){ - for (j=0; j<DIM2; j++){ + for(i=n=0; i<DIM1; i++){ + for(j=0; j<DIM2; j++){ buf1[i][j]=n++; } } @@ -4654,32 +4654,32 @@ static void gent_filters(void) * add a comment to the datasets *------------------------------------------------------------------------- */ - ret=H5Pset_layout(dcpl, H5D_COMPACT); - assert(ret>=0); + ret = H5Pset_layout(dcpl, H5D_COMPACT); + assert(ret >= 0); ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); assert(ret >= 0); - ret=H5Pset_layout(dcpl, H5D_CONTIGUOUS); - assert(ret>=0); + ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); + assert(ret >= 0); ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); assert(ret >= 0); - ret=H5Pset_layout(dcpl, H5D_CHUNKED); - assert(ret>=0); + ret = H5Pset_layout(dcpl, H5D_CHUNKED); + assert(ret >= 0); - ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret>=0); + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + assert(ret >= 0); ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); ret = H5Oset_comment(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); assert(ret >= 0); @@ -4690,25 +4690,25 @@ static void gent_filters(void) */ /* set up chunk */ - ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret>=0); + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + assert(ret >= 0); /*------------------------------------------------------------------------- * SZIP *------------------------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set szip data */ - ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret>=0); + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + assert(ret >= 0); ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ @@ -4718,15 +4718,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set deflate data */ - ret=H5Pset_deflate(dcpl, 9); - assert(ret>=0); + ret = H5Pset_deflate(dcpl, 9); + assert(ret >= 0); ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif @@ -4736,15 +4736,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_SHUFFLE) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the shuffle filter */ - ret=H5Pset_shuffle(dcpl); - assert(ret>=0); + ret = H5Pset_shuffle(dcpl); + assert(ret >= 0); ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif @@ -4754,15 +4754,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_FLETCHER32) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the checksum filter */ - ret=H5Pset_fletcher32(dcpl); - assert(ret>=0); + ret = H5Pset_fletcher32(dcpl); + assert(ret >= 0); ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4771,17 +4771,17 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_NBIT) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the checksum filter */ - ret=H5Pset_nbit(dcpl); - assert(ret>=0); + ret = H5Pset_nbit(dcpl); + assert(ret >= 0); tid=H5Tcopy(H5T_NATIVE_INT); H5Tset_precision(tid,H5Tget_size(tid)-1); ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4790,15 +4790,15 @@ static void gent_filters(void) */ #if defined (H5_HAVE_FILTER_SCALEOFFSET) /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /* set the scaleoffset filter */ - ret=H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); - assert(ret>=0); + ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); + assert(ret >= 0); ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -4806,44 +4806,44 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); #if defined (H5_HAVE_FILTER_SHUFFLE) /* set the shuffle filter */ - ret=H5Pset_shuffle(dcpl); - assert(ret>=0); + ret = H5Pset_shuffle(dcpl); + assert(ret >= 0); #endif #ifdef H5_HAVE_FILTER_SZIP - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; /* set szip data */ - ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret>=0); + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ #if defined (H5_HAVE_FILTER_DEFLATE) /* set deflate data */ - ret=H5Pset_deflate(dcpl, 5); - assert(ret>=0); + ret = H5Pset_deflate(dcpl, 5); + assert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_FLETCHER32) /* set the checksum filter */ - ret=H5Pset_fletcher32(dcpl); - assert(ret>=0); + ret = H5Pset_fletcher32(dcpl); + assert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_NBIT) /* set the nbit filter */ - ret=H5Pset_nbit(dcpl); - assert(ret>=0); + ret = H5Pset_nbit(dcpl); + assert(ret >= 0); #endif ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- @@ -4851,21 +4851,21 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); - ret=H5Zregister (H5Z_MYFILTER); - assert(ret>=0); + ret = H5Zregister (H5Z_MYFILTER); + assert(ret >= 0); - ret=H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); - assert(ret>=0); + ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); + assert(ret >= 0); ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /* remove the filters from the dcpl */ - ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret>=0); + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + assert(ret >= 0); /*------------------------------------------------------------------------- * make an external dataset @@ -4877,28 +4877,28 @@ static void gent_filters(void) * H5D_ALLOC_TIME_EARLY *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - assert(ret>=0); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); + assert(ret >= 0); ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * commit a H5G_TYPE type with a comment @@ -4911,21 +4911,21 @@ static void gent_filters(void) ret = H5Oset_comment(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); assert(ret >= 0); - ret=H5Tclose(tid); - assert(ret>=0); + ret = H5Tclose(tid); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); - ret=H5Pclose(dcpl); - assert(ret>=0); + ret = H5Pclose(dcpl); + assert(ret >= 0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -4962,16 +4962,16 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid) /* Get the filter's current parameters */ #ifdef H5_WANT_H5_V1_6_COMPAT - if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0) + if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL) < 0) #else - if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL)<0) + if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL) < 0) #endif /* H5_WANT_H5_V1_6_COMPAT */ return(FAIL); cd_nelmts=2; /* Modify the filter's parameters for this dataset */ - if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values)<0) + if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values) < 0) return(FAIL); return(SUCCEED); @@ -5027,31 +5027,31 @@ static void gent_fcontents(void) /* hard link to "dset" */ - ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* hard link to "dset" */ - ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* soft link to itself */ - ret=H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* soft link to "dset" */ - ret=H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* dangling external link */ - ret=H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* dangling udlink */ - ret=H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - assert(ret>=0); + ret = H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /*------------------------------------------------------------------------- * datatypes @@ -5081,8 +5081,8 @@ static void gent_fcontents(void) */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); /* create a file for the bootblock test */ @@ -5090,8 +5090,8 @@ static void gent_fcontents(void) assert(fid>=0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5142,43 +5142,43 @@ static void gent_fvalues(void) * H5D_FILL_TIME_IFSET *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_NEVER *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_ALLOC *------------------------------------------------------------------------- */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - assert(ret>=0); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); + assert(ret >= 0); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + assert(ret >= 0); ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret>=0); + assert(ret >= 0); - ret=H5Pclose(dcpl); - assert(ret>=0); + ret = H5Pclose(dcpl); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with no fill value @@ -5194,14 +5194,14 @@ static void gent_fvalues(void) tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); - ret=H5Pset_fill_value(dcpl, tid, &fillval2); - assert(ret>=0); + ret = H5Pset_fill_value(dcpl, tid, &fillval2); + assert(ret >= 0); ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); - ret=H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); + ret = H5Pclose(dcpl); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_VLEN fill value @@ -5211,26 +5211,26 @@ static void gent_fvalues(void) buf3[0].p = malloc( 1 * sizeof(int)); ((int *)buf3[0].p)[0]=1; buf3[1].len = 2; - buf3[1].p = malloc( 2 * sizeof(int)); - ((int *)buf3[1].p)[0]=2; - ((int *)buf3[1].p)[1]=3; + buf3[1].p = malloc(2 * sizeof(int)); + ((int *)buf3[1].p)[0] = 2; + ((int *)buf3[1].p)[1] = 3; tid = H5Tvlen_create(H5T_NATIVE_INT); dcpl = H5Pcreate(H5P_DATASET_CREATE); fillval3.p=NULL; fillval3.len=0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); - assert(ret>=0); + assert(ret >= 0); - did = H5Dcreate(fid,"fill_vlen",tid,sid,H5P_DEFAULT); - ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf3); - assert(ret>=0); - ret = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf3); - assert(ret>=0); + did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); + assert(ret >= 0); + ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3); + assert(ret >= 0); ret = H5Dclose(did); ret = H5Tclose(tid); ret = H5Pclose(dcpl); - assert(ret>=0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_ARRAY fill value @@ -5245,10 +5245,10 @@ static void gent_fvalues(void) * close *------------------------------------------------------------------------- */ - ret=H5Sclose(sid); - assert(ret>=0); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5299,30 +5299,30 @@ static void gent_string(void) */ tid=H5Tcopy(H5T_C_S1); - ret=H5Tset_size(tid, sizeof(buf1)); - assert(ret>=0); + ret = H5Tset_size(tid, sizeof(buf1)); + assert(ret >= 0); write_dset(fid,1,dims1,"str1",tid,buf1); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); + ret = H5Tclose(tid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str2 *------------------------------------------------------------------------- */ sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); - tid = H5Tcopy (H5T_C_S1); - ret = H5Tset_size (tid,H5T_VARIABLE); - assert(ret>=0); - did = H5Dcreate(fid,"str2",tid,sid,H5P_DEFAULT); - ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); - ret=H5Dclose(did); - assert(ret>=0); - ret=H5Sclose(sid); - assert(ret>=0); + tid = H5Tcopy(H5T_C_S1); + ret = H5Tset_size(tid, H5T_VARIABLE); + assert(ret >= 0); + did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); + assert(ret >= 0); + ret = H5Tclose(tid); + assert(ret >= 0); + ret = H5Dclose(did); + assert(ret >= 0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str3 @@ -5335,13 +5335,13 @@ static void gent_string(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(tid); - assert(ret>=0); + assert(ret >= 0); ret = H5Tclose(str_tid); - assert(ret>=0); - ret=H5Sclose(sid); - assert(ret>=0); + assert(ret >= 0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * str4 @@ -5349,15 +5349,15 @@ static void gent_string(void) */ sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); - ret=H5Sclose(sid); - assert(ret>=0); + ret = H5Sclose(sid); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5432,8 +5432,8 @@ static void gent_aindices(void) * close *------------------------------------------------------------------------- */ - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); } @@ -5505,31 +5505,31 @@ static int gent_ldouble(void) hsize_t dims[1] = {3}; long double buf[3] = {1,2,3}; - if ((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) + if((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if ((sid = H5Screate_simple(1, dims, NULL))<0) + if((sid = H5Screate_simple(1, dims, NULL)) < 0) goto error; - if ((tid = H5Tcopy(H5T_NATIVE_LDOUBLE))<0) + if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) goto error; - if ((size = H5Tget_size(tid))==0) + if((size = H5Tget_size(tid)) == 0) goto error; - if ((did = H5Dcreate(fid, "dset", tid, sid, H5P_DEFAULT))<0) + if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if (H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; - if (H5Sclose(sid)<0) + if(H5Sclose(sid) < 0) goto error; - if (H5Tclose(tid)<0) + if(H5Tclose(tid) < 0) goto error; - if (H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto error; - if (H5Fclose(fid)<0) + if(H5Fclose(fid) < 0) goto error; return 0; @@ -5573,7 +5573,7 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); H5Dclose(did); H5Sclose(sid); @@ -5583,7 +5583,7 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); H5Dclose(did); H5Sclose(sid); @@ -5594,7 +5594,7 @@ gent_binary(void) */ tid = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL); sid = H5Screate_simple(1, dimarray, NULL); - did = H5Dcreate(fid, "array", tid, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, "array", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, abuf); H5Dclose(did); H5Tclose(tid); @@ -5605,10 +5605,9 @@ gent_binary(void) *------------------------------------------------------------------------- */ sid = H5Screate_simple(1, dimsl, NULL); - did = H5Dcreate(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT); - dbuf=calloc(100000,sizeof(double)); - if (dbuf!=NULL) - { + did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dbuf = calloc(100000, sizeof(double)); + if(dbuf != NULL) { H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); free(dbuf); } @@ -5653,22 +5652,22 @@ gent_bigdims(void) /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + assert(fid >= 0); /* create dataset */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue)<0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0) goto out; - if (H5Pset_chunk(dcpl, 1, chunk_dims)<0) + if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if ((f_sid = H5Screate_simple(1,dims,NULL))<0) + if((f_sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if ((did = H5Dcreate(fid,"dset4gb",H5T_NATIVE_SCHAR,f_sid,dcpl))<0) + if((did = H5Dcreate2(fid, "dset4gb", H5T_NATIVE_SCHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if ((tid = H5Dget_type(did))<0) + if((tid = H5Dget_type(did)) < 0) goto out; - if ((size = H5Tget_size(tid))<=0) + if((size = H5Tget_size(tid)) <= 0) goto out; /* select an hyperslab */ @@ -5676,19 +5675,19 @@ gent_bigdims(void) hs_start[0] = GB4LL - 10; hs_size[0] = nelmts; - if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0) + if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; buf=(char *) malloc((unsigned)(nelmts*size)); - for (i=0, c=0; i<nelmts; i++, c++) + for(i=0, c=0; i<nelmts; i++, c++) { buf[i] = c; } - if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size,NULL)<0) + if(H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size,NULL) < 0) goto out; - if (H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf)<0) + if(H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0) goto out; @@ -5696,17 +5695,17 @@ gent_bigdims(void) buf=NULL; /* close */ - if(H5Sclose(f_sid)<0) + if(H5Sclose(f_sid) < 0) goto out; - if(H5Sclose(m_sid)<0) + if(H5Sclose(m_sid) < 0) goto out; - if(H5Pclose(dcpl)<0) + if(H5Pclose(dcpl) < 0) goto out; - if(H5Dclose(did)<0) + if(H5Dclose(did) < 0) goto out; - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); return; @@ -5741,7 +5740,7 @@ gent_hyperslab(void) int i, ret; buf = malloc(32 * 4097 * sizeof(double) ); - for (i = 0; i < 32 * 4097; i++) + for(i = 0; i < 32 * 4097; i++) buf[i] = 1; /* create a file */ @@ -5750,8 +5749,8 @@ gent_hyperslab(void) write_dset(fid,2,dims,"stripmine",H5T_NATIVE_DOUBLE,buf); - ret=H5Fclose(fid); - assert(ret>=0); + ret = H5Fclose(fid); + assert(ret >= 0); free(buf); } @@ -5772,13 +5771,13 @@ gent_group_creation_order(void) hid_t gcpl_id; /* group creation property list ID */ hid_t fcpl_id; /* file creation property list ID (to set root group order) */ - if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) + if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) goto out; - if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0) + if(H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0) goto out; - if ((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0) goto out; @@ -5792,40 +5791,40 @@ gent_group_creation_order(void) */ - if ((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; @@ -5837,48 +5836,48 @@ gent_group_creation_order(void) goto out; - if ((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if ((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; - if (H5Pclose(gcpl_id) < 0) + if(H5Pclose(gcpl_id) < 0) goto out; - if (H5Pclose(fcpl_id) < 0) + if(H5Pclose(fcpl_id) < 0) goto out; - if (H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) goto out; return; @@ -5956,12 +5955,11 @@ gent_attr_creation_order(void) */ /* create a dataset */ - if((did = H5Dcreate(fid, "dset", H5T_NATIVE_UCHAR, sid, dcpl_id)) < 0) + if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ - for(i = 0; i < 3; i++) - { + for(i = 0; i < 3; i++) { if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; @@ -5970,7 +5968,7 @@ gent_attr_creation_order(void) goto out; } /* end for */ - if (H5Dclose(did) < 0) + if(H5Dclose(did) < 0) goto out; @@ -5980,22 +5978,22 @@ gent_attr_creation_order(void) *------------------------------------------------------------------------- */ - if ((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; /*------------------------------------------------------------------------- @@ -6003,25 +6001,25 @@ gent_attr_creation_order(void) *------------------------------------------------------------------------- */ - if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) goto out; - if ((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0) + if((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0) goto out; /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Tclose(tid) < 0) + if(H5Tclose(tid) < 0) goto out; /*------------------------------------------------------------------------- * add some attributes to the root group @@ -6033,16 +6031,16 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ - if (H5Aclose(aid) < 0) + if(H5Aclose(aid) < 0) goto out; } /* end for */ - if (H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; @@ -6057,9 +6055,9 @@ gent_attr_creation_order(void) goto out; if(H5Pclose(gcpl_id) < 0) goto out; - if (H5Pclose(tcpl_id) < 0) + if(H5Pclose(tcpl_id) < 0) goto out; - if (H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) goto out; |