summaryrefslogtreecommitdiffstats
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 20:19:06 (GMT)
commitfcc1f0b7c747b5450a230e1a38f3fe062b4a97ca (patch)
tree6bc0ff9f6ba703d6836ff849f652be3bda8c2fae
parentfd4f6253ce5ed029263dfa47681fcd48fe2d1bc7 (diff)
downloadhdf5-fcc1f0b7c747b5450a230e1a38f3fe062b4a97ca.zip
hdf5-fcc1f0b7c747b5450a230e1a38f3fe062b4a97ca.tar.gz
hdf5-fcc1f0b7c747b5450a230e1a38f3fe062b4a97ca.tar.bz2
Add support for retrieving object name by token
-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 a554a78..282a8ff 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;