summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Pf.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2014-04-01 15:15:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2014-04-01 15:15:26 (GMT)
commitc86aedeba1f683daaf0289435450fd4e518fecc4 (patch)
tree34465d58fba592f9e2764decdabedc7326b4e097 /fortran/src/H5Pf.c
parent0fcac5670573e802100c2a099cdc6eb8af229d12 (diff)
downloadhdf5-c86aedeba1f683daaf0289435450fd4e518fecc4.zip
hdf5-c86aedeba1f683daaf0289435450fd4e518fecc4.tar.gz
hdf5-c86aedeba1f683daaf0289435450fd4e518fecc4.tar.bz2
[svn-r24939] Fix for HDFFV-8309 Fortran wrappers for H5Pget/set_file_image functions
Tested: jam (gnu, intel, pgi)
Diffstat (limited to 'fortran/src/H5Pf.c')
-rw-r--r--fortran/src/H5Pf.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index 7a3f899..98e5ff6 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -5546,3 +5546,73 @@ nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nb
ret_value = 0;
return ret_value;
}
+
+/*----------------------------------------------------------------------------
+ * Name: h5pset_file_image_c
+ * Purpose: Calls H5Pset_file_image
+ *
+ * Inputs:
+ * fapl_id - File access property list identifier
+ * buf_ptr - Pointer to the initial file image,
+ * or NULL if no initial file image is desired
+ * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired
+ *
+ * Returns: 0 on success, -1 on failure
+ * Programmer: M. Scot Breitenfeld
+ * February 19, 2012
+ *---------------------------------------------------------------------------*/
+
+int_f
+nh5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len)
+{
+ int ret_value = -1;
+ /*
+ * Call H5Pset_file_image function.
+ */
+ if( (H5Pset_file_image((hid_t)*fapl_id, buf_ptr, (size_t)*buf_len)) <0 )
+ return ret_value; /* error occurred */
+
+ ret_value = 0;
+ return ret_value;
+}
+
+/*----------------------------------------------------------------------------
+ * Name: h5pget_file_image_c
+ * Purpose: Calls H5Pget_file_image
+ *
+ * Inputs:
+ * fapl_id - File access property list identifier
+ * Outputs:
+ * buf_ptr - Pointer to the initial file image,
+ * or NULL if no initial file image is desired
+ * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired
+ *
+ * Returns: 0 on success, -1 on failure
+ * Programmer: M. Scot Breitenfeld
+ * February 19, 2012
+ *---------------------------------------------------------------------------*/
+
+int_f
+nh5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr)
+{
+ int ret_value = -1;
+ size_t c_buf_len_ptr;
+ void *c_buf_ptr = NULL;
+
+ c_buf_len_ptr = (size_t)*buf_len_ptr;
+
+ /*
+ * Call H5Pget_file_image function.
+ */
+ if( (H5Pget_file_image((hid_t)*fapl_id, (void **)&c_buf_ptr, &c_buf_len_ptr)) <0 )
+ return ret_value; /* error occurred */
+
+ HDmemcpy((void *)*buf_ptr, (void *)c_buf_ptr, c_buf_len_ptr);
+
+ *buf_len_ptr=(size_t_f)c_buf_len_ptr;
+
+ ret_value = 0;
+ if(c_buf_ptr) HDfree(c_buf_ptr);
+
+ return ret_value;
+}