diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-10-10 15:10:15 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-10-10 15:10:15 (GMT) |
commit | e962df1591bc6eaee5b9e318de83b9c6698bc7b6 (patch) | |
tree | de3cb2001c62b76a89837ff1e90044574d71f19d /src/H5Toh.c | |
parent | 471150151d29eeb806333a8db41fefc9dfb452bb (diff) | |
download | hdf5-e962df1591bc6eaee5b9e318de83b9c6698bc7b6.zip hdf5-e962df1591bc6eaee5b9e318de83b9c6698bc7b6.tar.gz hdf5-e962df1591bc6eaee5b9e318de83b9c6698bc7b6.tar.bz2 |
VOL FEATURE
Diffstat (limited to 'src/H5Toh.c')
-rw-r--r-- | src/H5Toh.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/H5Toh.c b/src/H5Toh.c index c5ee994..b21ce72 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -44,7 +44,7 @@ /********************/ static htri_t H5O__dtype_isa(const H5O_t *loc); -static hid_t H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dtype_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type); static void *H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); static H5O_loc_t *H5O__dtype_get_oloc(hid_t obj_id); @@ -125,28 +125,28 @@ done: * *------------------------------------------------------------------------- */ -static hid_t -H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref) +static void * +H5O__dtype_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type) { - H5T_t *type = NULL; /* Datatype opened */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5T_t *type = NULL; /* Datatype opened */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC HDassert(obj_loc); + *opened_type = H5I_DATATYPE; + /* Open the datatype */ if(NULL == (type = H5T_open(obj_loc))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open datatype") - /* Register an ID for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") + ret_value = (void *)type; done: - if(ret_value < 0) + if(NULL == ret_value) if(type && H5T_close(type) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") + HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, NULL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dtype_open() */ @@ -212,14 +212,17 @@ done: static H5O_loc_t * H5O__dtype_get_oloc(hid_t obj_id) { - H5T_t *type; /* Datatype opened */ + H5T_t *type = NULL; /* Datatype opened */ + H5T_t *dt = NULL; H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC /* Get the datatype */ - if(NULL == (type = (H5T_t *)H5I_object(obj_id))) + if(NULL == (dt = (H5T_t *)H5I_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") + /* If this is a named datatype, get the VOL driver pointer to the datatype */ + type = (H5T_t *)H5T_get_actual_type(dt); /* Get the datatype's object header location */ if(NULL == (ret_value = H5T_oloc(type))) |