summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5copy/h5copygentest.c2
-rw-r--r--tools/h5diff/h5diffgentest.c8
-rw-r--r--tools/h5dump/h5dumpgentest.c56
-rw-r--r--tools/h5repack/h5repack_copy.c16
-rw-r--r--tools/h5repack/h5repacktst.c50
5 files changed, 65 insertions, 67 deletions
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index 70c4694..6d07ae7 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -236,7 +236,7 @@ static void gent_named_vl(hid_t loc_id)
tid = H5Tvlen_create(H5T_NATIVE_INT);
/* create named datatype */
- H5Tcommit(loc_id, "vl", tid);
+ H5Tcommit2(loc_id, "vl", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* create dataset */
did = H5Dcreate(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index b50b985..dba7fca 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -349,15 +349,15 @@ int test_types(const char *fname)
*/
/* create and commit datatype 1 */
- tid1 = H5Tcreate (H5T_COMPOUND, sizeof(s1_t));
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT);
H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
- H5Tcommit(fid1, "t1", tid1);
+ H5Tcommit2(fid1, "t1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Tclose(tid1);
/* create and commit datatype 2 */
- tid2 = H5Tcreate (H5T_COMPOUND, sizeof(s2_t));
+ tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t));
H5Tinsert(tid2, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT);
- H5Tcommit(fid1, "t2", tid2);
+ H5Tcommit2(fid1, "t2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Tclose(tid2);
/*-------------------------------------------------------------------------
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index ec1b65c..ef80c4a 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -602,7 +602,7 @@ static void gent_compound_dt(void) { /* test compound data type */
type = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t));
H5Tinsert(type, "int_name", HOFFSET(dset2_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float_name", HOFFSET(dset2_t, b), H5T_IEEE_F32BE);
- H5Tcommit(fid, "type1", type);
+ H5Tcommit2(fid, "type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t));
H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT);
H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT);
@@ -639,7 +639,7 @@ static void gent_compound_dt(void) { /* test compound data type */
H5Tinsert(type2, "float_array", HOFFSET(dset3_t, b), array_dt);
H5Tclose(array_dt);
- H5Tcommit(fid, "type2", type);
+ H5Tcommit2(fid, "type2", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dset3_dim[0] = 3; dset3_dim[1] = 6;
@@ -665,7 +665,7 @@ static void gent_compound_dt(void) { /* test compound data type */
type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t));
H5Tinsert(type, "int", HOFFSET(dset4_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE);
- H5Tcommit(group, "type3", 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);
@@ -680,11 +680,11 @@ static void gent_compound_dt(void) { /* test compound data type */
/* unamed data type */
group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
+ type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE);
- H5Tcommit(group, "type4", type);
- type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
+ H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, 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);
dataset = H5Dcreate(group, "dset5", type, space, H5P_DEFAULT);
@@ -804,10 +804,10 @@ static void gent_compound_dt2(void) { /* test compound data type */
space = H5Screate_simple(1, &sdim, &maxdim);
/* shared data type 1 */
- type = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t));
+ type = H5Tcreate(H5T_COMPOUND, sizeof(dset2_t));
H5Tinsert(type, "int_name", HOFFSET(dset2_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float_name", HOFFSET(dset2_t, b), H5T_IEEE_F32BE);
- H5Tcommit(fid, "type1", type);
+ H5Tcommit2(fid, "type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -836,14 +836,14 @@ static void gent_compound_dt2(void) { /* test compound data type */
H5Tinsert(type, "float_array", HOFFSET(dset3_t, b), array_dt);
H5Tclose(array_dt);
- H5Tcommit(fid, "type2", type);
+ H5Tcommit2(fid, "type2", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Tclose(type);
/* shared data type 3 */
- type = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t));
+ type = H5Tcreate(H5T_COMPOUND, sizeof(dset4_t));
H5Tinsert(type, "int", HOFFSET(dset4_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE);
- H5Tcommit(group, "type3", type);
+ H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate(group, "dset4", type, space, create_plist);
@@ -861,12 +861,12 @@ static void gent_compound_dt2(void) { /* test compound data type */
/* unamed data type */
group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
+ type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE);
- H5Tcommit(group, "type4", type);
+ H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate(group, "dset5", type, space, create_plist);
- type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
+ 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);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset5);
@@ -1617,7 +1617,7 @@ static void gent_enum(void)
H5Tenum_insert(type, "BLUE blue", (val = 2, &val));
H5Tenum_insert(type, "WHITE \"white\"", (val = 3, &val));
H5Tenum_insert(type, "BLACK \'black\'", (val = 4, &val));
- H5Tcommit(file, "enum normal", type);
+ 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);
@@ -1691,7 +1691,7 @@ static void gent_objref(void)
H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_IEEE_F32BE);
/* Save datatype for later */
- H5Tcommit(group, "Datatype1", tid1);
+ H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Close datatype */
H5Tclose(tid1);
@@ -3111,7 +3111,7 @@ static void gent_vlstr(void)
/* Create a named VL string type. Change padding of datatype */
H5Tset_strpad(tid1, H5T_STR_NULLPAD);
- H5Tcommit(fid1, "vl_string_type", tid1);
+ H5Tcommit2(fid1, "vl_string_type", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create an group attribute of VL string type */
root = H5Gopen2(fid1, "/", H5P_DEFAULT);
@@ -4410,8 +4410,8 @@ static void gent_named_dtype_attr(void)
assert(tid>0);
/* Commit datatype to file */
- ret=H5Tcommit(fid,F42_TYPENAME,tid);
- assert(ret>=0);
+ ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* Create a scalar dataspace used for all objects */
sid=H5Screate(H5S_SCALAR);
@@ -4898,9 +4898,9 @@ static void gent_filters(void)
* commit a H5G_TYPE type with a comment
*-------------------------------------------------------------------------
*/
- tid=H5Tcopy(H5T_STD_B8LE);
- ret=H5Tcommit(fid, "mytype", tid);
- assert(ret>=0);
+ tid = H5Tcopy(H5T_STD_B8LE);
+ ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
ret = H5Oset_comment(fid, "mytype", "This is a commited datatype", H5P_DEFAULT);
assert(ret >= 0);
@@ -5051,16 +5051,16 @@ static void gent_fcontents(void)
* datatypes
*-------------------------------------------------------------------------
*/
- tid=H5Tcopy(H5T_NATIVE_INT);
- ret=H5Tcommit(fid, "mytype", tid);
- assert(ret>=0);
- ret=H5Tclose(tid);
- assert(ret>=0);
+ tid = H5Tcopy(H5T_NATIVE_INT);
+ ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
+ ret = H5Tclose(tid);
+ assert(ret >= 0);
/* no name datatype */
tid = H5Tcopy(H5T_NATIVE_INT);
- ret = H5Tcommit(fid, "mytype2", tid);
+ ret = H5Tcommit2(fid, "mytype2", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(ret >= 0);
write_dset(fid, 1, dims, "dsetmytype2", tid, buf);
ret = H5Ldelete(fid, "mytype2", H5P_DEFAULT);
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 05205b7..5180461 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -752,29 +752,29 @@ int do_copy_objects(hid_t fidin,
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
- if ((type_in = H5Topen (fidin,travt->objs[i].name))<0)
+ if((type_in = H5Topen(fidin, travt->objs[i].name)) < 0)
goto error;
- if ((type_out = H5Tcopy(type_in))<0)
+ if((type_out = H5Tcopy(type_in)) < 0)
goto error;
- if ((H5Tcommit(fidout,travt->objs[i].name,type_out))<0)
+ if((H5Tcommit2(fidout, travt->objs[i].name, type_out, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/*-------------------------------------------------------------------------
* copy attrs
*-------------------------------------------------------------------------
*/
- if (copy_attr(type_in,type_out,options)<0)
+ if(copy_attr(type_in, type_out, options) < 0)
goto error;
- if (H5Tclose(type_in)<0)
+ if(H5Tclose(type_in) < 0)
goto error;
- if (H5Tclose(type_out)<0)
+ if(H5Tclose(type_out) < 0)
goto error;
- if (options->verbose)
- printf(FORMAT_OBJ,"type",travt->objs[i].name );
+ if(options->verbose)
+ printf(FORMAT_OBJ, "type", travt->objs[i].name);
break;
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index cc5591d..0cdc4c0 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -1558,52 +1558,52 @@ int make_all_objects(hid_t loc_id)
} s_t;
/*-------------------------------------------------------------------------
- * H5G_DATASET
- *-------------------------------------------------------------------------
- */
+ * H5G_DATASET
+ *-------------------------------------------------------------------------
+ */
space_id = H5Screate_simple(1,dims,NULL);
dset_id = H5Dcreate(loc_id,"dset_referenced",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
H5Sclose(space_id);
/*-------------------------------------------------------------------------
- * H5G_GROUP
- *-------------------------------------------------------------------------
- */
+ * H5G_GROUP
+ *-------------------------------------------------------------------------
+ */
group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
root_id = H5Gopen2(loc_id, "/", H5P_DEFAULT);
/*-------------------------------------------------------------------------
- * H5G_TYPE
- *-------------------------------------------------------------------------
- */
+ * H5G_TYPE
+ *-------------------------------------------------------------------------
+ */
/* Create a memory compound datatype */
- type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t));
+ type_id = H5Tcreate(H5T_COMPOUND, sizeof(s_t));
H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT);
H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT);
/* Commit compound datatype and close it */
- H5Tcommit(loc_id, "type", type_id);
+ H5Tcommit2(loc_id, "type", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Tclose(type_id);
/*-------------------------------------------------------------------------
- * H5G_LINK
- *-------------------------------------------------------------------------
- */
+ * H5G_LINK
+ *-------------------------------------------------------------------------
+ */
H5Lcreate_soft("dset", loc_id, "link", H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
- * H5G_UDLINK
- *-------------------------------------------------------------------------
- */
+ * H5G_UDLINK
+ *-------------------------------------------------------------------------
+ */
/* Create an external link. Other UD links are not supported by h5repack */
H5Lcreate_external("file", "path", loc_id, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
- * write a series of datasetes
- *-------------------------------------------------------------------------
- */
+ * write a series of datasetes
+ *-------------------------------------------------------------------------
+ */
write_dset_in(root_id,"dset_referenced",loc_id,0);
@@ -2409,8 +2409,7 @@ int make_early(void)
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto out;
- for(i = 0; i < iter; i++)
- {
+ for(i = 0; i < iter; i++) {
if((fid = H5Fopen(FNAME5, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
if((dset_id = H5Dcreate(fid, "early", H5T_NATIVE_DOUBLE, sid, dcpl)) < 0)
@@ -2418,7 +2417,7 @@ int make_early(void)
if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
sprintf(name, "%d", i);
- if((H5Tcommit(fid, name, tid)) < 0)
+ if((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Tclose(tid) < 0)
goto out;
@@ -2438,12 +2437,11 @@ int make_early(void)
if((fid = H5Fcreate(FNAME6, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
- for(i = 0; i < iter; i++)
- {
+ for(i = 0; i < iter; i++) {
if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
sprintf(name, "%d", i);
- if((H5Tcommit(fid, name, tid)) < 0)
+ if((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Tclose(tid) < 0)
goto out;