summaryrefslogtreecommitdiffstats
path: root/src/H5Pdxpl.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-04-27 19:16:54 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-04-27 19:16:54 (GMT)
commitb3d2f04490363a24f1d43581116a61356ca89f77 (patch)
tree71b91e09d8fe1e0475e2da5fe39f487c9db5eba9 /src/H5Pdxpl.c
parent85b599e9332c1d7d6f454425b66ad43e78954814 (diff)
downloadhdf5-b3d2f04490363a24f1d43581116a61356ca89f77.zip
hdf5-b3d2f04490363a24f1d43581116a61356ca89f77.tar.gz
hdf5-b3d2f04490363a24f1d43581116a61356ca89f77.tar.bz2
[svn-r8424] *** empty log message ***
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r--src/H5Pdxpl.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 3805c68..e5bd817 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -348,6 +348,91 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5Pset_type_conv_cb
+ *
+ * Purpose: Sets user's callback function for dataset transfer property
+ * list. This callback function defines what user wants to do
+ * if there's exception during datatype conversion.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * April 15, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void *operate_data)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* return value */
+ H5T_conv_cb_t cb_struct;
+
+ FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL);
+ H5TRACE3("e","ixx",plist_id,op,operate_data);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Update property list */
+ cb_struct.func = op;
+ cb_struct.user_data = operate_data;
+
+ if (H5P_set(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value");
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_type_conv_cb
+ *
+ * Purpose: Gets callback function for dataset transfer property
+ * list. This callback function defines what user wants to do
+ * if there's exception during datatype conversion.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * April 15, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t **op, void **operate_data)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ H5T_conv_cb_t cb_struct;
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL);
+ H5TRACE3("e","ixx",plist_id,op,operate_data);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Get property */
+ if (H5P_get(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value");
+
+ /* Assign return value */
+ *op = cb_struct.func;
+ *operate_data = cb_struct.user_data;
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5Pget_btree_ratios
*
* Purpose: Queries B-tree split ratios. See H5Pset_btree_ratios().