summaryrefslogtreecommitdiffstats
path: root/src/H5VL.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-01 14:23:35 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-01 14:23:35 (GMT)
commit0b398e57b8f6f3ddf092754bb7b101b63487ce27 (patch)
tree207ffbad5ce5a3f5f1b425ef6b9883656082449f /src/H5VL.c
parent2b172e8d4aa696fbc19f42c4a6ba9e9e1850a55c (diff)
downloadhdf5-0b398e57b8f6f3ddf092754bb7b101b63487ce27.zip
hdf5-0b398e57b8f6f3ddf092754bb7b101b63487ce27.tar.gz
hdf5-0b398e57b8f6f3ddf092754bb7b101b63487ce27.tar.bz2
[svn-r22423] add link and object iterate callbacks
update some deprecated routines to use VOL
Diffstat (limited to 'src/H5VL.c')
-rw-r--r--src/H5VL.c79
1 files changed, 73 insertions, 6 deletions
diff --git a/src/H5VL.c b/src/H5VL.c
index d4b1961..a873862 100644
--- a/src/H5VL.c
+++ b/src/H5VL.c
@@ -192,8 +192,6 @@ H5VL_free_cls(H5VL_class_t *cls)
if(cls->terminate && cls->terminate() < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "vol plugin '%s' did not terminate cleanly", cls->name)
- H5MM_xfree(cls);
-
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_free_cls() */
@@ -430,7 +428,6 @@ H5VL_fapl_close(H5VL_class_t *vol_cls)
if(NULL != vol_cls) {
vol_cls->nrefs--;
- //H5MM_xfree(vol_cls);
}
done:
@@ -460,9 +457,6 @@ H5VL_close(H5VL_class_t *vol_plugin)
vol_plugin->nrefs--;
- if(0 == vol_plugin->nrefs)
- H5MM_xfree(vol_plugin);
-
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_close() */
@@ -1775,6 +1769,43 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5VL_link_iterate
+ *
+ * Purpose: Iterate over links in a group
+ *
+ * Return: Success: non negative
+ * Failure: negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * May, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t H5VL_link_iterate(hid_t loc_id, const char *name, hbool_t recursive,
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx,
+ H5L_iterate_t op, void *op_data, hid_t lapl_id)
+{
+ H5VL_class_t *vol_plugin; /* VOL structure attached to id */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ if (NULL == (vol_plugin = (H5VL_class_t *)H5I_get_aux(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
+
+ if(NULL == vol_plugin->link_cls.iterate)
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `link iterate' method")
+
+ if((ret_value = (vol_plugin->link_cls.iterate)(loc_id, name, recursive, idx_type,
+ order, idx, op, op_data, lapl_id)) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "iteration failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_link_iterate() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5VL_link_get
*
* Purpose: Get specific information about the link through the VOL
@@ -1935,6 +1966,42 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5VL_object_visit
+ *
+ * Purpose: Iterate over links in a group
+ *
+ * Return: Success: non negative
+ * Failure: negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * May, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t H5VL_object_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
+ H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id)
+{
+ H5VL_class_t *vol_plugin; /* VOL structure attached to id */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ if (NULL == (vol_plugin = (H5VL_class_t *)H5I_get_aux(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
+
+ if(NULL == vol_plugin->object_cls.visit)
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `link iterate' method")
+
+ if((ret_value = (vol_plugin->object_cls.visit)(loc_id, obj_name, idx_type, order, op,
+ op_data, lapl_id)) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "object visitation failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_object_visit() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5VL_object_lookup
*
* Purpose: Lookup the object location in the file