summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-23 20:25:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-23 20:25:25 (GMT)
commit63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e (patch)
treef0947a1f2d2d60d55935f092cbb7071b4e62b301 /tools
parent3183d38231c3d2de3dd9e18abac1e753ca727013 (diff)
downloadhdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.zip
hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.gz
hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.bz2
[svn-r14104] Description:
Pursue calls to H5Gcreate() relentlessly and ruthlessly exterminate them, leaving only a few tame specimens in text files and comments. ;-) Tested on: Mac OS X/32 10.4.10 (amazon) FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5copy/h5copygentest.c6
-rw-r--r--tools/h5diff/h5diffgentest.c315
-rw-r--r--tools/h5dump/h5dumpgentest.c512
-rwxr-xr-xtools/h5import/h5import.c63
-rw-r--r--tools/h5jam/h5jamgentest.c50
-rw-r--r--tools/h5repack/h5repack_copy.c4
-rw-r--r--tools/h5repack/h5repacktst.c301
-rw-r--r--tools/h5stat/h5stat_gentest.c61
8 files changed, 643 insertions, 669 deletions
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index ee6862a..70c4694 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -336,7 +336,7 @@ static void gent_empty_group(hid_t loc_id)
hid_t gid;
/* Create group in location */
- gid = H5Gcreate(loc_id, GROUP_EMPTY, (size_t)0);
+ gid = H5Gcreate2(loc_id, GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Release resources */
H5Gclose(gid);
@@ -355,7 +355,7 @@ static void gent_nested_datasets(hid_t loc_id)
hid_t gid;
/* Create group in location */
- gid = H5Gcreate(loc_id, GROUP_DATASETS, (size_t)0);
+ gid = H5Gcreate2(loc_id, GROUP_DATASETS, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Add datasets to group created */
gent_datasets(gid);
@@ -377,7 +377,7 @@ static void gent_nested_group(hid_t loc_id)
hid_t gid;
/* Create group in location */
- gid = H5Gcreate(loc_id, GROUP_NESTED, (size_t)0);
+ gid = H5Gcreate2(loc_id, GROUP_NESTED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Add datasets to group created */
gent_nested_datasets(gid);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index 09f2656..12acd77 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -48,7 +48,7 @@
#define MY_LINKCLASS 187
/* A UD link traversal function. Shouldn't actually be called. */
static hid_t UD_traverse(UNUSED const char * link_name, UNUSED hid_t cur_group,
- UNUSED void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id)
+ UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id)
{
return -1;
}
@@ -151,9 +151,9 @@ int test_basic(const char *fname1,
*-------------------------------------------------------------------------
*/
- gid1 = H5Gcreate(fid1, "g1", 0);
- gid2 = H5Gcreate(fid2, "g1", 0);
- gid3 = H5Gcreate(fid2, "g2", 0);
+ gid1 = H5Gcreate2(fid1, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid2 = H5Gcreate2(fid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid3 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
* tests:
@@ -256,15 +256,15 @@ int test_basic(const char *fname1,
float data15[6];
float data16[6];
- data15[0] = (float) sqrt( -1 );
+ data15[0] = (float) sqrt( (double)-1 );
data15[1] = 1;
- data15[2] = (float) sqrt( -1 );
+ data15[2] = (float) sqrt( (double)-1 );
data15[3] = 1;
data15[4] = 1;
data15[5] = 1;
- data16[0] = (float) sqrt( -1 );
- data16[1] = (float) sqrt( -1 );
+ data16[0] = (float) sqrt( (double)-1 );
+ data16[1] = (float) sqrt( (double)-1 );
data16[2] = 1;
data16[3] = 1;
data16[4] = 1;
@@ -305,84 +305,83 @@ out:
static
int test_types(const char *fname)
{
+ hid_t fid1;
+ hid_t gid1;
+ hid_t gid2;
+ hid_t tid1;
+ hid_t tid2;
+ herr_t status;
+ hsize_t dims[1]={1};
+ typedef struct s1_t
+ {
+ int a;
+ float b;
+ } s1_t;
+ typedef struct s2_t
+ {
+ int a;
+ } s2_t;
- hid_t fid1;
- hid_t gid1;
- hid_t gid2;
- hid_t tid1;
- hid_t tid2;
- herr_t status;
- hsize_t dims[1]={1};
- typedef struct s1_t
- {
- int a;
- float b;
- } s1_t;
- typedef struct s2_t
- {
- int a;
- } s2_t;
-
-/*-------------------------------------------------------------------------
- * Create one file
- *-------------------------------------------------------------------------
- */
- fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
-/*-------------------------------------------------------------------------
- * H5G_DATASET
- *-------------------------------------------------------------------------
- */
- write_dset(fid1,1,dims,"dset",H5T_NATIVE_INT,0);
+ /*-------------------------------------------------------------------------
+ * Create one file
+ *-------------------------------------------------------------------------
+ */
+ fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-/*-------------------------------------------------------------------------
- * H5G_GROUP
- *-------------------------------------------------------------------------
- */
- gid1 = H5Gcreate(fid1, "g1", 0);
- status = H5Gclose(gid1);
- gid2 = H5Gcreate(fid1, "g2", 0);
- status = H5Gclose(gid2);
+ /*-------------------------------------------------------------------------
+ * H5G_DATASET
+ *-------------------------------------------------------------------------
+ */
+ write_dset(fid1,1,dims,"dset",H5T_NATIVE_INT,0);
-/*-------------------------------------------------------------------------
- * H5G_TYPE
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * H5G_GROUP
+ *-------------------------------------------------------------------------
+ */
+ gid1 = H5Gcreate2(fid1, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Gclose(gid1);
+ gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Gclose(gid2);
- /* create and commit datatype 1 */
- 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);
- H5Tclose(tid1);
- /* create and commit datatype 2 */
- tid2 = H5Tcreate (H5T_COMPOUND, sizeof(s2_t));
- H5Tinsert(tid2, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT);
- H5Tcommit(fid1, "t2", tid2);
- H5Tclose(tid2);
+ /*-------------------------------------------------------------------------
+ * H5G_TYPE
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * H5G_LINK
- *-------------------------------------------------------------------------
- */
+ /* create and commit datatype 1 */
+ 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);
+ H5Tclose(tid1);
+ /* create and commit datatype 2 */
+ tid2 = H5Tcreate (H5T_COMPOUND, sizeof(s2_t));
+ H5Tinsert(tid2, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT);
+ H5Tcommit(fid1, "t2", tid2);
+ H5Tclose(tid2);
+
+ /*-------------------------------------------------------------------------
+ * H5G_LINK
+ *-------------------------------------------------------------------------
+ */
- status = H5Glink(fid1, H5L_TYPE_SOFT, "g1", "l1");
- status = H5Glink(fid1, H5L_TYPE_SOFT, "g2", "l2");
+ status = H5Glink(fid1, H5L_TYPE_SOFT, "g1", "l1");
+ status = H5Glink(fid1, H5L_TYPE_SOFT, "g2", "l2");
-/*-------------------------------------------------------------------------
- * H5G_UDLINK
- *-------------------------------------------------------------------------
- */
- H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
- H5Lregister(UD_link_class);
- H5Lcreate_ud(fid1, "ud_link", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
+ /*-------------------------------------------------------------------------
+ * H5G_UDLINK
+ *-------------------------------------------------------------------------
+ */
+ H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
+ H5Lregister(UD_link_class);
+ H5Lcreate_ud(fid1, "ud_link", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
-/*-------------------------------------------------------------------------
- * Close
- *-------------------------------------------------------------------------
- */
- status = H5Fclose(fid1);
- return status;
+ /*-------------------------------------------------------------------------
+ * Close
+ *-------------------------------------------------------------------------
+ */
+ status = H5Fclose(fid1);
+ return status;
}
@@ -610,50 +609,50 @@ static
int test_attributes(const char *file,
int make_diffs /* flag to modify data buffers */)
{
- hid_t fid;
- hid_t did;
- hid_t gid;
- hid_t root_id;
- hid_t sid;
- hsize_t dims[1]={2};
- herr_t status;
-
- /* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
- return -1;
-
- /* 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);
-
- /* Create groups */
- gid = H5Gcreate(fid,"g1",0);
- root_id = H5Gopen(fid, "/");
-
-/*-------------------------------------------------------------------------
- * write a series of attributes on the dataset, group, and root group
- *-------------------------------------------------------------------------
- */
+ hid_t fid;
+ hid_t did;
+ hid_t gid;
+ hid_t root_id;
+ hid_t sid;
+ hsize_t dims[1]={2};
+ herr_t status;
+
+ /* Create a file */
+ if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ return -1;
+
+ /* 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);
+
+ /* Create groups */
+ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ root_id = H5Gopen(fid, "/");
+
+ /*-------------------------------------------------------------------------
+ * write a series of attributes on the dataset, group, and root group
+ *-------------------------------------------------------------------------
+ */
- write_attr_in(did,"dset",fid,make_diffs);
- write_attr_in(gid,NULL,0,make_diffs);
- write_attr_in(root_id,NULL,0,make_diffs);
+ write_attr_in(did,"dset",fid,make_diffs);
+ write_attr_in(gid,NULL,0,make_diffs);
+ write_attr_in(root_id,NULL,0,make_diffs);
- /* Close */
- status = H5Dclose(did);
- assert(status>=0);
- status = H5Gclose(gid);
- assert(status>=0);
- status = H5Gclose(root_id);
- assert(status>=0);
+ /* Close */
+ status = H5Dclose(did);
+ assert(status>=0);
+ status = H5Gclose(gid);
+ assert(status>=0);
+ status = H5Gclose(root_id);
+ assert(status>=0);
- /* Close file */
- status = H5Fclose(fid);
- assert(status>=0);
- return status;
+ /* Close file */
+ status = H5Fclose(fid);
+ assert(status>=0);
+ return status;
}
@@ -671,50 +670,48 @@ static
int test_datasets(const char *file,
int make_diffs /* flag to modify data buffers */)
{
- hid_t fid;
- hid_t did;
- hid_t gid;
- hid_t sid;
- hsize_t dims[1]={2};
- herr_t status;
- int buf[2]={1,2};
-
- if (make_diffs)
- {
- memset(buf,0,sizeof buf);
- }
-
- /* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
- return -1;
-
- /* Create a 1D dataset */
- sid = H5Screate_simple(1,dims,NULL);
- did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT);
- status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
- status = H5Sclose(sid);
- assert(status>=0);
-
- /* Create a group */
- gid = H5Gcreate(fid,"g1",0);
+ hid_t fid;
+ hid_t did;
+ hid_t gid;
+ hid_t sid;
+ hsize_t dims[1]={2};
+ herr_t status;
+ int buf[2]={1,2};
+
+ if (make_diffs)
+ memset(buf,0,sizeof buf);
+
+ /* Create a file */
+ if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ return -1;
+
+ /* Create a 1D dataset */
+ sid = H5Screate_simple(1,dims,NULL);
+ did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT);
+ status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
+ status = H5Sclose(sid);
+ assert(status>=0);
+
+ /* Create a group */
+ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /*-------------------------------------------------------------------------
+ * write a series of datasets on the group
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * write a series of datasets on the group
- *-------------------------------------------------------------------------
- */
+ write_dset_in(gid,"/dset",fid,make_diffs);
- write_dset_in(gid,"/dset",fid,make_diffs);
+ /* Close */
+ status = H5Dclose(did);
+ assert(status>=0);
+ status = H5Gclose(gid);
+ assert(status>=0);
- /* Close */
- status = H5Dclose(did);
- assert(status>=0);
- status = H5Gclose(gid);
- assert(status>=0);
-
- /* Close file */
- status = H5Fclose(fid);
- assert(status>=0);
- return status;
+ /* Close file */
+ status = H5Fclose(fid);
+ assert(status>=0);
+ return status;
}
/*-------------------------------------------------------------------------
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 463230e..321a15d 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -125,7 +125,7 @@ const H5Z_class_t H5Z_MYFILTER[1] = {{
/* A UD link traversal function. Shouldn't actually be called. */
static hid_t UD_traverse(UNUSED const char * link_name, UNUSED hid_t cur_group,
- UNUSED void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id)
+ UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id)
{
return -1;
}
@@ -232,39 +232,39 @@ static void gent_group(void)
fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* / */
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g3", 0);
+ group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* /g1 */
- group = H5Gcreate (fid, "/g1/g1.1", 0);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.2", 0);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* /g2 */
- group = H5Gcreate (fid, "/g2/g2.1", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* /g3 */
- group = H5Gcreate (fid, "/g3/g3.1", 0);
+ group = H5Gcreate2(fid, "/g3/g3.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.2", 0);
+ group = H5Gcreate2(fid, "/g3/g3.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.3", 0);
+ group = H5Gcreate2(fid, "/g3/g3.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.4", 0);
+ group = H5Gcreate2(fid, "/g3/g3.4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* /g2/g2.1 */
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.1", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.2", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
H5Fclose(fid);
@@ -464,11 +464,11 @@ static void gent_hardlink(void)
H5Sclose(space);
H5Dclose(dataset);
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Glink (group, H5L_TYPE_HARD, "/dset1", "dset2");
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Glink (group, H5L_TYPE_HARD, "/dset1", "dset3");
H5Gclose(group);
@@ -602,7 +602,7 @@ static void gent_compound_dt(void) { /* test compound data type */
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);
- group = H5Gcreate (fid, "/group1", 0);
+ group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate(group, "dset2", type, space, H5P_DEFAULT);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
@@ -674,7 +674,7 @@ static void gent_compound_dt(void) { /* test compound data type */
/* unamed data type */
- group = H5Gcreate (fid, "/group2", 0);
+ group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE);
@@ -806,7 +806,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
H5Tinsert(type, "float_name", HOFFSET(dset2_t, b), H5T_IEEE_F32BE);
H5Tcommit(fid, "type1", type);
- group = H5Gcreate (fid, "/group1", 0);
+ group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate(group, "dset2", type, space, create_plist);
@@ -856,7 +856,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
/* unamed data type */
- group = H5Gcreate (fid, "/group2", 0);
+ group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE);
@@ -905,19 +905,19 @@ static void gent_all(void)
fid = H5Fcreate(FILE7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* create groups */
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.1", 0);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.2", 0);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.2/g1.2.1", 0);
+ group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* root attributes */
@@ -1041,9 +1041,9 @@ hid_t fid, group;
fid = H5Fcreate(FILE10, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
H5Glink(fid, H5L_TYPE_HARD, "/g2", "/g1/g1.1");
@@ -1058,11 +1058,11 @@ hid_t fid, group;
fid = H5Fcreate(FILE11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* create group object g1 and implcit path from root object */
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* create group object g2 and implcit path from root object */
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* create path from object at /g1 to object at /g2 and name it g1.1 */
@@ -1111,7 +1111,7 @@ static void gent_many(void)
fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
create_plist = H5Pcreate(H5P_DATASET_CREATE);
@@ -1119,7 +1119,7 @@ static void gent_many(void)
sdim = 2;
H5Pset_chunk(create_plist, 1, &sdim);
- group = H5Gcreate (fid, "/g1/g1.1", 0);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
@@ -1210,18 +1210,18 @@ static void gent_many(void)
H5Tclose(type2);
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.2", 0);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Glink (group, H5L_TYPE_HARD, "/g1/g1.1/dset1", "link1");
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Glink (group, H5L_TYPE_SOFT, "/g1", "slink2");
H5Gclose(group);
- group = H5Gcreate (fid, "/g3", 0);
+ group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g4", 0);
+ group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* dset2 */
dims[0] = 10; dims[1] = 10;
@@ -1242,10 +1242,10 @@ static void gent_many(void)
H5Glink (group, H5L_TYPE_HARD, "/g4/dset2", "link3");
H5Gclose(group);
- group = H5Gcreate (fid, "/g5", 0);
+ group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g6", 0);
+ group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* dset3 */
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
@@ -1266,9 +1266,9 @@ static void gent_many(void)
H5Gclose(group);
H5Pclose(create_plist);
- group = H5Gcreate (fid, "/g7", 0);
+ group = H5Gcreate2(fid, "/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate (fid, "/g8", 0);
+ group = H5Gcreate2(fid, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* Create dangling external and UD links */
@@ -1472,7 +1472,7 @@ hsize_t sdim;
/* dset1 */
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate(group, "dset1", fxdlenstr, space, H5P_DEFAULT);
/* add attributes to dset1 */
@@ -1507,7 +1507,7 @@ hsize_t sdim;
H5Dclose(dataset);
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ 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++) {
@@ -1527,7 +1527,7 @@ hsize_t sdim;
H5Tset_cset(fxdlenstr, H5T_CSET_ASCII);
H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD);
- group = H5Gcreate (fid, "/g3", 0);
+ 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++) {
@@ -1541,7 +1541,7 @@ hsize_t sdim;
H5Gclose(group);
- group = H5Gcreate (fid, "/g4", 0);
+ 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++) {
@@ -1560,7 +1560,7 @@ hsize_t sdim;
H5Tset_cset(fxdlenstr, H5T_CSET_ASCII);
H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD);
- group = H5Gcreate (fid, "/g5", 0);
+ 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++) {
@@ -1574,7 +1574,7 @@ hsize_t sdim;
H5Gclose(group);
- group = H5Gcreate (fid, "/g6", 0);
+ 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++) {
@@ -1655,7 +1655,7 @@ static void gent_objref(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
/* Create a group */
- group=H5Gcreate(fid1,"Group1",(size_t)-1);
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Set group's comment */
H5Gset_comment(group,".",write_comment);
@@ -1994,7 +1994,7 @@ static void gent_bitfields(void)
file = H5Fcreate(FILE20, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if ((grp=H5Gcreate(file, "typetests", 0))<0) goto error;
+ if((grp = H5Gcreate2(file, "typetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* bitfield_1 */
nelmts = sizeof(buf);
@@ -2875,51 +2875,51 @@ static void gent_group_comments(void)
fid = H5Fcreate(FILE33, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* / */
- group = H5Gcreate (fid, "/g1", 0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g1", "Comment for group /g1");
H5Gclose(group);
- group = H5Gcreate (fid, "/g2", 0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g2", "Comment for group /g2");
H5Gclose(group);
- group = H5Gcreate (fid, "/g3", 0);
+ group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g3", "Comment for group /g3");
H5Gclose(group);
/* /g1 */
- group = H5Gcreate (fid, "/g1/g1.1", 0);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g1/g1.1", "Comment for group /g1/g1.1");
H5Gclose(group);
- group = H5Gcreate (fid, "/g1/g1.2", 0);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g1/g1.2", "Comment for group /g1/g1.2");
H5Gclose(group);
/* /g2 */
- group = H5Gcreate (fid, "/g2/g2.1", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g2/g2.1", "Comment for group /g2/g2.1");
H5Gclose(group);
/* /g3 */
- group = H5Gcreate (fid, "/g3/g3.1", 0);
+ group = H5Gcreate2(fid, "/g3/g3.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g3/g3.1", "Comment for group /g3/g3.1");
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.2", 0);
+ group = H5Gcreate2(fid, "/g3/g3.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g3/g3.2", "Comment for group /g3/g3.2");
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.3", 0);
+ group = H5Gcreate2(fid, "/g3/g3.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g3/g3.3", "Comment for group /g3/g3.3");
H5Gclose(group);
- group = H5Gcreate (fid, "/g3/g3.4", 0);
+ group = H5Gcreate2(fid, "/g3/g3.4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g3/g3.4", "Comment for group /g3/g3.4");
H5Gclose(group);
/* /g2/g2.1 */
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.1", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1");
H5Gclose(group);
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.2", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g2/g2.1/g2.1.2", "Comment for group /g2/g2.1/g2.1.2");
H5Gclose(group);
- group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0);
+ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gset_comment(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3");
H5Gclose(group);
@@ -3066,11 +3066,11 @@ static void gent_large_objname(void)
fid = H5Fcreate(FILE37, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- group = H5Gcreate(fid, "this_is_a_large_group_name", 0);
+ group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 50; ++i) {
+ for(i = 0; i < 50; ++i) {
sprintf(grp_name, "this_is_a_large_group_name%d", i);
- group2 = H5Gcreate(group, grp_name, 0);
+ group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group2);
}
@@ -4073,58 +4073,58 @@ static void write_dset_in(hid_t loc_id,
static void gent_attr_all(void)
{
- hid_t fid;
- hid_t did;
- hid_t group_id;
- hid_t group2_id;
- hid_t root_id;
- hid_t sid;
- hsize_t dims[1]={2};
- herr_t status;
-
- /* Create a file and a dataset */
- 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);
-
- /* Create groups */
- group_id = H5Gcreate(fid,"g1",0);
- group2_id = H5Gcreate(fid,"g2",0);
- root_id = H5Gopen(fid, "/");
-
-/*-------------------------------------------------------------------------
- * write a series of attributes on the dataset, group
- *-------------------------------------------------------------------------
- */
-
- write_attr_in(did,"dset",fid);
- write_attr_in(group_id,NULL,0);
- write_attr_in(root_id,NULL,0);
-
-/*-------------------------------------------------------------------------
- * write a series of datasets on group 2
- *-------------------------------------------------------------------------
- */
-
- write_dset_in(group2_id,"/dset",fid);
+ hid_t fid;
+ hid_t did;
+ hid_t group_id;
+ hid_t group2_id;
+ hid_t root_id;
+ hid_t sid;
+ hsize_t dims[1]={2};
+ herr_t status;
+
+ /* Create a file and a dataset */
+ 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);
+
+ /* Create groups */
+ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ group2_id = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ root_id = H5Gopen(fid, "/");
+
+ /*-------------------------------------------------------------------------
+ * write a series of attributes on the dataset, group
+ *-------------------------------------------------------------------------
+ */
+
+ write_attr_in(did,"dset",fid);
+ write_attr_in(group_id,NULL,0);
+ write_attr_in(root_id,NULL,0);
+
+ /*-------------------------------------------------------------------------
+ * write a series of datasets on group 2
+ *-------------------------------------------------------------------------
+ */
+
+ write_dset_in(group2_id,"/dset",fid);
- /* Close */
- status = H5Dclose(did);
- assert(status>=0);
- status = H5Gclose(group_id);
- assert(status>=0);
- status = H5Gclose(group2_id);
- assert(status>=0);
- status = H5Gclose(root_id);
- assert(status>=0);
+ /* Close */
+ status = H5Dclose(did);
+ assert(status>=0);
+ status = H5Gclose(group_id);
+ assert(status>=0);
+ status = H5Gclose(group2_id);
+ assert(status>=0);
+ status = H5Gclose(root_id);
+ assert(status>=0);
- /* Close file */
- status = H5Fclose(fid);
- assert(status>=0);
+ /* Close file */
+ status = H5Fclose(fid);
+ assert(status>=0);
}
@@ -4446,7 +4446,7 @@ static void gent_named_dtype_attr(void)
*/
/* Create a group */
- gid=H5Gcreate(fid,"g1",0);
+ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(gid>0);
/* Create attribute on group */
@@ -4982,112 +4982,112 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid)
*/
static void gent_fcontents(void)
{
- hid_t fid; /* file id */
- hid_t gid1; /* group ID */
- hid_t tid; /* datatype ID */
- hsize_t dims[1]={4};
- int buf[4]={1,2,3,4};
- int ret;
+ hid_t fid; /* file id */
+ hid_t gid1; /* group ID */
+ hid_t tid; /* datatype ID */
+ hsize_t dims[1]={4};
+ int buf[4]={1,2,3,4};
+ int ret;
- /* create a file */
- fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(fid>=0);
+ /* create a file */
+ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ assert(fid>=0);
- write_dset(fid,1,dims,"dset",H5T_NATIVE_INT,buf);
+ write_dset(fid,1,dims,"dset",H5T_NATIVE_INT,buf);
-/*-------------------------------------------------------------------------
- * links
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * links
+ *-------------------------------------------------------------------------
+ */
- /* hard link to "dset" */
- gid1 = H5Gcreate (fid, "/g1", 0);
- H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset1");
- H5Gclose(gid1);
+ /* hard link to "dset" */
+ gid1 = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset1");
+ H5Gclose(gid1);
- /* hard link to "dset" */
- gid1 = H5Gcreate (fid, "/g2", 0);
- H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset2");
- H5Gclose(gid1);
+ /* hard link to "dset" */
+ gid1 = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset2");
+ H5Gclose(gid1);
- /* hard link to "g2" */
- gid1 = H5Gopen(fid, "/g1");
- H5Glink (gid1, H5L_TYPE_HARD, "/g2", "g1.1");
- H5Gclose(gid1);
+ /* hard link to "g2" */
+ gid1 = H5Gopen(fid, "/g1");
+ H5Glink (gid1, H5L_TYPE_HARD, "/g2", "g1.1");
+ H5Gclose(gid1);
- /* hard link to "dset" */
- ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset3");
- assert(ret>=0);
+ /* hard link to "dset" */
+ ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset3");
+ assert(ret>=0);
- /* hard link to "dset" */
- ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset4");
- assert(ret>=0);
+ /* hard link to "dset" */
+ ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset4");
+ assert(ret>=0);
- /* soft link to itself */
- ret=H5Glink (fid, H5L_TYPE_SOFT, "mylink", "mylink");
- assert(ret>=0);
+ /* soft link to itself */
+ ret=H5Glink (fid, H5L_TYPE_SOFT, "mylink", "mylink");
+ assert(ret>=0);
- /* soft link to "dset" */
- ret=H5Glink (fid, H5L_TYPE_SOFT, "/dset", "softlink");
- assert(ret>=0);
+ /* soft link to "dset" */
+ ret=H5Glink (fid, H5L_TYPE_SOFT, "/dset", "softlink");
+ assert(ret>=0);
- /* dangling external link */
- ret=H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ /* dangling external link */
+ 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);
+ /* dangling udlink */
+ ret=H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret>=0);
-/*-------------------------------------------------------------------------
- * datatypes
- *-------------------------------------------------------------------------
- */
- tid=H5Tcopy(H5T_NATIVE_INT);
- ret=H5Tcommit(fid, "mytype", tid);
- assert(ret>=0);
- ret=H5Tclose(tid);
- assert(ret>=0);
+ /*-------------------------------------------------------------------------
+ * datatypes
+ *-------------------------------------------------------------------------
+ */
+ tid=H5Tcopy(H5T_NATIVE_INT);
+ ret=H5Tcommit(fid, "mytype", tid);
+ assert(ret>=0);
+ ret=H5Tclose(tid);
+ assert(ret>=0);
- /* no name datatype */
- tid=H5Tcopy(H5T_NATIVE_INT);
- ret=H5Tcommit(fid, "mytype2", tid);
- assert(ret>=0);
- write_dset(fid,1,dims,"dsetmytype2",tid,buf);
- ret=H5Gunlink(fid,"mytype2");
- assert(ret>=0);
- ret=H5Tclose(tid);
- assert(ret>=0);
+ /* no name datatype */
+ tid=H5Tcopy(H5T_NATIVE_INT);
+ ret=H5Tcommit(fid, "mytype2", tid);
+ assert(ret>=0);
+ write_dset(fid,1,dims,"dsetmytype2",tid,buf);
+ ret=H5Gunlink(fid,"mytype2");
+ assert(ret>=0);
+ ret=H5Tclose(tid);
+ assert(ret>=0);
-/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret=H5Fclose(fid);
+ assert(ret>=0);
- /* create a file for the bootblock test */
- fid = H5Fcreate(FILE47, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(fid>=0);
+ /* create a file for the bootblock test */
+ fid = H5Fcreate(FILE47, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ assert(fid>=0);
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret=H5Fclose(fid);
+ assert(ret>=0);
}
/*-------------------------------------------------------------------------
@@ -5366,80 +5366,70 @@ static void gent_string(void)
*/
static void gent_aindices(void)
{
- hid_t fid; /* file id */
- hid_t gid[6]; /* group ids */
- hsize_t dims1[1] = {100};
- hsize_t dims2[2] = {10,10};
- hsize_t dims3[3] = {2,10,10};
- hsize_t dims4[4] = {2,2,10,10};
- int buf1[100];
- int buf2[10][10];
- int buf3[2][10][10];
- int buf4[2][2][10][10];
- int i, j, k, l, n, ret;
-
- for (i=n=0; i<100; i++){
- buf1[i]=n++;
- }
-
- for (i=n=0; i<10; i++){
- for (j=0; j<10; j++){
- buf2[i][j]=n++;
- }
- }
- for (i=n=0; i<2; i++){
- for (j=0; j<10; j++){
- for (k=0; k<10; k++){
- buf3[i][j][k]=n++;
- }
- }
- }
- for (i=n=0; i<2; i++){
- for (j=0; j<2; j++){
- for (k=0; k<10; k++){
- for (l=0; l<10; l++){
- buf4[i][j][k][l]=n++;
- }
- }
- }
- }
-
- /* create a file */
- fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(fid>=0);
-
-/*-------------------------------------------------------------------------
- * root datasets
- *-------------------------------------------------------------------------
- */
- write_dset(fid,1,dims1,"1d",H5T_NATIVE_INT,buf1);
- write_dset(fid,2,dims2,"2d",H5T_NATIVE_INT,buf2);
- write_dset(fid,3,dims3,"3d",H5T_NATIVE_INT,buf3);
- write_dset(fid,4,dims4,"4d",H5T_NATIVE_INT,buf4);
+ hid_t fid; /* file id */
+ hid_t gid[6]; /* group ids */
+ hsize_t dims1[1] = {100};
+ hsize_t dims2[2] = {10,10};
+ hsize_t dims3[3] = {2,10,10};
+ hsize_t dims4[4] = {2,2,10,10};
+ int buf1[100];
+ int buf2[10][10];
+ int buf3[2][10][10];
+ int buf4[2][2][10][10];
+ int i, j, k, l, n, ret;
+
+ for(i = n = 0; i < 100; i++)
+ buf1[i] = n++;
+
+ for(i = n = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
+ buf2[i][j] = n++;
+ for(i = n = 0; i < 2; i++)
+ for(j = 0; j < 10; j++)
+ for(k = 0; k < 10; k++)
+ buf3[i][j][k] = n++;
+ for(i = n = 0; i < 2; i++)
+ for(j = 0; j < 2; j++)
+ for(k = 0; k < 10; k++)
+ for(l = 0; l < 10; l++)
+ buf4[i][j][k][l] = n++;
-/*-------------------------------------------------------------------------
- * test with group indentation
- *-------------------------------------------------------------------------
- */
- gid[0] = H5Gcreate (fid, "/g1", 0);
- gid[1] = H5Gcreate (fid, "g1/g2", 0);
- gid[2] = H5Gcreate (fid, "g1/g2/g3", 0);
- gid[3] = H5Gcreate (fid, "g1/g2/g3/g4", 0);
- gid[4] = H5Gcreate (fid, "g1/g2/g3/g4/g5", 0);
- gid[5] = H5Gcreate (fid, "g1/g2/g3/g4/g5/g6", 0);
- write_dset(gid[5],1,dims1,"1d",H5T_NATIVE_INT,buf1);
- write_dset(gid[5],2,dims2,"2d",H5T_NATIVE_INT,buf2);
- write_dset(gid[5],3,dims3,"3d",H5T_NATIVE_INT,buf3);
- write_dset(gid[5],4,dims4,"4d",H5T_NATIVE_INT,buf4);
- for (i=0; i<6; i++)
- H5Gclose(gid[i]);
+ /* create a file */
+ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ assert(fid>=0);
-/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
- ret=H5Fclose(fid);
- assert(ret>=0);
+ /*-------------------------------------------------------------------------
+ * root datasets
+ *-------------------------------------------------------------------------
+ */
+ write_dset(fid,1,dims1,"1d",H5T_NATIVE_INT,buf1);
+ write_dset(fid,2,dims2,"2d",H5T_NATIVE_INT,buf2);
+ write_dset(fid,3,dims3,"3d",H5T_NATIVE_INT,buf3);
+ write_dset(fid,4,dims4,"4d",H5T_NATIVE_INT,buf4);
+
+ /*-------------------------------------------------------------------------
+ * test with group indentation
+ *-------------------------------------------------------------------------
+ */
+ gid[0] = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid[1] = H5Gcreate2(fid, "g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid[2] = H5Gcreate2(fid, "g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid[3] = H5Gcreate2(fid, "g1/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid[4] = H5Gcreate2(fid, "g1/g2/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ gid[5] = H5Gcreate2(fid, "g1/g2/g3/g4/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ write_dset(gid[5],1,dims1,"1d",H5T_NATIVE_INT,buf1);
+ write_dset(gid[5],2,dims2,"2d",H5T_NATIVE_INT,buf2);
+ write_dset(gid[5],3,dims3,"3d",H5T_NATIVE_INT,buf3);
+ write_dset(gid[5],4,dims4,"4d",H5T_NATIVE_INT,buf4);
+ for(i = 0; i < 6; i++)
+ H5Gclose(gid[i]);
+
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
+ ret=H5Fclose(fid);
+ assert(ret>=0);
}
@@ -5464,7 +5454,7 @@ static void gent_longlinks(void)
assert(fid >= 0);
/* Create group with short name in file (used as target for hard links) */
- gid=H5Gcreate(fid, "grp1", (size_t)0);
+ gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(gid >= 0);
/* Construct very long file name */
@@ -5482,7 +5472,7 @@ static void gent_longlinks(void)
assert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0);
/* Create group with long name in existing group */
- gid2=H5Gcreate(gid, objname, (size_t)0);
+ gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(gid2 >= 0);
/* Close objects */
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index cd99ce0..b494a67 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -848,17 +848,14 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id)
{
/* create parent groups */
- if (in->path.count > 1)
- {
+ if(in->path.count > 1) {
j = 0;
handle = file_id;
- while (j<in->path.count-1)
- {
- if ((group_id = H5Gopen(handle, in->path.group[j])) < 0)
- {
- group_id = H5Gcreate(handle, in->path.group[j++], 0);
- for (; j<in->path.count-1; j++)
- group_id = H5Gcreate(group_id, in->path.group[j], 0);
+ while(j < in->path.count - 1) {
+ if((group_id = H5Gopen(handle, in->path.group[j])) < 0) {
+ group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(; j < in->path.count - 1; j++)
+ group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
handle = group_id;
break;
}
@@ -866,10 +863,9 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id)
j++;
}
}
- else
- {
+ else {
handle = file_id;
- j=0;
+ j = 0;
}
/*enable error reporting */
@@ -2443,31 +2439,26 @@ process(struct Options *opt)
/* disable error reporting */
H5E_BEGIN_TRY {
-
- /* create parent groups */
- if (in->path.count > 1)
- {
- j = 0;
- handle = file_id;
- while (j<in->path.count-1)
- {
- if ((group_id = H5Gopen(handle, in->path.group[j])) < 0)
- {
- group_id = H5Gcreate(handle, in->path.group[j++], 0);
- for (; j<in->path.count-1; j++)
- group_id = H5Gcreate(group_id, in->path.group[j], 0);
- handle = group_id;
- break;
+ /* create parent groups */
+ if(in->path.count > 1) {
+ j = 0;
+ handle = file_id;
+ while(j < in->path.count - 1) {
+ if((group_id = H5Gopen(handle, in->path.group[j])) < 0) {
+ group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for (; j < in->path.count - 1; j++)
+ group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ handle = group_id;
+ break;
+ }
+ handle = group_id;
+ j++;
+ }
+ }
+ else {
+ handle = file_id;
+ j=0;
}
- handle = group_id;
- j++;
- }
- }
- else
- {
- handle = file_id;
- j=0;
- }
/*enable error reporting */
} H5E_END_TRY;
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 0ae81d8..d0c1283 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -22,6 +22,7 @@
* trying it on a new platform, ...), you need to verify the correctness
* of the expected output and update the corresponding *.ddl files.
*/
+#include <assert.h>
#include <limits.h>
#include "hdf5.h"
@@ -122,10 +123,12 @@ typedef struct s1_t {
#define VLSTR_TYPE "vl_string_type"
/* A UD link traversal function. Shouldn't actually be called. */
-static hid_t UD_traverse(const char UNUSED * link_name, hid_t UNUSED cur_group, void UNUSED * udata, size_t UNUSED udata_size, hid_t UNUSED lapl_id)
+static hid_t UD_traverse(const char UNUSED * link_name, hid_t UNUSED cur_group,
+ const void UNUSED * udata, size_t UNUSED udata_size, hid_t UNUSED lapl_id)
{
-return -1;
+ return -1;
}
+
#define MY_LINKCLASS 187
const H5L_class_t UD_link_class[1] = {{
H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
@@ -184,19 +187,19 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
}
/* create groups */
- group = H5Gcreate(fid, "/g1", (size_t)0);
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate(fid, "/g2", (size_t)0);
+ group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate(fid, "/g1/g1.1", (size_t)0);
+ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate(fid, "/g1/g1.2", (size_t)0);
+ group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- group = H5Gcreate(fid, "/g1/g1.2/g1.2.1", (size_t)0);
+ group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
/* root attributes */
@@ -330,28 +333,23 @@ create_textfile(const char *name, size_t size)
size_t i;
char *bp;
- #ifdef _WIN32
- fd = _creat(name, _S_IREAD | _S_IWRITE);
- #else /* _WIN32 */
- fd = creat(name,(mode_t)0777);
- #endif /* _WIN32 */
- if (fd < 0) {
- /* panic */
- }
- buf = calloc(size, (size_t)1);
- if (buf == NULL) {
- /* panic */
- }
- /* fill buf with pattern */
- bp = buf;
- for (i = 0; i < size; i++) {
- *bp++ = pattern[i%10];
- }
+#ifdef _WIN32
+ fd = _creat(name, _S_IREAD | _S_IWRITE);
+#else /* _WIN32 */
+ fd = creat(name,(mode_t)0777);
+#endif /* _WIN32 */
+ assert(fd >= 0);
+ buf = calloc(size, (size_t)1);
+ assert(buf);
+ /* fill buf with pattern */
+ bp = buf;
+ for(i = 0; i < size; i++)
+ *bp++ = pattern[i % 10];
- HDwrite(fd,buf,size);
+ HDwrite(fd, buf, size);
- close(fd);
+ close(fd);
}
#ifdef notdef
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index bbb8d1c..e9a89e2 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -346,8 +346,8 @@ int do_copy_objects(hid_t fidin,
goto error;
}
else {
- if ((grp_out=H5Gcreate(fidout,travt->objs[i].name, 0))<0)
- goto error;
+ if((grp_out = H5Gcreate2(fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
}
if((grp_in = H5Gopen (fidin,travt->objs[i].name))<0)
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index 93d9b23..3328c70 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -1544,75 +1544,75 @@ out:
*/
int make_all_objects(hid_t loc_id)
{
- hid_t dset_id;
- hid_t group_id;
- hid_t type_id;
- hid_t root_id;
- hid_t space_id;
- hsize_t dims[1]={2};
- /* Compound datatype */
- typedef struct s_t
- {
- int a;
- float b;
- } s_t;
-
-/*-------------------------------------------------------------------------
- * 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
- *-------------------------------------------------------------------------
- */
- group_id = H5Gcreate(loc_id,"g1",0);
- root_id = H5Gopen(loc_id, "/");
-
-/*-------------------------------------------------------------------------
- * H5G_TYPE
- *-------------------------------------------------------------------------
- */
-
- /* Create a memory compound datatype */
- 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);
- H5Tclose(type_id);
-
-/*-------------------------------------------------------------------------
- * H5G_LINK
- *-------------------------------------------------------------------------
- */
-
- H5Glink(loc_id, H5L_TYPE_SOFT, "dset", "link");
-
-/*-------------------------------------------------------------------------
- * 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_dset_in(root_id,"dset_referenced",loc_id,0);
-
- /* Close */
- H5Dclose(dset_id);
- H5Gclose(group_id);
- H5Gclose(root_id);
-
- return 0;
-
+ hid_t dset_id;
+ hid_t group_id;
+ hid_t type_id;
+ hid_t root_id;
+ hid_t space_id;
+ hsize_t dims[1]={2};
+ /* Compound datatype */
+ typedef struct s_t
+ {
+ int a;
+ float b;
+ } s_t;
+
+ /*-------------------------------------------------------------------------
+ * 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
+ *-------------------------------------------------------------------------
+ */
+ group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ root_id = H5Gopen(loc_id, "/");
+
+ /*-------------------------------------------------------------------------
+ * H5G_TYPE
+ *-------------------------------------------------------------------------
+ */
+
+ /* Create a memory compound datatype */
+ 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);
+ H5Tclose(type_id);
+
+ /*-------------------------------------------------------------------------
+ * H5G_LINK
+ *-------------------------------------------------------------------------
+ */
+
+ H5Glink(loc_id, H5L_TYPE_SOFT, "dset", "link");
+
+ /*-------------------------------------------------------------------------
+ * 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_dset_in(root_id,"dset_referenced",loc_id,0);
+
+ /* Close */
+ H5Dclose(dset_id);
+ H5Gclose(group_id);
+ H5Gclose(root_id);
+
+ return 0;
}
@@ -1625,45 +1625,43 @@ int make_all_objects(hid_t loc_id)
*/
int make_attributes(hid_t loc_id)
{
- hid_t dset_id;
- hid_t group_id;
- hid_t root_id;
- hid_t space_id;
- hsize_t dims[1]={2};
-
-
-/*-------------------------------------------------------------------------
- * H5G_DATASET
- *-------------------------------------------------------------------------
- */
-
- space_id = H5Screate_simple(1,dims,NULL);
- dset_id = H5Dcreate(loc_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
- H5Sclose(space_id);
-
-/*-------------------------------------------------------------------------
- * H5G_GROUP
- *-------------------------------------------------------------------------
- */
- group_id = H5Gcreate(loc_id,"g1",0);
- root_id = H5Gopen(loc_id, "/");
-
-/*-------------------------------------------------------------------------
- * write a series of attributes on the dataset, group, and root group
- *-------------------------------------------------------------------------
- */
-
- write_attr_in(dset_id,"dset",loc_id,0);
- write_attr_in(group_id,"dset",loc_id,0);
- write_attr_in(root_id,"dset",loc_id,0);
-
- /* Close */
- H5Dclose(dset_id);
- H5Gclose(group_id);
- H5Gclose(root_id);
-
- return 0;
-
+ hid_t dset_id;
+ hid_t group_id;
+ hid_t root_id;
+ hid_t space_id;
+ hsize_t dims[1]={2};
+
+ /*-------------------------------------------------------------------------
+ * H5G_DATASET
+ *-------------------------------------------------------------------------
+ */
+
+ space_id = H5Screate_simple(1,dims,NULL);
+ dset_id = H5Dcreate(loc_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
+ H5Sclose(space_id);
+
+ /*-------------------------------------------------------------------------
+ * H5G_GROUP
+ *-------------------------------------------------------------------------
+ */
+ group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ root_id = H5Gopen(loc_id, "/");
+
+ /*-------------------------------------------------------------------------
+ * write a series of attributes on the dataset, group, and root group
+ *-------------------------------------------------------------------------
+ */
+
+ write_attr_in(dset_id,"dset",loc_id,0);
+ write_attr_in(group_id,"dset",loc_id,0);
+ write_attr_in(root_id,"dset",loc_id,0);
+
+ /* Close */
+ H5Dclose(dset_id);
+ H5Gclose(group_id);
+ H5Gclose(root_id);
+
+ return 0;
}
/*-------------------------------------------------------------------------
@@ -1675,50 +1673,49 @@ int make_attributes(hid_t loc_id)
*/
int make_hlinks(hid_t loc_id)
{
- hid_t group1_id;
- hid_t group2_id;
- hid_t group3_id;
- hsize_t dims[2]={3,2};
- int buf[3][2]= {{1,1},{1,2},{2,2}};
-
-/*-------------------------------------------------------------------------
- * create a dataset and some hard links to it
- *-------------------------------------------------------------------------
- */
-
- if (write_dset(loc_id,2,dims,"dset",H5T_NATIVE_INT,buf)<0)
- return -1;
- if (H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link1 to dset")<0)
- return -1;
- if (H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link2 to dset")<0)
- return -1;
- if (H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link3 to dset")<0)
- return -1;
-
-
-/*-------------------------------------------------------------------------
- * create a group and some hard links to it
- *-------------------------------------------------------------------------
- */
-
- if ((group1_id = H5Gcreate(loc_id,"g1",0))<0)
- return -1;
- if ((group2_id = H5Gcreate(group1_id,"g2",0))<0)
- return -1;
- if ((group3_id = H5Gcreate(group2_id,"g3",0))<0)
- return -1;
-
- if (H5Glink2(loc_id, "g1", H5L_TYPE_HARD, group2_id, "link1 to g1")<0)
- return -1;
- if (H5Glink2(group1_id, "g2", H5L_TYPE_HARD, group3_id, "link1 to g2")<0)
- return -1;
-
- H5Gclose(group1_id);
- H5Gclose(group2_id);
- H5Gclose(group3_id);
-
- return 0;
-
+ hid_t group1_id;
+ hid_t group2_id;
+ hid_t group3_id;
+ hsize_t dims[2]={3,2};
+ int buf[3][2]= {{1,1},{1,2},{2,2}};
+
+ /*-------------------------------------------------------------------------
+ * create a dataset and some hard links to it
+ *-------------------------------------------------------------------------
+ */
+
+ if(write_dset(loc_id,2,dims,"dset",H5T_NATIVE_INT,buf)<0)
+ return -1;
+ if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link1 to dset")<0)
+ return -1;
+ if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link2 to dset")<0)
+ return -1;
+ if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link3 to dset")<0)
+ return -1;
+
+
+ /*-------------------------------------------------------------------------
+ * create a group and some hard links to it
+ *-------------------------------------------------------------------------
+ */
+
+ if((group1_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ if((group2_id = H5Gcreate2(group1_id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ if((group3_id = H5Gcreate2(group2_id, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+
+ if(H5Glink2(loc_id, "g1", H5L_TYPE_HARD, group2_id, "link1 to g1")<0)
+ return -1;
+ if(H5Glink2(group1_id, "g2", H5L_TYPE_HARD, group3_id, "link1 to g2")<0)
+ return -1;
+
+ H5Gclose(group1_id);
+ H5Gclose(group2_id);
+ H5Gclose(group3_id);
+
+ return 0;
}
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index f0219bd..6d82e43 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -35,45 +35,45 @@
/*
* Generate 1.8 HDF5 file
* with NUM_GRPS groups
- * with NUM_ATTRS for the
+ * with NUM_ATTRS attributes on the dataset
*/
static void gen_file(void)
{
- int ret, i;
- hid_t fapl, gid;
- hid_t file, type_id, space_id, attr_id, dset_id;
- char name[30];
- char attrname[30];
+ int ret, i;
+ hid_t fapl, gid;
+ hid_t file, type_id, space_id, attr_id, dset_id;
+ char name[30];
+ char attrname[30];
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ ret = H5Pset_latest_format(fapl, 1);
- fapl = H5Pcreate(H5P_FILE_ACCESS);
- ret = H5Pset_latest_format(fapl,1);
+ /* Create dataset */
+ file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ for(i = 1; i <= NUM_GRPS; i++) {
+ sprintf(name, "%s%d", GROUP_NAME,i);
+ gid = H5Gcreate2(file, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Gclose(gid);
+ }
- /* Create dataset */
- file=H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- for (i=1; i<=NUM_GRPS; i++) {
- sprintf(name, "%s%d", GROUP_NAME,i);
- gid = H5Gcreate(file, name, (size_t)0);
- H5Gclose(gid);
- }
+ /* Create a datatype to commit and use */
+ type_id = H5Tcopy(H5T_NATIVE_INT);
+ /* Create dataspace for dataset */
+ space_id = H5Screate(H5S_SCALAR);
- /* Create a datatype to commit and use */
- type_id=H5Tcopy(H5T_NATIVE_INT);
- /* Create dataspace for dataset */
- space_id=H5Screate(H5S_SCALAR);
- /* Create dataset */
- dset_id=H5Dcreate(file, DATASET_NAME,type_id,space_id,H5P_DEFAULT);
- for (i=1; i<=NUM_ATTRS; i++) {
- sprintf(attrname, "%s%d", ATTR_NAME,i);
- attr_id=H5Acreate(dset_id,attrname, type_id,space_id,H5P_DEFAULT);
- ret=H5Aclose(attr_id);
- }
+ /* Create dataset */
+ dset_id = H5Dcreate(file, DATASET_NAME, type_id, space_id, H5P_DEFAULT);
+ for(i = 1; i <= NUM_ATTRS; i++) {
+ sprintf(attrname, "%s%d", ATTR_NAME,i);
+ attr_id = H5Acreate(dset_id, attrname, type_id, space_id, H5P_DEFAULT);
+ ret = H5Aclose(attr_id);
+ }
- ret=H5Dclose(dset_id);
- ret=H5Sclose(space_id);
- ret=H5Tclose(type_id);
- ret=H5Fclose(file);
+ ret = H5Dclose(dset_id);
+ ret = H5Sclose(space_id);
+ ret = H5Tclose(type_id);
+ ret = H5Fclose(file);
}
int main(void)
@@ -82,3 +82,4 @@ int main(void)
return 0;
}
+