summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ff.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-07 13:57:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-07 13:57:18 (GMT)
commita5d1c5c576a7a26ef78dfb4715c2b1f2cbcced3a (patch)
treed7b9efd00dc6a81b4312d75a64e09ba13e93d052 /fortran/src/H5Ff.c
parent4ee4926dbde7184de260f507cc42afb4738c0f82 (diff)
downloadhdf5-a5d1c5c576a7a26ef78dfb4715c2b1f2cbcced3a.zip
hdf5-a5d1c5c576a7a26ef78dfb4715c2b1f2cbcced3a.tar.gz
hdf5-a5d1c5c576a7a26ef78dfb4715c2b1f2cbcced3a.tar.bz2
[svn-r7560] Purpose:
Add feature Description: Add H5Fget_freespace() routine, to check the amount of free space in a file. This information is only valid until the file is closed currently, however (until we start recording the free space information in the file itself). Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'fortran/src/H5Ff.c')
-rw-r--r--fortran/src/H5Ff.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c
index fa1e108..e486698 100644
--- a/fortran/src/H5Ff.c
+++ b/fortran/src/H5Ff.c
@@ -452,3 +452,26 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f
if ( H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, (hid_t *)obj_ids) < 0 ) ret_value = -1;
return ret_value;
}
+/*----------------------------------------------------------------------------
+ * Name: h5fget_freespace_c
+ * Purpose: Call H5Fget_freespace to get amount of free space within a file
+ * Inputs: file_id - identifier of the file to query
+ * Returns: free_space - amount of free space in file
+ * 0 on success, -1 on failure
+ * Programmer: Quincey Koziol
+ * Tuesday, October 7, 2003
+ * Modifications:
+ *---------------------------------------------------------------------------*/
+
+int_f
+nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space)
+{
+ int ret_value = 0;
+ hid_t c_file_id;
+ hssize_t c_free_space;
+
+ c_file_id = (hid_t)*file_id;
+ if ( (c_free_space=H5Fget_freespace(c_file_id)) < 0 ) ret_value = -1;
+ *free_space=(hssize_t_f)c_free_space;
+ return ret_value;
+}