summaryrefslogtreecommitdiffstats
path: root/src/H5Rdeprec.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-28 19:51:46 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-28 19:51:46 (GMT)
commit5f34b5703d93fd795f136054a191008affb80011 (patch)
tree2360311955cb5ad8090ebdaeff28e02adc2418c2 /src/H5Rdeprec.c
parentdf961a00414a440b8967983f62281b6205b9627c (diff)
downloadhdf5-5f34b5703d93fd795f136054a191008affb80011.zip
hdf5-5f34b5703d93fd795f136054a191008affb80011.tar.gz
hdf5-5f34b5703d93fd795f136054a191008affb80011.tar.bz2
[svn-r22501] change the interface callbacks for the VOL to use objects pointers and public VL structure instead of IDs.
tests will fail now because of named datatypes.
Diffstat (limited to 'src/H5Rdeprec.c')
-rw-r--r--src/H5Rdeprec.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index eb9e09f..e6850b2 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -44,6 +44,7 @@
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
#include "H5Oprivate.h" /* Object headers */
#include "H5Rpkg.h" /* References */
#include "H5Ppublic.h" /* for using H5P_DATASET_ACCESS_DEFAULT */
@@ -133,6 +134,9 @@ H5R_init_deprec_interface(void)
H5G_obj_t
H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
{
+ void *obj = NULL; /* object token of loc_id */
+ H5VL_t *vol_plugin; /* VOL plugin information */
+ H5VL_loc_params_t loc_params;
H5O_type_t obj_type; /* Object type */
H5G_obj_t ret_value; /* Return value */
@@ -145,8 +149,19 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
if(ref == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer")
+ loc_params.type = H5VL_OBJECT_BY_SELF;
+ loc_params.obj_type = H5I_get_type(id);
+
+ /* get the file object */
+ if(NULL == (obj = (void *)H5I_object(id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* get the plugin pointer */
+ if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
+
/* get the object type through the VOL */
- if((ret_value = H5VL_object_get(id, H5VL_REF_GET_TYPE, H5_REQUEST_NULL, &obj_type, ref_type, ref)) < 0)
+ if((ret_value = H5VL_object_get(obj, loc_params, vol_plugin, H5VL_REF_GET_TYPE,
+ H5_REQUEST_NULL, &obj_type, ref_type, ref)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info")
/* Set return value */
@@ -182,6 +197,10 @@ done:
hid_t
H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
{
+ void *obj = NULL; /* object token of loc_id */
+ H5VL_t *vol_plugin; /* VOL plugin information */
+ H5I_type_t opened_type;
+ void *opened_obj = NULL;
H5VL_loc_params_t loc_params;
hid_t ret_value;
@@ -198,11 +217,16 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
loc_params.loc_data.loc_by_ref.ref_type = ref_type;
loc_params.loc_data.loc_by_ref._ref = _ref;
loc_params.loc_data.loc_by_ref.plist_id = H5P_DATASET_ACCESS_DEFAULT;
+ loc_params.obj_type = H5I_get_type(obj_id);
/* Open the object through the VOL */
- if((ret_value = H5VL_object_open(obj_id, loc_params, H5_REQUEST_NULL)) < 0)
+ if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin, &opened_type, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object")
+ /* Get an atom for the object */
+ if ((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle")
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Rdereference1() */