summaryrefslogtreecommitdiffstats
path: root/src/H5VLnative_object.c
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2019-08-30 17:37:06 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2019-10-08 19:30:24 (GMT)
commit616567f8a18736a6e02bb41c0f00954726464c02 (patch)
tree73a61d7601c35219dd5d1f0770e8d702a019ea09 /src/H5VLnative_object.c
parent2c9699a61dbbde30706d8019e2badfad13bd7024 (diff)
downloadhdf5-616567f8a18736a6e02bb41c0f00954726464c02.zip
hdf5-616567f8a18736a6e02bb41c0f00954726464c02.tar.gz
hdf5-616567f8a18736a6e02bb41c0f00954726464c02.tar.bz2
Add support for retrieving object name by token
Diffstat (limited to 'src/H5VLnative_object.c')
-rw-r--r--src/H5VLnative_object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c
index fb6239b..3ca99bd 100644
--- a/src/H5VLnative_object.c
+++ b/src/H5VLnative_object.c
@@ -225,6 +225,18 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
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_TOKEN) {
+ 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 = *(haddr_t *)loc_params->loc_data.loc_by_token.token;
+
+ /* 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;