diff options
38 files changed, 529 insertions, 234 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 70ec66e..39f21c4 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 = H5Acreate2(id, ".", name, type_id, space_id, plist_id, H5P_DEFAULT, H5P_DEFAULT ); + hid_t attr_id = H5Acreate2(id, name, type_id, space_id, plist_id, H5P_DEFAULT ); // If the attribute id is valid, create and return the Attribute object if( attr_id > 0 ) diff --git a/examples/Attributes.txt b/examples/Attributes.txt index 50881b9..0f25f68 100644 --- a/examples/Attributes.txt +++ b/examples/Attributes.txt @@ -27,7 +27,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group <Write data to first dataset> /* Create an attribute for the dataset */ - attr = H5Acreate2(dataset, ".", "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT); /* Write attribute information */ H5Awrite(attr, H5T_INT32, &attr_data); @@ -42,7 +42,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group group = H5Gcreate2(file, "/Group One", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create an attribute for the dataset */ - attr = H5Acreate2(group, ".", "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, "Attr1", H5T_INT32, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT); /* Write attribute information */ H5Awrite(attr, H5T_INT32, &attr_data); diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index f34f771..665e2c0 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -111,7 +111,7 @@ main (void) /* * Create array attribute. */ - attr1 = H5Acreate2(dataset, ".", ANAME, H5T_NATIVE_FLOAT, aid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr1 = H5Acreate2(dataset, ANAME, H5T_NATIVE_FLOAT, aid1, H5P_DEFAULT, H5P_DEFAULT); /* * Write array attribute. @@ -122,8 +122,8 @@ main (void) * Create scalar attribute. */ aid2 = H5Screate(H5S_SCALAR); - attr2 = H5Acreate2(dataset, ".", "Integer attribute", H5T_NATIVE_INT, aid2, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr2 = H5Acreate2(dataset, "Integer attribute", H5T_NATIVE_INT, aid2, + 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 = H5Acreate2(dataset, ".", ANAMES, atype, aid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr3 = H5Acreate2(dataset, ANAMES, atype, aid3, H5P_DEFAULT, H5P_DEFAULT); /* * Write string attribute. diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c index 6528994..2548350 100644 --- a/examples/h5_shared_mesg.c +++ b/examples/h5_shared_mesg.c @@ -294,7 +294,7 @@ create_standard_file(const char *filename, hid_t fcpl_id) if(dset_id < 0) goto error; /* Create an attribute on the dataset */ - attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); if(attr_id < 0) goto error; /* Write data to the attribute */ diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index d711102..cc4f932 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -49,7 +49,7 @@ nh5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, /* * Call H5Acreate2 function. */ - 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) + 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)) < 0) HGOTO_DONE(FAIL); done: diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index f8527fd..7b59c18 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -249,7 +249,7 @@ herr_t H5DSattach_scale(hid_t did, goto out; /* create the attribute */ - if((aid = H5Acreate2(did, ".", DIMENSION_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, DIMENSION_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* allocate and initialize the VL */ @@ -421,7 +421,7 @@ herr_t H5DSattach_scale(hid_t did, goto out; /* create the attribute */ - if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* store the IDX information */ @@ -505,7 +505,7 @@ herr_t H5DSattach_scale(hid_t did, free(dims); /* create the attribute again with the changes of space */ - if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write the attribute with the new references */ @@ -859,7 +859,7 @@ herr_t H5DSdetach_scale(hid_t did, goto out; /* create the attribute again with the changes of space */ - if((aid = H5Acreate2(dsid, ".", REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write the new attribute with the new references */ @@ -1451,7 +1451,7 @@ herr_t H5DSset_label(hid_t did, goto out; /* create the attribute */ - if((aid = H5Acreate2(did, ".", DIMENSION_LABELS, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, DIMENSION_LABELS, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* allocate and initialize */ diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index cf2ea80..0cc79e4 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -547,7 +547,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create the attribute "PALETTE" to be attached to the image*/ - if((attr_id = H5Acreate2(image_id, ".", "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* Create a reference. The reference is created on the local id. */ @@ -617,7 +617,7 @@ herr_t H5IMlink_palette( hid_t loc_id, if(H5Aclose(attr_id) < 0) goto out; - if((attr_id = H5Acreate2(image_id, ".", "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* Write the attribute with the new references */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 9b58b46..84b0cea 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -888,7 +888,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id, /* Create and write the attribute */ - if((attr_id = H5Acreate2(obj_id, ".", attr_name, attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(obj_id, attr_name, attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, attr_type, attr_data) < 0) @@ -965,7 +965,7 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id, goto out; /* Create the attribute. */ - if((attr_id = H5Acreate2(obj_id, ".", attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(obj_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* Write the attribute data. */ @@ -2866,7 +2866,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, * create and write the attribute *------------------------------------------------------------------------- */ - if((aid = H5Acreate2(dset_id, ".", name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(dset_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(aid, tid, buf) < 0) diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 2471466..3502b3a 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -220,7 +220,7 @@ herr_t H5TBmake_table( const char *table_title, sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - if((attr_id = H5Acreate2(did, ".", attr_name, field_types[i], sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(did, attr_name, field_types[i], sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, field_types[i], tmp_buf+field_offset[i]) < 0) @@ -1977,7 +1977,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - if((attr_id = H5Acreate2(dataset_id3, ".", attr_name, member_type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(dataset_id3, attr_name, member_type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) @@ -2550,7 +2550,7 @@ herr_t H5TBinsert_field( hid_t loc_id, sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) @@ -2581,7 +2581,7 @@ herr_t H5TBinsert_field( hid_t loc_id, if((member_type_id = H5Tget_member_type(type_id1, (unsigned)nfields - 1)) < 0) goto out; - if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, member_type_id, fill_data) < 0) @@ -3035,7 +3035,7 @@ herr_t H5TBdelete_field( hid_t loc_id, sprintf(aux, "%s", "_FILL"); strcat(attr_name, aux); - if((attr_id = H5Acreate2(dataset_id1, ".", attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Awrite(attr_id, member_type_id, tmp_fill_buf+member_offset) < 0) diff --git a/perform/perf_meta.c b/perform/perf_meta.c index 572dfff..279c8de 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -399,8 +399,8 @@ create_attrs_1(void) 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) + if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, + small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr) < 0) goto error; @@ -502,8 +502,8 @@ create_attrs_2(void) 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) + if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, + small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr) < 0) goto error; @@ -615,8 +615,8 @@ create_attrs_3(void) 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) + if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, + small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr) < 0) goto error; @@ -190,7 +190,72 @@ H5A_term_interface(void) PURPOSE Creates an attribute on an object USAGE - hid_t H5Acreate2(loc_id, obj_name, attr_name, type_id, space_id, acpl_id, + hid_t H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id, + aapl_id) + hid_t loc_id; IN: Object (dataset or group) to be attached to + const char *attr_name; IN: Name of attribute to locate and open + hid_t type_id; IN: ID of datatype for attribute + hid_t space_id; IN: ID of dataspace for attribute + hid_t acpl_id; IN: ID of creation property list (currently not used) + hid_t aapl_id; IN: Attribute access property list + RETURNS + Non-negative on success/Negative on failure + + DESCRIPTION + This function creates an attribute which is attached to the object + specified with 'loc_id'. The name specified with 'attr_name' for + each attribute for an object must be unique for that object. The 'type_id' + and 'space_id' are created with the H5T and H5S interfaces respectively. + The 'aapl_id' property list is currently unused, but will be used in the + future for optional attribute access properties. The attribute ID returned + from this function must be released with H5Aclose or resource leaks will + develop. + +--------------------------------------------------------------------------*/ +/* ARGSUSED */ +hid_t +H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, + hid_t acpl_id, hid_t UNUSED aapl_id) +{ + H5G_loc_t loc; /* Object location */ + H5T_t *type; /* Datatype to use for attribute */ + H5S_t *space; /* Dataspace to use for attribute */ + hid_t ret_value; /* Return value */ + + FUNC_ENTER_API(H5Acreate2, FAIL) + H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, + acpl_id, aapl_id); + + /* check arguments */ + if(H5I_ATTR == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(0 == (H5F_INTENT(loc.oloc->file) & H5F_ACC_RDWR)) + HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, FAIL, "no write intent on file") + if(!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type") + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + + /* Go do the real work for attaching the attribute to the dataset */ + if((ret_value = H5A_create(&loc, attr_name, type, space, acpl_id, H5AC_dxpl_id)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Acreate2() */ + + +/*-------------------------------------------------------------------------- + NAME + H5Acreate_by_name + PURPOSE + Creates an attribute on an object + USAGE + hid_t H5Acreate_by_name(loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id) hid_t loc_id; IN: Object (dataset or group) to be attached to const char *obj_name; IN: Name of object relative to location @@ -216,7 +281,7 @@ H5A_term_interface(void) --------------------------------------------------------------------------*/ /* ARGSUSED */ hid_t -H5Acreate2(hid_t loc_id, const char *obj_name, const char *attr_name, +H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t UNUSED aapl_id, hid_t lapl_id) { @@ -229,7 +294,7 @@ H5Acreate2(hid_t loc_id, const char *obj_name, const char *attr_name, H5S_t *space; /* Dataspace to use for attribute */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Acreate2, FAIL) + FUNC_ENTER_API(H5Acreate_by_name, FAIL) H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id); @@ -269,7 +334,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") FUNC_LEAVE_API(ret_value) -} /* H5Acreate2() */ +} /* H5Acreate_by_name() */ /*------------------------------------------------------------------------- diff --git a/src/H5Apublic.h b/src/H5Apublic.h index d0c406e..7de9cbc 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -41,7 +41,9 @@ typedef herr_t (*H5A_operator2_t)(hid_t location_id/*in*/, const char *attr_name/*in*/, const H5A_info_t *ainfo/*in*/, void *op_data/*in,out*/); /* Public function prototypes */ -H5_DLL hid_t H5Acreate2(hid_t loc_id, const char *obj_name, const char *attr_name, +H5_DLL hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, + hid_t space_id, hid_t acpl_id, hid_t aapl_id); +H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id); H5_DLL hid_t H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id); H5_DLL hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, @@ -94,7 +96,7 @@ 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); + hid_t space_id, hid_t acpl_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/test/dangle.c b/test/dangle.c index a08941c..b08a5e6 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -456,7 +456,7 @@ test_dangle_attribute(H5F_close_degree_t degree) TEST_ERROR; /* Create an attribute on the dataset */ - if((aid = H5Acreate2(dsid, ".", ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(dsid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Don't worry about writing the attribute - it will have a fill value */ @@ -467,7 +467,7 @@ test_dangle_attribute(H5F_close_degree_t degree) /* Try creating duplicate attribute */ H5E_BEGIN_TRY { - if((aid = H5Acreate2(dsid, ".", ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) + if((aid = H5Acreate2(dsid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) >= 0) TEST_ERROR; } H5E_END_TRY; diff --git a/test/dtypes.c b/test/dtypes.c index bf98761..ea56056 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -2475,7 +2475,7 @@ test_transient (hid_t fapl) /* It should not be possible to create an attribute for a transient type */ H5E_BEGIN_TRY { - status = H5Acreate2(type, ".", "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if (status>=0) { H5_FAILED(); @@ -2622,8 +2622,8 @@ test_named (hid_t fapl) } /* It should be possible to define an attribute for the named type */ - if((attr1 = H5Acreate2(type, ".", "attr1", H5T_NATIVE_UCHAR, space, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if((attr1 = H5Acreate2(type, "attr1", H5T_NATIVE_UCHAR, space, + 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 5850f04..c4bb9e8 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 = H5Acreate2(gid, ".", ATTR1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR1, tid, sid, 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 = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR2, tid, sid, 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 = H5Acreate2(gid, ".", ATTR3, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR3, tid, sid, 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 = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR2, tid, sid, 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 = H5Acreate2(gid, ".", ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT); assert(aid > 0); /* Close dataspace */ diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 1c422df..8349a5c 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -63,7 +63,7 @@ main(void) assert(gid > 0); /* Create an attribute for the group */ - attr = H5Acreate2(gid, ".", NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(gid, NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); assert(attr > 0); /* Close attribute */ diff --git a/test/links.c b/test/links.c index e99dd37..1675d44 100644 --- a/test/links.c +++ b/test/links.c @@ -8612,7 +8612,7 @@ object_info(hid_t fapl) sprintf(attrname, "attr %02u", v); /* Create attribute */ - if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close attribute */ if(H5Aclose(attr_id) < 0) TEST_ERROR @@ -8660,7 +8660,7 @@ object_info(hid_t fapl) sprintf(attrname, "attr %02u", v); /* Create attribute */ - if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close attribute */ if(H5Aclose(attr_id) < 0) TEST_ERROR @@ -8809,7 +8809,7 @@ object_info_old(hid_t fapl) sprintf(attrname, "attr %02u", v); /* Create attribute */ - if((attr_id = H5Acreate2(group_id2, ".", attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, 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 bea0c11..fa6a6e2 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 = H5Acreate2(loc_id, ".", "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((aid = H5Acreate2(loc_id, "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, 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 = H5Acreate2(loc_id, ".", "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((aid = H5Acreate2(loc_id, "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, 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 = H5Acreate2(dsetv_id, ".", "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((aid = H5Acreate2(dsetv_id, "reg_ref_attr", H5T_STD_REF_DSETREG, spacer_id, 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 = H5Acreate2(loc_id, ".", "vlen attribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(loc_id, "vlen attribute", tid, sid, 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 = H5Acreate2(loc_id, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, 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 = H5Acreate2(loc_id, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done; + if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, 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 = H5Acreate2(loc_id2, ".", attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done; + if((aid = H5Acreate2(loc_id2, attr_name, type_id, sid, 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 eeab056..583fd64 100755 --- a/test/reserved.c +++ b/test/reserved.c @@ -200,7 +200,7 @@ rsrv_ohdr(void) sprintf(attrname, "attr %d", i); H5E_BEGIN_TRY{ aid = H5Screate_simple(2, dims, NULL); - attr_id = H5Acreate2(dataset_id, ".", attrname, H5T_STD_I32BE, aid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dataset_id, attrname, H5T_STD_I32BE, aid, 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 cb93300..124d4a7 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -192,7 +192,7 @@ test_attr_basic_write(hid_t fapl) /* Try to create an attribute on the file (should create an attribute on root group) */ - attr = H5Acreate2(fid1, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(fid1, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close attribute */ @@ -217,11 +217,11 @@ test_attr_basic_write(hid_t fapl) /* Create an attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -229,7 +229,7 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Create an another attribute for the dataset */ - attr2 = H5Acreate2(dataset, ".", ATTR1A_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr2 = H5Acreate2(dataset, ATTR1A_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -343,7 +343,7 @@ test_attr_basic_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create an attribute for the group */ - attr = H5Acreate2(group, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check storage size for attribute */ @@ -351,7 +351,7 @@ test_attr_basic_write(hid_t fapl) VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(group, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(set, FAIL, "H5Dcreate2"); - att = H5Acreate2(set, ".", ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att = H5Acreate2(set, ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); @@ -585,7 +585,7 @@ 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 = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close the property list, and get the attribute's property list */ @@ -617,7 +617,7 @@ 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 = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close the property list and attribute */ @@ -706,11 +706,11 @@ test_attr_compound_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create complex attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write complex attribute data */ @@ -924,11 +924,11 @@ test_attr_scalar_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create an attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -1068,11 +1068,11 @@ test_attr_mult_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create 1st attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write 1st attribute data */ @@ -1092,11 +1092,11 @@ test_attr_mult_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create 2nd attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write 2nd attribute information */ @@ -1116,11 +1116,11 @@ test_attr_mult_write(hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create 3rd attribute for the dataset */ - attr = H5Acreate2(dataset, ".", ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ".", ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate2"); /* Write 3rd attribute information */ @@ -1668,7 +1668,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(oinfo.rc, 2, "H5Oget_info"); /* Create attribute on dataset */ - attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Check reference count on named datatype */ @@ -1690,7 +1690,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(oinfo.rc, 2, "H5Adelete2"); /* Create attribute on dataset */ - attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Check reference count on named datatype */ @@ -1917,7 +1917,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -1936,7 +1936,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check on dataset's attribute storage status */ @@ -1952,7 +1952,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Attempt to add attribute again, which should fail */ - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); VERIFY(attr, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -2052,7 +2052,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2075,7 +2075,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check on dataset's attribute storage status */ @@ -2192,7 +2192,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2367,7 +2367,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2526,7 +2526,7 @@ 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 = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2665,7 +2665,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2686,7 +2686,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -2841,7 +2841,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close attribute */ @@ -2860,7 +2860,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close attribute */ @@ -2879,7 +2879,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 2; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); if(latest_format) { CHECK(attr, FAIL, "H5Acreate2"); @@ -2903,7 +2903,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 3; sprintf(attrname, "attr %02u", u); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Close attribute */ @@ -3079,7 +3079,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) /* Create attribute */ HDstrcpy(attrname, "null attr"); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to read data from the attribute */ @@ -3120,7 +3120,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) /* Create attribute */ HDstrcpy(attrname, "null attr #2"); - attr = H5Acreate2(dataset, ".", attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Try to write data to the attribute */ @@ -3381,7 +3381,7 @@ test_attr_many(hid_t fcpl, hid_t fapl) for(u = 0; u < NATTR_MANY; u++) { sprintf(attrname, "a-%06u", u); - aid = H5Acreate2(fid, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(fid, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Awrite(aid, H5T_NATIVE_UINT, &u); @@ -3631,7 +3631,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -3831,7 +3831,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -3854,7 +3854,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4009,7 +4009,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(gid, FAIL, "H5Gcreate2"); /* Create a couple of attributes */ - aid = H5Acreate2(gid, ".", "attr-003", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, "attr-003", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); buf = 3; ret = H5Awrite(aid, H5T_NATIVE_INT, &buf); @@ -4017,7 +4017,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) ret = H5Aclose(aid); CHECK(ret, FAIL, "H5Aclose"); - aid = H5Acreate2(gid, ".", "attr-004", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, "attr-004", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); buf = 4; ret = H5Awrite(aid, H5T_NATIVE_INT, &buf); @@ -4049,7 +4049,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(aid, FAIL, "H5Adelete2"); /* Create some additional attributes */ - aid = H5Acreate2(gid, ".", "attr-008", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, "attr-008", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); buf = 8; ret = H5Awrite(aid, H5T_NATIVE_INT, &buf); @@ -4057,7 +4057,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) ret = H5Aclose(aid); CHECK(ret, FAIL, "H5Aclose"); - aid = H5Acreate2(gid, ".", "attr-006", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, "attr-006", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); buf = 6; ret = H5Awrite(aid, H5T_NATIVE_INT, &buf); @@ -4219,7 +4219,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4242,7 +4242,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4306,7 +4306,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4430,7 +4430,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4600,7 +4600,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4936,7 +4936,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -4973,7 +4973,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -5174,7 +5174,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -5284,7 +5284,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -5417,7 +5417,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -5991,7 +5991,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6050,7 +6050,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6317,7 +6317,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6375,7 +6375,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6536,12 +6536,12 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, unsigned max_attr /**************************************************************** ** -** test_attr_open(): Test basic H5A (attribute) code. +** test_attr_open_by_name(): Test basic H5A (attribute) code. ** Tests opening attributes by name ** ****************************************************************/ static void -test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl) +test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) { hid_t fid; /* HDF5 File ID */ hid_t dset1, dset2, dset3; /* Dataset IDs */ @@ -6643,7 +6643,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6710,7 +6710,7 @@ 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 = H5Acreate2(my_dataset, ".", attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write data into the attribute */ @@ -6785,7 +6785,231 @@ test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Close dataspace */ ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); -} /* test_attr_open() */ +} /* test_attr_open_by_name() */ + + +/**************************************************************** +** +** test_attr_create_by_name(): Test basic H5A (attribute) code. +** Tests creating attributes by name +** +****************************************************************/ +static void +test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ + hsize_t nattrs; /* Number of attributes on object */ + hsize_t name_count; /* # of records in name index */ + hsize_t corder_count; /* # of records in creation order index */ + hbool_t use_index; /* Use index on creation order values */ + const char *dsetname; /* Name of dataset for attributes */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + unsigned curr_dset; /* Current dataset to work on */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ + + /* Create dataspace for dataset & attributes */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + + /* Query the attribute creation properties */ + ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); + CHECK(ret, FAIL, "H5Pget_attr_phase_change"); + + /* Loop over using index for creation order value */ + for(use_index = FALSE; use_index <= TRUE; use_index++) { + /* Print appropriate test message */ + if(use_index) + MESSAGE(5, ("Testing Creating Attributes By Name w/Creation Order Index\n")) + else + MESSAGE(5, ("Testing Creating Attributes By Name w/o Creation Order Index\n")) + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Set attribute creation order tracking & indexing for object */ + if(new_format == TRUE) { + ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | (use_index ? H5P_CRT_ORDER_INDEXED : (unsigned)0))); + CHECK(ret, FAIL, "H5Pset_attr_creation_order"); + } /* end if */ + + /* Create datasets */ + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); + + /* Work on all the datasets */ + for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { + switch(curr_dset) { + case 0: + my_dataset = dset1; + dsetname = DSET1_NAME; + break; + + case 1: + my_dataset = dset2; + dsetname = DSET2_NAME; + break; + + case 2: + my_dataset = dset3; + dsetname = DSET3_NAME; + break; + + default: + HDassert(0 && "Too many datasets!"); + } /* end switch */ + + /* Check on dataset's attribute storage status */ + is_empty = H5O_is_attr_empty_test(my_dataset); + VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); + is_dense = H5O_is_attr_dense_test(my_dataset); + VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); + + /* Create attributes, up to limit of compact form */ + for(u = 0; u < max_compact; u++) { + /* Create attribute */ + sprintf(attrname, "attr %02u", u); + attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(attr, FAIL, "H5Acreate_by_name"); + + /* Write data into the attribute */ + ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); + CHECK(ret, FAIL, "H5Awrite"); + + /* Close attribute */ + ret = H5Aclose(attr); + CHECK(ret, FAIL, "H5Aclose"); + + /* Verify information for new attribute */ + ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); + CHECK(ret, FAIL, "attr_info_by_idx_check"); + } /* end for */ + + /* Verify state of object */ + ret = H5O_num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O_num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); + is_empty = H5O_is_attr_empty_test(my_dataset); + VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); + is_dense = H5O_is_attr_dense_test(my_dataset); + VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); + + /* Test opening attributes stored compactly */ + ret = attr_open_check(fid, dsetname, my_dataset, u); + CHECK(ret, FAIL, "attr_open_check"); + } /* end for */ + + + /* Work on all the datasets */ + for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { + switch(curr_dset) { + case 0: + my_dataset = dset1; + dsetname = DSET1_NAME; + break; + + case 1: + my_dataset = dset2; + dsetname = DSET2_NAME; + break; + + case 2: + my_dataset = dset3; + dsetname = DSET3_NAME; + break; + + default: + HDassert(0 && "Too many datasets!"); + } /* end switch */ + + /* Create more attributes, to push into dense form */ + for(u = max_compact; u < (max_compact * 2); u++) { + /* Create attribute */ + sprintf(attrname, "attr %02u", u); + attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(attr, FAIL, "H5Acreate_by_name"); + + /* Write data into the attribute */ + ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); + CHECK(ret, FAIL, "H5Awrite"); + + /* Close attribute */ + ret = H5Aclose(attr); + CHECK(ret, FAIL, "H5Aclose"); + + /* Verify state of object */ + if(u >= max_compact) { + is_dense = H5O_is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); + } /* end if */ + + /* Verify information for new attribute */ + ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); + CHECK(ret, FAIL, "attr_info_by_idx_check"); + } /* end for */ + + /* Verify state of object */ + ret = H5O_num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O_num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); + is_empty = H5O_is_attr_empty_test(my_dataset); + VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); + is_dense = H5O_is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); + + if(new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O_attr_dense_info_test"); + if(use_index) + VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); + } /* end if */ + + /* Test opening attributes stored compactly */ + ret = attr_open_check(fid, dsetname, my_dataset, u); + CHECK(ret, FAIL, "attr_open_check"); + } /* end for */ + + /* Close Datasets */ + ret = H5Dclose(dset1); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(dset3); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } /* end for */ + + /* Close property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_attr_create_by_name() */ /**************************************************************** ** @@ -6941,7 +7165,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Alternate between creating "small" & "big" attributes */ if(u % 2) { /* Create "small" attribute on first dataset */ - attr = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -6955,7 +7179,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on first dataset */ - attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -6993,7 +7217,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Alternate between creating "small" & "big" attributes */ if(u % 2) { /* Create "small" attribute on second dataset */ - attr = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -7007,7 +7231,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on second dataset */ - attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -7267,7 +7491,7 @@ 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 = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -7281,7 +7505,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on first dataset */ - attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -7319,7 +7543,7 @@ 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 = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -7333,7 +7557,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on second dataset */ - attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -7708,7 +7932,7 @@ 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 = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -7722,7 +7946,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on first dataset */ - attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -7760,7 +7984,7 @@ 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 = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -7774,7 +7998,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on second dataset */ - attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -8072,7 +8296,7 @@ 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 = H5Acreate2(dataset, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -8086,7 +8310,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on first dataset */ - attr = H5Acreate2(dataset, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -8124,7 +8348,7 @@ 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 = H5Acreate2(dataset2, ".", attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ @@ -8138,7 +8362,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) } /* end if */ else { /* Create "big" attribute on second dataset */ - attr = H5Acreate2(dataset2, ".", attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ @@ -8325,7 +8549,7 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(gid, FAIL, "H5Gopen2"); /* Create attribute on first group */ - aid = H5Acreate2(gid, ".", ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); @@ -8358,7 +8582,7 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(gid, FAIL, "H5Gopen2"); /* Create another attribute on first group */ - aid = H5Acreate2(gid, ".", ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); @@ -8384,7 +8608,7 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Adelete2"); /* Re-create first attribute */ - aid = H5Acreate2(gid, ".", ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); @@ -8395,7 +8619,7 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Adelete2"); /* Re-create second attribute */ - aid = H5Acreate2(gid, ".", ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); @@ -8536,7 +8760,8 @@ test_attr(void) test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */ test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */ test_attr_open_by_idx(new_format, my_fcpl, my_fapl); /* Test opening attributes by index */ - test_attr_open(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */ + test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */ + test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */ /* More complex tests with both "new format" and "shared" attributes */ if(use_shared == TRUE) { @@ -8551,15 +8776,18 @@ test_attr(void) } /* end for */ } /* end if */ else { + /* General attribute tests */ + test_attr_big(fcpl, my_fapl); /* Test storing big attribute */ + test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */ + test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */ + /* New attribute API routine tests, on old-format storage */ test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */ test_attr_delete_by_idx(new_format, fcpl, my_fapl); /* Test deleting attribute by index */ test_attr_iterate2(new_format, fcpl, my_fapl); /* Test iterating over attributes by index */ test_attr_open_by_idx(new_format, fcpl, my_fapl); /* Test opening attributes by index */ - test_attr_open(new_format, fcpl, my_fapl); /* Test opening attributes by name */ - test_attr_big(fcpl, my_fapl); /* Test storing big attribute */ - test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */ - test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */ + test_attr_open_by_name(new_format, fcpl, my_fapl); /* Test opening attributes by name */ + test_attr_create_by_name(new_format, fcpl, my_fapl); /* Test creating attributes by name */ /* Tests that address specific bugs */ test_attr_bug1(fcpl, my_fapl); /* Test odd allocation operations */ diff --git a/test/tfile.c b/test/tfile.c index d89686f..e839630 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -949,7 +949,7 @@ test_get_file_id(void) /* Create an attribute for the dataset. Make a duplicated file ID from * this attribute. And close it. */ - attr_id = H5Acreate2(dataset_id, ".", ATTR_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dataset_id, ATTR_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Acreate2"); /* Test H5Iget_file_id() */ @@ -1619,7 +1619,7 @@ test_file_getname(void) VERIFY_STR(name, FILE1, "H5Fget_name"); /* Create an attribute for the dataset */ - attr_id = H5Acreate2(dataset_id, ".", TESTA_ATTRNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dataset_id, TESTA_ATTRNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Get and verify file name */ diff --git a/test/th5s.c b/test/th5s.c index f649fa6..6808679 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -280,7 +280,7 @@ test_h5s_basic(void) /* Now use the bad dataspace as the space for an attribute */ H5E_BEGIN_TRY { - aid1 = H5Acreate2(dset1, ".", BASICATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid1 = H5Acreate2(dset1, BASICATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY VERIFY(aid1, FAIL, "H5Acreate2"); @@ -405,7 +405,7 @@ test_h5s_null(void) VERIFY(val, 1, "H5Dread"); /* Create an attribute for the group */ - attr = H5Acreate2(did, ".", NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(did, NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); /* Write "nothing" to the attribute */ diff --git a/test/titerate.c b/test/titerate.c index 72038d9..0579123 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -408,7 +408,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) for(i = 0; i < NATTR; i++) { sprintf(name, "Attribute %02d", i); - attribute = H5Acreate2(dataset, ".", name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attribute = H5Acreate2(dataset, name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT); CHECK(attribute, FAIL, "H5Acreate2"); /* Keep a copy of the attribute names around for later */ diff --git a/test/tmisc.c b/test/tmisc.c index ef53c1c..abe32ff 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -421,7 +421,7 @@ static void test_misc2_write_attribute(void) root1 = H5Gopen2(file1, "/", H5P_DEFAULT); CHECK(root1, FAIL, "H5Gopen2"); - att1 = H5Acreate2(root1, ".", MISC2_ATT_NAME_1, type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att1 = H5Acreate2(root1, MISC2_ATT_NAME_1, type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att1, FAIL, "H5Acreate2"); data.string = string_att1; @@ -448,7 +448,7 @@ static void test_misc2_write_attribute(void) root2 = H5Gopen2(file2, "/", H5P_DEFAULT); CHECK(root2, FAIL, "H5Gopen2"); - att2 = H5Acreate2(root2, ".", MISC2_ATT_NAME_2, type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att2 = H5Acreate2(root2, MISC2_ATT_NAME_2, type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att2, FAIL, "H5Acreate2"); data.string = string_att2; @@ -1040,7 +1040,7 @@ test_misc6(void) CHECK(dataset_id, FAIL, "H5Dopen2"); /* Add attribute to dataset */ - attr_id = H5Acreate2(dataset_id, ".", attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dataset_id, attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Close attribute */ @@ -1057,7 +1057,7 @@ test_misc6(void) CHECK(dataset_id, FAIL, "H5Dopen2"); /* Add attribute to dataset */ - attr_id = H5Acreate2(dataset_id, ".", attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dataset_id, attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Close attribute */ @@ -2882,14 +2882,14 @@ test_misc18(void) sprintf(attr_name, "Attr %u", u); /* Create & close attribute on first dataset */ - aid = H5Acreate2(did1, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); CHECK(ret, FAIL, "HAclose"); /* Create & close attribute on second dataset */ - aid = H5Acreate2(did2, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(did2, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); ret = H5Aclose(aid); @@ -3179,7 +3179,7 @@ test_misc19(void) CHECK(sid, FAIL, "H5Screate"); /* Create an attribute */ - aid = H5Acreate2(gid, ".", MISC19_ATTR_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC19_ATTR_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Check the reference count */ @@ -4298,7 +4298,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Tset_size"); /* Add 1st attribute on first group */ - aid = H5Acreate2(gid, ".", MISC25A_ATTR1_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25A_ATTR1_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4324,7 +4324,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Tset_size"); /* Add 2nd attribute on first group */ - aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4397,7 +4397,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Tset_size"); /* Add 3rd attribute on first group (smaller than 2nd attribute) */ - aid = H5Acreate2(gid, ".", MISC25A_ATTR3_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25A_ATTR3_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4445,7 +4445,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Tset_size"); /* Re-create 2nd attribute on first group */ - aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4509,7 +4509,7 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Tset_size"); /* Re-create 2nd attribute on first group */ - aid = H5Acreate2(gid, ".", MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25A_ATTR2_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4639,7 +4639,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Gclose"); /* Add an attribute to the dataset group */ - aid = H5Acreate2(gid, ".", MISC25C_ATTRNAME, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25C_ATTRNAME, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close the attribute */ @@ -4655,7 +4655,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Gclose"); /* Add second attribute to the dataset group */ - aid = H5Acreate2(gid, ".", MISC25C_ATTRNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, MISC25C_ATTRNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); /* Close the attribute */ diff --git a/test/tsohm.c b/test/tsohm.c index 64eb86f..7af1362 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -994,7 +994,7 @@ 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 = H5Acreate2(group_id, ".", "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(group_id, "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata); CHECK_I(ret, "H5Awrite"); @@ -1030,7 +1030,7 @@ 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 = H5Acreate2(group_id, ".", "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(group_id, "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata); CHECK_I(ret, "H5Awrite"); @@ -1480,7 +1480,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size dset_id = H5Dcreate2(file_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT); CHECK_I(dset_id, "H5Dcreate2"); - attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string1); CHECK_I(ret, "H5Awrite"); @@ -1529,7 +1529,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT); CHECK_I(dset_id, "H5Dcreate2"); - attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string2); CHECK_I(ret, "H5Awrite"); @@ -1570,7 +1570,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT); CHECK_I(dset_id, "H5Dcreate2"); - attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string1); CHECK_I(ret, "H5Awrite"); @@ -1583,7 +1583,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size dset_id = H5Dcreate2(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT); CHECK_I(dset_id, "H5Dcreate2"); - attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string2); CHECK_I(ret, "H5Awrite"); @@ -1628,7 +1628,7 @@ 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 = H5Acreate2(group_id, ".", attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string1); CHECK_I(ret, "H5Awrite"); @@ -1668,7 +1668,7 @@ 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 = H5Acreate2(group_id, ".", attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); ret = H5Awrite(attr_id, attr_type_id, attr_string1); CHECK_I(ret, "H5Awrite"); @@ -2568,7 +2568,7 @@ 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 = H5Acreate2(dset_id, ".", "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); /* Write to attribute */ diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index b4c27ae..0e2c7c8 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -167,9 +167,9 @@ void *tts_acreate_thread(void *client_data) /* Create attribute */ attribute_name = gen_name(attrib_data->current_index); - attribute = H5Acreate2(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, H5P_DEFAULT); /* Write data to the attribute */ attribute_data = malloc(sizeof(int)); diff --git a/test/tunicode.c b/test/tunicode.c index 873918a..a5f1309 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -531,7 +531,7 @@ 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 = H5Acreate2(group_id, ".", string, dtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(group_id, string, dtype_id, space_id, 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"); diff --git a/test/tvlstr.c b/test/tvlstr.c index dfc3015..0d5b955 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -597,7 +597,7 @@ static void test_write_vl_string_attribute(void) CHECK(dataspace, FAIL, "H5Screate"); /* Test creating a "normal" sized string attribute */ - att = H5Acreate2(root, ".", "test_scalar", type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att = H5Acreate2(root, "test_scalar", type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); ret = H5Awrite(att, type, &string_att); @@ -615,7 +615,7 @@ static void test_write_vl_string_attribute(void) CHECK(ret, FAIL, "HAclose"); /* Test creating a "large" sized string attribute */ - att = H5Acreate2(root, ".", "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att = H5Acreate2(root, "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); string_att_write = (char*)HDcalloc((size_t)8192, sizeof(char)); diff --git a/test/unlink.c b/test/unlink.c index e1fc7f4..637d14f 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 = H5Acreate2(dataset, ".", objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((attr = H5Acreate2(dataset, objname, H5T_NATIVE_INT, attr_space, 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 = H5Acreate2(dataset2, ".", objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((attr = H5Acreate2(dataset2, objname, H5T_NATIVE_INT, attr_space, 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 = H5Acreate2(dataset, ".", ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((attr = H5Acreate2(dataset, ATTRNAME, H5T_NATIVE_INT, attr_space, 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 = H5Acreate2(dataset, ".", ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(attr >= 0) { H5Aclose(attr); @@ -1055,7 +1055,7 @@ test_multi(void) if((aspace = H5Screate_simple(1, adims, NULL)) < 0) TEST_ERROR; - if((attr = H5Acreate2(root, ".", "Metadata", atype, aspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr = H5Acreate2(root, "Metadata", atype, aspace, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Awrite(attr, atype, meta) < 0) diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 6a4d5f2..332118b 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -340,7 +340,7 @@ void null_dataset(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* Create an attribute for the group */ - attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); VRFY((attr >= 0), "H5Acreate2"); /* Write "nothing" to the attribute(with type conversion) */ @@ -1296,7 +1296,7 @@ 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 = H5Acreate2(obj_id, ".", attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(aid, H5T_NATIVE_INT, &num); H5Aclose(aid); H5Sclose(sid); @@ -1306,7 +1306,7 @@ void write_attribute(hid_t obj_id, int this_type, int num) for(i=0; i<8; i++) attr_data[i] = i; sid = H5Screate_simple(dspace_rank, dspace_dims, NULL); - aid = H5Acreate2(obj_id, ".", attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(aid, H5T_NATIVE_INT, attr_data); H5Aclose(aid); H5Sclose(sid); diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index de2c1ff..51e0a83 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -974,7 +974,7 @@ void write_attr_in(hid_t loc_id, sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf5); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); @@ -1245,7 +1245,7 @@ position enum2D of </g1> enum2D of </g1> difference sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf52); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); @@ -1642,7 +1642,7 @@ etc */ sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf53); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); @@ -2533,7 +2533,7 @@ int write_attr(hid_t loc_id, goto out; /* create the attribute */ - if((aid = H5Acreate2(loc_id, ".", name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write */ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index d0cb5f8..63e8d05 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 = H5Acreate2(root, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr1", H5T_STD_I8BE, space, 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 = H5Acreate2(root, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr2", H5T_STD_I32BE, space, 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 = H5Acreate2(root, ".", "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr3", H5T_IEEE_F64BE, space, 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 = H5Acreate2(root, ".", "attr4", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr4", H5T_STD_I32BE, space, 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 = H5Acreate2(root, ".", "attr5", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr5", type, space, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(attr, type, string); H5Tclose(type); @@ -930,7 +930,7 @@ static void gent_all(void) dims[0] = 10; space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(group, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); sprintf(buf, "abcdefghi"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); @@ -938,7 +938,7 @@ static void gent_all(void) dims[0] = 2; dims[1] = 2; space = H5Screate_simple(2, dims, NULL); - attr = H5Acreate2(group, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, 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); @@ -961,7 +961,7 @@ static void gent_all(void) /* attributes of dset1.1.1 */ dims[0] = 27; space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); sprintf(buf, "1st attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); @@ -969,7 +969,7 @@ static void gent_all(void) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); sprintf(buf, "2nd attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); @@ -1164,7 +1164,7 @@ static void gent_many(void) /* add attributes to dset1 */ dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT); sprintf(buf, "abcdefghi"); H5Awrite(attr, H5T_NATIVE_CHAR, buf); H5Sclose(space2); @@ -1172,7 +1172,7 @@ static void gent_many(void) dims[0] = 2; dims[1] = 2; space2 = H5Screate_simple(2, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr2", H5T_STD_I32BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr2", H5T_STD_I32BE, space2, 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); @@ -1180,7 +1180,7 @@ static void gent_many(void) dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) d[i] = 0.1 * i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); @@ -1488,7 +1488,7 @@ hsize_t sdim; dims[0] = 3; space2 = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, ".", "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT); sprintf(&(buf2[0*LENSTR2]), "0123456789"); sprintf(&(buf2[1*LENSTR2]), "abcdefghij"); sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ"); @@ -2951,7 +2951,7 @@ void gent_split_file(void) dims[0] = 1; space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(root, ".", "Metadata", atype, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "Metadata", atype, space, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(attr, atype, meta); H5Tclose(atype); H5Sclose(space); @@ -3121,7 +3121,7 @@ static void gent_vlstr(void) root = H5Gopen2(fid1, "/", H5P_DEFAULT); dataspace = H5Screate(H5S_SCALAR); - att = H5Acreate2(root, ".", "test_scalar", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + att = H5Acreate2(root, "test_scalar", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(att, tid1, &string_att); /* Close */ @@ -3322,7 +3322,7 @@ static void write_attr_in(hid_t loc_id, sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf5); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); @@ -3433,7 +3433,7 @@ static void write_attr_in(hid_t loc_id, sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf52); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); @@ -3566,7 +3566,7 @@ static void write_attr_in(hid_t loc_id, sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, ".", "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf53); assert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); @@ -4157,7 +4157,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, sid = H5Screate_simple(rank, dims, NULL); /* Create the attribute */ - aid = H5Acreate2(loc_id, ".", attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(loc_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT); /* Write the buf */ if(buf) @@ -4421,7 +4421,7 @@ static void gent_named_dtype_attr(void) assert(sid > 0); /* Create attribute on commited datatype */ - aid = H5Acreate2(tid, ".", F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); assert(aid > 0); /* Write data into the attribute */ @@ -4438,7 +4438,7 @@ static void gent_named_dtype_attr(void) assert(did > 0); /* Create attribute on dataset */ - aid = H5Acreate2(did, ".", F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); assert(aid > 0); /* Write data into the attribute */ @@ -4455,7 +4455,7 @@ static void gent_named_dtype_attr(void) assert(gid > 0); /* Create attribute on group */ - aid = H5Acreate2(gid, ".", F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); assert(aid > 0); /* Write data into the attribute */ @@ -4513,7 +4513,7 @@ static void gent_null_space(void) H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); /* attribute */ - attr = H5Acreate2(root, ".", "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT); H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ H5Dclose(dataset); @@ -5955,7 +5955,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -5979,7 +5979,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(did, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -6003,7 +6003,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -6026,7 +6026,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -6053,7 +6053,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(tid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -6079,7 +6079,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(tid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ @@ -6101,7 +6101,7 @@ gent_attr_creation_order(void) /* add attributes */ for(i = 0; i < 3; i++) { - if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((aid = H5Acreate2(gid, attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close attribute */ diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index 06aaaf1..908a609 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 = H5Acreate2(group, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, 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 = H5Acreate2(group, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, 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 = H5Acreate2(dataset, ".", "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, 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 = H5Acreate2(dataset, ".", "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, 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 e6c32c6..7edb70b 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -977,7 +977,7 @@ int copy_attr(hid_t loc_in, *------------------------------------------------------------------------- */ - if((attr_out = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Awrite(attr_out, wtype_id, buf) < 0) goto error; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 595c32d..28828b8 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 = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, 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 = H5Acreate2(loc_out, ".", name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, 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 de04685..0e99d4f 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -3838,7 +3838,7 @@ void write_attr_in(hid_t loc_id, space_id = H5Screate_simple(1, dims, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, ".", "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(loc_id, "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(attr_id, type_id, buf5); assert(status >= 0); status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5); @@ -4107,7 +4107,7 @@ position enum2D of </g1> enum2D of </g1> difference space_id = H5Screate_simple(2, dims2, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, ".", "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(loc_id, "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(attr_id, type_id, buf52); assert(status >= 0); status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52); @@ -4505,7 +4505,7 @@ etc */ space_id = H5Screate_simple(3, dims3, NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); - attr_id = H5Acreate2(loc_id, ".", "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(loc_id, "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(attr_id, type_id, buf53); assert(status >= 0); status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53); @@ -4693,7 +4693,7 @@ int make_attr(hid_t loc_id, return -1; /* create the attribute */ - if((attr_id = H5Acreate2(loc_id, ".", attr_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((attr_id = H5Acreate2(loc_id, attr_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write the buffer */ diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index a3fcc60..22396b6 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -66,7 +66,7 @@ static void gen_file(void) dset_id = H5Dcreate2(file, DATASET_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 1; i <= NUM_ATTRS; i++) { sprintf(attrname, "%s%d", ATTR_NAME,i); - attr_id = H5Acreate2(dset_id, ".", attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); ret = H5Aclose(attr_id); } /* end for */ |