summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2015-09-17 04:45:52 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2016-11-29 23:42:30 (GMT)
commit2599f771dc2ee43115354e6520a8f2ccc6ab873c (patch)
treeb9ed605a629c6b6d9456791c097afe07194be48a
parentd67d6789996dd20650c7a0fec45b42127f10e05a (diff)
downloadhdf5-2599f771dc2ee43115354e6520a8f2ccc6ab873c.zip
hdf5-2599f771dc2ee43115354e6520a8f2ccc6ab873c.tar.gz
hdf5-2599f771dc2ee43115354e6520a8f2ccc6ab873c.tar.bz2
Add private H5D_write function
-rw-r--r--src/H5Dio.c31
-rw-r--r--src/H5Dprivate.h4
2 files changed, 33 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9d83c06..138c746 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -275,8 +275,8 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
} /* end if */
}
- if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data")
+ if(H5D_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
/* Call index post_update if available */
if (dset->shared->idx_class) {
@@ -312,6 +312,33 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dwrite() */
+/*-------------------------------------------------------------------------
+ * Function: H5D_write
+ *
+ * Purpose: Private function for H5Dwrite.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
+ const H5S_t *mem_space, const H5S_t *file_space,
+ hid_t dxpl_id, const void *buf)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ HDassert(dset);
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ if(FAIL == H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf))
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
/*-------------------------------------------------------------------------
* Function: H5D__pre_write
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index af86702..b381424 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -211,5 +211,9 @@ H5_DLL herr_t H5D_virtual_free_parsed_name(H5O_storage_virtual_name_seg_t *name_
H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
int indent, int fwidth, unsigned ndims, const uint32_t *dim);
+/* Internal I/O routines */
+H5_DLL herr_t H5D_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
+ const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf);
+
#endif /* _H5Dprivate_H */