summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-07 13:32:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-07 13:32:32 (GMT)
commitf766b32d07fae4562e95b9166255c35c8f3e467a (patch)
tree59aa2706ca5c91e1ac4c314a9de9b48f8979dc40 /fortran/src
parent259247fc328fa17b705fc16ab8e004d8c5814ea8 (diff)
downloadhdf5-f766b32d07fae4562e95b9166255c35c8f3e467a.zip
hdf5-f766b32d07fae4562e95b9166255c35c8f3e467a.tar.gz
hdf5-f766b32d07fae4562e95b9166255c35c8f3e467a.tar.bz2
[svn-r7559] 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')
-rw-r--r--fortran/src/H5Ff.c23
-rw-r--r--fortran/src/H5Fff.f9052
-rw-r--r--fortran/src/H5f90proto.h15
3 files changed, 82 insertions, 8 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;
+}
diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90
index 90a5a97..24e3945 100644
--- a/fortran/src/H5Fff.f90
+++ b/fortran/src/H5Fff.f90
@@ -802,4 +802,56 @@
hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids)
END SUBROUTINE h5fget_obj_ids_f
+
+!----------------------------------------------------------------------
+! Name: h5fget_freespace_f
+!
+! Purpose: Get amount of free space within a file
+!
+! Inputs:
+! file_id - file identifier
+! Outputs:
+! free_space - amount of free space in file
+! hdferr: - error code
+! Success: 0
+! Failure: -1
+! Optional parameters:
+! NONE
+!
+! Programmer: Quincey Koziol
+! October 7, 2003
+!
+! Modifications:
+!
+! Comment:
+!----------------------------------------------------------------------
+
+ SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr)
+!
+!This definition is needed for Windows DLLs
+!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$attributes dllexport :: h5fget_freespace_f
+!DEC$endif
+!
+
+ IMPLICIT NONE
+ INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
+ INTEGER(HSSIZE_T), INTENT(OUT) :: free_space
+ !amount of free space in file
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+
+ INTERFACE
+ INTEGER FUNCTION h5fget_freespace_c(file_id, free_space)
+ USE H5GLOBAL
+ !DEC$ IF DEFINED(HDF5F90_WINDOWS)
+ !MS$ATTRIBUTES C,reference,alias:'_H5FGET_FREESPACE_C':: h5fget_freespace_c
+ !DEC$ ENDIF
+ INTEGER(HID_T), INTENT(IN) :: file_id
+ INTEGER(HSSIZE_T), INTENT(OUT) :: free_space
+ END FUNCTION h5fget_freespace_c
+ END INTERFACE
+
+ hdferr = h5fget_freespace_c(file_id, free_space)
+
+ END SUBROUTINE h5fget_freespace_f
END MODULE H5F
diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h
index 85d8779..ad82080 100644
--- a/fortran/src/H5f90proto.h
+++ b/fortran/src/H5f90proto.h
@@ -39,6 +39,7 @@ H5_DLL int HD5packFstring(char *src, char *dest, int len);
# define nh5fget_access_plist_c FNAME(H5FGET_ACCESS_PLIST_C)
# define nh5fget_obj_count_c FNAME(H5FGET_OBJ_COUNT_C)
# define nh5fget_obj_ids_c FNAME(H5FGET_OBJ_IDS_C)
+# define nh5fget_freespace_c FNAME(H5FGET_FREESPACE_C)
#else /* !DF_CAPFNAMES */
# define nh5fcreate_c FNAME(h5fcreate_c)
# define nh5fflush_c FNAME(h5fflush_c)
@@ -52,6 +53,7 @@ H5_DLL int HD5packFstring(char *src, char *dest, int len);
# define nh5fget_access_plist_c FNAME(h5fget_access_plist_c)
# define nh5fget_obj_count_c FNAME(h5fget_obj_count_c)
# define nh5fget_obj_ids_c FNAME(h5fget_obj_ids_c)
+# define nh5fget_freespace_c FNAME(h5fget_freespace_c)
#endif /* DF_CAPFNAMES */
#endif /* H5Ff90_FNAMES */
@@ -78,6 +80,7 @@ H5_DLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
H5_DLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, int_f *obj_ids);
+H5_DLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space);
H5_DLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
/*
@@ -677,11 +680,11 @@ H5_DLL int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset);
H5_DLL int_f nh5tget_strpad_c ( hid_t_f *type_id, int_f * strpad);
H5_DLL int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad);
H5_DLL int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members);
-H5_DLL int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f *namelen);
+H5_DLL int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen);
H5_DLL int_f nh5tget_member_dims_c ( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm );
H5_DLL int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f* offset);
H5_DLL int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype);
-H5_DLL int_f nh5tget_member_index_c ( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *index);
+H5_DLL int_f nh5tget_member_index_c ( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *idx);
H5_DLL int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id);
H5_DLL int_f nh5tpack_c(hid_t_f * type_id);
@@ -810,7 +813,6 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pget_size_c FNAME(H5PGET_SIZE_C)
# define nh5pget_nprops_c FNAME(H5PGET_NPROPS_C)
# define nh5pget_class_parent_c FNAME(H5PGET_CLASS_PARENT_C)
-# define nh5pequal_c FNAME(H5PEQUAL_C)
# define nh5pisa_class_c FNAME(H5PISA_CLASS_C)
# define nh5pcopy_prop_c FNAME(H5PCOPY_PROP_C)
# define nh5premove_c FNAME(H5PREMOVE_C)
@@ -917,7 +919,6 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pget_size_c FNAME(h5pget_size_c)
# define nh5pget_nprops_c FNAME(h5pget_nprops_c)
# define nh5pget_class_parent_c FNAME(h5pget_class_parent_c)
-# define nh5pequal_c FNAME(h5pequal_c)
# define nh5pisa_class_c FNAME(h5pisa_class_c)
# define nh5pcopy_prop_c FNAME(h5pcopy_prop_c)
# define nh5premove_c FNAME(h5premove_c)
@@ -1071,7 +1072,6 @@ H5_DLL int_f nh5pset_alloc_time_c(hid_t_f *plist, int_f *flag);
H5_DLL int_f nh5pget_alloc_time_c(hid_t_f *plist, int_f *flag);
H5_DLL int_f nh5pset_fill_time_c(hid_t_f *plist, int_f *flag);
H5_DLL int_f nh5pget_fill_time_c(hid_t_f *plist, int_f *flag);
-H5_DLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size);
H5_DLL int_f nh5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
H5_DLL int_f nh5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
@@ -1111,7 +1111,6 @@ H5_DLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
H5_DLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size);
H5_DLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops);
H5_DLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id);
-H5_DLL int_f nh5pequal_c(hid_t_f *plist1_id, hid_t_f *plist2_id, int_f *c_flag);
H5_DLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass);
H5_DLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len);
H5_DLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len);
@@ -1208,9 +1207,9 @@ H5_DLL int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_
#endif
#endif
-H5_DLL int_f nh5eclear_c();
+H5_DLL int_f nh5eclear_c(void);
H5_DLL int_f nh5eprint_c1(_fcd name, int_f* namelen);
-H5_DLL int_f nh5eprint_c2();
+H5_DLL int_f nh5eprint_c2(void);
H5_DLL int_f nh5eget_major_c(int_f* error_no, _fcd name);
H5_DLL int_f nh5eget_minor_c(int_f* error_no, _fcd name);
H5_DLL int_f nh5eset_auto_c(int_f* printflag);