diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2019-05-23 18:51:56 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2019-05-23 18:51:56 (GMT) |
commit | e1879a23ae414e5256bcc0170f40784cd698af89 (patch) | |
tree | 23c1734d351327e33ec8fc2f66d27fed992cf467 /src/H5VLnative_object.c | |
parent | f37a17a6cef650c7e304d687c4f9b0a948c4262e (diff) | |
parent | 982ed75720d7dece10623868cda22c46908baebe (diff) | |
download | hdf5-e1879a23ae414e5256bcc0170f40784cd698af89.zip hdf5-e1879a23ae414e5256bcc0170f40784cd698af89.tar.gz hdf5-e1879a23ae414e5256bcc0170f40784cd698af89.tar.bz2 |
Merge pull request #1706 in HDFFV/hdf5 from ~JSOUMAGNE/hdf5:topic_getloc to develop
* commit '982ed75720d7dece10623868cda22c46908baebe':
Rename H5VL_ID_GET_NAME to H5VL_OBJECT_GET_NAME
Diffstat (limited to 'src/H5VLnative_object.c')
-rw-r--r-- | src/H5VLnative_object.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 0b1d73a..de2a8a5 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -213,17 +213,32 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj break; } - /* H5Iget_name */ - case H5VL_ID_GET_NAME: + /* Object name */ + case H5VL_OBJECT_GET_NAME: { ssize_t *ret = HDva_arg(arguments, ssize_t *); char *name = HDva_arg(arguments, char *); size_t size = HDva_arg(arguments, size_t); - /* Retrieve object's name */ - if((*ret = H5G_get_name(&loc, name, size, NULL)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") + if(loc_params->type == H5VL_OBJECT_BY_SELF) { + /* Retrieve object's name */ + if((*ret = H5G_get_name(&loc, name, size, NULL)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve object name") + } /* end if */ + else if(loc_params->type == H5VL_OBJECT_BY_ADDR) { + H5O_loc_t obj_oloc; /* Object location */ + + /* Initialize the object location */ + H5O_loc_reset(&obj_oloc); + obj_oloc.file = loc.oloc->file; + obj_oloc.addr = loc_params->loc_data.loc_by_addr.addr; + /* Retrieve object's name */ + if((*ret = H5G_get_name_by_addr(loc.oloc->file, &obj_oloc, name, size)) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't determine object name") + } /* end else-if */ + else + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get_name parameters") break; } |