summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c++/src/H5Object.cpp6
-rw-r--r--examples/Attributes.txt14
-rw-r--r--examples/h5_attribute.c8
-rw-r--r--examples/h5_shared_mesg.c5
-rw-r--r--fortran/src/H5Af.c18
-rw-r--r--hl/src/H5DS.c80
-rw-r--r--hl/src/H5IM.c146
-rw-r--r--hl/src/H5LT.c144
-rw-r--r--hl/src/H5TB.c890
-rw-r--r--perform/perf_meta.c153
-rw-r--r--src/H5A.c2
-rw-r--r--src/H5Adeprec.c17
-rw-r--r--src/H5Apublic.h10
-rw-r--r--src/H5Tconv.c2
-rw-r--r--src/H5vers.txt1
-rw-r--r--src/H5version.h15
-rw-r--r--test/dangle.c66
-rw-r--r--test/dtypes.c6
-rw-r--r--test/gen_mergemsg.c10
-rw-r--r--test/gen_nullspace.c6
-rw-r--r--test/links.c6
-rwxr-xr-xtest/objcopy.c14
-rwxr-xr-xtest/reserved.c5
-rw-r--r--test/tattr.c346
-rw-r--r--test/tfile.c12
-rw-r--r--test/th5s.c9
-rw-r--r--test/titerate.c4
-rw-r--r--test/tmisc.c87
-rw-r--r--test/tsohm.c36
-rw-r--r--test/ttsafe_acreate.c10
-rw-r--r--test/tunicode.c4
-rw-r--r--test/tvlstr.c8
-rw-r--r--test/unlink.c8
-rw-r--r--test/vfd.c221
-rw-r--r--testpar/t_mdset.c16
-rw-r--r--tools/h5diff/h5diffgentest.c78
-rw-r--r--tools/h5dump/h5dumpgentest.c184
-rw-r--r--tools/h5jam/h5jamgentest.c8
-rw-r--r--tools/h5repack/h5repack_copy.c101
-rw-r--r--tools/h5repack/h5repack_refs.c4
-rw-r--r--tools/h5repack/h5repacktst.c700
-rw-r--r--tools/h5stat/h5stat_gentest.c2
42 files changed, 1735 insertions, 1727 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index cae9155..0b6c20e 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -103,7 +103,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type
hid_t type_id = data_type.getId();
hid_t space_id = data_space.getId();
hid_t plist_id = create_plist.getId();
- hid_t attr_id = H5Acreate( id, name, type_id, space_id, plist_id );
+ hid_t attr_id = H5Acreate2(id, ".", name, type_id, space_id, plist_id, H5P_DEFAULT, H5P_DEFAULT );
// If the attribute id is valid, create and return the Attribute object
if( attr_id > 0 )
@@ -112,9 +112,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type
return( attr );
}
else
- {
- throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate failed");
- }
+ throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
}
//--------------------------------------------------------------------------
diff --git a/examples/Attributes.txt b/examples/Attributes.txt
index 69db544..76f2aae 100644
--- a/examples/Attributes.txt
+++ b/examples/Attributes.txt
@@ -1,6 +1,6 @@
Attribute Examples:
-H5Acreate example: Show how to create an attribute for a dataset and a group
+H5Acreate2 example: Show how to create an attribute for a dataset and a group
----------------
{
hid_t file;
@@ -22,15 +22,15 @@ H5Acreate example: Show how to create an attribute for a dataset and a group
dataspace = H5Screate_simple(rank, dimsf, NULL);
/* Create a dataset */
- dataset=H5Dcreate(file,"Dataset1",H5T_UINT8,dataspace,H5P_DEFAULT);
+ dataset = H5Dcreate(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT);
<Write data to first dataset>
/* Create an attribute for the dataset */
- attr=H5Acreate(dataset,"Attr1",H5T_INT32,H5S_SCALAR,H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write attribute information */
- H5Awrite(attr,H5T_INT32,&attr_data);
+ H5Awrite(attr, H5T_INT32, &attr_data);
/* Close attribute */
H5Aclose(attr);
@@ -39,13 +39,13 @@ H5Acreate example: Show how to create an attribute for a dataset and a group
H5Dclose(dataset);
/* Create a group */
- group=H5Gcreate2(file, "/Group One", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ group = H5Gcreate2(file, "/Group One", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create an attribute for the dataset */
- attr=H5Acreate(group,"Attr1",H5T_INT32,H5S_SCALAR,H5P_DEFAULT);
+ attr = H5Acreate2(group, ".", "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write attribute information */
- H5Awrite(attr,H5T_INT32,&attr_data);
+ H5Awrite(attr, H5T_INT32, &attr_data);
/* Close attribute */
H5Aclose(attr);
diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c
index 3ce72be..1581a88 100644
--- a/examples/h5_attribute.c
+++ b/examples/h5_attribute.c
@@ -111,7 +111,7 @@ main (void)
/*
* Create array attribute.
*/
- attr1 = H5Acreate(dataset, ANAME, H5T_NATIVE_FLOAT, aid1, H5P_DEFAULT);
+ attr1 = H5Acreate2(dataset, ".", ANAME, H5T_NATIVE_FLOAT, aid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write array attribute.
@@ -122,8 +122,8 @@ main (void)
* Create scalar attribute.
*/
aid2 = H5Screate(H5S_SCALAR);
- attr2 = H5Acreate(dataset, "Integer attribute", H5T_NATIVE_INT, aid2,
- H5P_DEFAULT);
+ attr2 = H5Acreate2(dataset, ".", "Integer attribute", H5T_NATIVE_INT, aid2,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write scalar attribute.
@@ -137,7 +137,7 @@ main (void)
atype = H5Tcopy(H5T_C_S1);
H5Tset_size(atype, 5);
H5Tset_strpad(atype,H5T_STR_NULLTERM);
- attr3 = H5Acreate(dataset, ANAMES, atype, aid3, H5P_DEFAULT);
+ attr3 = H5Acreate2(dataset, ".", ANAMES, atype, aid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write string attribute.
diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c
index 6c9267c..ab79b15 100644
--- a/examples/h5_shared_mesg.c
+++ b/examples/h5_shared_mesg.c
@@ -288,14 +288,15 @@ create_standard_file(const char *filename, hid_t fcpl_id)
/* Begin using the messages many times. Do this by creating datasets
* that use this datatype, dataspace, and have this attribute.
*/
- for(x=0; x<NUM_DATASETS; ++x) {
+ for(x = 0; x < NUM_DATASETS; ++x) {
/* Create a dataset */
dset_id = H5Dcreate(file_id, DSETNAME[x], type_id, space_id, H5P_DEFAULT);
if(dset_id < 0) goto error;
/* Create an attribute on the dataset */
- attr_id = H5Acreate(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT);
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(attr_id < 0) goto error;
+
/* Write data to the attribute */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, attr_data);
if(ret < 0) goto error;
diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c
index 4d66103..76e7d89 100644
--- a/fortran/src/H5Af.c
+++ b/fortran/src/H5Af.c
@@ -20,7 +20,7 @@
/*----------------------------------------------------------------------------
* Name: h5acreate_c
- * Purpose: Call H5Acreate to create an attribute
+ * Purpose: Call H5Acreate2 to create an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* namelen - name length
@@ -34,25 +34,27 @@
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id)
+nh5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id,
+ hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id)
{
- char *c_name=NULL; /* Buffer to hold C string */
- int_f ret_value=0; /* Return value */
+ char *c_name = NULL; /* Buffer to hold C string */
+ int_f ret_value = 0; /* Return value */
/*
* Convert FORTRAN name to C name
*/
- if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL)
+ if(NULL == (c_name = HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL);
/*
- * Call H5Acreate function.
+ * Call H5Acreate2 function.
*/
- if((*attr_id = (hid_t_f)H5Acreate((hid_t)*obj_id, c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*crt_prp))<0)
+ if((*attr_id = (hid_t_f)H5Acreate2((hid_t)*obj_id, ".", c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*crt_prp, H5P_DEFAULT, H5P_DEFAULT)) < 0)
HGOTO_DONE(FAIL);
done:
- if(c_name) HDfree(c_name);
+ if(c_name)
+ HDfree(c_name);
return ret_value;
}
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 6d1c41e..1d823a0 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -235,31 +235,30 @@ herr_t H5DSattach_scale(hid_t did,
/* create one entry array */
dims = (hsize_t*) malloc (1 * sizeof (hsize_t));
- if (dims == NULL)
+ if(dims == NULL)
return FAIL;
dims[0] = rank;
/* space for the attribute */
- if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
return FAIL;
/* create the type for the attribute "DIMENSION_LIST" */
- if ((tid = H5Tvlen_create(H5T_STD_REF_OBJ)) < 0)
+ if((tid = H5Tvlen_create(H5T_STD_REF_OBJ)) < 0)
goto out;
/* create the attribute */
- if ((aid = H5Acreate(did,DIMENSION_LIST,tid,sid,H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(did, ".", DIMENSION_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* allocate and initialize the VL */
buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
- if (buf == NULL)
+ if(buf == NULL)
goto out;
- for(i=0; i<rank; i++)
- {
+ for(i = 0; i < rank; i++) {
buf[i].len = 0;
buf[i].p = NULL;
}
@@ -410,32 +409,32 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
/* create the compound datatype for the attribute "REFERENCE_LIST" */
- if ((tid = H5Tcreate(H5T_COMPOUND,sizeof(ds_list_t))) < 0)
+ if((tid = H5Tcreate(H5T_COMPOUND, sizeof(ds_list_t))) < 0)
goto out;
/* insert reference field */
- if (H5Tinsert(tid,"dataset",HOFFSET(ds_list_t,ref),H5T_STD_REF_OBJ) < 0)
+ if(H5Tinsert(tid, "dataset", HOFFSET(ds_list_t,ref), H5T_STD_REF_OBJ) < 0)
goto out;
/* insert dimension idx of the dataset field */
- if (H5Tinsert(tid,"dimension",HOFFSET(ds_list_t,dim_idx),H5T_NATIVE_INT) < 0)
+ if(H5Tinsert(tid, "dimension", HOFFSET(ds_list_t, dim_idx), H5T_NATIVE_INT) < 0)
goto out;
/* create the attribute */
- if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* store the IDX information */
dsl.dim_idx = idx;
/* write the attribute with the reference */
- if (H5Awrite(aid,tid,&dsl) < 0)
+ if(H5Awrite(aid, tid, &dsl) < 0)
goto out;
/* close */
- if (H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Tclose(tid) < 0)
+ if(H5Tclose(tid) < 0)
goto out;
if(H5Aclose(aid) < 0)
goto out;
@@ -494,31 +493,31 @@ herr_t H5DSattach_scale(hid_t did,
dsbuf[nelmts-1] = dsl;
/* create a new data space for the new references array */
- dims = (hsize_t*) malloc ( (size_t)nelmts * sizeof (hsize_t));
- if (dims == NULL)
+ dims = (hsize_t *)malloc((size_t)nelmts * sizeof(hsize_t));
+ if(dims == NULL)
goto out;
dims[0] = nelmts;
- if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
- if (dims)
+ if(dims)
free(dims);
/* create the attribute again with the changes of space */
- if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* write the attribute with the new references */
- if (H5Awrite(aid,tid,dsbuf) < 0)
+ if(H5Awrite(aid, tid, dsbuf) < 0)
goto out;
/* close */
- if (H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Tclose(tid) < 0)
+ if(H5Tclose(tid) < 0)
goto out;
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
if (dsbuf)
@@ -840,41 +839,38 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* don't do anything for an empty array */
- if (nelmts)
+ if(nelmts)
{
/* create a new data space for the new references array */
- dims = (hsize_t*) malloc ( (size_t)nelmts * sizeof (hsize_t));
- if (dims == NULL)
+ dims = (hsize_t*)malloc((size_t)nelmts * sizeof (hsize_t));
+ if(dims == NULL)
goto out;
dims[0] = nelmts;
dsbufn = malloc((size_t)nelmts * sizeof(ds_list_t));
- if (dsbufn == NULL)
+ if(dsbufn == NULL)
goto out;
/* store the new information */
- for(i=0; i<nelmts; i++)
- {
+ for(i = 0; i < nelmts; i++)
dsbufn[i] = dsbuf[i];
- }
- if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
/* create the attribute again with the changes of space */
- if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* write the new attribute with the new references */
- if (H5Awrite(aid,tid,dsbufn) < 0)
+ if(H5Awrite(aid, tid, dsbufn) < 0)
goto out;
/* close space and attribute */
- if (H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
-
} /* nelmts */
/* close type */
@@ -1445,26 +1441,26 @@ herr_t H5DSset_label(hid_t did,
dims[0] = rank;
/* space for the attribute */
- if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
/* create the datatype */
- if ((tid = H5Tcopy(H5T_C_S1)) < 0)
+ if((tid = H5Tcopy(H5T_C_S1)) < 0)
goto out;
- if (H5Tset_size(tid,H5T_VARIABLE) < 0)
+ if(H5Tset_size(tid, H5T_VARIABLE) < 0)
goto out;
/* create the attribute */
- if ((aid = H5Acreate(did,DIMENSION_LABELS,tid,sid,H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(did, ".", DIMENSION_LABELS, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* allocate and initialize */
buf = (const char **)malloc((size_t)rank * sizeof(char *));
- if (buf == NULL)
+ if(buf == NULL)
goto out;
- for(i=0; i<(unsigned int)rank; i++)
+ for(i = 0; i < (unsigned int)rank; i++)
buf[i] = NULL;
/* store the label information in the required index */
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index e6bd506..c7e905d 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -52,19 +52,19 @@ herr_t H5IMmake_image_8bit( hid_t loc_id,
dims[2] = 1;
/* Make the dataset */
- if ( H5LTmake_dataset( loc_id, dset_name, IMAGE8_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0 )
+ if ( H5LTmake_dataset( loc_id, dset_name, IMAGE8_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0)
return -1;
/* Attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0)
return -1;
/* Attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0)
return -1;
/* Attach the IMAGE_SUBCLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0)
return -1;
return 0;
@@ -124,23 +124,23 @@ herr_t H5IMmake_image_24bit( hid_t loc_id,
else return -1;
/* Make the dataset */
- if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0 )
+ if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0)
return -1;
/* Attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0)
return -1;
/* Attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0)
return -1;
/* Attach the IMAGE_SUBCLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0)
return -1;
/* Attach the INTERLACE_MODE attribute. This attributes is only for true color images */
- if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0)
return -1;
return 0;
@@ -280,11 +280,11 @@ herr_t H5IMget_image_info( hid_t loc_id,
}
/* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if ( (sid = H5Dget_space( did )) < 0)
goto out;
/* Get dimensions */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
+ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0)
goto out;
/* Initialize the image dimensions */
@@ -319,7 +319,7 @@ herr_t H5IMget_image_info( hid_t loc_id,
}
/* Close */
- if ( H5Sclose( sid ) < 0 )
+ if ( H5Sclose( sid ) < 0)
goto out;
@@ -348,27 +348,27 @@ herr_t H5IMget_image_info( hid_t loc_id,
/* Get the reference(s) */
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if ( (attr_space_id = H5Aget_space( attr_id )) < 0)
goto out;
*npals = H5Sget_simple_extent_npoints( attr_space_id );
- if ( H5Sclose( attr_space_id ) < 0 )
+ if ( H5Sclose( attr_space_id ) < 0)
goto out;
} /* H5T_REFERENCE */
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
/* Close the attribute. */
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
}
/* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
+ if ( H5Dclose( did ) < 0)
goto out;
return 0;
@@ -407,11 +407,11 @@ herr_t H5IMread_image( hid_t loc_id,
hid_t did;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if ( (did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Read */
- if ( H5Dread( did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer ) < 0 )
+ if ( H5Dread( did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer ) < 0)
goto out;
/* End access to the dataset and release resources used by it. */
@@ -468,11 +468,11 @@ herr_t H5IMmake_palette( hid_t loc_id,
return -1;
/* Attach the attribute "CLASS" to the >>palette<< dataset*/
- if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0)
return -1;
/* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/
- if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 )
+ if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0)
return -1;
return 0;
@@ -527,7 +527,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
*/
/* First we get the image id */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0 )
+ if ( (image_id = H5Dopen( loc_id, image_name )) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -537,31 +537,31 @@ herr_t H5IMlink_palette( hid_t loc_id,
* It does not exist. We create the attribute and one reference
*-------------------------------------------------------------------------
*/
- if ( ok_pal == 0 )
+ if(ok_pal == 0 )
{
- if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 )
+ if((attr_space_id = H5Screate(H5S_SCALAR)) < 0)
goto out;
/* Create the attribute type for the reference */
- if ( (attr_type = H5Tcopy( H5T_STD_REF_OBJ )) < 0 )
+ if((attr_type = H5Tcopy(H5T_STD_REF_OBJ)) < 0)
goto out;
/* Create the attribute "PALETTE" to be attached to the image*/
- if ( (attr_id = H5Acreate( image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(image_id, ".", "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* Create a reference. The reference is created on the local id. */
- if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 )
+ if(H5Rcreate(&ref, loc_id, pal_name, H5R_OBJECT, -1) < 0)
goto out;
/* Write the attribute with the reference */
- if ( H5Awrite( attr_id, attr_type, &ref ) < 0 )
+ if(H5Awrite(attr_id, attr_type, &ref) < 0)
goto out;
/* close */
- if ( H5Sclose( attr_space_id ) < 0 )
+ if(H5Sclose(attr_space_id) < 0)
goto out;
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
if(H5Aclose(attr_id) < 0)
goto out;
@@ -593,7 +593,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
- if ( H5Aread( attr_id, attr_type, refbuf ) < 0 )
+ if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
/* The attribute must be deleted, in order to the new one can reflect the changes*/
@@ -601,33 +601,33 @@ herr_t H5IMlink_palette( hid_t loc_id,
goto out;
/* Create a new reference for this palette. */
- if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 )
+ if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0)
goto out;
refbuf[n_refs] = ref;
/* Create the data space for the new references */
- if ( H5Sclose( attr_space_id ) < 0 )
+ if(H5Sclose(attr_space_id) < 0)
goto out;
- if ( (attr_space_id = H5Screate_simple( 1, &dim_ref, NULL )) < 0 )
+ if((attr_space_id = H5Screate_simple(1, &dim_ref, NULL)) < 0)
goto out;
/* Create the attribute again with the changes of space */
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
- if ( (attr_id = H5Acreate( image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(image_id, ".", "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* Write the attribute with the new references */
- if ( H5Awrite( attr_id, attr_type, refbuf ) < 0 )
+ if(H5Awrite(attr_id, attr_type, refbuf) < 0)
goto out;
/* close */
- if ( H5Sclose( attr_space_id ) < 0 )
+ if(H5Sclose(attr_space_id) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
free( refbuf );
@@ -635,7 +635,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
} /* ok_pal == 1 */
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if ( H5Dclose( image_id ) < 0)
return -1;
return 0;
@@ -694,7 +694,7 @@ herr_t H5IMunlink_palette( hid_t loc_id,
*/
/* First we get the image id */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0 )
+ if ( (image_id = H5Dopen( loc_id, image_name )) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -726,17 +726,17 @@ herr_t H5IMunlink_palette( hid_t loc_id,
} /* H5T_REFERENCE */
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
/* Close the attribute. */
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
} /* ok_pal */
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if ( H5Dclose( image_id ) < 0)
return -1;
return 0;
@@ -807,22 +807,22 @@ herr_t H5IMget_npalettes( hid_t loc_id,
*npals = H5Sget_simple_extent_npoints( attr_space_id );
- if ( H5Sclose( attr_space_id ) < 0 )
+ if ( H5Sclose( attr_space_id ) < 0)
goto out;
} /* H5T_REFERENCE */
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
/* Close the attribute. */
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
}
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if ( H5Dclose( image_id ) < 0)
return -1;
return 0;
@@ -900,32 +900,32 @@ herr_t H5IMget_palette_info( hid_t loc_id,
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
- if ( H5Aread( attr_id, attr_type, refbuf ) < 0 )
+ if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
/* Get the actual palette */
- if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0 )
+ if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0)
goto out;
- if ( (pal_space_id = H5Dget_space( pal_id )) < 0 )
+ if ( (pal_space_id = H5Dget_space( pal_id )) < 0)
goto out;
- if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0 )
+ if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0)
goto out;
- if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0 )
+ if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0)
goto out;
/* close */
if (H5Dclose(pal_id)<0)
goto out;
- if ( H5Sclose( pal_space_id ) < 0 )
+ if ( H5Sclose( pal_space_id ) < 0)
goto out;
- if ( H5Sclose( attr_space_id ) < 0 )
+ if ( H5Sclose( attr_space_id ) < 0)
goto out;
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
free( refbuf );
@@ -933,7 +933,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
}
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if ( H5Dclose( image_id ) < 0)
return -1;
return 0;
@@ -1012,31 +1012,31 @@ herr_t H5IMget_palette( hid_t loc_id,
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
- if ( H5Aread( attr_id, attr_type, refbuf ) < 0 )
+ if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
/* Get the palette id */
- if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0 )
+ if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0)
goto out;
/* Read the palette dataset */
- if ( H5Dread( pal_id, H5Dget_type(pal_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0 )
+ if ( H5Dread( pal_id, H5Dget_type(pal_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0)
goto out;
/* close */
if (H5Dclose(pal_id)<0)
goto out;
- if ( H5Sclose( attr_space_id ) < 0 )
+ if ( H5Sclose( attr_space_id ) < 0)
goto out;
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
free( refbuf );
}
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if ( H5Dclose( image_id ) < 0)
return -1;
return 0;
@@ -1084,7 +1084,7 @@ herr_t H5IMis_image( hid_t loc_id,
ret = -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if ( (did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Try to find the attribute "CLASS" on the dataset */
@@ -1115,16 +1115,16 @@ herr_t H5IMis_image( hid_t loc_id,
else
ret = 0;
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
}
/* Close the dataset. */
- if ( H5Dclose( did ) < 0 )
+ if ( H5Dclose( did ) < 0)
return -1;
return ret;
@@ -1169,7 +1169,7 @@ herr_t H5IMis_palette( hid_t loc_id,
ret = -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if ( (did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Try to find the attribute "CLASS" on the dataset */
@@ -1200,16 +1200,16 @@ herr_t H5IMis_palette( hid_t loc_id,
else
ret = 0;
- if ( H5Tclose( attr_type ) < 0 )
+ if ( H5Tclose( attr_type ) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if ( H5Aclose( attr_id ) < 0)
goto out;
}
/* Close the dataset. */
- if ( H5Dclose( did ) < 0 )
+ if ( H5Dclose( did ) < 0)
return -1;
return ret;
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 1810c1e..865dfb2 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1141,30 +1141,28 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
goto out;
/* Verify if the attribute already exists */
- has_attr = H5LT_find_attribute( obj_id, attr_name );
+ has_attr = H5LT_find_attribute(obj_id, attr_name);
/* The attribute already exists, delete it */
- if ( has_attr == 1 )
- {
- if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0)
- goto out;
- }
+ if(has_attr == 1)
+ if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0)
+ goto out;
/* Create and write the attribute */
- if ( (attr_id = H5Acreate( obj_id, attr_name, attr_type, attr_space_id, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(obj_id, ".", attr_name, attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, attr_type, attr_data ) < 0 )
+ if(H5Awrite(attr_id, attr_type, attr_data) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
- if ( H5Sclose( attr_space_id ) < 0 )
+ if(H5Sclose(attr_space_id) < 0)
goto out;
- if ( H5Tclose(attr_type) < 0 )
+ if(H5Tclose(attr_type) < 0)
goto out;
/* Close the object */
@@ -1221,33 +1219,31 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id,
goto out;
/* Verify if the attribute already exists */
- has_attr = H5LT_find_attribute( obj_id, attr_name );
+ has_attr = H5LT_find_attribute(obj_id, attr_name);
/* The attribute already exists, delete it */
- if ( has_attr == 1 )
- {
- if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0)
- goto out;
- }
+ if(has_attr == 1)
+ if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0)
+ goto out;
/* Create the attribute. */
- if ( (attr_id = H5Acreate( obj_id, attr_name, tid, sid, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(obj_id, ".", attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* Write the attribute data. */
- if ( H5Awrite( attr_id, tid, data ) < 0 )
+ if(H5Awrite(attr_id, tid, data) < 0)
goto out;
/* Close the attribute. */
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
/* Close the dataspace. */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose(sid) < 0)
goto out;
/* Close the object */
- if(H5Oclose(obj_id) < 0 )
+ if(H5Oclose(obj_id) < 0)
return -1;
return 0;
@@ -1874,7 +1870,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
input_len = strlen(text);
myinput = strdup(text);
- if((type_id = H5LTyyparse())<0)
+ if((type_id = H5LTyyparse()) < 0)
goto out;
free(myinput);
@@ -1944,7 +1940,7 @@ print_enum(hid_t type, char* str, int indt)
if((nmembs = H5Tget_nmembers(type))==0)
goto out;
assert(nmembs>0);
- if((super = H5Tget_super(type))<0)
+ if((super = H5Tget_super(type)) < 0)
goto out;
/* Use buffer of INT or UNSIGNED INT to print enum values because
@@ -1967,13 +1963,13 @@ print_enum(hid_t type, char* str, int indt)
for (i = 0; i < nmembs; i++) {
if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL)
goto out;
- if(H5Tget_member_value(type, (unsigned)i, value + i * super_size)<0)
+ if(H5Tget_member_value(type, (unsigned)i, value + i * super_size) < 0)
goto out;
}
/* Convert values to native data type */
if (native > 0) {
- if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT)<0)
+ if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0)
goto out;
}
@@ -2055,11 +2051,11 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *
if(len && !str) {
text_str = (char*)calloc(str_len, sizeof(char));
text_str[0]='\0';
- if((ret = H5LT_dtype_to_text(dtype, &text_str, lang_type, &str_len, 1))<0)
+ if((ret = H5LT_dtype_to_text(dtype, &text_str, lang_type, &str_len, 1)) < 0)
goto out;
*len = strlen(text_str) + 1;
} else if(len && str) {
- if((ret = H5LT_dtype_to_text(dtype, &str, lang_type, len, 0))<0)
+ if((ret = H5LT_dtype_to_text(dtype, &str, lang_type, len, 0)) < 0)
goto out;
str[*len-1] = '\0';
}
@@ -2110,7 +2106,7 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
goto out;
}
- if((tcls = H5Tget_class(dtype))<0)
+ if((tcls = H5Tget_class(dtype)) < 0)
goto out;
switch (tcls) {
@@ -2207,15 +2203,15 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
H5T_cset_t cset;
htri_t is_vlstr;
- if((tmp_type = H5Tcopy(dtype))<0)
+ if((tmp_type = H5Tcopy(dtype)) < 0)
goto out;
if((size = H5Tget_size(tmp_type))==0)
goto out;
- if((str_pad = H5Tget_strpad(tmp_type))<0)
+ if((str_pad = H5Tget_strpad(tmp_type)) < 0)
goto out;
- if((cset = H5Tget_cset(tmp_type))<0)
+ if((cset = H5Tget_cset(tmp_type)) < 0)
goto out;
- if((is_vlstr = H5Tis_variable_str(tmp_type))<0)
+ if((is_vlstr = H5Tis_variable_str(tmp_type)) < 0)
goto out;
/* Print lead-in */
@@ -2253,18 +2249,18 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
/* Reproduce a C type string */
- if((str_type = H5Tcopy(H5T_C_S1))<0)
+ if((str_type = H5Tcopy(H5T_C_S1)) < 0)
goto out;
if(is_vlstr) {
- if(H5Tset_size(str_type, H5T_VARIABLE)<0)
+ if(H5Tset_size(str_type, H5T_VARIABLE) < 0)
goto out;
} else {
- if(H5Tset_size(str_type, size)<0)
+ if(H5Tset_size(str_type, size) < 0)
goto out;
}
- if(H5Tset_cset(str_type, cset)<0)
+ if(H5Tset_cset(str_type, cset) < 0)
goto out;
- if(H5Tset_strpad(str_type, str_pad)<0)
+ if(H5Tset_strpad(str_type, str_pad) < 0)
goto out;
indentation(indent + COL, *dt_str);
@@ -2276,13 +2272,13 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
}
/* Change the endianness and see if they're equal. */
- if((order = H5Tget_order(tmp_type))<0)
+ if((order = H5Tget_order(tmp_type)) < 0)
goto out;
if(order==H5T_ORDER_LE) {
- if(H5Tset_order(str_type, H5T_ORDER_LE)<0)
+ if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
goto out;
} else if(order==H5T_ORDER_BE) {
- if(H5Tset_order(str_type, H5T_ORDER_BE)<0)
+ if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
goto out;
}
@@ -2293,15 +2289,15 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
/* If not equal to C variable-length string, check Fortran type.
* Actually H5Tequal can't tell difference between H5T_C_S1 and H5T_FORTRAN_S1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
- if(H5Tclose(str_type)<0)
+ if(H5Tclose(str_type) < 0)
goto out;
- if((str_type = H5Tcopy(H5T_FORTRAN_S1))<0)
+ if((str_type = H5Tcopy(H5T_FORTRAN_S1)) < 0)
goto out;
- if(H5Tset_cset(str_type, cset)<0)
+ if(H5Tset_cset(str_type, cset) < 0)
goto out;
- if(H5Tset_size(str_type, size)<0)
+ if(H5Tset_size(str_type, size) < 0)
goto out;
- if(H5Tset_strpad(str_type, str_pad)<0)
+ if(H5Tset_strpad(str_type, str_pad) < 0)
goto out;
/* Are the two types equal? */
@@ -2311,13 +2307,13 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
}
/* Change the endianness and see if they're equal. */
- if((order = H5Tget_order(tmp_type))<0)
+ if((order = H5Tget_order(tmp_type)) < 0)
goto out;
if(order==H5T_ORDER_LE) {
- if(H5Tset_order(str_type, H5T_ORDER_LE)<0)
+ if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
goto out;
} else if(order==H5T_ORDER_BE) {
- if(H5Tset_order(str_type, H5T_ORDER_BE)<0)
+ if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
goto out;
}
@@ -2371,19 +2367,19 @@ next:
indent += COL;
indentation(indent + COL, *dt_str);
- if((super = H5Tget_super(dtype))<0)
+ if((super = H5Tget_super(dtype)) < 0)
goto out;
- if(H5LTdtype_to_text(super, NULL, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
- if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
strcat(*dt_str, stmp);
free(stmp);
strcat(*dt_str, ";\n");
H5Tclose(super);
- if(print_enum(dtype, *dt_str, indent)<0)
+ if(print_enum(dtype, *dt_str, indent) < 0)
goto out;
/* Print closing */
@@ -2404,12 +2400,12 @@ next:
indent += COL;
indentation(indent + COL, *dt_str);
- if((super = H5Tget_super(dtype))<0)
+ if((super = H5Tget_super(dtype)) < 0)
goto out;
- if(H5LTdtype_to_text(super, NULL, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
- if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
strcat(*dt_str, stmp);
free(stmp);
@@ -2437,7 +2433,7 @@ next:
indentation(indent + COL, *dt_str);
/* Get array information */
- if((ndims = H5Tget_array_ndims(dtype))<0)
+ if((ndims = H5Tget_array_ndims(dtype)) < 0)
goto out;
if(H5Tget_array_dims(dtype, dims, NULL) < 0)
goto out;
@@ -2449,12 +2445,12 @@ next:
}
strcat(*dt_str, " ");
- if((super = H5Tget_super(dtype))<0)
+ if((super = H5Tget_super(dtype)) < 0)
goto out;
- if(H5LTdtype_to_text(super, NULL, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
- if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
+ if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
strcat(*dt_str, stmp);
free(stmp);
@@ -2478,7 +2474,7 @@ next:
char* mtmp;
int nmembs;
- if((nmembs = H5Tget_nmembers(dtype))<0)
+ if((nmembs = H5Tget_nmembers(dtype)) < 0)
goto out;
sprintf(*dt_str, "H5T_COMPOUND {\n");
@@ -2487,20 +2483,20 @@ next:
for (i = 0; i < nmembs; i++) {
if((mname = H5Tget_member_name(dtype, (unsigned)i))==NULL)
goto out;
- if((mtype = H5Tget_member_type(dtype, (unsigned)i))<0)
+ if((mtype = H5Tget_member_type(dtype, (unsigned)i)) < 0)
goto out;
moffset = H5Tget_member_offset(dtype, (unsigned)i);
indentation(indent + COL, *dt_str);
- if((mclass = H5Tget_class(mtype))<0)
+ if((mclass = H5Tget_class(mtype)) < 0)
goto out;
if (H5T_COMPOUND == mclass)
indent += COL;
- if(H5LTdtype_to_text(mtype, NULL, lang, &mlen)<0)
+ if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0)
goto out;
mtmp = (char*)calloc(mlen, sizeof(char));
- if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen)<0)
+ if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0)
goto out;
strcat(*dt_str, mtmp);
free(mtmp);
@@ -3113,18 +3109,18 @@ herr_t H5LT_set_attribute_string(hid_t dset_id,
* create the attribute type
*-------------------------------------------------------------------------
*/
- if ((tid = H5Tcopy(H5T_C_S1))<0)
+ if ((tid = H5Tcopy(H5T_C_S1)) < 0)
return FAIL;
size = strlen(buf) + 1; /* extra null term */
- if (H5Tset_size(tid,(size_t)size)<0)
+ if (H5Tset_size(tid,(size_t)size) < 0)
goto out;
- if (H5Tset_strpad(tid,H5T_STR_NULLTERM)<0)
+ if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0)
goto out;
- if ((sid = H5Screate(H5S_SCALAR))<0)
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
goto out;
@@ -3132,19 +3128,19 @@ herr_t H5LT_set_attribute_string(hid_t dset_id,
* create and write the attribute
*-------------------------------------------------------------------------
*/
- if ((aid = H5Acreate(dset_id,name,tid,sid,H5P_DEFAULT))<0)
+ if((aid = H5Acreate2(dset_id, ".", name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Awrite(aid,tid,buf)<0)
+ if(H5Awrite(aid, tid, buf) < 0)
goto out;
- if (H5Aclose(aid)<0)
+ if(H5Aclose(aid) < 0)
goto out;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Tclose(tid)<0)
+ if(H5Tclose(tid) < 0)
goto out;
return SUCCEED;
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 23bf569..3221cb4 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -102,29 +102,29 @@ herr_t H5TBmake_table( const char *table_title,
dims_chunk[0] = chunk_size;
/* Create the memory data type. */
- if ((mem_type_id = H5Tcreate (H5T_COMPOUND, type_size )) < 0 )
+ if ((mem_type_id = H5Tcreate (H5T_COMPOUND, type_size )) < 0)
return -1;
/* Insert fields. */
for ( i = 0; i < nfields; i++)
{
- if ( H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0 )
+ if(H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0)
return -1;
}
/* Create a simple data space with unlimited size */
- if ( (sid = H5Screate_simple( 1, dims, maxdims )) < 0 )
+ if((sid = H5Screate_simple( 1, dims, maxdims )) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
plist_id = H5Pcreate (H5P_DATASET_CREATE);
- if ( H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0 )
+ if(H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0)
return -1;
/* Set the fill value using a struct as the data type. */
- if ( fill_data )
+ if(fill_data )
{
- if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 )
+ if(H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0)
return -1;
}
@@ -133,34 +133,34 @@ herr_t H5TBmake_table( const char *table_title,
GZIP compression with the compression effort set to 6.
Note that compression can be used only when dataset is chunked.
*/
- if ( compress )
+ if(compress )
{
- if ( H5Pset_deflate( plist_id, 6) < 0 )
+ if(H5Pset_deflate( plist_id, 6) < 0)
return -1;
}
/* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0 )
+ if((did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0)
goto out;
/* Only write if there is something to write */
- if ( data )
+ if(data )
{
/* Write data to the dataset. */
- if ( H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
+ if(H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0)
goto out;
}
/* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
goto out;
/* End access to the property list */
- if ( H5Pclose( plist_id ) < 0 )
+ if(H5Pclose( plist_id ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -169,15 +169,15 @@ herr_t H5TBmake_table( const char *table_title,
*/
/* Attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0)
goto out;
/* Attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0)
goto out;
/* Attach the TITLE attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0)
goto out;
/* Attach the FIELD_ name attribute */
@@ -194,7 +194,7 @@ herr_t H5TBmake_table( const char *table_title,
strcat( attr_name, aux );
/* Attach the attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0)
goto out;
free( member_name );
@@ -202,40 +202,40 @@ herr_t H5TBmake_table( const char *table_title,
}
/* Attach the FIELD_ fill value attribute */
- if ( fill_data )
+ if(fill_data )
{
tmp_buf = fill_data;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
- if (( sid = H5Screate(H5S_SCALAR)) < 0 )
+ if (( sid = H5Screate(H5S_SCALAR)) < 0)
goto out;
for ( i = 0; i < nfields; i++)
{
/* Get the member name */
- member_name = H5Tget_member_name( mem_type_id, (unsigned) i );
+ member_name = H5Tget_member_name(mem_type_id, (unsigned)i);
- strcpy( attr_name, "FIELD_" );
- sprintf( aux, "%d", (int)i );
- strcat( attr_name, aux );
- sprintf( aux, "%s", "_FILL" );
- strcat( attr_name, aux );
+ strcpy(attr_name, "FIELD_");
+ sprintf(aux, "%d", (int)i);
+ strcat(attr_name, aux);
+ sprintf(aux, "%s", "_FILL");
+ strcat(attr_name, aux);
- if ( (attr_id = H5Acreate( did, attr_name, field_types[i], sid, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(did, ".", attr_name, field_types[i], sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, field_types[i], tmp_buf+field_offset[i] ) < 0 )
+ if(H5Awrite(attr_id, field_types[i], tmp_buf+field_offset[i]) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
- free( member_name );
+ free(member_name);
}
/* Close the dataset. */
@@ -246,7 +246,7 @@ herr_t H5TBmake_table( const char *table_title,
}
/* Release the datatype. */
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
return -1;
return 0;
@@ -309,15 +309,15 @@ herr_t H5TBappend_records( hid_t loc_id,
hsize_t nfields;
/* Get the original number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0)
return -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatypes */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid))<0)
@@ -328,15 +328,15 @@ herr_t H5TBappend_records( hid_t loc_id,
goto out;
/* Release the datatype. */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
return -1;
/* Release the datatype. */
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
goto out;
@@ -396,59 +396,59 @@ herr_t H5TBwrite_records( hid_t loc_id,
hid_t mem_type_id=-1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid))<0)
goto out;
/* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* Get records */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( sid, dims, NULL) < 0)
goto out;
- if ( start + nrecords > dims[0] )
+ if(start + nrecords > dims[0] )
goto out;
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
+ if(H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0)
goto out;
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
@@ -518,19 +518,19 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
return -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Get the number of fields */
- if ( ( nfields = H5Tget_nmembers( tid )) < 0 )
+ if(( nfields = H5Tget_nmembers( tid )) < 0)
goto out;
/* Create a write id */
- if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 )
+ if(( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0)
goto out;
j = 0;
@@ -541,11 +541,11 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
/* Get the member name */
member_name = H5Tget_member_name( tid, (unsigned)i );
- if ( H5TB_find_field( member_name, field_names ) > 0 )
+ if(H5TB_find_field( member_name, field_names ) > 0 )
{
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( tid,(unsigned) i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( tid,(unsigned) i )) < 0)
goto out;
/* Convert to native type */
@@ -562,24 +562,24 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
}
/* The field in the file is found by its name */
- if ( field_offset )
+ if(field_offset )
{
- if ( H5Tinsert( write_type_id, member_name, field_offset[j], nmtype_id ) < 0 )
+ if(H5Tinsert( write_type_id, member_name, field_offset[j], nmtype_id ) < 0)
goto out;
}
/* Only one field */
else
{
- if ( H5Tinsert( write_type_id, member_name, (size_t)0, nmtype_id ) < 0 )
+ if(H5Tinsert( write_type_id, member_name, (size_t)0, nmtype_id ) < 0)
goto out;
}
j++;
/* Close */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
- if ( H5Tclose( nmtype_id ) < 0 )
+ if(H5Tclose( nmtype_id ) < 0)
goto out;
}
@@ -588,33 +588,33 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
}
/* Get the dataspace handle */
- if ( (file_space_id = H5Dget_space( did )) < 0 )
+ if((file_space_id = H5Dget_space( did )) < 0)
goto out;
- if ( (mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0 )
+ if((mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0)
goto out;
/* Define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Write */
- if ( H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0 )
+ if(H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0)
goto out;
/* close */
- if ( H5Tclose( write_type_id ) )
+ if(H5Tclose( write_type_id ) )
goto out;
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
return -1;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
- if ( H5Pclose( PRESERVE ) < 0 )
+ if(H5Pclose( PRESERVE ) < 0)
return -1;
- if ( H5Sclose( file_space_id ) < 0 )
+ if(H5Sclose( file_space_id ) < 0)
return -1;
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
return -1;
return 0;
@@ -689,15 +689,15 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
return -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Create a write id */
- if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 )
+ if(( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0)
goto out;
/* Iterate tru the members */
@@ -710,7 +710,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
member_name = H5Tget_member_name( tid, (unsigned) j );
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0 )
+ if(( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0)
goto out;
/* Convert to native type */
@@ -726,21 +726,21 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
}
/* The field in the file is found by its name */
- if ( field_offset )
+ if(field_offset )
{
- if ( H5Tinsert( write_type_id, member_name, field_offset[ i ], nmtype_id ) < 0 )
+ if(H5Tinsert( write_type_id, member_name, field_offset[ i ], nmtype_id ) < 0)
goto out;
}
/* Only one field */
else
{
- if ( H5Tinsert( write_type_id, member_name, (size_t)0, nmtype_id ) < 0 )
+ if(H5Tinsert( write_type_id, member_name, (size_t)0, nmtype_id ) < 0)
goto out;
}
/* Close */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
- if ( H5Tclose( nmtype_id ) < 0 )
+ if(H5Tclose( nmtype_id ) < 0)
goto out;
free( member_name );
@@ -748,33 +748,33 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
}
/* Get the dataspace handles */
- if ( (file_space_id = H5Dget_space( did )) < 0 )
+ if((file_space_id = H5Dget_space( did )) < 0)
goto out;
- if ( (mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0 )
+ if((mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0)
goto out;
/* Define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Write */
- if ( H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0 )
+ if(H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0)
goto out;
/* close */
- if ( H5Tclose( write_type_id ) )
+ if(H5Tclose( write_type_id ) )
goto out;
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
return -1;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
- if ( H5Pclose( PRESERVE ) < 0 )
+ if(H5Pclose( PRESERVE ) < 0)
return -1;
- if ( H5Sclose( file_space_id ) < 0 )
+ if(H5Sclose( file_space_id ) < 0)
return -1;
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
return -1;
return 0;
@@ -838,11 +838,11 @@ herr_t H5TBread_table( hid_t loc_id,
return -1;
/* get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* get dimensions */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( sid, dims, NULL) < 0)
goto out;
/* get the datatypes */
@@ -853,17 +853,17 @@ herr_t H5TBread_table( hid_t loc_id,
goto out;
/* read */
- if ( H5Dread( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, dst_buf) < 0 )
+ if(H5Dread( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, dst_buf) < 0)
goto out;
/* close */
- if ( H5Tclose( ftype_id ) < 0 )
+ if(H5Tclose( ftype_id ) < 0)
goto out;
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
goto out;
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -923,15 +923,15 @@ herr_t H5TBread_records( hid_t loc_id,
hsize_t nfields;
/* get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords_orig ) < 0)
return -1;
/* open the dataset */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* get the datatypes */
- if ( (ftype_id = H5Dget_type( did )) < 0 )
+ if((ftype_id = H5Dget_type( did )) < 0)
goto out;
if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id))<0)
@@ -942,41 +942,41 @@ herr_t H5TBread_records( hid_t loc_id,
goto out;
/* get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* get records */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( sid, dims, NULL) < 0)
goto out;
- if ( start + nrecords > dims[0] )
+ if(start + nrecords > dims[0] )
goto out;
/* define a hyperslab in the dataset of the size of the records */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
/* read */
- if ( H5Dread( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
+ if(H5Dread( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0)
goto out;
/* close */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
- if ( H5Tclose( ftype_id ) < 0 )
+ if(H5Tclose( ftype_id ) < 0)
return -1;
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
return -1;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -1043,19 +1043,19 @@ herr_t H5TBread_fields_name( hid_t loc_id,
hssize_t i, j;
/* open the dataset */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* get the datatype */
- if ( (ftype_id = H5Dget_type( did )) < 0 )
+ if((ftype_id = H5Dget_type( did )) < 0)
goto out;
/* get the number of fields */
- if ( ( nfields = H5Tget_nmembers( ftype_id )) < 0 )
+ if(( nfields = H5Tget_nmembers( ftype_id )) < 0)
goto out;
/* create a memory read id */
- if ( ( mem_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 )
+ if(( mem_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0)
goto out;
/* iterate tru the members */
@@ -1064,10 +1064,10 @@ herr_t H5TBread_fields_name( hid_t loc_id,
/* get the member name */
member_name = H5Tget_member_name( ftype_id, (unsigned)i );
- if ( H5TB_find_field( member_name, field_names ) > 0 )
+ if(H5TB_find_field( member_name, field_names ) > 0 )
{
/* get the member type */
- if ( ( mtype_id = H5Tget_member_type( ftype_id, (unsigned) i )) < 0 )
+ if(( mtype_id = H5Tget_member_type( ftype_id, (unsigned) i )) < 0)
goto out;
/* convert to native type */
@@ -1082,21 +1082,21 @@ herr_t H5TBread_fields_name( hid_t loc_id,
goto out;
}
/* the field in the file is found by its name */
- if ( field_offset )
+ if(field_offset )
{
- if ( H5Tinsert( mem_type_id, member_name, field_offset[j], nmtype_id ) < 0 )
+ if(H5Tinsert( mem_type_id, member_name, field_offset[j], nmtype_id ) < 0)
goto out;
}
else
{
- if ( H5Tinsert( mem_type_id, member_name, (size_t)0, nmtype_id ) < 0 )
+ if(H5Tinsert( mem_type_id, member_name, (size_t)0, nmtype_id ) < 0)
goto out;
}
/* close */
- if ( H5Tclose( mtype_id ) < 0 )
+ if(H5Tclose( mtype_id ) < 0)
goto out;
- if ( H5Tclose( nmtype_id ) < 0 )
+ if(H5Tclose( nmtype_id ) < 0)
goto out;
j++;
}
@@ -1104,34 +1104,34 @@ herr_t H5TBread_fields_name( hid_t loc_id,
}
/* get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
/* read */
- if ( H5Dread( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
+ if(H5Dread( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0)
goto out;
/* close */
- if ( H5Tclose( mem_type_id ) )
+ if(H5Tclose( mem_type_id ) )
goto out;
- if ( H5Tclose( ftype_id ) < 0 )
+ if(H5Tclose( ftype_id ) < 0)
return -1;
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -1198,15 +1198,15 @@ herr_t H5TBread_fields_index( hid_t loc_id,
hsize_t i, j;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Create a read id */
- if ( ( read_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 )
+ if(( read_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0)
goto out;
/* Iterate tru the members */
@@ -1218,11 +1218,11 @@ herr_t H5TBread_fields_index( hid_t loc_id,
member_name = H5Tget_member_name( tid, (unsigned) j );
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0 )
+ if(( member_type_id = H5Tget_member_type( tid, (unsigned) j )) < 0)
goto out;
/* Get the member size */
- if ( H5Tget_size( member_type_id ) == 0 )
+ if(H5Tget_size( member_type_id ) == 0 )
goto out;
/* Convert to native type */
@@ -1238,63 +1238,63 @@ herr_t H5TBread_fields_index( hid_t loc_id,
}
/* The field in the file is found by its name */
- if ( field_offset )
+ if(field_offset )
{
- if ( H5Tinsert( read_type_id, member_name, field_offset[i], nmtype_id ) < 0 )
+ if(H5Tinsert( read_type_id, member_name, field_offset[i], nmtype_id ) < 0)
goto out;
}
else
{
- if ( H5Tinsert( read_type_id, member_name, (size_t)0, nmtype_id ) < 0 )
+ if(H5Tinsert( read_type_id, member_name, (size_t)0, nmtype_id ) < 0)
goto out;
}
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
- if ( H5Tclose( nmtype_id ) < 0 )
+ if(H5Tclose( nmtype_id ) < 0)
goto out;
free( member_name );
}
/* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* Define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
/* Read */
- if ( H5Dread( did, read_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
+ if(H5Dread( did, read_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* End access to the read id */
- if ( H5Tclose( read_type_id ) )
+ if(H5Tclose( read_type_id ) )
goto out;
/* Release the datatype. */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -1370,17 +1370,17 @@ herr_t H5TBdelete_record( hid_t loc_id,
*/
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0)
return -1;
src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t));
src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t));
- if ( src_offset == NULL )
+ if(src_offset == NULL )
return -1;
/* Get field info */
- if ( H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0 )
+ if(H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -1392,12 +1392,12 @@ herr_t H5TBdelete_record( hid_t loc_id,
read_nrecords = ntotal_records - read_start;
tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, src_size );
- if ( tmp_buf == NULL )
+ if(tmp_buf == NULL )
return -1;
/* Read the records after the deleted one(s) */
- if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size,
- src_offset, src_sizes, tmp_buf ) < 0 )
+ if(H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size,
+ src_offset, src_sizes, tmp_buf ) < 0)
return -1;
@@ -1407,41 +1407,41 @@ herr_t H5TBdelete_record( hid_t loc_id,
*/
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start;
count[0] = read_nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dwrite( did, tid, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dwrite( did, tid, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
goto out;
@@ -1451,12 +1451,12 @@ herr_t H5TBdelete_record( hid_t loc_id,
*/
#if defined (SHRINK)
dims[0] = ntotal_records - nrecords;
- if ( H5Dset_extent( did, dims ) < 0 )
+ if(H5Dset_extent( did, dims ) < 0)
goto out;
#endif
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
free( tmp_buf );
@@ -1534,15 +1534,15 @@ herr_t H5TBinsert_record( hid_t loc_id,
*/
/* Get the dimensions */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0)
return -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Create the memory data type. */
@@ -1553,14 +1553,14 @@ herr_t H5TBinsert_record( hid_t loc_id,
tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size );
/* Read the records after the inserted one(s) */
- if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset,
- field_sizes, tmp_buf ) < 0 )
+ if(H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset,
+ field_sizes, tmp_buf ) < 0)
return -1;
/* Extend the dataset */
dims[0] = ntotal_records + nrecords;
- if ( H5Dextend ( did, dims ) < 0 )
+ if(H5Dextend ( did, dims ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1570,26 +1570,26 @@ herr_t H5TBinsert_record( hid_t loc_id,
/* Create a simple memory data space */
mem_dims[0]=nrecords;
- if ( (mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0)
return -1;
/* Get the file data space */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
return -1;
/* Define a hyperslab in the dataset to write the new data */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
- if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
+ if(H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1599,39 +1599,39 @@ herr_t H5TBinsert_record( hid_t loc_id,
/* Create a simple memory data space */
mem_dims[0]=read_nrecords;
- if ( (mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0)
return -1;
/* Get the file data space */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
return -1;
/* Define a hyperslab in the dataset to write the new data */
offset[0] = start + nrecords;
count[0] = read_nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
- if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
return -1;
/* Release the datatype. */
- if ( H5Tclose( mem_type_id ) < 0 )
+ if(H5Tclose( mem_type_id ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
free( tmp_buf );
@@ -1700,17 +1700,17 @@ herr_t H5TBadd_records_from( hid_t loc_id,
*/
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name1, &nfields, &ntotal_records ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name1, &nfields, &ntotal_records ) < 0)
return -1;
src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t));
src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t));
- if ( src_offset == NULL )
+ if(src_offset == NULL )
return -1;
/* Get field info */
- if ( H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 )
+ if(H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -1719,19 +1719,19 @@ herr_t H5TBadd_records_from( hid_t loc_id,
*/
/* Open the 1st dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id, dset_name1 )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id, dset_name1 )) < 0)
return -1;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Get the dataspace handle */
- if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 )
+ if((space_id1 = H5Dget_space( dataset_id1 )) < 0)
goto out;
/* Get the size of the datatype */
- if ( ( type_size1 = H5Tget_size( type_id1 )) == 0 )
+ if(( type_size1 = H5Tget_size( type_id1 )) == 0 )
goto out;
tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1 );
@@ -1739,22 +1739,22 @@ herr_t H5TBadd_records_from( hid_t loc_id,
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start1;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dread( dataset_id1, type_id1, mem_space_id1, space_id1, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dread( dataset_id1, type_id1, mem_space_id1, space_id1, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
/*-------------------------------------------------------------------------
* Add to the second table
*-------------------------------------------------------------------------
*/
- if ( H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0 )
+ if(H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1763,19 +1763,19 @@ herr_t H5TBadd_records_from( hid_t loc_id,
*/
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id1 ) < 0 )
+ if(H5Sclose( mem_space_id1 ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose( space_id1 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
return -1;
free( tmp_buf );
@@ -1870,18 +1870,18 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0)
return -1;
src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t));
src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t));
- if ( src_offset == NULL )
+ if(src_offset == NULL )
return -1;
/* Get field info */
- if ( H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 )
+ if(H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -1890,23 +1890,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Open the 1st dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id1, dset_name1 )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id1, dset_name1 )) < 0)
goto out;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Get the dataspace handle */
- if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 )
+ if((space_id1 = H5Dget_space( dataset_id1 )) < 0)
goto out;
/* Get creation properties list */
- if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 )
+ if((plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0)
goto out;
/* Get the dimensions */
- if ( H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -1915,11 +1915,11 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Clone the property list */
- if ( ( plist_id3 = H5Pcopy( plist_id1 )) < 0 )
+ if(( plist_id3 = H5Pcopy( plist_id1 )) < 0)
goto out;
/* Clone the type id */
- if ( ( type_id3 = H5Tcopy( type_id1 )) < 0 )
+ if(( type_id3 = H5Tcopy( type_id1 )) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1930,18 +1930,18 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
dims[0] = 0;
/* Create a simple data space with unlimited size */
- if ( (space_id3 = H5Screate_simple( 1, dims, maxdims )) < 0 )
+ if((space_id3 = H5Screate_simple( 1, dims, maxdims )) < 0)
return -1;
/* Create the dataset */
- if ( (dataset_id3 = H5Dcreate( loc_id1, dset_name3, type_id3, space_id3, plist_id3 )) < 0 )
+ if((dataset_id3 = H5Dcreate( loc_id1, dset_name3, type_id3, space_id3, plist_id3 )) < 0)
goto out;
/*-------------------------------------------------------------------------
* Attach the conforming table attributes
*-------------------------------------------------------------------------
*/
- if ( H5TB_attach_attributes( "Merge table", loc_id1, dset_name3, nfields, type_id3 ) < 0 )
+ if(H5TB_attach_attributes( "Merge table", loc_id1, dset_name3, nfields, type_id3 ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1961,43 +1961,43 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
* Attach the fill attributes from previous table
*-------------------------------------------------------------------------
*/
- if ( has_fill == 1 )
+ if(has_fill == 1 )
{
- if (( sid = H5Screate(H5S_SCALAR)) < 0 )
+ if (( sid = H5Screate(H5S_SCALAR)) < 0)
goto out;
for ( i = 0; i < nfields; i++)
{
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id3, (unsigned) i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id3, (unsigned) i )) < 0)
goto out;
/* Get the member offset */
- member_offset = H5Tget_member_offset( type_id3, (unsigned) i );
+ member_offset = H5Tget_member_offset(type_id3, (unsigned)i);
- strcpy( attr_name, "FIELD_" );
- sprintf( aux, "%d", (int) i );
- strcat( attr_name, aux );
- sprintf( aux, "%s", "_FILL" );
- strcat( attr_name, aux );
+ strcpy(attr_name, "FIELD_");
+ sprintf(aux, "%d", (int)i);
+ strcat(attr_name, aux);
+ sprintf(aux, "%s", "_FILL");
+ strcat(attr_name, aux);
- if ( (attr_id = H5Acreate( dataset_id3, attr_name, member_type_id, sid, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(dataset_id3, ".", attr_name, member_type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 )
+ if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose(member_type_id) < 0)
goto out;
}
/* Close data space. */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
}
@@ -2011,15 +2011,15 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = 0;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dread( dataset_id1, type_id1, mem_space_id, space_id1, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dread( dataset_id1, type_id1, mem_space_id, space_id1, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2028,7 +2028,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Append the records to the new table */
- if ( H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0 )
+ if(H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2037,23 +2037,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose( space_id1 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
goto out;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id1 ) < 0 )
+ if(H5Pclose( plist_id1 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
goto out;
/* Release resources. */
@@ -2065,23 +2065,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Open the dataset. */
- if ( (dataset_id2 = H5Dopen( loc_id2, dset_name2 )) < 0 )
+ if((dataset_id2 = H5Dopen( loc_id2, dset_name2 )) < 0)
goto out;
/* Get the datatype */
- if ( (type_id2 = H5Dget_type( dataset_id2 )) < 0 )
+ if((type_id2 = H5Dget_type( dataset_id2 )) < 0)
goto out;
/* Get the dataspace handle */
- if ( (space_id2 = H5Dget_space( dataset_id2 )) < 0 )
+ if((space_id2 = H5Dget_space( dataset_id2 )) < 0)
goto out;
/* Get the property list handle */
- if ( (plist_id2 = H5Dget_create_plist( dataset_id2 )) < 0 )
+ if((plist_id2 = H5Dget_create_plist( dataset_id2 )) < 0)
goto out;
/* Get the dimensions */
- if ( H5TBget_table_info ( loc_id2, dset_name2, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id2, dset_name2, &nfields, &nrecords ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2094,15 +2094,15 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = 0;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id2, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( space_id2, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dread( dataset_id2, type_id2, mem_space_id, space_id2, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dread( dataset_id2, type_id2, mem_space_id, space_id2, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
@@ -2112,7 +2112,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* append the records to the new table */
- if ( H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0 )
+ if(H5TBappend_records( loc_id1, dset_name3, nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2121,23 +2121,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id2 ) < 0 )
+ if(H5Sclose( space_id2 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id2 ) < 0 )
+ if(H5Tclose( type_id2 ) < 0)
return -1;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id2 ) < 0 )
+ if(H5Pclose( plist_id2 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id2 ) < 0 )
+ if(H5Dclose( dataset_id2 ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2146,19 +2146,19 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id3 ) < 0 )
+ if(H5Sclose( space_id3 ) < 0)
return -1;
/* Release the datatype. */
- if ( H5Tclose( type_id3 ) < 0 )
+ if(H5Tclose( type_id3 ) < 0)
return -1;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id3 ) < 0 )
+ if(H5Pclose( plist_id3 ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( dataset_id3 ) < 0 )
+ if(H5Dclose( dataset_id3 ) < 0)
return -1;
/* Release resources. */
@@ -2246,7 +2246,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
hsize_t i;
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2255,27 +2255,27 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Open the dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get creation properties list */
- if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 )
+ if((plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0)
goto out;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Get the size of the datatype */
- if ( ( total_size = H5Tget_size( type_id1 )) == 0 )
+ if(( total_size = H5Tget_size( type_id1 )) == 0 )
goto out;
/* Get the dataspace handle */
- if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 )
+ if((space_id1 = H5Dget_space( dataset_id1 )) < 0)
goto out;
/* Get dimension */
- if ( H5Sget_simple_extent_dims( space_id1, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( space_id1, dims, NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2284,14 +2284,14 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Get the table title */
- if ( (H5TBAget_title( dataset_id1, table_title )) < 0 )
+ if((H5TBAget_title( dataset_id1, table_title )) < 0)
goto out;
/* alloc fill value attribute buffer */
tmp_fill_buf = (unsigned char *)malloc(total_size );
/* Get the fill value attributes */
- if ( (H5TBAget_fill( loc_id, dset_name, dataset_id1, tmp_fill_buf )) < 0 )
+ if((H5TBAget_fill( loc_id, dset_name, dataset_id1, tmp_fill_buf )) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2303,7 +2303,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
member_size = H5Tget_size( field_type );
/* Create the data type. */
- if (( type_id2 = H5Tcreate (H5T_COMPOUND,(size_t)(total_size + member_size) )) < 0 )
+ if (( type_id2 = H5Tcreate (H5T_COMPOUND,(size_t)(total_size + member_size) )) < 0)
goto out;
curr_offset = 0;
@@ -2314,17 +2314,17 @@ herr_t H5TBinsert_field( hid_t loc_id,
{
idx = i;
- if ( inserted )
+ if(inserted )
idx = i - 1;
- if ( i == position )
+ if(i == position )
{
/* Get the new member size */
new_member_size = H5Tget_size( field_type );
/* Insert the new field type */
- if ( H5Tinsert( type_id2, field_name, curr_offset, field_type ) < 0 )
+ if(H5Tinsert( type_id2, field_name, curr_offset, field_type ) < 0)
goto out;
curr_offset += new_member_size;
@@ -2339,14 +2339,14 @@ herr_t H5TBinsert_field( hid_t loc_id,
member_name = H5Tget_member_name( type_id1, (unsigned)idx );
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1,(unsigned)idx )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1,(unsigned)idx )) < 0)
goto out;
/* Get the member size */
member_size = H5Tget_size( member_type_id );
/* Insert it into the new type */
- if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 )
+ if(H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0)
goto out;
curr_offset += member_size;
@@ -2354,7 +2354,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
free( member_name );
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
@@ -2366,20 +2366,20 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if ( H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0 )
+ if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
- if ( ( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0 )
+ if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
- if ( H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0 )
+ if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
return -1;
/* Create the dataset. */
- if ( ( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0 )
+ if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
goto out;
@@ -2393,15 +2393,15 @@ herr_t H5TBinsert_field( hid_t loc_id,
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = 0;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ( (mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ( H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
@@ -2411,7 +2411,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Write */
- if ( H5Dwrite( dataset_id2, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dwrite( dataset_id2, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
@@ -2422,11 +2422,11 @@ herr_t H5TBinsert_field( hid_t loc_id,
/* Create a write id */
- if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0 )
+ if(( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0)
goto out;
/* The field in the file is found by its name */
- if ( H5Tinsert( write_type_id, field_name, (size_t)0, field_type ) < 0 )
+ if(H5Tinsert( write_type_id, field_name, (size_t)0, field_type ) < 0)
goto out;
/* Create xfer properties to preserve initialized data */
@@ -2436,24 +2436,24 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* Only write if there is something to write */
- if ( data )
+ if(data )
{
/* Create a memory dataspace handle */
- if ( (mem_space_id2 = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if((mem_space_id2 = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
/* Write */
- if ( H5Dwrite( dataset_id2, write_type_id, mem_space_id2, space_id2, PRESERVE, data ) < 0 )
+ if(H5Dwrite( dataset_id2, write_type_id, mem_space_id2, space_id2, PRESERVE, data ) < 0)
goto out;
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id2 ) < 0 )
+ if(H5Sclose( mem_space_id2 ) < 0)
goto out;
}
/* End access to the property list */
- if ( H5Pclose( PRESERVE ) < 0 )
+ if(H5Pclose( PRESERVE ) < 0)
goto out;
@@ -2464,23 +2464,23 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id1 ) < 0 )
+ if(H5Sclose( mem_space_id1 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
goto out;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id1 ) < 0 )
+ if(H5Pclose( plist_id1 ) < 0)
goto out;
/* Terminate access to the data space */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose( space_id1 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
goto out;
@@ -2490,25 +2490,25 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id2 ) < 0 )
+ if(H5Sclose( space_id2 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id2 ) < 0 )
+ if(H5Tclose( type_id2 ) < 0)
return -1;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id2 ) < 0 )
+ if(H5Pclose( plist_id2 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id2 ) < 0 )
+ if(H5Dclose( dataset_id2 ) < 0)
return -1;
/*-------------------------------------------------------------------------
* Delete 1st table
*-------------------------------------------------------------------------
*/
- if ( H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0 )
+ if(H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2516,7 +2516,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- if ( H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0 )
+ if(H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2525,54 +2525,54 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
/* Open the dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Set the attributes */
- if ( H5TB_attach_attributes( table_title, loc_id, dset_name,(hsize_t) nfields, type_id1 ) < 0 )
+ if(H5TB_attach_attributes( table_title, loc_id, dset_name,(hsize_t) nfields, type_id1 ) < 0)
return -1;
/*-------------------------------------------------------------------------
* Attach the fill attributes from previous table
*-------------------------------------------------------------------------
*/
- if (( space_id1 = H5Screate(H5S_SCALAR)) < 0 )
+ if (( space_id1 = H5Screate(H5S_SCALAR)) < 0)
goto out;
for ( i = 0; i < nfields-1; i++)
{
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned) i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1, (unsigned) i )) < 0)
goto out;
/* Get the member offset */
- member_offset = H5Tget_member_offset( type_id1, (unsigned) i );
+ member_offset = H5Tget_member_offset(type_id1, (unsigned)i);
- strcpy( attr_name, "FIELD_" );
- sprintf( aux, "%d", (int)i );
- strcat( attr_name, aux );
- sprintf( aux, "%s", "_FILL" );
- strcat( attr_name, aux );
+ strcpy(attr_name, "FIELD_");
+ sprintf(aux, "%d", (int)i);
+ strcat(attr_name, aux);
+ sprintf(aux, "%s", "_FILL");
+ strcat(attr_name, aux);
- if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 )
+ if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose(member_type_id) < 0)
goto out;
}
@@ -2580,43 +2580,43 @@ herr_t H5TBinsert_field( hid_t loc_id,
* Attach the fill attribute from the new field, if present
*-------------------------------------------------------------------------
*/
- if ( fill_data )
+ if(fill_data)
{
- strcpy( attr_name, "FIELD_" );
- sprintf( aux, "%d",(int)( nfields-1) );
- strcat( attr_name, aux );
- sprintf( aux, "%s", "_FILL" );
- strcat( attr_name, aux );
+ strcpy(attr_name, "FIELD_");
+ sprintf(aux, "%d",(int)(nfields - 1));
+ strcat(attr_name, aux);
+ sprintf(aux, "%s", "_FILL");
+ strcat(attr_name, aux);
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)nfields-1 )) < 0 )
+ if((member_type_id = H5Tget_member_type(type_id1, (unsigned)nfields - 1)) < 0)
goto out;
- if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, member_type_id, fill_data ) < 0 )
+ if(H5Awrite(attr_id, member_type_id, fill_data) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose(member_type_id) < 0)
goto out;
}
/* Close data space. */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose( space_id1 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
goto out;
/* Release resources. */
@@ -2693,7 +2693,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
int has_fill=0;
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2702,26 +2702,26 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Open the dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get creation properties list */
- if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 )
+ if((plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0)
goto out;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Get the size of the datatype */
type_size1 = H5Tget_size( type_id1 );
/* Get the dataspace handle */
- if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 )
+ if((space_id1 = H5Dget_space( dataset_id1 )) < 0)
goto out;
/* Get dimension */
- if ( H5Sget_simple_extent_dims( space_id1, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( space_id1, dims, NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2737,17 +2737,17 @@ herr_t H5TBdelete_field( hid_t loc_id,
member_name = H5Tget_member_name( type_id1,(unsigned) i );
/* We want to find the field to delete */
- if ( H5TB_find_field( member_name, field_name ) > 0 )
+ if(H5TB_find_field( member_name, field_name ) > 0 )
{
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1,(unsigned) i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1,(unsigned) i )) < 0)
goto out;
/* Get the member size */
delete_member_size = H5Tget_size( member_type_id );
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
free( member_name );
@@ -2761,7 +2761,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
} /* i */
/* No field to delete was found */
- if ( delete_member_size == 0 )
+ if(delete_member_size == 0 )
goto out;
/*-------------------------------------------------------------------------
@@ -2772,7 +2772,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
type_size2 = type_size1 - delete_member_size;
/* Create the data type. */
- if (( type_id2 = H5Tcreate (H5T_COMPOUND, type_size2 )) < 0 )
+ if (( type_id2 = H5Tcreate (H5T_COMPOUND, type_size2 )) < 0)
goto out;
curr_offset = 0;
@@ -2786,7 +2786,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Get the table title */
- if ( (H5TBAget_title( dataset_id1, table_title )) < 0 )
+ if((H5TBAget_title( dataset_id1, table_title )) < 0)
goto out;
/* Insert the old fields except the one to delete */
@@ -2797,21 +2797,21 @@ herr_t H5TBdelete_field( hid_t loc_id,
member_name = H5Tget_member_name( type_id1, (unsigned) i );
/* We want to skip the field to delete */
- if ( H5TB_find_field( member_name, field_name ) > 0 )
+ if(H5TB_find_field( member_name, field_name ) > 0 )
{
free( member_name );
continue;
}
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0)
goto out;
/* Get the member size */
member_size = H5Tget_size( member_type_id );
/* Insert it into the new type */
- if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 )
+ if(H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2829,9 +2829,9 @@ herr_t H5TBdelete_field( hid_t loc_id,
has_fill = H5LT_find_attribute( dataset_id1, attr_name );
/* Get it */
- if ( has_fill == 1 )
+ if(has_fill == 1 )
{
- if ( H5LT_get_attribute_disk( dataset_id1, attr_name, tmp_fill_buf+curr_offset ) < 0 )
+ if(H5LT_get_attribute_disk( dataset_id1, attr_name, tmp_fill_buf+curr_offset ) < 0)
goto out;
}
@@ -2840,7 +2840,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
free( member_name );
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
} /* i */
@@ -2851,20 +2851,20 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if ( H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0 )
+ if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
- if ( ( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0 )
+ if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
- if ( H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0 )
+ if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
return -1;
/* Create the dataset. */
- if ( ( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0 )
+ if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2878,39 +2878,39 @@ herr_t H5TBdelete_field( hid_t loc_id,
member_name = H5Tget_member_name( type_id1,(unsigned) i );
/* Skip the field to delete */
- if ( H5TB_find_field( member_name, field_name ) > 0 )
+ if(H5TB_find_field( member_name, field_name ) > 0 )
{
free( member_name );
continue;
}
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0)
goto out;
/* Get the member size */
member_size = H5Tget_size( member_type_id );
/* Create a read id */
- if ( ( read_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0 )
+ if(( read_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0)
goto out;
/* Insert it into the new type */
- if ( H5Tinsert( read_type_id, member_name, (size_t)0, member_type_id ) < 0 )
+ if(H5Tinsert( read_type_id, member_name, (size_t)0, member_type_id ) < 0)
goto out;
tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size );
/* Read */
- if ( H5Dread( dataset_id1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 )
+ if(H5Dread( dataset_id1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
goto out;
/* Create a write id */
- if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0 )
+ if(( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0)
goto out;
/* The field in the file is found by its name */
- if ( H5Tinsert( write_type_id, member_name, (size_t)0, member_type_id ) < 0 )
+ if(H5Tinsert( write_type_id, member_name, (size_t)0, member_type_id ) < 0)
goto out;
/* Create xfer properties to preserve initialized data */
@@ -2920,23 +2920,23 @@ herr_t H5TBdelete_field( hid_t loc_id,
goto out;
/* Write */
- if ( H5Dwrite( dataset_id2, write_type_id, H5S_ALL, H5S_ALL, PRESERVE, tmp_buf ) < 0 )
+ if(H5Dwrite( dataset_id2, write_type_id, H5S_ALL, H5S_ALL, PRESERVE, tmp_buf ) < 0)
goto out;
/* End access to the property list */
- if ( H5Pclose( PRESERVE ) < 0 )
+ if(H5Pclose( PRESERVE ) < 0)
goto out;
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
/* Close the read type */
- if ( H5Tclose( read_type_id ) < 0 )
+ if(H5Tclose( read_type_id ) < 0)
goto out;
/* Close the write type */
- if ( H5Tclose( write_type_id ) < 0 )
+ if(H5Tclose( write_type_id ) < 0)
goto out;
/* Release resources. */
@@ -2951,19 +2951,19 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
goto out;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id1 ) < 0 )
+ if(H5Pclose( plist_id1 ) < 0)
goto out;
/* Terminate access to the data space */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose( space_id1 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
goto out;
@@ -2973,19 +2973,19 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id2 ) < 0 )
+ if(H5Sclose( space_id2 ) < 0)
goto out;
/* Release the datatype. */
- if ( H5Tclose( type_id2 ) < 0 )
+ if(H5Tclose( type_id2 ) < 0)
return -1;
/* Terminate access to a property list */
- if ( H5Pclose( plist_id2 ) < 0 )
+ if(H5Pclose( plist_id2 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id2 ) < 0 )
+ if(H5Dclose( dataset_id2 ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -2993,7 +2993,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- if ( H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0 )
+ if(H5Ldelete( loc_id, dset_name, H5P_DEFAULT ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -3001,7 +3001,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- if ( H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0 )
+ if(H5Lmove( loc_id, "new", H5L_SAME_LOC, dset_name, H5P_DEFAULT, H5P_DEFAULT ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -3010,19 +3010,19 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
/* Open the dataset. */
- if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 )
+ if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get the datatype */
- if ( (type_id1 = H5Dget_type( dataset_id1 )) < 0 )
+ if((type_id1 = H5Dget_type( dataset_id1 )) < 0)
goto out;
/* Set the attributes */
- if ( H5TB_attach_attributes( table_title, loc_id, dset_name, nfields, type_id1 ) < 0 )
+ if(H5TB_attach_attributes( table_title, loc_id, dset_name, nfields, type_id1 ) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -3030,55 +3030,53 @@ herr_t H5TBdelete_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- if ( has_fill == 1 )
+ if(has_fill == 1)
{
-
- if (( space_id1 = H5Screate(H5S_SCALAR)) < 0 )
+ if((space_id1 = H5Screate(H5S_SCALAR)) < 0)
goto out;
- for ( i = 0; i < nfields; i++)
+ for(i = 0; i < nfields; i++)
{
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0)
goto out;
/* Get the member offset */
- member_offset = H5Tget_member_offset( type_id1, (unsigned)i );
+ member_offset = H5Tget_member_offset(type_id1, (unsigned)i);
- strcpy( attr_name, "FIELD_" );
- sprintf( aux, "%d", (int)i );
- strcat( attr_name, aux );
- sprintf( aux, "%s", "_FILL" );
- strcat( attr_name, aux );
+ strcpy(attr_name, "FIELD_");
+ sprintf(aux, "%d", (int)i);
+ strcat(attr_name, aux);
+ sprintf(aux, "%s", "_FILL");
+ strcat(attr_name, aux);
- if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 )
+ if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 )
+ if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose(member_type_id) < 0)
goto out;
-
}
/* Close data space. */
- if ( H5Sclose( space_id1 ) < 0 )
+ if(H5Sclose(space_id1) < 0)
goto out;
} /*has_fill*/
/* Release the datatype. */
- if ( H5Tclose( type_id1 ) < 0 )
+ if(H5Tclose( type_id1 ) < 0)
goto out;
/* End access to the dataset */
- if ( H5Dclose( dataset_id1 ) < 0 )
+ if(H5Dclose( dataset_id1 ) < 0)
goto out;
/* Release resources. */
@@ -3121,7 +3119,7 @@ herr_t H5TBAget_title( hid_t loc_id,
{
/* Get the TITLE attribute */
- if ( H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0 )
+ if(H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0)
return -1;
@@ -3163,7 +3161,7 @@ herr_t H5TBAget_fill( hid_t loc_id,
int has_fill=0;
/* Get the number of records and fields */
- if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 )
+ if(H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t));
@@ -3172,7 +3170,7 @@ herr_t H5TBAget_fill( hid_t loc_id,
return -1;
/* Get field info */
- if ( H5TBget_field_info( loc_id, dset_name, NULL, NULL, src_offset, NULL ) < 0 )
+ if(H5TBget_field_info( loc_id, dset_name, NULL, NULL, src_offset, NULL ) < 0)
goto out;
for ( i = 0; i < nfields; i++)
@@ -3187,9 +3185,9 @@ herr_t H5TBAget_fill( hid_t loc_id,
has_fill = H5LT_find_attribute( dset_id, attr_name );
/* Get it */
- if ( has_fill == 1 )
+ if(has_fill == 1 )
{
- if ( H5LT_get_attribute_disk( dset_id, attr_name, dst_buf+src_offset[i] ) < 0 )
+ if(H5LT_get_attribute_disk( dset_id, attr_name, dst_buf+src_offset[i] ) < 0)
goto out;
}
@@ -3248,15 +3246,15 @@ herr_t H5TBget_table_info ( hid_t loc_id,
hsize_t n[1];
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen( loc_id, dset_name )) < 0)
return -1;
/* Get the datatype */
- if ( (tid = H5Dget_type( did )) < 0 )
+ if((tid = H5Dget_type( did )) < 0)
goto out;
/* Get the number of members */
- if ( (num_members = H5Tget_nmembers( tid )) < 0 )
+ if((num_members = H5Tget_nmembers( tid )) < 0)
goto out;
if (nfields)
@@ -3274,10 +3272,10 @@ herr_t H5TBget_table_info ( hid_t loc_id,
has_attr = H5LT_find_attribute( did, "NROWS" );
/* It exists, get it */
- if ( has_attr == 1 )
+ if(has_attr == 1 )
{
/* Get the attribute */
- if ( H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0)
+ if(H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0)
return -1;
/**nrecords = *n;*/
@@ -3286,15 +3284,15 @@ herr_t H5TBget_table_info ( hid_t loc_id,
else
{
/* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ if((sid = H5Dget_space( did )) < 0)
goto out;
/* Get records */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
+ if(H5Sget_simple_extent_dims( sid, dims, NULL) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
+ if(H5Sclose( sid ) < 0)
goto out;
*nrecords = dims[0];
@@ -3302,9 +3300,9 @@ herr_t H5TBget_table_info ( hid_t loc_id,
}/*nrecords*/
/* close */
- if ( H5Tclose( tid ) < 0 )
+ if(H5Tclose( tid ) < 0)
goto out;
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -3358,11 +3356,11 @@ herr_t H5TBget_field_info( hid_t loc_id,
hssize_t i;
/* Open the dataset. */
- if ( ( did = H5Dopen( loc_id, dset_name )) < 0 )
+ if(( did = H5Dopen( loc_id, dset_name )) < 0)
goto out;
/* Get the datatype */
- if ( ( ftype_id = H5Dget_type( did )) < 0 )
+ if(( ftype_id = H5Dget_type( did )) < 0)
goto out;
if ((native_type_id = H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0)
@@ -3371,11 +3369,11 @@ herr_t H5TBget_field_info( hid_t loc_id,
/* Get the type size */
size = H5Tget_size( native_type_id );
- if ( type_size )
+ if(type_size )
*type_size = size;
/* Get the number of members */
- if ( ( nfields = H5Tget_nmembers( ftype_id )) < 0 )
+ if(( nfields = H5Tget_nmembers( ftype_id )) < 0)
goto out;
/* Iterate tru the members */
@@ -3384,11 +3382,11 @@ herr_t H5TBget_field_info( hid_t loc_id,
/* Get the member name */
member_name = H5Tget_member_name( ftype_id, (unsigned)i );
- if ( field_names )
+ if(field_names )
strcpy( field_names[i], member_name );
/* Get the member type */
- if ( ( member_type_id = H5Tget_member_type( ftype_id,(unsigned) i )) < 0 )
+ if(( member_type_id = H5Tget_member_type( ftype_id,(unsigned) i )) < 0)
goto out;
if ((nativem_type_id = H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0)
goto out;
@@ -3396,19 +3394,19 @@ herr_t H5TBget_field_info( hid_t loc_id,
/* Get the member size */
member_size = H5Tget_size( nativem_type_id );
- if ( field_sizes )
+ if(field_sizes )
field_sizes[i] = member_size;
/* Get the member offset */
member_offset = H5Tget_member_offset( native_type_id,(unsigned) i );
- if ( field_offsets )
+ if(field_offsets )
field_offsets[i] = member_offset;
/* Close the member type */
- if ( H5Tclose( member_type_id ) < 0 )
+ if(H5Tclose( member_type_id ) < 0)
goto out;
- if ( H5Tclose( nativem_type_id ) < 0 )
+ if(H5Tclose( nativem_type_id ) < 0)
goto out;
free( member_name );
@@ -3416,13 +3414,13 @@ herr_t H5TBget_field_info( hid_t loc_id,
} /* i */
/* Release the datatype. */
- if ( H5Tclose( ftype_id ) < 0 )
+ if(H5Tclose( ftype_id ) < 0)
return -1;
- if ( H5Tclose( native_type_id ) < 0 )
+ if(H5Tclose( native_type_id ) < 0)
return -1;
/* End access to the dataset */
- if ( H5Dclose( did ) < 0 )
+ if(H5Dclose( did ) < 0)
return -1;
return 0;
@@ -3463,12 +3461,12 @@ int H5TB_find_field( const char *field, const char *field_list )
while ( (end = strstr( start, "," )) != 0 )
{
size_t count = end - start;
- if ( strncmp(start, field, count) == 0 && count == strlen(field) )
+ if(strncmp(start, field, count) == 0 && count == strlen(field) )
return 1;
start = end + 1;
}
- if ( strcmp( start, field ) == 0 )
+ if(strcmp( start, field ) == 0 )
return 1;
return -1;
@@ -3510,15 +3508,15 @@ herr_t H5TB_attach_attributes( const char *table_title,
hsize_t i;
/* Attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0)
goto out;
/* Attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0)
goto out;
/* Attach the TITLE attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0)
goto out;
/* Attach the FIELD_ name attribute */
@@ -3535,7 +3533,7 @@ herr_t H5TB_attach_attributes( const char *table_title,
strcat( attr_name, aux );
/* Attach the attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 )
+ if(H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0)
goto out;
free( member_name );
@@ -3599,7 +3597,7 @@ hid_t H5TB_create_type(hid_t loc_id,
}
/* get field info */
- if ( H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL)<0)
+ if(H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL)<0)
goto out;
/* create the memory data type */
@@ -3619,7 +3617,7 @@ hid_t H5TB_create_type(hid_t loc_id,
if (H5Tset_size(nmtype_id,field_sizes[i])<0)
goto out;
}
- if (H5Tinsert(mem_type_id,fnames[i],field_offset[i],nmtype_id) < 0 )
+ if (H5Tinsert(mem_type_id,fnames[i],field_offset[i],nmtype_id) < 0)
goto out;
if (H5Tclose(mtype_id)<0)
goto out;
@@ -3693,33 +3691,33 @@ herr_t H5TB_common_append_records( hid_t dataset_id,
/* Extend the dataset */
dims[0] = nrecords + orig_table_size;
- if ( H5Dextend ( dataset_id, dims ) < 0 )
+ if(H5Dextend ( dataset_id, dims ) < 0)
goto out;
/* Create a simple memory data space */
mem_dims[0]=nrecords;
- if ( (mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0 )
+ if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0)
goto out;
/* Get a copy of the new file data space for writing */
- if ( (space_id = H5Dget_space( dataset_id )) < 0 )
+ if((space_id = H5Dget_space( dataset_id )) < 0)
goto out;
/* Define a hyperslab in the dataset */
offset[0] = orig_table_size;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL)<0)
+ if(H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL)<0)
goto out;
/* Write the records */
- if ( H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data )<0)
+ if(H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data )<0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
- if ( H5Sclose( space_id ) < 0 )
+ if(H5Sclose( space_id ) < 0)
goto out;
return 0;
@@ -3766,32 +3764,32 @@ herr_t H5TB_common_read_records( hid_t dataset_id,
hsize_t mem_size[1];
/* Make sure the read request is in bounds */
- if ( start + nrecords > table_size )
+ if(start + nrecords > table_size )
goto out;
/* Get the dataspace handle */
- if ( (space_id = H5Dget_space( dataset_id )) < 0 )
+ if((space_id = H5Dget_space( dataset_id )) < 0)
goto out;
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if(H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if ((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
+ if ((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
if ((H5Dread( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data))<0)
goto out;
/* Terminate access to the memory dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
+ if(H5Sclose( mem_space_id ) < 0)
goto out;
/* Terminate access to the dataspace */
- if ( H5Sclose( space_id ) < 0 )
+ if(H5Sclose( space_id ) < 0)
goto out;
return 0;
diff --git a/perform/perf_meta.c b/perform/perf_meta.c
index 7676974..7093717 100644
--- a/perform/perf_meta.c
+++ b/perform/perf_meta.c
@@ -379,38 +379,42 @@ create_attrs_1(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
- fapl))<0)
+ fapl)) < 0)
goto error;
- if(create_dsets(file)<0)
+ if(create_dsets(file) < 0)
goto error;
/*
* Create all(user specifies the number) attributes for each dataset
*/
- for(i=0; i<NUM_DSETS; i++) {
+ for(i = 0; i < NUM_DSETS; i++) {
sprintf(dset_name, "dataset %d", i);
open_t.start = retrieve_time();
- if((dataset=H5Dopen(file, dset_name))<0)
+ if((dataset = H5Dopen(file, dset_name)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
- for(j=0; j<NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
- attr_t.start = retrieve_time();
- if((attr = H5Acreate(dataset, attr_name, H5T_NATIVE_DOUBLE,
- small_space, H5P_DEFAULT)) < 0)
- goto error;
- if (H5Aclose(attr) < 0) goto error;
- perf(&attr_t, attr_t.start, retrieve_time());
- if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL)<0) goto error;
- }
+ for(j = 0; j < NUM_ATTRS; j++) {
+ sprintf(attr_name, "all attrs for each dset %d", j);
+ attr_t.start = retrieve_time();
+ if((attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_DOUBLE,
+ small_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr) < 0)
+ goto error;
+ perf(&attr_t, attr_t.start, retrieve_time());
+ if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
close_t.start = retrieve_time();
- if(H5Dclose(dataset)<0) goto error;
+ if(H5Dclose(dataset) < 0)
+ goto error;
perf(&close_t, close_t.start, retrieve_time());
- if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
- }
+ if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) {
#ifdef H5_HAVE_PARALLEL
@@ -434,7 +438,7 @@ create_attrs_1(void)
print_perf(open_t, close_t, attr_t);
}
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0) goto error;
return 0;
@@ -480,36 +484,40 @@ create_attrs_2(void)
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/*
* Create all(user specifies the number) attributes for each new dataset
*/
- for(i=0; i<NUM_DSETS; i++) {
+ for(i = 0; i < NUM_DSETS; i++) {
sprintf(dset_name, "dataset %d", i);
create_t.start = retrieve_time();
if((dataset = H5Dcreate(file, dset_name, H5T_NATIVE_DOUBLE,
- space, H5P_DEFAULT)) < 0)
- goto error;
+ space, H5P_DEFAULT)) < 0)
+ goto error;
perf(&create_t, create_t.start, retrieve_time());
- for(j=0; j<NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
- attr_t.start = retrieve_time();
- if((attr = H5Acreate(dataset, attr_name, H5T_NATIVE_DOUBLE,
- small_space, H5P_DEFAULT)) < 0)
- goto error;
- if (H5Aclose(attr) < 0) goto error;
- perf(&attr_t, attr_t.start, retrieve_time());
- if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
- }
+ for(j = 0; j < NUM_ATTRS; j++) {
+ sprintf(attr_name, "all attrs for each dset %d", j);
+ attr_t.start = retrieve_time();
+ if((attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_DOUBLE,
+ small_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr) < 0)
+ goto error;
+ perf(&attr_t, attr_t.start, retrieve_time());
+ if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
close_t.start = retrieve_time();
- if(H5Dclose(dataset)<0) goto error;
+ if(H5Dclose(dataset) < 0)
+ goto error;
perf(&close_t, close_t.start, retrieve_time());
- if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
- }
+ if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) {
#ifdef H5_HAVE_PARALLEL
@@ -534,7 +542,7 @@ create_attrs_2(void)
print_perf(create_t, close_t, attr_t);
}
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0) goto error;
return 0;
@@ -583,10 +591,10 @@ create_attrs_3(void)
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
- fapl))<0)
+ fapl)) < 0)
goto error;
- if(create_dsets(file)<0)
+ if(create_dsets(file) < 0)
goto error;
/*
@@ -595,32 +603,35 @@ create_attrs_3(void)
*/
loop_num = NUM_ATTRS/BATCH_ATTRS;
- for(i=0; i<loop_num; i++) {
- for(j=0; j<NUM_DSETS; j++) {
- sprintf(dset_name, "dataset %d", j);
- open_t.start = retrieve_time();
- if((dataset = H5Dopen(file, dset_name)) < 0)
- goto error;
- perf(&open_t, open_t.start, retrieve_time());
-
- for(k=0; k<BATCH_ATTRS; k++) {
- sprintf(attr_name, "some attrs for each dset %d %d",
- i, k);
- attr_t.start = retrieve_time();
- if((attr = H5Acreate(dataset, attr_name,
- H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT))
- < 0) goto error;
- if (H5Aclose(attr) < 0) goto error;
- perf(&attr_t, attr_t.start, retrieve_time());
- if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
- }
-
- close_t.start = retrieve_time();
- if(H5Dclose(dataset)<0) goto error;
- perf(&close_t, close_t.start, retrieve_time());
- if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
- }
- }
+ for(i = 0; i < loop_num; i++) {
+ for(j = 0; j < NUM_DSETS; j++) {
+ sprintf(dset_name, "dataset %d", j);
+ open_t.start = retrieve_time();
+ if((dataset = H5Dopen(file, dset_name)) < 0)
+ goto error;
+ perf(&open_t, open_t.start, retrieve_time());
+
+ for(k = 0; k < BATCH_ATTRS; k++) {
+ sprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ attr_t.start = retrieve_time();
+ if((attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_DOUBLE,
+ small_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr) < 0)
+ goto error;
+ perf(&attr_t, attr_t.start, retrieve_time());
+ if(flush_attr && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
+
+ close_t.start = retrieve_time();
+ if(H5Dclose(dataset) < 0)
+ goto error;
+ perf(&close_t, close_t.start, retrieve_time());
+ if(flush_dset && H5Fflush(file, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ } /* end for */
+ } /* end for */
if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) {
#ifdef H5_HAVE_PARALLEL
@@ -644,7 +655,7 @@ create_attrs_3(void)
print_perf(open_t, close_t, attr_t);
}
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0) goto error;
return 0;
@@ -812,17 +823,17 @@ main(int argc, char **argv)
#endif /*H5_HAVE_PARALLEL*/
}
- nerrors += create_dspace()<0 ?1:0;
+ nerrors += create_dspace() < 0 ?1:0;
if((RUN_TEST & TEST_1) || !RUN_TEST)
- nerrors += create_attrs_1()<0 ?1:0;
+ nerrors += create_attrs_1() < 0 ?1:0;
if((RUN_TEST & TEST_2) || !RUN_TEST)
- nerrors += create_attrs_2()<0 ?1:0;
+ nerrors += create_attrs_2() < 0 ?1:0;
if(((RUN_TEST & TEST_3) || !RUN_TEST) && BATCH_ATTRS && NUM_ATTRS)
- nerrors += create_attrs_3()<0 ?1:0;
+ nerrors += create_attrs_3() < 0 ?1:0;
- if (H5Sclose(space)<0) goto error;
- if (H5Sclose(small_space)<0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Sclose(small_space) < 0) goto error;
h5_cleanup(FILENAME, fapl);
diff --git a/src/H5A.c b/src/H5A.c
index f7d1081..7f0d7ed 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -276,7 +276,7 @@ done:
* Function: H5A_create
*
* Purpose:
- * This is the guts of the H5Acreate function.
+ * This is the guts of creating an attribute.
* Usage:
* hid_t H5A_create (ent, name, type, space)
* const H5G_entry_t *ent; IN: Pointer to symbol table entry for object to attribute
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 1ff98c0..c490dcc 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -105,14 +105,15 @@ H5A_init_deprec_interface(void)
FUNC_LEAVE_NOAPI(H5A_init())
} /* H5A_init_deprec_interface() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/*--------------------------------------------------------------------------
NAME
- H5Acreate
+ H5Acreate1
PURPOSE
Creates an attribute on an object
USAGE
- hid_t H5Acreate (loc_id, name, type_id, space_id, plist_id)
+ hid_t H5Acreate1(loc_id, name, type_id, space_id, plist_id)
hid_t loc_id; IN: Object (dataset or group) to be attached to
const char *name; IN: Name of attribute to create
hid_t type_id; IN: ID of datatype for attribute
@@ -129,9 +130,12 @@ H5A_init_deprec_interface(void)
The attribute ID returned from this function must be released with H5Aclose
or resource leaks will develop.
+ NOTE
+ Deprecated in favor of H5Acreate2
+
--------------------------------------------------------------------------*/
hid_t
-H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
+H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t plist_id)
{
H5G_loc_t loc; /* Object location */
@@ -139,7 +143,7 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
H5S_t *space; /* Dataspace to use for attribute */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Acreate, FAIL)
+ FUNC_ENTER_API(H5Acreate1, FAIL)
H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, plist_id);
/* check arguments */
@@ -162,9 +166,8 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Acreate() */
+} /* H5Acreate1() */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
/*--------------------------------------------------------------------------
NAME
@@ -185,6 +188,8 @@ done:
H5Aclose or resource leaks will develop.
The location object may be either a group or a dataset, both of
which may have any sort of attribute.
+ NOTE
+ Deprecated in favor of H5Aopen
--------------------------------------------------------------------------*/
hid_t
H5Aopen_name(hid_t loc_id, const char *name)
diff --git a/src/H5Apublic.h b/src/H5Apublic.h
index 911b7b1..fdda900 100644
--- a/src/H5Apublic.h
+++ b/src/H5Apublic.h
@@ -75,14 +75,6 @@ H5_DLL herr_t H5Adelete2(hid_t loc_id, const char *obj_name,
H5_DLL herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id);
-/* Functions and variables defined for compatibility with previous versions
- * of the HDF5 API.
- *
- * Use of these functions and variables is deprecated.
- */
-H5_DLL hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_id,
- hid_t space_id, hid_t plist_id);
-
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
@@ -100,6 +92,8 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id/*in*/,
/* Function prototypes */
+H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id,
+ hid_t space_id, hid_t plist_id);
H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name);
H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx);
H5_DLL int H5Aget_num_attrs(hid_t loc_id);
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 7094fe0..0da4d53 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1890,7 +1890,7 @@ H5T_subset_t
H5T_conv_struct_subset(const H5T_cdata_t *cdata)
{
H5T_conv_struct_t *priv;
- H5T_subset_t ret_value = FALSE; /* Return value */
+ H5T_subset_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_conv_struct_subset)
diff --git a/src/H5vers.txt b/src/H5vers.txt
index fa7200a..8d4b6f9 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -45,6 +45,7 @@
# API function names
# (although not required, it's easier to compare this file with the headers
# generated if the list below is in alphanumeric sort order - QAK)
+FUNCTION: H5Acreate; ; v10, v18
FUNCTION: H5Adelete; ; v10, v18
FUNCTION: H5Aiterate; H5A_operator; v10, v18
FUNCTION: H5Arename; ; v16, v18
diff --git a/src/H5version.h b/src/H5version.h
index 1a84886..25efa53 100644
--- a/src/H5version.h
+++ b/src/H5version.h
@@ -38,6 +38,10 @@
/* Functions */
/*************/
+#if !defined(H5Acreate_vers)
+#define H5Acreate_vers 1
+#endif /* !defined(H5Acreate_vers) */
+
#if !defined(H5Adelete_vers)
#define H5Adelete_vers 1
#endif /* !defined(H5Adelete_vers) */
@@ -115,6 +119,17 @@
/* Functions */
/*************/
+#if !defined(H5Acreate_vers) || H5Acreate_vers == 2
+#ifndef H5Acreate_vers
+#define H5Acreate_vers 2
+#endif /* H5Acreate_vers */
+#define H5Acreate H5Acreate2
+#elif H5Acreate_vers == 1
+#define H5Acreate H5Acreate1
+#else /* H5Acreate_vers */
+#error "H5Acreate_vers set to invalid value"
+#endif /* H5Acreate_vers */
+
#if !defined(H5Adelete_vers) || H5Adelete_vers == 2
#ifndef H5Adelete_vers
#define H5Adelete_vers 2
diff --git a/test/dangle.c b/test/dangle.c
index 84cc965..4b1be63 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -63,28 +63,28 @@ test_dangle_dataset(H5F_close_degree_t degree)
TESTING(" dangling dataset IDs");
- if(H5open()<0)
+ if(H5open() < 0)
TEST_ERROR;
/* Create file access property list */
- if((fapl=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
/* Set file close degree */
- if(H5Pset_fclose_degree(fapl,degree)<0)
+ if(H5Pset_fclose_degree(fapl,degree) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
- if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if((sid = H5Screate (H5S_SCALAR))<0)
+ if((sid = H5Screate (H5S_SCALAR)) < 0)
TEST_ERROR;
- if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
TEST_ERROR;
/* Try creating duplicate dataset */
@@ -93,12 +93,12 @@ test_dangle_dataset(H5F_close_degree_t degree)
TEST_ERROR;
} H5E_END_TRY;
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
TEST_ERROR;
/* Leave open a _lot_ of objects */
for(u=0; u<MAX_DANGLE; u++) {
- if((dsid = H5Dopen (fid, DSETNAME))<0)
+ if((dsid = H5Dopen (fid, DSETNAME)) < 0)
TEST_ERROR;
} /* end for */
@@ -109,16 +109,16 @@ test_dangle_dataset(H5F_close_degree_t degree)
} H5E_END_TRY;
} /* end if */
else
- if(H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl)<0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(H5close()<0)
+ if(H5close() < 0)
TEST_ERROR;
- if(h5_get_file_size(filename)<0)
+ if(h5_get_file_size(filename) < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -159,24 +159,24 @@ test_dangle_group(H5F_close_degree_t degree)
TESTING(" dangling group IDs");
- if(H5open()<0)
+ if(H5open() < 0)
TEST_ERROR;
/* Create file access property list */
- if((fapl=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
/* Set file close degree */
- if(H5Pset_fclose_degree(fapl,degree)<0)
+ if(H5Pset_fclose_degree(fapl,degree) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
- if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
if((gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
TEST_ERROR;
/* Try creating duplicate group */
@@ -200,16 +200,16 @@ test_dangle_group(H5F_close_degree_t degree)
} H5E_END_TRY;
} /* end if */
else
- if(H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl)<0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(H5close()<0)
+ if(H5close() < 0)
TEST_ERROR;
- if(h5_get_file_size(filename)<0)
+ if(h5_get_file_size(filename) < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -275,7 +275,7 @@ test_dangle_datatype1(H5F_close_degree_t degree)
TEST_ERROR;
/* Try creating duplicate named datatype */
- if((tid = H5Tcopy (H5T_NATIVE_INT))<0)
+ if((tid = H5Tcopy (H5T_NATIVE_INT)) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
if(H5Tcommit2(fid, TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) >= 0)
@@ -435,29 +435,29 @@ test_dangle_attribute(H5F_close_degree_t degree)
TESTING(" dangling attribute IDs");
- if(H5open()<0)
+ if(H5open() < 0)
TEST_ERROR;
/* Create file access property list */
- if((fapl=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
/* Set file close degree */
- if(H5Pset_fclose_degree(fapl,degree)<0)
+ if(H5Pset_fclose_degree(fapl,degree) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
- if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if((sid = H5Screate (H5S_SCALAR))<0)
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
TEST_ERROR;
- if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Create an attribute on the dataset */
- if((aid = H5Acreate (dsid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT))<0)
+ if((aid = H5Acreate2(dsid, ".", ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Don't worry about writing the attribute - it will have a fill value */
@@ -468,7 +468,7 @@ test_dangle_attribute(H5F_close_degree_t degree)
/* Try creating duplicate attribute */
H5E_BEGIN_TRY {
- if((aid = H5Acreate(dsid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) >= 0)
+ if((aid = H5Acreate2(dsid, ".", ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0)
TEST_ERROR;
} H5E_END_TRY;
@@ -496,10 +496,10 @@ test_dangle_attribute(H5F_close_degree_t degree)
if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(H5close()<0)
+ if(H5close() < 0)
TEST_ERROR;
- if(h5_get_file_size(filename)<0)
+ if(h5_get_file_size(filename) < 0)
TEST_ERROR;
/* Clean up temporary file */
diff --git a/test/dtypes.c b/test/dtypes.c
index 2f8f030..b327344 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -2487,7 +2487,7 @@ test_transient (hid_t fapl)
/* It should not be possible to create an attribute for a transient type */
H5E_BEGIN_TRY {
- status = H5Acreate (type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ status = H5Acreate2(type, ".", "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if (status>=0) {
H5_FAILED();
@@ -2633,8 +2633,8 @@ test_named (hid_t fapl)
}
/* It should be possible to define an attribute for the named type */
- if((attr1 = H5Acreate (type, "attr1", H5T_NATIVE_UCHAR, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((attr1 = H5Acreate2(type, ".", "attr1", H5T_NATIVE_UCHAR, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
for(i = 0; i < (size_t)ds_size[0]; i++)
for(j = 0; j < (size_t)ds_size[1]; j++)
attr_data[i][j] = (int)(i * ds_size[1] + j);
diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c
index b7d07d2..5850f04 100644
--- a/test/gen_mergemsg.c
+++ b/test/gen_mergemsg.c
@@ -91,7 +91,7 @@ int main()
assert(ret >= 0);
/* Add 1st attribute on first group */
- aid = H5Acreate(gid, ATTR1, tid, sid, H5P_DEFAULT);
+ aid = H5Acreate2(gid, ".", ATTR1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(aid > 0);
/* Close dataspace */
@@ -117,7 +117,7 @@ int main()
assert(ret >= 0);
/* Add 2nd attribute on first group */
- aid = H5Acreate(gid, ATTR2, tid, sid, H5P_DEFAULT);
+ aid = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(aid > 0);
/* Close dataspace */
@@ -191,7 +191,7 @@ int main()
assert(ret >= 0);
/* Add 3rd attribute on first group (smaller than 2nd attribute) */
- aid = H5Acreate(gid, ATTR3, tid, sid, H5P_DEFAULT);
+ aid = H5Acreate2(gid, ".", ATTR3, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(aid > 0);
/* Close dataspace */
@@ -239,7 +239,7 @@ int main()
assert(ret >= 0);
/* Re-create 2nd attribute on first group */
- aid = H5Acreate(gid, ATTR2, tid, sid, H5P_DEFAULT);
+ aid = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(aid > 0);
/* Close dataspace */
@@ -303,7 +303,7 @@ int main()
assert(ret >= 0);
/* Re-create 2nd attribute on first group */
- aid = H5Acreate(gid, ATTR2, tid, sid, H5P_DEFAULT);
+ aid = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(aid > 0);
/* Close dataspace */
diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c
index 80e5590..385564f 100644
--- a/test/gen_nullspace.c
+++ b/test/gen_nullspace.c
@@ -63,11 +63,11 @@ main(void)
assert(gid > 0);
/* Create an attribute for the group */
- attr=H5Acreate(gid,NULLATTR,H5T_NATIVE_INT,sid,H5P_DEFAULT);
- assert(attr>0);
+ attr = H5Acreate2(gid, ".", NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(attr > 0);
/* Close attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
assert(ret>=0);
/* Close the group */
diff --git a/test/links.c b/test/links.c
index 8aa5f4a..1e9e8d4 100644
--- a/test/links.c
+++ b/test/links.c
@@ -8616,7 +8616,7 @@ object_info(hid_t fapl)
sprintf(attrname, "attr %02u", v);
/* Create attribute */
- if((attr_id = H5Acreate(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close attribute */
if(H5Aclose(attr_id) < 0) TEST_ERROR
@@ -8664,7 +8664,7 @@ object_info(hid_t fapl)
sprintf(attrname, "attr %02u", v);
/* Create attribute */
- if((attr_id = H5Acreate(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close attribute */
if(H5Aclose(attr_id) < 0) TEST_ERROR
@@ -8813,7 +8813,7 @@ object_info_old(hid_t fapl)
sprintf(attrname, "attr %02u", v);
/* Create attribute */
- if((attr_id = H5Acreate(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close attribute */
if(H5Aclose(attr_id) < 0) TEST_ERROR
diff --git a/test/objcopy.c b/test/objcopy.c
index 119ad82..5e620fa 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -256,7 +256,7 @@ attach_ref_attr(hid_t file_id, hid_t loc_id)
/* create an attribute with two object references */
if(H5Rcreate(&ref[0], file_id, dsetname1, H5R_OBJECT, -1) < 0) TEST_ERROR
if(H5Rcreate(&ref[1], file_id, dsetname2, H5R_OBJECT, -1) < 0) TEST_ERROR
- if((aid = H5Acreate(loc_id, "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((aid = H5Acreate2(loc_id, ".", "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Awrite(aid, H5T_STD_REF_OBJ, ref) < 0) TEST_ERROR
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -329,12 +329,12 @@ attach_reg_ref_attr(hid_t file_id, hid_t loc_id)
if(H5Rcreate(&ref[1], file_id, dsetnamev, H5R_DATASET_REGION, space_id) < 0) TEST_ERROR
/* create reg_ref attribute */
- if((aid = H5Acreate(loc_id, "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((aid = H5Acreate2(loc_id, ".", "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Awrite(aid, H5T_STD_REF_DSETREG, ref) < 0) TEST_ERROR
/* attach the reg_ref attribute to the dataset itself */
if(H5Aclose(aid) < 0) TEST_ERROR
- if((aid = H5Acreate(dsetv_id, "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((aid = H5Acreate2(dsetv_id, ".", "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Awrite(aid, H5T_STD_REF_DSETREG, ref) < 0) TEST_ERROR
if(H5Sclose(spacer_id) < 0) TEST_ERROR
@@ -488,7 +488,7 @@ test_copy_attach_attribute_vl(hid_t loc_id)
((int *)buf[i].p)[j] = j+1;
} /* end for */
- if((aid = H5Acreate(loc_id, "vlen attribute", tid, sid, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(loc_id, ".", "vlen attribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto done;
if(H5Awrite(aid, tid, buf) < 0)
@@ -542,7 +542,7 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id)
attr_data[0] = 100 * i;
attr_data[1] = 200 * i;
- if((aid = H5Acreate(loc_id, attr_name, type_id, sid, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(loc_id, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto done;
if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0)
@@ -596,12 +596,12 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id)
attr_data[1] = 200 * i;
/* Add attribute to first object */
- if((aid = H5Acreate(loc_id, attr_name, type_id, sid, H5P_DEFAULT)) < 0) goto done;
+ if((aid = H5Acreate2(loc_id, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done;
if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0) goto done;
if(H5Aclose(aid) < 0) goto done;
/* Add attribute to second object */
- if((aid = H5Acreate(loc_id2, attr_name, type_id, sid, H5P_DEFAULT)) < 0) goto done;
+ if((aid = H5Acreate2(loc_id2, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done;
if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0) goto done;
if(H5Aclose(aid) < 0) goto done;
}
diff --git a/test/reserved.c b/test/reserved.c
index d7b7299..df30b5c 100755
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -198,12 +198,11 @@ rsrv_ohdr(void)
attrval[3][i] = 3;
}
- for (i = 0; i< 2000; i++)
- {
+ for(i = 0; i < 2000; i++) {
sprintf(attrname, "attr %d", i);
H5E_BEGIN_TRY{
aid = H5Screate_simple(2, dims, NULL);
- attr_id = H5Acreate (dataset_id, attrname, H5T_STD_I32BE, aid, H5P_DEFAULT);
+ attr_id = H5Acreate2(dataset_id, ".", attrname, H5T_STD_I32BE, aid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attr_id, H5T_NATIVE_INT, attrval);
status = H5Aclose(attr_id);
} H5E_END_TRY
diff --git a/test/tattr.c b/test/tattr.c
index b88ba5f..3e1110c 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -192,8 +192,8 @@ test_attr_basic_write(hid_t fapl)
/* Try to create an attribute on the file (should create an attribute on root group) */
- attr = H5Acreate(fid1, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(fid1, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close attribute */
ret = H5Aclose(attr);
@@ -217,23 +217,23 @@ test_attr_basic_write(hid_t fapl)
/* Create an attribute for the dataset */
- attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write attribute information */
- ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data1);
+ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data1);
CHECK(ret, FAIL, "H5Awrite");
/* Create an another attribute for the dataset */
- attr2=H5Acreate(dataset,ATTR1A_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr2 = H5Acreate2(dataset, ".", ATTR1A_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write attribute information */
- ret=H5Awrite(attr2,H5T_NATIVE_INT,attr_data1a);
+ ret = H5Awrite(attr2, H5T_NATIVE_INT, attr_data1a);
CHECK(ret, FAIL, "H5Awrite");
/* Check storage size for attribute */
@@ -343,27 +343,27 @@ test_attr_basic_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create an attribute for the group */
- attr=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(group, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check storage size for attribute */
- attr_size=H5Aget_storage_size(attr);
- VERIFY(attr_size, (ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "H5Aget_storage_size");
+ attr_size = H5Aget_storage_size(attr);
+ VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(group, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write attribute information */
- ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data2);
+ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data2);
CHECK(ret, FAIL, "H5Awrite");
/* Check storage size for attribute */
- attr_size=H5Aget_storage_size(attr);
- VERIFY(attr_size, (ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "H5A_get_storage_size");
+ attr_size = H5Aget_storage_size(attr);
+ VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5A_get_storage_size");
/* Close attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Close Attribute dataspace */
@@ -500,8 +500,8 @@ test_attr_flush(hid_t fapl)
set = H5Dcreate(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT);
CHECK(set, FAIL, "H5Dcreate");
- att = H5Acreate(set, ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT);
- CHECK(att, FAIL, "H5Acreate");
+ att = H5Acreate2(set, ".", ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(att, FAIL, "H5Acreate2");
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
@@ -585,8 +585,8 @@ test_attr_plist(hid_t fapl)
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the property list */
- attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,plist);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close the property list, and get the attribute's property list */
ret = H5Pclose(plist);
@@ -608,7 +608,7 @@ test_attr_plist(hid_t fapl)
/* Create a new property list and modify it to use a different encoding */
plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
CHECK(plist, FAIL, "H5Pcreate");
- ret=H5Pset_char_encoding(plist, H5T_CSET_UTF8);
+ ret = H5Pset_char_encoding(plist, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Pset_char_encoding");
/* Get the character encoding and ensure that it has been changed */
@@ -617,8 +617,8 @@ test_attr_plist(hid_t fapl)
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the modified property list */
- attr=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT,sid2,plist);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close the property list and attribute */
ret = H5Pclose(plist);
@@ -707,19 +707,19 @@ test_attr_compound_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create complex attribute for the dataset */
- attr=H5Acreate(dataset,ATTR4_NAME,tid1,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR4_NAME,tid1,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write complex attribute data */
- ret=H5Awrite(attr,tid1,attr_data4);
+ ret = H5Awrite(attr, tid1, attr_data4);
CHECK(ret, FAIL, "H5Awrite");
/* Close attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Close attribute's dataspace */
@@ -917,7 +917,7 @@ test_attr_scalar_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate");
/* Create dataspace for attribute */
@@ -925,19 +925,19 @@ test_attr_scalar_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create an attribute for the dataset */
- attr=H5Acreate(dataset,ATTR5_NAME,H5T_NATIVE_FLOAT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR5_NAME,H5T_NATIVE_FLOAT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write attribute information */
- ret=H5Awrite(attr,H5T_NATIVE_FLOAT,&attr_data5);
+ ret = H5Awrite(attr, H5T_NATIVE_FLOAT, &attr_data5);
CHECK(ret, FAIL, "H5Awrite");
/* Close attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
ret = H5Sclose(sid1);
@@ -1057,7 +1057,7 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate");
/* Close dataset's dataspace */
@@ -1069,19 +1069,19 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create 1st attribute for the dataset */
- attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write 1st attribute data */
- ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data1);
+ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data1);
CHECK(ret, FAIL, "H5Awrite");
/* Close 1st attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Close attribute's dataspace */
@@ -1093,19 +1093,19 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create 2nd attribute for the dataset */
- attr=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write 2nd attribute information */
- ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data2);
+ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data2);
CHECK(ret, FAIL, "H5Awrite");
/* Close 2nd attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Close 2nd attribute's dataspace */
@@ -1117,19 +1117,19 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create 3rd attribute for the dataset */
- attr=H5Acreate(dataset,ATTR3_NAME,H5T_NATIVE_DOUBLE,sid2,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to create the same attribute again (should fail) */
- ret=H5Acreate(dataset,ATTR3_NAME,H5T_NATIVE_DOUBLE,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+ ret = H5Acreate2(dataset, ".", ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Acreate2");
/* Write 3rd attribute information */
- ret=H5Awrite(attr,H5T_NATIVE_DOUBLE,attr_data3);
+ ret = H5Awrite(attr, H5T_NATIVE_DOUBLE, attr_data3);
CHECK(ret, FAIL, "H5Awrite");
/* Close 3rd attribute */
- ret=H5Aclose(attr);
+ ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Close 3rd attribute's dataspace */
@@ -1669,13 +1669,13 @@ test_attr_dtype_shared(hid_t fapl)
VERIFY(oinfo.rc, 2, "H5Dcreate");
/* Create attribute on dataset */
- attr_id = H5Acreate(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
/* Check reference count on named datatype */
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.rc, 3, "H5Acreate");
+ VERIFY(oinfo.rc, 3, "H5Oget_info");
/* Close attribute */
ret = H5Aclose(attr_id);
@@ -1691,13 +1691,13 @@ test_attr_dtype_shared(hid_t fapl)
VERIFY(oinfo.rc, 2, "H5Adelete2");
/* Create attribute on dataset */
- attr_id = H5Acreate(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
/* Check reference count on named datatype */
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.rc, 3, "H5Acreate");
+ VERIFY(oinfo.rc, 3, "H5Oget_info");
/* Write data into the attribute */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, &data);
@@ -1918,8 +1918,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -1937,8 +1937,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
is_dense = H5O_is_attr_dense_test(dataset);
@@ -1953,8 +1953,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Attempt to add attribute again, which should fail */
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- VERIFY(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(attr, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2053,8 +2053,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2076,8 +2076,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
is_dense = H5O_is_attr_dense_test(dataset);
@@ -2193,8 +2193,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2368,8 +2368,8 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2527,8 +2527,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2666,8 +2666,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2687,8 +2687,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2842,8 +2842,8 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close attribute */
ret = H5Aclose(attr);
@@ -2861,8 +2861,8 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close attribute */
ret = H5Aclose(attr);
@@ -2880,9 +2880,9 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 2;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(latest_format) {
- CHECK(attr, FAIL, "H5Acreate");
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close attribute */
ret = H5Aclose(attr);
@@ -2904,8 +2904,8 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 3;
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Close attribute */
ret = H5Aclose(attr);
@@ -2981,7 +2981,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Shouldn't be able to create "big" attributes with older version of format */
- VERIFY(attr, FAIL, "H5Acreate");
+ VERIFY(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
/* (when attributes are shared, the "big" attribute goes into the shared
@@ -3080,8 +3080,8 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
/* Create attribute */
HDstrcpy(attrname, "null attr");
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to read data from the attribute */
/* (shouldn't fail, but should leave buffer alone) */
@@ -3121,8 +3121,8 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
/* Create attribute */
HDstrcpy(attrname, "null attr #2");
- attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Try to write data to the attribute */
/* (shouldn't fail, but should leave buffer alone) */
@@ -3272,8 +3272,8 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
/* Add attribute to dataset */
/* Create attribute */
- attr = H5Acreate(dataset, "attr", H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate1(dataset, "attr", H5T_NATIVE_UINT, sid, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate1");
/* Close attribute */
ret = H5Aclose(attr);
@@ -3382,8 +3382,8 @@ test_attr_many(hid_t fcpl, hid_t fapl)
for(u = 0; u < NATTR_MANY; u++) {
sprintf(attrname, "a-%06u", u);
- aid = H5Acreate(fid, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(fid, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Awrite(aid, H5T_NATIVE_UINT, &u);
CHECK(ret, FAIL, "H5Awrite");
@@ -3632,8 +3632,8 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -3832,8 +3832,8 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -3855,8 +3855,8 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
/* Create another attribute, to push into dense storage */
sprintf(attrname, "attr %02u", max_compact);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4220,8 +4220,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4243,8 +4243,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Create another attribute, to push into dense storage */
sprintf(attrname, "attr %02u", max_compact);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4307,8 +4307,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4431,8 +4431,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4601,8 +4601,8 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4937,8 +4937,8 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -4974,8 +4974,8 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -5175,8 +5175,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -5285,8 +5285,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -5418,8 +5418,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -5992,8 +5992,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -6051,8 +6051,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -6318,8 +6318,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -6376,8 +6376,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -6602,8 +6602,8 @@ test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < max_compact; u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -6660,8 +6660,8 @@ test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
sprintf(attrname, "attr %02u", u);
- attr = H5Acreate(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -7211,8 +7211,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -7225,8 +7225,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -7263,8 +7263,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -7277,8 +7277,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -7652,8 +7652,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -7666,8 +7666,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -7704,8 +7704,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -7718,8 +7718,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -8016,8 +8016,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -8030,8 +8030,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on first dataset */
- attr = H5Acreate(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -8068,8 +8068,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
/* Create "small" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
is_shared = H5A_is_shared_test(attr);
@@ -8082,8 +8082,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
else {
/* Create "big" attribute on second dataset */
- attr = H5Acreate(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
is_shared = H5A_is_shared_test(attr);
@@ -8142,7 +8142,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Open attribute on first dataset */
attr = H5Aopen(dataset, ".", attrname, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ CHECK(attr, FAIL, "H5Aopen");
if(u % 2) {
/* Check that attribute is not shared */
@@ -8269,8 +8269,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl)
CHECK(gid, FAIL, "H5Gopen2");
/* Create attribute on first group */
- aid = H5Acreate(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
@@ -8302,8 +8302,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl)
CHECK(gid, FAIL, "H5Gopen2");
/* Create another attribute on first group */
- aid = H5Acreate(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
@@ -8328,8 +8328,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete2");
/* Re-create first attribute */
- aid = H5Acreate(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
@@ -8339,8 +8339,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete2");
/* Re-create second attribute */
- aid = H5Acreate(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
diff --git a/test/tfile.c b/test/tfile.c
index e37a060..4766838 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -951,8 +951,8 @@ test_get_file_id(void)
/* Create an attribute for the dataset. Make a duplicated file ID from
* this attribute. And close it.
*/
- attr_id=H5Acreate(dataset_id,ATTR_NAME,H5T_NATIVE_INT,dataspace_id,H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dataset_id, ".", ATTR_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Acreate2");
/* Test H5Iget_file_id() */
check_file_id(fid, attr_id);
@@ -960,8 +960,8 @@ test_get_file_id(void)
/* Create a named datatype. Make a duplicated file ID from
* this attribute. And close it.
*/
- datatype_id=H5Tcopy(H5T_NATIVE_INT);
- CHECK(ret, FAIL, "H5Acreate");
+ datatype_id = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tcopy");
ret = H5Tcommit2(fid, TYPE_NAME, datatype_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tcommit2");
@@ -1621,8 +1621,8 @@ test_file_getname(void)
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Create an attribute for the dataset */
- attr_id = H5Acreate(dataset_id,TESTA_ATTRNAME,H5T_NATIVE_INT,space_id,H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dataset_id, ".", TESTA_ATTRNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
/* Get and verify file name */
name_len = H5Fget_name(attr_id, name, (size_t)TESTA_NAME_BUF_SIZE);
diff --git a/test/th5s.c b/test/th5s.c
index e9f7951..46f7110 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -280,10 +280,9 @@ test_h5s_basic(void)
/* Now use the bad dataspace as the space for an attribute */
H5E_BEGIN_TRY {
- aid1 = H5Acreate(dset1, BASICATTR,
- H5T_NATIVE_INT, sid1, H5P_DEFAULT);
+ aid1 = H5Acreate2(dset1, ".", BASICATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY
- VERIFY(aid1, FAIL, "H5Acreate");
+ VERIFY(aid1, FAIL, "H5Acreate2");
/* Make sure that dataspace reads using the bad dataspace fail */
H5E_BEGIN_TRY {
@@ -406,8 +405,8 @@ test_h5s_null(void)
VERIFY(val, 1, "H5Dread");
/* Create an attribute for the group */
- attr=H5Acreate(did,NULLATTR,H5T_NATIVE_INT,sid,H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate");
+ attr = H5Acreate2(did, ".", NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
/* Write "nothing" to the attribute */
ret = H5Awrite(attr, H5T_NATIVE_INT, &val);
diff --git a/test/titerate.c b/test/titerate.c
index 81c5c78..f7938e5 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -408,8 +408,8 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
for(i = 0; i < NATTR; i++) {
sprintf(name, "Attribute %02d", i);
- attribute = H5Acreate(dataset, name, H5T_NATIVE_INT, filespace, H5P_DEFAULT);
- CHECK(attribute, FAIL, "H5Acreate");
+ attribute = H5Acreate2(dataset, ".", name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attribute, FAIL, "H5Acreate2");
/* Keep a copy of the attribute names around for later */
anames[i] = HDstrdup(name);
diff --git a/test/tmisc.c b/test/tmisc.c
index 5fee9dc..1a7da71 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -421,8 +421,8 @@ static void test_misc2_write_attribute(void)
root1 = H5Gopen2(file1, "/", H5P_DEFAULT);
CHECK(root1, FAIL, "H5Gopen2");
- att1 = H5Acreate(root1, MISC2_ATT_NAME_1, type, dataspace, H5P_DEFAULT);
- CHECK(att1, FAIL, "H5Acreate");
+ att1 = H5Acreate2(root1, ".", MISC2_ATT_NAME_1, type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(att1, FAIL, "H5Acreate2");
data.string = string_att1;
@@ -448,8 +448,8 @@ static void test_misc2_write_attribute(void)
root2 = H5Gopen2(file2, "/", H5P_DEFAULT);
CHECK(root2, FAIL, "H5Gopen2");
- att2 = H5Acreate(root2, MISC2_ATT_NAME_2, type, dataspace, H5P_DEFAULT);
- CHECK(att2, FAIL, "H5Acreate");
+ att2 = H5Acreate2(root2, ".", MISC2_ATT_NAME_2, type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(att2, FAIL, "H5Acreate2");
data.string = string_att2;
@@ -1022,57 +1022,56 @@ test_misc6(void)
CHECK(ret,FAIL,"H5Dclose");
/* Close file */
- ret=H5Fclose(loc_id);
- CHECK(ret,FAIL,"H5Fclose");
+ ret = H5Fclose(loc_id);
+ CHECK(ret, FAIL, "H5Fclose");
/* Loop through adding attributes to each dataset */
- for(u=0; u<MISC6_NUMATTR; u++) {
+ for(u = 0; u < MISC6_NUMATTR; u++) {
/* Create name for attribute */
- sprintf(attr_name,"Attr#%u",u);
+ sprintf(attr_name, "Attr#%u", u);
/* Open the file */
- loc_id=H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(loc_id,FAIL,"H5Fopen");
+ loc_id = H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(loc_id, FAIL, "H5Fopen");
/* Open first dataset */
- dataset_id=H5Dopen(loc_id, MISC6_DSETNAME1);
- CHECK(dataset_id,FAIL,"H5Dopen");
+ dataset_id = H5Dopen(loc_id, MISC6_DSETNAME1);
+ CHECK(dataset_id, FAIL, "H5Dopen");
/* Add attribute to dataset */
- attr_id=H5Acreate(dataset_id,attr_name,H5T_NATIVE_INT,space_id,H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dataset_id, ".", attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
/* Close attribute */
- ret=H5Aclose(attr_id);
+ ret = H5Aclose(attr_id);
CHECK(ret, FAIL, "H5Aclose");
/* Close dataset */
- ret=H5Dclose(dataset_id);
+ ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
/* Open second dataset */
- dataset_id=H5Dopen(loc_id, MISC6_DSETNAME2);
- CHECK(dataset_id,FAIL,"H5Dopen");
+ dataset_id = H5Dopen(loc_id, MISC6_DSETNAME2);
+ CHECK(dataset_id, FAIL, "H5Dopen");
/* Add attribute to dataset */
- attr_id=H5Acreate(dataset_id,attr_name,H5T_NATIVE_INT,space_id,H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(dataset_id, ".", attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
/* Close attribute */
- ret=H5Aclose(attr_id);
+ ret = H5Aclose(attr_id);
CHECK(ret, FAIL, "H5Aclose");
/* Close dataset */
- ret=H5Dclose(dataset_id);
+ ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
/* Close file */
- ret=H5Fclose(loc_id);
+ ret = H5Fclose(loc_id);
CHECK(ret,FAIL,"H5Fclose");
-
} /* end for */
/* Close dataspace */
@@ -2883,15 +2882,15 @@ test_misc18(void)
sprintf(attr_name,"Attr %u",u);
/* Create & close attribute on first dataset */
- aid = H5Acreate(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(did1, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "HAclose");
/* Create & close attribute on second dataset */
- aid = H5Acreate(did2, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(did2, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
ret = H5Aclose(aid);
CHECK(ret, FAIL, "HAclose");
@@ -3180,8 +3179,8 @@ test_misc19(void)
CHECK(sid, FAIL, "H5Screate");
/* Create an attribute */
- aid = H5Acreate(gid,MISC19_ATTR_NAME,H5T_NATIVE_INT,sid,H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC19_ATTR_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Check the reference count */
rc = H5Iget_ref(aid);
@@ -4296,8 +4295,8 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Tset_size");
/* Add 1st attribute on first group */
- aid = H5Acreate(gid, MISC25A_ATTR1_NAME, tid, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25A_ATTR1_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -4322,8 +4321,8 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Tset_size");
/* Add 2nd attribute on first group */
- aid = H5Acreate(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -4395,8 +4394,8 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Tset_size");
/* Add 3rd attribute on first group (smaller than 2nd attribute) */
- aid = H5Acreate(gid, MISC25A_ATTR3_NAME, tid, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25A_ATTR3_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -4443,8 +4442,8 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Tset_size");
/* Re-create 2nd attribute on first group */
- aid = H5Acreate(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -4507,8 +4506,8 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Tset_size");
/* Re-create 2nd attribute on first group */
- aid = H5Acreate(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -4637,8 +4636,8 @@ test_misc25c(void)
CHECK(ret, FAIL, "H5Gclose");
/* Add an attribute to the dataset group */
- aid = H5Acreate(gid, MISC25C_ATTRNAME, H5T_NATIVE_CHAR, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25C_ATTRNAME, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close the attribute */
ret = H5Aclose(aid);
@@ -4653,8 +4652,8 @@ test_misc25c(void)
CHECK(ret, FAIL, "H5Gclose");
/* Add second attribute to the dataset group */
- aid = H5Acreate(gid, MISC25C_ATTRNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate");
+ aid = H5Acreate2(gid, ".", MISC25C_ATTRNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
/* Close the attribute */
ret = H5Aclose(aid);
diff --git a/test/tsohm.c b/test/tsohm.c
index 5b003c3..894f0bc 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -998,8 +998,8 @@ static void sohm_attr_helper(hid_t fcpl_id)
/* Create and verify an attribute on a group */
group_id = H5Gcreate2(file_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(group_id, "H5Gcreate2");
- attr_id = H5Acreate(group_id, "attribute", type_id, space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(group_id, ".", "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
CHECK_I(ret, "H5Awrite");
@@ -1034,8 +1034,8 @@ static void sohm_attr_helper(hid_t fcpl_id)
/* Create and verify an attribute */
group_id = H5Gcreate2(file_id, "another_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(group_id, "H5Gcreate2");
- attr_id = H5Acreate(group_id, "attribute", type_id, space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(group_id, ".", "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
CHECK_I(ret, "H5Awrite");
@@ -1484,8 +1484,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
dset_id = H5Dcreate(file_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id);
CHECK_I(dset_id, "H5Dcreate");
- attr_id = H5Acreate(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string1);
CHECK_I(ret, "H5Awrite");
@@ -1533,8 +1533,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
dset_id = H5Dcreate(group_id, DSETNAME[x], dtype2_id, dspace2_id, dcpl2_id);
CHECK_I(dset_id, "H5Dcreate");
- attr_id = H5Acreate(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string2);
CHECK_I(ret, "H5Awrite");
@@ -1574,8 +1574,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
dset_id = H5Dcreate(group_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id);
CHECK_I(dset_id, "H5Dcreate");
- attr_id = H5Acreate(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string1);
CHECK_I(ret, "H5Awrite");
@@ -1587,8 +1587,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
dset_id = H5Dcreate(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, dcpl2_id);
CHECK_I(dset_id, "H5Dcreate");
- attr_id = H5Acreate(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string2);
CHECK_I(ret, "H5Awrite");
@@ -1632,8 +1632,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
attr_string1[1] = attr_name[1] = (x % 10) + '0';
/* Create an attribute on the group */
- attr_id = H5Acreate(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(group_id, ".", attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string1);
CHECK_I(ret, "H5Awrite");
@@ -1672,8 +1672,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
attr_string1[1] = attr_name[1] = (x % 10) + '0';
/* Create an attribute on the group */
- attr_id = H5Acreate(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(group_id, ".", attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
ret = H5Awrite(attr_id, attr_type_id, attr_string1);
CHECK_I(ret, "H5Awrite");
@@ -2573,8 +2573,8 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id,
CHECK_I(ret, "H5Dwrite");
/* Create an attribute on the dataset. */
- attr_id = H5Acreate(dset_id, "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate");
+ attr_id = H5Acreate2(dset_id, ".", "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
/* Write to attribute */
ret = H5Awrite(attr_id, H5T_NATIVE_CHAR, &wdata);
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index cfc250b..6409bb1 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -19,17 +19,17 @@
* operations. -- Threaded program --
* ------------------------------------------------------------------
*
- * Plan: Attempt to break H5Acreate by making many simultaneous create
+ * Plan: Attempt to break H5Acreate2 by making many simultaneous create
* calls.
*
- * Claim: N calls to H5Acreate should create N attributes for a dataset
+ * Claim: N calls to H5Acreate2 should create N attributes for a dataset
* if threadsafe. If some unprotected shared data exists for the
* dataset (eg, a count of the number of attributes in the
* dataset), there is a small chance that consecutive reads occur
* before a write to that shared variable.
*
* HDF5 APIs exercised in thread:
- * H5Acreate, H5Awrite, H5Aclose.
+ * H5Acreate2, H5Awrite, H5Aclose.
*
* Created: Oct 5 1999
* Programmer: Chee Wai LEE
@@ -167,9 +167,9 @@ void *tts_acreate_thread(void *client_data)
/* Create attribute */
attribute_name = gen_name(attrib_data->current_index);
- attribute = H5Acreate(attrib_data->dataset, attribute_name,
+ attribute = H5Acreate2(attrib_data->dataset, ".", attribute_name,
attrib_data->datatype, attrib_data->dataspace,
- H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write data to the attribute */
attribute_data = malloc(sizeof(int));
diff --git a/test/tunicode.c b/test/tunicode.c
index 20ca9bc..6898857 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -530,8 +530,8 @@ void test_attrname(hid_t fid, const char * string)
CHECK(ret, FAIL, "H5Tset_size");
/* Create the attribute and check that its name is correct */
- attr_id = H5Acreate(group_id, string, dtype_id, space_id, H5P_DEFAULT);
- CHECK(attr_id, FAIL, "H5Acreate");
+ attr_id = H5Acreate2(group_id, ".", string, dtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr_id, FAIL, "H5Acreate2");
ret = H5Aget_name(attr_id, (size_t)MAX_STRING_LENGTH, read_buf);
CHECK(ret, FAIL, "H5Aget_name");
ret = strcmp(read_buf, string);
diff --git a/test/tvlstr.c b/test/tvlstr.c
index a758a9e..c9acba0 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -597,8 +597,8 @@ static void test_write_vl_string_attribute(void)
CHECK(dataspace, FAIL, "H5Screate");
/* Test creating a "normal" sized string attribute */
- att = H5Acreate(root, "test_scalar", type, dataspace, H5P_DEFAULT);
- CHECK(att, FAIL, "H5Acreate");
+ att = H5Acreate2(root, ".", "test_scalar", type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(att, FAIL, "H5Acreate2");
ret = H5Awrite(att, type, &string_att);
CHECK(ret, FAIL, "H5Awrite");
@@ -615,8 +615,8 @@ static void test_write_vl_string_attribute(void)
CHECK(ret, FAIL, "HAclose");
/* Test creating a "large" sized string attribute */
- att = H5Acreate(root, "test_scalar_large", type, dataspace, H5P_DEFAULT);
- CHECK(att, FAIL, "H5Acreate");
+ att = H5Acreate2(root, ".", "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(att, FAIL, "H5Acreate2");
string_att_write = (char*)HDcalloc((size_t)8192, sizeof(char));
HDmemset(string_att_write, 'A', (size_t)8191);
diff --git a/test/unlink.c b/test/unlink.c
index 1d89c29..fad41ae 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -824,7 +824,7 @@ test_filespace(hid_t fapl)
sprintf(objname,"%s %u",ATTRNAME,u);
/* Create an attribute on the first dataset */
- if((attr = H5Acreate(dataset, objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((attr = H5Acreate2(dataset, ".", objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Don't worry about writing the attribute - it will have a fill value */
@@ -832,7 +832,7 @@ test_filespace(hid_t fapl)
if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
/* Create an attribute on the second dataset */
- if((attr = H5Acreate(dataset2, objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((attr = H5Acreate2(dataset2, ".", objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Don't worry about writing the attribute - it will have a fill value */
@@ -1191,7 +1191,7 @@ test_filespace(hid_t fapl)
if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR
/* Create an attribute on the dataset */
- if((attr = H5Acreate(dataset, ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((attr = H5Acreate2(dataset, ".", ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Don't worry about writing the attribute - it will have a fill value */
@@ -1200,7 +1200,7 @@ test_filespace(hid_t fapl)
/* Create another attribute with same name */
H5E_BEGIN_TRY {
- attr = H5Acreate(dataset, ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(attr >= 0) {
H5Aclose(attr);
diff --git a/test/vfd.c b/test/vfd.c
index 97a2526..01d9d98 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -84,11 +84,11 @@ test_sec2(void)
/* Set property list and file name for SEC2 driver. */
fapl = h5_fileaccess();
- if(H5Pset_fapl_sec2(fapl)<0)
+ if(H5Pset_fapl_sec2(fapl) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -100,7 +100,7 @@ test_sec2(void)
TEST_ERROR;
/* Check file handle API */
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
@@ -115,7 +115,7 @@ test_sec2(void)
if(file_size<1*KB || file_size>4*KB)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
PASSED();
@@ -175,17 +175,17 @@ test_direct(void)
/* Set property list and file name for Direct driver. Set memory alignment boundary
* and file block size to 512 which is the minimum for Linux 2.6. */
fapl = h5_fileaccess();
- if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE)<0)
+ if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
/* Verify the file access properties */
- if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize)<0)
+ if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0)
TEST_ERROR;
if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE)
TEST_ERROR;
- if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE)<0)
+ if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -207,7 +207,7 @@ test_direct(void)
TEST_ERROR;
/* Check file handle API */
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
@@ -239,25 +239,25 @@ test_direct(void)
/* Create the data space1 */
dims1[0] = DSET1_DIM1;
dims1[1] = DSET1_DIM2;
- if ((space1 = H5Screate_simple(2, dims1, NULL))<0)
+ if ((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT))<0)
+ if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
+ if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0)
+ if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -276,25 +276,25 @@ test_direct(void)
/* Create the data space2. For data set 2, memory address and data size are not aligned. */
dims2[0] = DSET2_DIM;
- if ((space2 = H5Screate_simple(1, dims2, NULL))<0)
+ if ((space2 = H5Screate_simple(1, dims2, NULL)) < 0)
TEST_ERROR;
/* Create the dset2 */
- if ((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT))<0)
+ if ((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2)<0)
+ if (H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2) < 0)
TEST_ERROR;
- if(H5Dclose(dset2)<0)
+ if(H5Dclose(dset2) < 0)
TEST_ERROR;
- if((dset2=H5Dopen(file, DSET2_NAME))<0)
+ if((dset2=H5Dopen(file, DSET2_NAME)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2)<0)
+ if (H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -307,15 +307,15 @@ test_direct(void)
}
}
- if(H5Sclose(space1)<0)
+ if(H5Sclose(space1) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Sclose(space2)<0)
+ if(H5Sclose(space2) < 0)
TEST_ERROR;
- if(H5Dclose(dset2)<0)
+ if(H5Dclose(dset2) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
if(points)
free(points);
@@ -379,11 +379,11 @@ test_core(void)
/* Set property list and file name for CORE driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -394,7 +394,7 @@ test_core(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle) < 0)
TEST_ERROR;
if(fhandle==NULL)
{
@@ -412,16 +412,16 @@ test_core(void)
if(file_size<2*KB || file_size>6*KB)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Open the file with backing store off for read and write.
* Changes won't be saved in file. */
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Allocate memory for data set. */
@@ -437,25 +437,25 @@ test_core(void)
/* Create the data space1 */
dims1[0] = DSET1_DIM1;
dims1[1] = DSET1_DIM2;
- if ((space1 = H5Screate_simple(2, dims1, NULL))<0)
+ if ((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT))<0)
+ if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
+ if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0)
+ if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -472,32 +472,32 @@ test_core(void)
}
}
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Open the file with backing store on for read and write.
* Changes will be saved in file. */
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT))<0)
+ if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
+ if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
TEST_ERROR;
/* Reallocate memory for reading buffer. */
@@ -507,7 +507,7 @@ test_core(void)
check=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int));
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0)
+ if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -533,11 +533,11 @@ test_core(void)
if(file_size<64*KB || file_size>256*KB)
TEST_ERROR;
- if(H5Sclose(space1)<0)
+ if(H5Sclose(space1) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
if(points)
free(points);
@@ -597,7 +597,7 @@ test_family_opens(char *fname, hid_t fa_pl)
if(file >= 0) TEST_ERROR
/* Case 3: reopen file with wrong member size */
- if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -613,7 +613,7 @@ test_family_opens(char *fname, hid_t fa_pl)
break;
}
- if(H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -671,14 +671,14 @@ test_family(void)
/* Set property list and file name for FAMILY driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test different wrong ways to reopen family files where there's only
@@ -687,10 +687,10 @@ test_family(void)
TEST_ERROR;
/* Reopen the file with default member file size */
- if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Check file size API */
@@ -702,7 +702,7 @@ test_family(void)
TEST_ERROR;
/* Create and write dataset */
- if((space=H5Screate_simple(2, dims, NULL))<0)
+ if((space=H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -713,30 +713,30 @@ test_family(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0)
+ if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<FAMILY_NUMBER; i++)
for(j=0; j<FAMILY_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
/* check file handle API */
- if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl2=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
- if(H5Pset_family_offset(fapl2, (hsize_t)0)<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)0) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
- if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2))<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2)) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2) < 0)
TEST_ERROR;
if(*fhandle2<0)
TEST_ERROR;
@@ -755,28 +755,28 @@ test_family(void)
TEST_ERROR;
}
- if(H5Sclose(space)<0)
+ if(H5Sclose(space) < 0)
TEST_ERROR;
- if(H5Dclose(dset)<0)
+ if(H5Dclose(dset) < 0)
TEST_ERROR;
- if(H5Pclose(fapl2)<0)
+ if(H5Pclose(fapl2) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test different wrong ways to reopen family files when there're multiple
* member files existing. */
- if(test_family_opens(filename, fapl)<0)
+ if(test_family_opens(filename, fapl) < 0)
TEST_ERROR;
/* Reopen the file with correct member file size. */
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
@@ -834,7 +834,7 @@ test_family_compat(void)
/* Set property list and file name for FAMILY driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT) < 0)
TEST_ERROR;
h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename);
@@ -847,13 +847,13 @@ test_family_compat(void)
}
strcat(pathname, filename);
- if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0)
+ if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
- if(H5Pclose(fapl)<0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
PASSED();
@@ -979,27 +979,27 @@ test_multi(void)
memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX*3/4;
- if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE)<0)
+ if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test wrong ways to reopen multi files */
- if(test_multi_opens(filename)<0)
+ if(test_multi_opens(filename) < 0)
TEST_ERROR;
/* Reopen the file */
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Create and write data set */
- if((space=H5Screate_simple(2, dims, NULL))<0)
+ if((space=H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -1020,27 +1020,27 @@ test_multi(void)
if(file_size < HADDR_MAX/4 || file_size > HADDR_MAX/2)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0)
+ if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<MULTI_SIZE; i++)
for(j=0; j<MULTI_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
- if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl2=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
- if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER)<0)
+ if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
- if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW)<0)
+ if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2) < 0)
TEST_ERROR;
if(*fhandle2<0)
TEST_ERROR;
@@ -1056,11 +1056,11 @@ test_multi(void)
if(file_size < HADDR_MAX/2 || file_size > HADDR_MAX)
TEST_ERROR;
- if(H5Sclose(space)<0)
+ if(H5Sclose(space) < 0)
TEST_ERROR;
- if(H5Dclose(dset)<0)
+ if(H5Dclose(dset) < 0)
TEST_ERROR;
- if(H5Pclose(fapl2)<0)
+ if(H5Pclose(fapl2) < 0)
TEST_ERROR;
/* Create and write attribute for the root group. */
@@ -1068,34 +1068,34 @@ test_multi(void)
FAIL_STACK_ERROR
/* Attribute string. */
- if((atype = H5Tcopy(H5T_C_S1))<0)
+ if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1)<0)
+ if(H5Tset_size(atype, strlen(meta) + 1) < 0)
TEST_ERROR;
- if(H5Tset_strpad(atype, H5T_STR_NULLTERM)<0)
+ if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
TEST_ERROR;
/* Create and write attribute */
- if((aspace = H5Screate_simple(1, adims, NULL))<0)
+ if((aspace = H5Screate_simple(1, adims, NULL)) < 0)
TEST_ERROR;
- if((attr = H5Acreate(root, "Metadata", atype, aspace, H5P_DEFAULT))<0)
+ if((attr = H5Acreate2(root, ".", "Metadata", atype, aspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(H5Awrite(attr, atype, meta)<0)
+ if(H5Awrite(attr, atype, meta) < 0)
TEST_ERROR;
/* Close IDs */
- if(H5Tclose(atype)<0)
+ if(H5Tclose(atype) < 0)
TEST_ERROR;
- if(H5Sclose(aspace)<0)
+ if(H5Sclose(aspace) < 0)
TEST_ERROR;
- if(H5Aclose(attr)<0)
+ if(H5Aclose(attr) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
@@ -1134,18 +1134,18 @@ error:
int
main(void)
{
- int nerrors=0;
+ int nerrors = 0;
h5_reset();
- nerrors += test_sec2()<0 ?1:0;
- nerrors += test_core()<0 ?1:0;
- nerrors += test_family()<0 ?1:0;
- nerrors += test_family_compat()<0 ?1:0;
- nerrors += test_multi()<0 ?1:0;
- nerrors += test_direct()<0 ?1:0;
+ nerrors += test_sec2() < 0 ? 1 : 0;
+ nerrors += test_core() < 0 ? 1 : 0;
+ nerrors += test_family() < 0 ? 1 : 0;
+ nerrors += test_family_compat() < 0 ? 1 : 0;
+ nerrors += test_multi() < 0 ? 1 : 0;
+ nerrors += test_direct() < 0 ? 1 : 0;
- if (nerrors){
+ if(nerrors) {
printf("***** %d Virtual File Driver TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
return 1;
@@ -1154,3 +1154,4 @@ main(void)
printf("All Virtual File Driver tests passed.\n");
return 0;
}
+
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 83421cb..0a7a1a8 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -338,16 +338,16 @@ void null_dataset(void)
/* Write "nothing" to the dataset (with type conversion) */
- ret=H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval);
+ ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* Create an attribute for the group */
- attr=H5Acreate(dataset,attr_name,H5T_NATIVE_UINT,sid,H5P_DEFAULT);
- VRFY((attr>=0), "H5Acreate");
+ attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((attr >= 0), "H5Acreate2");
/* Write "nothing" to the attribute (with type conversion) */
ret = H5Awrite(attr, H5T_NATIVE_INT, &val);
- VRFY((ret>=0), "H5Awrite");
+ VRFY((ret >= 0), "H5Awrite");
H5Aclose (attr);
H5Dclose (dataset);
@@ -1300,21 +1300,21 @@ void write_attribute(hid_t obj_id, int this_type, int num)
if(this_type == is_group) {
sprintf(attr_name, "Group Attribute %d", num);
sid = H5Screate(H5S_SCALAR);
- aid = H5Acreate(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ aid = H5Acreate2(obj_id, ".", attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(aid, H5T_NATIVE_INT, &num);
H5Aclose(aid);
H5Sclose(sid);
- }
+ } /* end if */
else if(this_type == is_dset) {
sprintf(attr_name, "Dataset Attribute %d", num);
for(i=0; i<8; i++)
attr_data[i] = i;
sid = H5Screate_simple(dspace_rank, dspace_dims, NULL);
- aid = H5Acreate(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ aid = H5Acreate2(obj_id, ".", attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(aid, H5T_NATIVE_INT, attr_data);
H5Aclose(aid);
H5Sclose(sid);
- }
+ } /* end else-if */
}
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index dba7fca..ba8b222 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -618,7 +618,7 @@ int test_attributes(const char *file,
herr_t status;
/* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* Create a 1D dataset */
@@ -682,7 +682,7 @@ int test_datasets(const char *file,
memset(buf,0,sizeof buf);
/* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* Create a 1D dataset */
@@ -972,13 +972,13 @@ void write_attr_in(hid_t loc_id,
[ 1 ] 3 0 3
*/
- sid = H5Screate_simple(1,dims,NULL);
+ sid = H5Screate_simple(1, dims, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- aid = H5Acreate(loc_id,"vlen",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -1243,13 +1243,13 @@ position enum2D of </g1> enum2D of </g1> difference
[ 2 1 ] 11 0 11
*/
- sid = H5Screate_simple(2,dims2,NULL);
+ sid = H5Screate_simple(2, dims2, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- aid = H5Acreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -1640,13 +1640,13 @@ position vlen3D of </g1> vlen3D of </g1> difference
[ 1 1 0 ] 10 0 10
etc
*/
- sid = H5Screate_simple(3,dims3,NULL);
+ sid = H5Screate_simple(3, dims3, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- aid = H5Acreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -2438,19 +2438,19 @@ int test_hyperslab(const char *fname,
/* create */
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue)<0)
+ if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &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,"big",H5T_NATIVE_CHAR,f_sid,dcpl))<0)
+ if ((did = H5Dcreate(fid,"big",H5T_NATIVE_CHAR,f_sid,dcpl)) < 0)
goto out;
- if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0)
+ if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
goto out;
- if ((tid = H5Dget_type(did))<0)
+ if ((tid = H5Dget_type(did)) < 0)
goto out;
if ((size = H5Tget_size(tid))<=0)
goto out;
@@ -2476,13 +2476,13 @@ int test_hyperslab(const char *fname,
}
hs_start[0] = i * GBLL/(1024*1024);
- 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;
/* write only one hyperslab */
if ( i==512*512)
{
- if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf)<0)
+ if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0)
goto out;
}
@@ -2491,13 +2491,13 @@ int test_hyperslab(const char *fname,
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;
H5Fclose(fid);
@@ -2535,25 +2535,23 @@ int write_attr(hid_t loc_id,
hid_t sid;
/* create a space */
- if (( sid = H5Screate_simple(rank,dims,NULL)) < 0 )
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
goto out;
/* create the attribute */
- if (( aid = H5Acreate(loc_id,name,tid,sid,H5P_DEFAULT)) < 0 )
+ if((aid = H5Acreate2(loc_id, ".", name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* write */
- if ( buf )
- {
- if ( H5Awrite(aid,tid,buf) < 0 )
+ if(buf)
+ if(H5Awrite(aid, tid, buf) < 0)
goto out;
- }
/* close */
H5Aclose(aid);
H5Sclose(sid);
-return SUCCEED;
+ return SUCCEED;
out:
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 862ae60..16fe91b 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -379,7 +379,7 @@ gent_attribute(void)
/* attribute 1 */
dims[0] = 24;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (root, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "attribute of root group");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -388,7 +388,7 @@ gent_attribute(void)
/* attribute 2 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (root, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 10; i++) data[i] = i+1;
@@ -399,7 +399,7 @@ gent_attribute(void)
/* attribute 3 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (root, "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT);
+ 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;
@@ -409,7 +409,7 @@ gent_attribute(void)
/* attribute 4 */
space = H5Screate(H5S_SCALAR);
- attr = H5Acreate (root, "attr4", H5T_STD_I32BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "attr4", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attr, H5T_NATIVE_INT, &point);
H5Sclose(space);
H5Aclose(attr);
@@ -418,7 +418,7 @@ gent_attribute(void)
space = H5Screate(H5S_SCALAR);
type = H5Tcopy(H5T_C_S1);
H5Tset_size(type, 17);
- attr = H5Acreate (root, "attr5", type, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "attr5", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attr, type, string);
H5Tclose(type);
@@ -931,7 +931,7 @@ static void gent_all(void)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(group, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -939,7 +939,7 @@ static void gent_all(void)
dims[0] = 2; dims[1] = 2;
space = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate (group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(group, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
H5Awrite(attr, H5T_NATIVE_INT, data);
H5Sclose(space);
@@ -962,7 +962,7 @@ static void gent_all(void)
/* attributes of dset1.1.1 */
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -970,7 +970,7 @@ static void gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -1165,7 +1165,7 @@ static void gent_many(void)
/* add attributes to dset1 */
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_CHAR, buf);
H5Sclose(space2);
@@ -1173,7 +1173,7 @@ static void gent_many(void)
dims[0] = 2; dims[1] = 2;
space2 = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate (dataset, "attr2", H5T_STD_I32BE, space2, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr2", H5T_STD_I32BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
H5Awrite(attr, H5T_NATIVE_INT, data);
H5Sclose(space2);
@@ -1181,7 +1181,7 @@ static void gent_many(void)
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 10; i++)
d[i] = 0.1 * i;
H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
@@ -1489,7 +1489,7 @@ hsize_t sdim;
dims[0] = 3;
space2 = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(&(buf2[0*LENSTR2]), "0123456789");
sprintf(&(buf2[1*LENSTR2]), "abcdefghij");
sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ");
@@ -2950,7 +2950,7 @@ void gent_split_file(void)
dims[0] = 1;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate(root, "Metadata", atype, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "Metadata", atype, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attr, atype, meta);
H5Tclose(atype);
H5Sclose(space);
@@ -3120,7 +3120,7 @@ static void gent_vlstr(void)
root = H5Gopen2(fid1, "/", H5P_DEFAULT);
dataspace = H5Screate(H5S_SCALAR);
- att = H5Acreate(root, "test_scalar", tid1, dataspace, H5P_DEFAULT);
+ att = H5Acreate2(root, ".", "test_scalar", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(att, tid1, &string_att);
/* Close */
@@ -3312,20 +3312,20 @@ static void write_attr_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
- ((int *)buf5[0].p)[0]=1;
+ buf5[0].p = malloc(1 * sizeof(int));
+ ((int *)buf5[0].p)[0] = 1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
- ((int *)buf5[1].p)[0]=2;
- ((int *)buf5[1].p)[1]=3;
+ buf5[1].p = malloc(2 * sizeof(int));
+ ((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);
- aid = H5Acreate(loc_id,"vlen",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -3419,23 +3419,24 @@ static void write_attr_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);
- aid = H5Acreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -3548,26 +3549,27 @@ static void write_attr_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);
- aid = H5Acreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT);
- status = H5Awrite(aid,tid,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53);
- assert(status>=0);
+ aid = H5Acreate2(loc_id, ".", "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(aid, tid, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -4154,18 +4156,19 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name,
herr_t status;
/* Create a buf space */
- sid = H5Screate_simple(rank,dims,NULL);
+ sid = H5Screate_simple(rank, dims, NULL);
/* Create the attribute */
- aid = H5Acreate(loc_id,attr_name,tid,sid,H5P_DEFAULT);
+ aid = H5Acreate2(loc_id, ".", attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write the buf */
- if ( buf )
- status = H5Awrite(aid,tid,buf);
+ if(buf)
+ status = H5Awrite(aid, tid, buf);
/* Close */
status = H5Aclose(aid);
status = H5Sclose(sid);
+
return status;
}
@@ -4417,16 +4420,16 @@ static void gent_named_dtype_attr(void)
assert(ret >= 0);
/* Create a scalar dataspace used for all objects */
- sid=H5Screate(H5S_SCALAR);
- assert(sid>0);
+ sid = H5Screate(H5S_SCALAR);
+ assert(sid > 0);
/* Create attribute on commited datatype */
- aid=H5Acreate(tid,F42_ATTRNAME,H5T_STD_I32LE,sid,H5P_DEFAULT);
- assert(aid>0);
+ aid = H5Acreate2(tid, ".", F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(aid > 0);
/* Write data into the attribute */
- ret=H5Awrite(aid,H5T_NATIVE_INT,&data);
- assert(ret>=0);
+ ret = H5Awrite(aid, H5T_NATIVE_INT, &data);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* dataset
@@ -4434,16 +4437,16 @@ static void gent_named_dtype_attr(void)
*/
/* Create dataset */
- did=H5Dcreate(fid,F42_DSETNAME,tid,sid,H5P_DEFAULT);
- assert(did>0);
+ did = H5Dcreate(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT);
+ assert(did > 0);
/* Create attribute on dataset */
- aid=H5Acreate(did,F42_ATTRNAME,tid,sid,H5P_DEFAULT);
- assert(aid>0);
+ aid = H5Acreate2(did, ".", F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(aid > 0);
/* Write data into the attribute */
- ret=H5Awrite(aid,H5T_NATIVE_INT,&data);
- assert(ret>=0);
+ ret = H5Awrite(aid, H5T_NATIVE_INT, &data);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* group
@@ -4452,15 +4455,15 @@ static void gent_named_dtype_attr(void)
/* Create a group */
gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(gid>0);
+ assert(gid > 0);
/* Create attribute on group */
- aid=H5Acreate(gid,F42_ATTRNAME,tid,sid,H5P_DEFAULT);
- assert(aid>0);
+ aid = H5Acreate2(gid, ".", F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(aid > 0);
/* Write data into the attribute */
- ret=H5Awrite(aid,H5T_NATIVE_INT,&data);
- assert(ret>=0);
+ ret = H5Awrite(aid, H5T_NATIVE_INT, &data);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* close
@@ -4513,7 +4516,7 @@ static void gent_null_space(void)
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf);
/* attribute */
- attr = H5Acreate (root, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT);
+ attr = H5Acreate2(root, ".", "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */
H5Dclose(dataset);
@@ -5762,7 +5765,7 @@ gent_hyperslab(void)
*-------------------------------------------------------------------------
*/
static void
-gent_group_creation_order()
+gent_group_creation_order(void)
{
hid_t fid; /* file ID */
hid_t gid; /* group ID */
@@ -5902,7 +5905,7 @@ out:
*-------------------------------------------------------------------------
*/
static void
-gent_attr_creation_order()
+gent_attr_creation_order(void)
{
hid_t fid; /* file id */
hid_t gid; /* group id */
@@ -5910,11 +5913,11 @@ gent_attr_creation_order()
hid_t sid; /* space id */
hid_t aid; /* attribute id */
hid_t gcpl_id; /* group creation property list ID */
- hid_t dcpl_id; /* dataset creation property list ID */
+ hid_t dcpl_id; /* dataset creation property list ID */
int i;
- char *attr_name[3] = {"c", "b", "a" };
+ const char *attr_name[3] = {"c", "b", "a" };
- if ((fid = H5Fcreate(FILE59, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((fid = H5Fcreate(FILE59, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* create group creation property list */
@@ -5939,23 +5942,21 @@ gent_attr_creation_order()
*/
/* create dataspace for dataset */
- if ((sid = H5Screate(H5S_SCALAR)) < 0)
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
goto out;
/* create a dataset */
- if ((did = H5Dcreate(fid, "dset", H5T_NATIVE_UCHAR, sid, dcpl_id)) < 0)
+ if((did = H5Dcreate(fid, "dset", H5T_NATIVE_UCHAR, sid, dcpl_id)) < 0)
goto out;
/* add attributes */
- for(i = 0; i < 3; i++)
- {
- if ((aid = H5Acreate(did, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT)) < 0)
+ 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;
/* close attribute */
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
-
} /* end for */
if (H5Dclose(did) < 0)
@@ -5967,33 +5968,30 @@ gent_attr_creation_order()
*-------------------------------------------------------------------------
*/
- 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 = H5Acreate(gid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT)) < 0)
+ for(i = 0; i < 3; i++) {
+ 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)
goto out;
-
/* close */
- if (H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if (H5Pclose(gcpl_id) < 0)
+ if(H5Pclose(gcpl_id) < 0)
goto out;
- if (H5Fclose(fid) < 0)
+ if(H5Fclose(fid) < 0)
goto out;
return;
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 96f9bc7..846d300 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -207,7 +207,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(group, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -215,7 +215,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 2; dims[1] = 2;
space = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate (group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(group, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
H5Awrite(attr, H5T_NATIVE_INT, data);
H5Sclose(space);
@@ -238,7 +238,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
/* attributes of dset1.1.1 */
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -246,7 +246,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT);
+ attr = H5Acreate2(dataset, ".", "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 677d9fd..4a84ea6 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -417,16 +417,16 @@ int do_copy_objects(hid_t fidin,
* copy attrs
*-------------------------------------------------------------------------
*/
- if (copy_attr(grp_in,grp_out,options)<0)
+ if (copy_attr(grp_in,grp_out,options) < 0)
goto error;
if (gcpl_id>0) {
- if (H5Pclose(gcpl_id)<0)
+ if (H5Pclose(gcpl_id) < 0)
goto error;
}
- if (H5Gclose(grp_out)<0)
+ if (H5Gclose(grp_out) < 0)
goto error;
- if (H5Gclose(grp_in)<0)
+ if (H5Gclose(grp_in) < 0)
goto error;
break;
@@ -440,15 +440,15 @@ int do_copy_objects(hid_t fidin,
has_filter = 0;
/* early detection of references */
- if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0)
+ if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0)
goto error;
- if ((ftype_id=H5Dget_type (dset_in))<0)
+ if ((ftype_id=H5Dget_type (dset_in)) < 0)
goto error;
if (H5T_REFERENCE==H5Tget_class(ftype_id))
is_ref=1;
- if (H5Tclose(ftype_id)<0)
+ if (H5Tclose(ftype_id) < 0)
goto error;
- if (H5Dclose(dset_in)<0)
+ if (H5Dclose(dset_in) < 0)
goto error;
@@ -466,20 +466,20 @@ int do_copy_objects(hid_t fidin,
{
int j;
- if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0)
+ if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0)
goto error;
- if ((f_space_id=H5Dget_space(dset_in))<0)
+ if ((f_space_id=H5Dget_space(dset_in)) < 0)
goto error;
- if ((ftype_id=H5Dget_type (dset_in))<0)
+ if ((ftype_id=H5Dget_type (dset_in)) < 0)
goto error;
- if ((dcpl_id=H5Dget_create_plist(dset_in))<0)
+ if ((dcpl_id=H5Dget_create_plist(dset_in)) < 0)
goto error;
- if ((dcpl_out = H5Pcopy (dcpl_id))<0)
+ if ((dcpl_out = H5Pcopy (dcpl_id)) < 0)
goto error;
- if ( (rank=H5Sget_simple_extent_ndims(f_space_id))<0)
+ if ( (rank=H5Sget_simple_extent_ndims(f_space_id)) < 0)
goto error;
HDmemset(dims, 0, sizeof dims);
- if ( H5Sget_simple_extent_dims(f_space_id,dims,NULL)<0)
+ if ( H5Sget_simple_extent_dims(f_space_id,dims,NULL) < 0)
goto error;
nelmts=1;
for (j=0; j<rank; j++)
@@ -522,7 +522,7 @@ int do_copy_objects(hid_t fidin,
/* apply the filter */
if (apply_s) {
- if (apply_filters(travt->objs[i].name,rank,dims,dcpl_out,options,&has_filter)<0)
+ if (apply_filters(travt->objs[i].name,rank,dims,dcpl_out,options,&has_filter) < 0)
goto error;
}
@@ -537,7 +537,7 @@ int do_copy_objects(hid_t fidin,
} H5E_END_TRY;
if (dset_out==FAIL)
{
- if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_id))<0)
+ if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_id)) < 0)
goto error;
apply_f=0;
}
@@ -554,9 +554,9 @@ int do_copy_objects(hid_t fidin,
if (buf != NULL )
{
- if (H5Dread(dset_in,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dread(dset_in,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
- if (H5Dwrite(dset_out,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dwrite(dset_out,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
}
@@ -616,9 +616,9 @@ int do_copy_objects(hid_t fidin,
hs_nelmts *= hs_size[k];
}
- if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL)<0)
+ if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
goto error;
- if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL)<0)
+ if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
goto error;
}
else
@@ -693,11 +693,11 @@ int do_copy_objects(hid_t fidin,
* copy attrs
*-------------------------------------------------------------------------
*/
- if (copy_attr(dset_in,dset_out,options)<0)
+ if (copy_attr(dset_in,dset_out,options) < 0)
goto error;
/*close */
- if (H5Dclose(dset_out)<0)
+ if (H5Dclose(dset_out) < 0)
goto error;
}/*!H5T_REFERENCE*/
@@ -708,17 +708,17 @@ int do_copy_objects(hid_t fidin,
* close
*-------------------------------------------------------------------------
*/
- if (H5Tclose(ftype_id)<0)
+ if (H5Tclose(ftype_id) < 0)
goto error;
- if (H5Tclose(wtype_id)<0)
+ if (H5Tclose(wtype_id) < 0)
goto error;
- if (H5Pclose(dcpl_id)<0)
+ if (H5Pclose(dcpl_id) < 0)
goto error;
- if (H5Pclose(dcpl_out)<0)
+ if (H5Pclose(dcpl_out) < 0)
goto error;
- if (H5Sclose(f_space_id)<0)
+ if (H5Sclose(f_space_id) < 0)
goto error;
- if (H5Dclose(dset_in)<0)
+ if (H5Dclose(dset_in) < 0)
goto error;
}
@@ -748,11 +748,11 @@ int do_copy_objects(hid_t fidin,
fidout, /* Destination file or group identifier */
travt->objs[i].name, /* Name of the destination object */
pid, /* Properties which apply to the copy */
- H5P_DEFAULT)<0) /* Properties which apply to the new hard link */
+ H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */
goto error;
/* close property */
- if (H5Pclose(pid)<0)
+ if (H5Pclose(pid) < 0)
goto error;
@@ -760,15 +760,15 @@ int do_copy_objects(hid_t fidin,
* copy attrs manually
*-------------------------------------------------------------------------
*/
- if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0)
+ if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0)
goto error;
- if ((dset_out=H5Dopen(fidout,travt->objs[i].name))<0)
+ if ((dset_out=H5Dopen(fidout,travt->objs[i].name)) < 0)
goto error;
- if (copy_attr(dset_in,dset_out,options)<0)
+ if (copy_attr(dset_in,dset_out,options) < 0)
goto error;
- if (H5Dclose(dset_in)<0)
+ if (H5Dclose(dset_in) < 0)
goto error;
- if (H5Dclose(dset_out)<0)
+ if (H5Dclose(dset_out) < 0)
goto error;
} /* end do we have request for filter/chunking */
@@ -923,7 +923,7 @@ int copy_attr(hid_t loc_in,
goto error;
/* get name */
- if (H5Aget_name( attr_id, (size_t)255, name )<0)
+ if (H5Aget_name( attr_id, (size_t)255, name ) < 0)
goto error;
/* get the file datatype */
@@ -969,12 +969,12 @@ int copy_attr(hid_t loc_in,
*-------------------------------------------------------------------------
*/
- buf=(void *) HDmalloc((size_t)(nelmts*msize));
- if ( buf==NULL){
+ buf = (void *)HDmalloc((size_t)(nelmts * msize));
+ if(buf == NULL) {
error_msg(progname, "cannot read into memory\n" );
goto error;
}
- if (H5Aread(attr_id,wtype_id,buf)<0)
+ if(H5Aread(attr_id, wtype_id, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -982,24 +982,23 @@ int copy_attr(hid_t loc_in,
*-------------------------------------------------------------------------
*/
- if ((attr_out=H5Acreate(loc_out,name,ftype_id,space_id,H5P_DEFAULT))<0)
+ if((attr_out = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- if(H5Awrite(attr_out,wtype_id,buf)<0)
+ if(H5Awrite(attr_out, wtype_id, buf) < 0)
goto error;
/*close*/
- if (H5Aclose(attr_out)<0)
+ if(H5Aclose(attr_out) < 0)
goto error;
- if (buf)
+ if(buf)
free(buf);
-
} /*H5T_REFERENCE*/
- if (options->verbose)
+ if(options->verbose)
printf(FORMAT_OBJ_ATTR, "attr", name);
/*-------------------------------------------------------------------------
@@ -1007,10 +1006,10 @@ int copy_attr(hid_t loc_in,
*-------------------------------------------------------------------------
*/
- if (H5Tclose(ftype_id)<0) goto error;
- if (H5Tclose(wtype_id)<0) goto error;
- if (H5Sclose(space_id)<0) goto error;
- if (H5Aclose(attr_id)<0) goto error;
+ if (H5Tclose(ftype_id) < 0) goto error;
+ if (H5Tclose(wtype_id) < 0) goto error;
+ if (H5Sclose(space_id) < 0) goto error;
+ if (H5Aclose(attr_id) < 0) goto error;
} /* u */
@@ -1059,7 +1058,7 @@ static void print_dataset_info(hid_t dcpl_id,
strcpy(strfilter,"\0");
/* get information about input filters */
- if ((nfilters = H5Pget_nfilters(dcpl_id))<0)
+ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
return;
for ( i=0; i<nfilters; i++)
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index 9a6b3ae..1f078c3 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -522,7 +522,7 @@ static int copy_refs_attr(hid_t loc_in,
* copy
*-------------------------------------------------------------------------
*/
- if((attr_out = H5Acreate(loc_out, name, ftype_id, space_id, H5P_DEFAULT)) < 0)
+ if((attr_out = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(nelmts)
if(H5Awrite(attr_out, mtype_id, refbuf) < 0)
@@ -602,7 +602,7 @@ static int copy_refs_attr(hid_t loc_in,
* copy
*-------------------------------------------------------------------------
*/
- if((attr_out = H5Acreate(loc_out, name, ftype_id, space_id, H5P_DEFAULT)) < 0)
+ if((attr_out = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(nelmts)
if(H5Awrite(attr_out, mtype_id, refbuf) < 0)
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index fd38eed..16ed995 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -157,7 +157,7 @@ int main (void)
/* make the test files */
TESTING(" generating datasets");
- if (make_testfiles()<0)
+ if (make_testfiles() < 0)
GOERROR;
PASSED();
@@ -175,7 +175,7 @@ int main (void)
*/
TESTING(" copy of datasets (fill values)");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME0,FNAME0OUT,&pack_options) < 0)
GOERROR;
@@ -185,7 +185,7 @@ int main (void)
GOERROR;
if (h5repack_cmpdcpl(FNAME0,FNAME0OUT)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -195,7 +195,7 @@ int main (void)
*-------------------------------------------------------------------------
*/
TESTING(" copy of datasets (all datatypes)");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0)
GOERROR;
@@ -205,7 +205,7 @@ int main (void)
GOERROR;
if (h5repack_cmpdcpl(FNAME1,FNAME1OUT)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -215,7 +215,7 @@ int main (void)
*-------------------------------------------------------------------------
*/
TESTING(" copy of datasets (attributes)");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME2,FNAME2OUT,&pack_options) < 0)
GOERROR;
@@ -225,7 +225,7 @@ int main (void)
GOERROR;
if (h5repack_cmpdcpl(FNAME2,FNAME2OUT)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -234,7 +234,7 @@ int main (void)
*-------------------------------------------------------------------------
*/
TESTING(" copy of datasets (hardlinks)");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME3,FNAME3OUT,&pack_options) < 0)
GOERROR;
@@ -244,7 +244,7 @@ int main (void)
GOERROR;
if (h5repack_cmpdcpl(FNAME3,FNAME3OUT)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -254,7 +254,7 @@ int main (void)
*-------------------------------------------------------------------------
*/
TESTING(" copy of allocation early file");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME5,FNAME5OUT,&pack_options) < 0)
GOERROR;
@@ -262,7 +262,7 @@ int main (void)
GOERROR;
if (h5repack_verify(FNAME5OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -284,11 +284,11 @@ int main (void)
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset1:GZIP=9",&pack_options)<0)
+ if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -296,7 +296,7 @@ int main (void)
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
#else
@@ -312,11 +312,11 @@ int main (void)
#ifdef H5_HAVE_FILTER_DEFLATE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("GZIP=1",&pack_options)<0)
+ if (h5repack_addfilter("GZIP=1",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -324,7 +324,7 @@ int main (void)
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -350,11 +350,11 @@ if (h5tools_can_encode(H5Z_FILTER_SZIP) >0) {
*/
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options)<0)
+ if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("dset2:CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset2:CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -362,7 +362,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -382,9 +382,9 @@ TESTING(" adding szip filter to all");
#if defined (H5_HAVE_FILTER_SZIP)
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("SZIP=8,NN",&pack_options)<0)
+ if (h5repack_addfilter("SZIP=8,NN",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -392,7 +392,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -413,11 +413,11 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset1:SHUF",&pack_options)<0)
+ if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -425,7 +425,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -442,11 +442,11 @@ TESTING(" addding shuffle filter to all");
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("SHUF",&pack_options)<0)
+ if (h5repack_addfilter("SHUF",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -454,7 +454,7 @@ TESTING(" addding shuffle filter to all");
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -471,11 +471,11 @@ TESTING(" addding shuffle filter to all");
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset1:FLET",&pack_options)<0)
+ if (h5repack_addfilter("dset1:FLET",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -483,7 +483,7 @@ TESTING(" addding shuffle filter to all");
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -501,11 +501,11 @@ TESTING(" addding shuffle filter to all");
#ifdef H5_HAVE_FILTER_FLETCHER32
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("FLET",&pack_options)<0)
+ if (h5repack_addfilter("FLET",&pack_options) < 0)
GOERROR;
- if (h5repack_addlayout("CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -513,7 +513,7 @@ TESTING(" addding shuffle filter to all");
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -529,30 +529,30 @@ TESTING(" addding shuffle filter to all");
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0)
GOERROR;
#if defined (H5_HAVE_FILTER_FLETCHER32)
- if (h5repack_addfilter("dset1:FLET",&pack_options)<0)
+ if (h5repack_addfilter("dset1:FLET",&pack_options) < 0)
GOERROR;
#endif
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (h5repack_addfilter("dset1:SHUF",&pack_options)<0)
+ if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0)
GOERROR;
#endif
#if defined (H5_HAVE_FILTER_SZIP)
if (szip_can_encode) {
- if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options)<0)
+ if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options) < 0)
GOERROR;
}
#endif
#ifdef H5_HAVE_FILTER_DEFLATE
- if (h5repack_addfilter("dset1:GZIP=1",&pack_options)<0)
+ if (h5repack_addfilter("dset1:GZIP=1",&pack_options) < 0)
GOERROR;
#endif
@@ -562,7 +562,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -575,9 +575,9 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -585,7 +585,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -595,9 +595,9 @@ if (szip_can_encode) {
*/
TESTING(" adding layout chunked to all");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("CHUNK=20x10",&pack_options)<0)
+ if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -605,7 +605,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -616,9 +616,9 @@ if (szip_can_encode) {
* test an individual object option
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:CONTI",&pack_options)<0)
+ if (h5repack_addlayout("dset1:CONTI",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -626,7 +626,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -637,9 +637,9 @@ if (szip_can_encode) {
* test all objects option
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("CONTI",&pack_options)<0)
+ if (h5repack_addlayout("CONTI",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -647,7 +647,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -659,9 +659,9 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset1:COMPA",&pack_options)<0)
+ if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -669,7 +669,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -680,9 +680,9 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("COMPA",&pack_options)<0)
+ if (h5repack_addlayout("COMPA",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -690,7 +690,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -702,9 +702,9 @@ if (szip_can_encode) {
* layout compact to contiguous conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_compact:CONTI",&pack_options)<0)
+ if (h5repack_addlayout("dset_compact:CONTI",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -712,7 +712,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -722,9 +722,9 @@ if (szip_can_encode) {
* layout compact to chunk conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options)<0)
+ if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -732,7 +732,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -742,9 +742,9 @@ if (szip_can_encode) {
* layout compact to compact conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_compact:COMPA",&pack_options)<0)
+ if (h5repack_addlayout("dset_compact:COMPA",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -752,7 +752,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -761,9 +761,9 @@ if (szip_can_encode) {
* layout contiguous to compact conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options)<0)
+ if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -771,7 +771,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -780,9 +780,9 @@ if (szip_can_encode) {
* layout contiguous to chunk conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options)<0)
+ if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -790,7 +790,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -800,9 +800,9 @@ if (szip_can_encode) {
* layout contiguous to contiguous conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options)<0)
+ if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -810,7 +810,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -819,9 +819,9 @@ if (szip_can_encode) {
* layout chunked to compact conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_chunk:COMPA",&pack_options)<0)
+ if (h5repack_addlayout("dset_chunk:COMPA",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -829,7 +829,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -839,9 +839,9 @@ if (szip_can_encode) {
* layout chunked to contiguous conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_chunk:CONTI",&pack_options)<0)
+ if (h5repack_addlayout("dset_chunk:CONTI",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -849,7 +849,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -858,9 +858,9 @@ if (szip_can_encode) {
* layout chunked to chunked conversion
*-------------------------------------------------------------------------
*/
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options)<0)
+ if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0)
GOERROR;
@@ -868,7 +868,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -888,7 +888,7 @@ if (szip_can_encode) {
#if defined (H5_HAVE_FILTER_SZIP)
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0)
GOERROR;
@@ -896,7 +896,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME7OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -911,9 +911,9 @@ if (szip_can_encode) {
#if defined (H5_HAVE_FILTER_SZIP)
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_szip:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_szip:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0)
GOERROR;
@@ -921,7 +921,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME7OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -936,7 +936,7 @@ if (szip_can_encode) {
TESTING(" copy of deflate filter");
#ifdef H5_HAVE_FILTER_DEFLATE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0)
GOERROR;
@@ -944,7 +944,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME8OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -956,9 +956,9 @@ if (szip_can_encode) {
TESTING(" removing deflate filter");
#ifdef H5_HAVE_FILTER_DEFLATE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_deflate:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_deflate:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0)
GOERROR;
@@ -966,7 +966,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME8OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -979,7 +979,7 @@ if (szip_can_encode) {
TESTING(" copy of shuffle filter");
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0)
GOERROR;
@@ -987,7 +987,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME9OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -998,9 +998,9 @@ if (szip_can_encode) {
TESTING(" removing shuffle filter");
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_shuffle:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0)
GOERROR;
@@ -1008,7 +1008,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME9OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1019,7 +1019,7 @@ if (szip_can_encode) {
TESTING(" copy of fletcher filter");
#ifdef H5_HAVE_FILTER_FLETCHER32
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0)
GOERROR;
@@ -1027,7 +1027,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME10OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1038,9 +1038,9 @@ if (szip_can_encode) {
TESTING(" removing fletcher filter");
#ifdef H5_HAVE_FILTER_FLETCHER32
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0)
GOERROR;
@@ -1048,7 +1048,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME10OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1060,7 +1060,7 @@ if (szip_can_encode) {
TESTING(" copy of nbit filter");
#ifdef H5_HAVE_FILTER_NBIT
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0)
GOERROR;
@@ -1068,7 +1068,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME12OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1079,9 +1079,9 @@ if (szip_can_encode) {
TESTING(" removing nbit filter");
#ifdef H5_HAVE_FILTER_NBIT
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_nbit:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0)
GOERROR;
@@ -1089,7 +1089,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME12OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1100,9 +1100,9 @@ if (szip_can_encode) {
TESTING(" adding nbit filter");
#ifdef H5_HAVE_FILTER_NBIT
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_int31:NBIT",&pack_options)<0)
+ if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0)
GOERROR;
@@ -1110,7 +1110,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME12OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1120,7 +1120,7 @@ if (szip_can_encode) {
TESTING(" copy of scaleoffset filter");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0)
GOERROR;
@@ -1128,7 +1128,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME13OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1139,9 +1139,9 @@ if (szip_can_encode) {
TESTING(" removing scaleoffset filter");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options)<0)
+ if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0)
GOERROR;
@@ -1149,7 +1149,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME13OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1161,9 +1161,9 @@ if (szip_can_encode) {
TESTING(" adding scaleoffset filter");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options)<0)
+ if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0)
GOERROR;
@@ -1171,7 +1171,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME13OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1197,9 +1197,9 @@ if (szip_can_encode) {
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options)<0)
+ if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0)
GOERROR;
@@ -1207,7 +1207,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME11OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1225,9 +1225,9 @@ if (szip_can_encode) {
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
if (szip_can_encode) {
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0)
+ if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0)
GOERROR;
@@ -1235,7 +1235,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME11OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1257,9 +1257,9 @@ if (szip_can_encode) {
#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
- if (h5repack_addfilter("NONE",&pack_options)<0)
+ if (h5repack_addfilter("NONE",&pack_options) < 0)
GOERROR;
if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0)
GOERROR;
@@ -1267,7 +1267,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME11OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1280,7 +1280,7 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
TESTING(" big file");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME14,FNAME14OUT,&pack_options) < 0)
GOERROR;
@@ -1288,7 +1288,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME14OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1297,7 +1297,7 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
TESTING(" external datasets");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
if (h5repack(FNAME15,FNAME15OUT,&pack_options) < 0)
GOERROR;
@@ -1305,7 +1305,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME15OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1333,7 +1333,7 @@ if (szip_can_encode) {
*-------------------------------------------------------------------------
*/
TESTING(" latest file format options");
- if (h5repack_init (&pack_options, 0)<0)
+ if (h5repack_init (&pack_options, 0) < 0)
GOERROR;
pack_options.latest=1;
pack_options.grp_compact=10;
@@ -1349,7 +1349,7 @@ if (szip_can_encode) {
GOERROR;
if (h5repack_verify(FNAME1OUT,&pack_options)<=0)
GOERROR;
- if (h5repack_end (&pack_options)<0)
+ if (h5repack_end (&pack_options) < 0)
GOERROR;
PASSED();
@@ -1396,60 +1396,60 @@ int make_testfiles(void)
* create a file for general copy test
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_fill(loc_id)<0)
+ if (make_fill(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create another file for general copy test (all datatypes)
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_all_objects(loc_id)<0)
+ if (make_all_objects(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file for attributes copy test
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_attributes(loc_id)<0)
+ if (make_attributes(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file for hard links test
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_hlinks(loc_id)<0)
+ if (make_hlinks(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file for layouts test
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_layout(loc_id)<0)
+ if (make_layout(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file for the H5D_ALLOC_TIME_EARLY test
*-------------------------------------------------------------------------
*/
- if (make_early()<0)
+ if (make_early() < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1457,11 +1457,11 @@ int make_testfiles(void)
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_SZIP
- if((loc_id = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_szip(loc_id)<0)
+ if (make_szip(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
#endif /* H5_HAVE_FILTER_SZIP */
@@ -1469,88 +1469,88 @@ int make_testfiles(void)
* create a file with the deflate filter
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_deflate(loc_id)<0)
+ if (make_deflate(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with the shuffle filter
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_shuffle(loc_id)<0)
+ if (make_shuffle(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with the fletcher32 filter
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_fletcher32(loc_id)<0)
+ if (make_fletcher32(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with all the filters
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_all(loc_id)<0)
+ if (make_all(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with the nbit filter
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_nbit(loc_id)<0)
+ if (make_nbit(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with the scaleoffset filter
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_scaleoffset(loc_id)<0)
+ if (make_scaleoffset(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a big dataset
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_big(loc_id)<0)
+ if (make_big(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
* create a file with external dataset
*-------------------------------------------------------------------------
*/
- if((loc_id = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((loc_id = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
- if (make_external(loc_id)<0)
+ if (make_external(loc_id) < 0)
goto out;
- if(H5Fclose(loc_id)<0)
+ if(H5Fclose(loc_id) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -1779,13 +1779,13 @@ int make_szip(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dcpl */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1798,17 +1798,17 @@ if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
}
if (szip_can_encode) {
/* set szip data */
- if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0)
+ if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block) < 0)
goto out;
- if (make_dset(loc_id,"dset_szip",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_szip",sid,dcpl,buf) < 0)
goto out;
} else {
/* WARNING? SZIP is decoder only, can't generate test files */
}
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -1849,13 +1849,13 @@ int make_deflate(hid_t loc_id)
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dcpl */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
/*-------------------------------------------------------------------------
* GZIP
@@ -1863,16 +1863,16 @@ int make_deflate(hid_t loc_id)
*/
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
- if(H5Pset_deflate(dcpl, 9)<0)
+ if(H5Pset_deflate(dcpl, 9) < 0)
goto out;
- if (make_dset(loc_id,"dset_deflate",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_deflate",sid,dcpl,buf) < 0)
goto out;
/* create a reference to the dataset, test second seeep of file for references */
- if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,-1)<0)
+ if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,-1) < 0)
goto out;
- if (write_dset(loc_id,1,dims1r,"ref",H5T_STD_REF_OBJ,bufref)<0)
+ if (write_dset(loc_id,1,dims1r,"ref",H5T_STD_REF_OBJ,bufref) < 0)
goto out;
#endif
@@ -1880,9 +1880,9 @@ int make_deflate(hid_t loc_id)
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -1918,13 +1918,13 @@ int make_shuffle(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dcpl */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1933,9 +1933,9 @@ int make_shuffle(hid_t loc_id)
*/
#if defined (H5_HAVE_FILTER_SHUFFLE)
/* set the shuffle filter */
- if (H5Pset_shuffle(dcpl)<0)
+ if (H5Pset_shuffle(dcpl) < 0)
goto out;
- if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf) < 0)
goto out;
#endif
@@ -1943,9 +1943,9 @@ int make_shuffle(hid_t loc_id)
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -1980,13 +1980,13 @@ int make_fletcher32(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dataset creation property list; the same DCPL is used for all dsets */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
@@ -1996,12 +1996,12 @@ int make_fletcher32(hid_t loc_id)
*/
#if defined (H5_HAVE_FILTER_FLETCHER32)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set the checksum filter */
- if (H5Pset_fletcher32(dcpl)<0)
+ if (H5Pset_fletcher32(dcpl) < 0)
goto out;
- if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf) < 0)
goto out;
#endif
@@ -2009,9 +2009,9 @@ int make_fletcher32(hid_t loc_id)
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -2049,13 +2049,13 @@ int make_nbit(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dataset creation property list; the same DCPL is used for all dsets */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
dtid = H5Tcopy(H5T_NATIVE_INT);
@@ -2067,39 +2067,39 @@ int make_nbit(hid_t loc_id)
#if defined (H5_HAVE_FILTER_NBIT)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
{
H5Tclose(dtid);
goto out;
}
- if (H5Pset_nbit(dcpl)<0)
+ if (H5Pset_nbit(dcpl) < 0)
{
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl))<0)
+ if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0)
{
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
{
H5Tclose(dtid);
goto out;
}
H5Dclose(dsid);
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
{
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_int31",dtid,sid,dcpl))<0)
+ if((dsid = H5Dcreate (loc_id,"dset_int31",dtid,sid,dcpl)) < 0)
{
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
{
H5Tclose(dtid);
goto out;
@@ -2111,11 +2111,11 @@ int make_nbit(hid_t loc_id)
* close
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
- if (H5Tclose(dtid)<0)
+ if (H5Tclose(dtid) < 0)
goto out;
return 0;
@@ -2153,46 +2153,46 @@ int make_scaleoffset(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dataset creation property list; the same DCPL is used for all dsets */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
dtid = H5Tcopy(H5T_NATIVE_INT);
#if defined (H5_HAVE_FILTER_SCALEOFFSET)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
{
H5Tclose(dtid);
goto out;
}
- if (H5Pset_scaleoffset(dcpl,H5Z_SO_INT,31)<0)
+ if (H5Pset_scaleoffset(dcpl,H5Z_SO_INT,31) < 0)
{
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_scaleoffset",dtid,sid,dcpl))<0)
+ if((dsid = H5Dcreate (loc_id,"dset_scaleoffset",dtid,sid,dcpl)) < 0)
{
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
{
H5Tclose(dtid);
goto out;
}
H5Dclose(dsid);
- if((dsid = H5Dcreate (loc_id,"dset_none",dtid,sid,H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate (loc_id,"dset_none",dtid,sid,H5P_DEFAULT)) < 0)
{
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
{
H5Tclose(dtid);
goto out;
@@ -2205,9 +2205,9 @@ int make_scaleoffset(hid_t loc_id)
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -2254,24 +2254,24 @@ int make_all(hid_t loc_id)
}
}
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dataset creation property list; the same DCPL is used for all dsets */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/* set up chunk */
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
#if defined (H5_HAVE_FILTER_SHUFFLE)
/* set the shuffle filter */
- if (H5Pset_shuffle(dcpl)<0)
+ if (H5Pset_shuffle(dcpl) < 0)
goto out;
#endif
#if defined (H5_HAVE_FILTER_FLETCHER32)
/* set the checksum filter */
- if (H5Pset_fletcher32(dcpl)<0)
+ if (H5Pset_fletcher32(dcpl) < 0)
goto out;
#endif
@@ -2281,7 +2281,7 @@ if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
}
if (szip_can_encode) {
/* set szip data */
- if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0)
+ if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block) < 0)
goto out;
} else {
/* WARNING? SZIP is decoder only, can't generate test data using szip */
@@ -2290,11 +2290,11 @@ if (szip_can_encode) {
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
- if(H5Pset_deflate(dcpl, 9)<0)
+ if(H5Pset_deflate(dcpl, 9) < 0)
goto out;
#endif
- if (make_dset(loc_id,"dset_all",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_all",sid,dcpl,buf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2303,12 +2303,12 @@ if (szip_can_encode) {
*/
#if defined (H5_HAVE_FILTER_FLETCHER32)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set the checksum filter */
- if (H5Pset_fletcher32(dcpl)<0)
+ if (H5Pset_fletcher32(dcpl) < 0)
goto out;
- if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf) < 0)
goto out;
#endif
@@ -2320,12 +2320,12 @@ if (szip_can_encode) {
#if defined (H5_HAVE_FILTER_SZIP)
if (szip_can_encode) {
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set szip data */
- if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0)
+ if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block) < 0)
goto out;
- if (make_dset(loc_id,"dset_szip",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_szip",sid,dcpl,buf) < 0)
goto out;
} else {
/* WARNING? SZIP is decoder only, can't generate test dataset */
@@ -2338,12 +2338,12 @@ if (szip_can_encode) {
*/
#if defined (H5_HAVE_FILTER_SHUFFLE)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set the shuffle filter */
- if (H5Pset_shuffle(dcpl)<0)
+ if (H5Pset_shuffle(dcpl) < 0)
goto out;
- if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf) < 0)
goto out;
#endif
@@ -2353,12 +2353,12 @@ if (szip_can_encode) {
*/
#if defined (H5_HAVE_FILTER_DEFLATE)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set deflate data */
- if(H5Pset_deflate(dcpl, 1)<0)
+ if(H5Pset_deflate(dcpl, 1) < 0)
goto out;
- if (make_dset(loc_id,"dset_deflate",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_deflate",sid,dcpl,buf) < 0)
goto out;
#endif
@@ -2369,22 +2369,22 @@ if (szip_can_encode) {
*/
#if defined (H5_HAVE_FILTER_NBIT)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
+ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
goto out;
/* set the shuffle filter */
- if (H5Pset_nbit(dcpl)<0)
+ if (H5Pset_nbit(dcpl) < 0)
goto out;
dtid = H5Tcopy(H5T_NATIVE_INT);
H5Tset_precision(dtid,(H5Tget_precision(dtid)-1));
- if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl))<0)
+ if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0)
goto out;
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
/* close */
- if(H5Tclose(dtid)<0)
+ if(H5Tclose(dtid) < 0)
return -1;
- if(H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
return -1;
#endif
@@ -2392,9 +2392,9 @@ if (szip_can_encode) {
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -2533,7 +2533,7 @@ int make_layout(hid_t loc_id)
for (i=0; i<4; i++)
{
sprintf(name,"dset%d",i+1);
- if (write_dset(loc_id,RANK,dims,name,H5T_NATIVE_INT,buf)<0)
+ if (write_dset(loc_id,RANK,dims,name,H5T_NATIVE_INT,buf) < 0)
return -1;
}
@@ -2543,46 +2543,46 @@ int make_layout(hid_t loc_id)
*-------------------------------------------------------------------------
*/
/* create a space */
- if((sid = H5Screate_simple(RANK, dims, NULL))<0)
+ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
return -1;
/* create a dataset creation property list; the same DCPL is used for all dsets */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
/*-------------------------------------------------------------------------
* H5D_COMPACT
*-------------------------------------------------------------------------
*/
- if(H5Pset_layout (dcpl,H5D_COMPACT)<0)
+ if(H5Pset_layout (dcpl,H5D_COMPACT) < 0)
goto out;
- if (make_dset(loc_id,"dset_compact",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_compact",sid,dcpl,buf) < 0)
goto out;
/*-------------------------------------------------------------------------
* H5D_CONTIGUOUS
*-------------------------------------------------------------------------
*/
- if(H5Pset_layout (dcpl,H5D_CONTIGUOUS)<0)
+ if(H5Pset_layout (dcpl,H5D_CONTIGUOUS) < 0)
goto out;
- if (make_dset(loc_id,"dset_contiguous",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_contiguous",sid,dcpl,buf) < 0)
goto out;
/*-------------------------------------------------------------------------
* H5D_CHUNKED
*-------------------------------------------------------------------------
*/
- if(H5Pset_chunk(dcpl, RANK, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto out;
- if (make_dset(loc_id,"dset_chunk",sid,dcpl,buf)<0)
+ if (make_dset(loc_id,"dset_chunk",sid,dcpl,buf) < 0)
goto out;
/*-------------------------------------------------------------------------
* close space and dcpl
*-------------------------------------------------------------------------
*/
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
return 0;
@@ -2615,23 +2615,23 @@ int make_fill(hid_t loc_id)
* H5T_INTEGER, write a fill value
*-------------------------------------------------------------------------
*/
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue)<0)
+ if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue) < 0)
goto out;
- if ((sid = H5Screate_simple(2,dims,NULL))<0)
+ if ((sid = H5Screate_simple(2,dims,NULL)) < 0)
goto out;
- if ((did = H5Dcreate(loc_id,"dset_fill",H5T_NATIVE_INT,sid,dcpl))<0)
+ if ((did = H5Dcreate(loc_id,"dset_fill",H5T_NATIVE_INT,sid,dcpl)) < 0)
goto out;
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
/* close */
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
- if(H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
return 0;
@@ -2676,19 +2676,19 @@ int make_big(hid_t loc_id)
hs_size[0] = 1024;
/* create */
- 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(loc_id,"dset",H5T_NATIVE_SCHAR,f_sid,dcpl))<0)
+ if ((did = H5Dcreate(loc_id,"dset",H5T_NATIVE_SCHAR,f_sid,dcpl)) < 0)
goto out;
- if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0)
+ if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
goto out;
- if ((tid = H5Dget_type(did))<0)
+ if ((tid = H5Dget_type(did)) < 0)
goto out;
if ((size = H5Tget_size(tid))<=0)
goto out;
@@ -2696,22 +2696,22 @@ int make_big(hid_t loc_id)
/* initialize buffer to 0 */
buf=(signed char *) calloc( nelmts, size);
- 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;
free(buf);
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;
return 0;
@@ -2750,23 +2750,23 @@ int make_external(hid_t loc_id)
size = max_size[0] * sizeof(int);
/* create */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size)<0)
+ if (H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size) < 0)
goto out;
- if ((sid = H5Screate_simple(1,cur_size, max_size))<0)
+ if ((sid = H5Screate_simple(1,cur_size, max_size)) < 0)
goto out;
- if ((did = H5Dcreate(loc_id,"external",H5T_NATIVE_INT,sid,dcpl))<0)
+ if ((did = H5Dcreate(loc_id,"external",H5T_NATIVE_INT,sid,dcpl)) < 0)
goto out;
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
/* close */
- if(H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
- if(H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
return 0;
@@ -3827,15 +3827,15 @@ void write_attr_in(hid_t loc_id,
buf5[0].p = malloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
- ((int *)buf5[1].p)[0]=2;
- ((int *)buf5[1].p)[1]=3;
+ buf5[1].p = malloc(2 * sizeof(int));
+ ((int *)buf5[1].p)[0] = 2;
+ ((int *)buf5[1].p)[1] = 3;
- if (make_diffs)
+ if(make_diffs)
{
- ((int *)buf5[0].p)[0]=0;
- ((int *)buf5[1].p)[0]=0;
- ((int *)buf5[1].p)[1]=0;
+ ((int *)buf5[0].p)[0] = 0;
+ ((int *)buf5[1].p)[0] = 0;
+ ((int *)buf5[1].p)[1] = 0;
}
/*
$h5diff file7.h5 file6.h5 g1 g1 -v
@@ -3847,13 +3847,13 @@ void write_attr_in(hid_t loc_id,
[ 1 ] 3 0 3
*/
- space_id = H5Screate_simple(1,dims,NULL);
+ space_id = H5Screate_simple(1, dims, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- attr_id = H5Acreate(loc_id,"vlen",type_id,space_id,H5P_DEFAULT);
- status = H5Awrite(attr_id,type_id,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf5);
- assert(status>=0);
+ attr_id = H5Acreate2(loc_id, ".", "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(attr_id, type_id, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Aclose(attr_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -4118,13 +4118,13 @@ position enum2D of </g1> enum2D of </g1> difference
[ 2 1 ] 11 0 11
*/
- space_id = H5Screate_simple(2,dims2,NULL);
+ space_id = H5Screate_simple(2, dims2, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- attr_id = H5Acreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT);
- status = H5Awrite(attr_id,type_id,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf52);
- assert(status>=0);
+ attr_id = H5Acreate2(loc_id, ".", "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(attr_id, type_id, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Aclose(attr_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -4517,13 +4517,13 @@ position vlen3D of </g1> vlen3D of </g1> difference
[ 1 1 0 ] 10 0 10
etc
*/
- space_id = H5Screate_simple(3,dims3,NULL);
+ space_id = H5Screate_simple(3, dims3, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- attr_id = H5Acreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT);
- status = H5Awrite(attr_id,type_id,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf53);
- assert(status>=0);
+ attr_id = H5Acreate2(loc_id, ".", "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Awrite(attr_id, type_id, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Aclose(attr_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -4617,15 +4617,15 @@ int make_dset(hid_t loc_id,
hid_t dsid;
/* create the dataset */
- if((dsid = H5Dcreate (loc_id,name,H5T_NATIVE_INT,sid,dcpl))<0)
+ if((dsid = H5Dcreate (loc_id,name,H5T_NATIVE_INT,sid,dcpl)) < 0)
return -1;
/* write */
- if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
/* close */
- if(H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
return -1;
return 0;
@@ -4660,22 +4660,22 @@ int write_dset( hid_t loc_id,
hid_t space_id;
/* Create a buf space */
- if ((space_id = H5Screate_simple(rank,dims,NULL))<0)
+ if ((space_id = H5Screate_simple(rank,dims,NULL)) < 0)
return -1;
/* Create a dataset */
- if ((dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT))<0)
+ if ((dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT)) < 0)
return -1;
/* Write the buf */
if ( buf )
- if (H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
return -1;
/* Close */
- if (H5Dclose(dset_id)<0)
+ if (H5Dclose(dset_id) < 0)
return -1;
- if (H5Sclose(space_id)<0)
+ if (H5Sclose(space_id) < 0)
return -1;
return 0;
@@ -4706,19 +4706,17 @@ int make_attr(hid_t loc_id,
hid_t space_id;
/* create a space */
- if ((space_id = H5Screate_simple(rank,dims,NULL))<0)
+ if((space_id = H5Screate_simple(rank, dims, NULL)) < 0)
return -1;
/* create the attribute */
- if ((attr_id = H5Acreate(loc_id,attr_name,type_id,space_id,H5P_DEFAULT))<0)
+ if((attr_id = H5Acreate2(loc_id, ".", attr_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* write the buffer */
- if ( buf )
- {
- if (H5Awrite(attr_id,type_id,buf)<0)
- goto out;
- }
+ if(buf)
+ if(H5Awrite(attr_id, type_id, buf) < 0)
+ goto out;
/* close */
H5Aclose(attr_id);
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 6d82e43..9c8b22f 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -66,7 +66,7 @@ static void gen_file(void)
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);
+ attr_id = H5Acreate2(dset_id, ".", attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Aclose(attr_id);
}