diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-07-16 16:12:50 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-07-16 16:12:50 (GMT) |
commit | 21401d18912008750bdd7b2b0406cd5ac9aa185a (patch) | |
tree | 098bfc1fc62701d81e3e5c48bf6a4f69e449f35a /fortran | |
parent | 27ee3e76fa5fbd82fabd014067dd16a73bec3c2e (diff) | |
download | hdf5-21401d18912008750bdd7b2b0406cd5ac9aa185a.zip hdf5-21401d18912008750bdd7b2b0406cd5ac9aa185a.tar.gz hdf5-21401d18912008750bdd7b2b0406cd5ac9aa185a.tar.bz2 |
[svn-r15377] Description:
Added optional "mounted" parameter to H5Gget_info_f, H5Gget_info_by_idx_f, H5Gget_info_by_name_f
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5Gf.c | 30 | ||||
-rw-r--r-- | fortran/src/H5Gff.f90 | 78 |
2 files changed, 85 insertions, 23 deletions
diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 28e5312..1f3e416 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -725,14 +725,18 @@ done: * * nlinks - Number of links in group * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * Returns: 0 on success, -1 on failure * Programmer: M.S. Breitenfeld * February 15, 2008 - * Modifications: N/A + * Modifications: + * - Added 'mounted' paramater + * M.S. Breitenfeld + * July 16, 2008 *---------------------------------------------------------------------------*/ int_f -nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder) +nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) { int_f ret_value = 0; /* Return value */ @@ -749,6 +753,8 @@ nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *ma *storage_type = (int_f)ginfo.storage_type; *nlinks = (int_f)ginfo.nlinks; *max_corder = (int_f)ginfo.max_corder; + *mounted = 0; + if(ginfo.mounted) *mounted = 1; done: return ret_value; @@ -774,16 +780,20 @@ done: * * nlinks - Number of links in group * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * Returns: 0 on success, -1 on failure * Programmer: M.S. Breitenfeld * February 18, 2008 - * Modifications: N/A + * Modifications: + * - Added 'mounted' paramater + * M.S. Breitenfeld + * July 16, 2008 *---------------------------------------------------------------------------*/ int_f nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder) + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) { char *c_group_name = NULL; /* Buffer to hold group name C string */ @@ -807,6 +817,8 @@ nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, *storage_type = (int_f)ginfo.storage_type; *nlinks = (int_f)ginfo.nlinks; *max_corder = (int_f)ginfo.max_corder; + *mounted = 0; + if(ginfo.mounted) *mounted = 1; done: if(c_group_name) @@ -830,15 +842,19 @@ nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * * nlinks - Number of links in group * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * Returns: 0 on success, -1 on failure * Programmer: M.S. Breitenfeld * February 18, 2008 - * Modifications: N/A + * Modifications: + * - Added 'mounted' paramater + * M.S. Breitenfeld + * July 16, 2008 *---------------------------------------------------------------------------*/ int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder) + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) { char *c_group_name = NULL; /* Buffer to hold group name C string */ @@ -861,6 +877,8 @@ nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen *storage_type = (int_f)ginfo.storage_type; *nlinks = (int_f)ginfo.nlinks; *max_corder = (int_f)ginfo.max_corder; + *mounted = 0; + if(ginfo.mounted) *mounted = 1; done: if(c_group_name) diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index 1e4b2b1..13baa94 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -1197,16 +1197,19 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! NONE +! mounted - Whether group has a file mounted on it ! ! Programmer: M. S. Breitenfeld ! February 15, 2008 ! -! Modifications: N/A +! Modifications: +! - Added 'mounted' paramater +! M.S. Breitenfeld +! July 16, 2008 ! !---------------------------------------------------------------------- - SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr) + SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5gget_info_f @@ -1222,11 +1225,14 @@ CONTAINS INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it + + INTEGER :: mounted_c ! MS FORTRAN needs explicit interface for C functions called here. ! INTERFACE - INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder) + INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_C'::h5gget_info_c @@ -1235,10 +1241,19 @@ CONTAINS INTEGER, INTENT(OUT) :: storage_type INTEGER, INTENT(OUT) :: nlinks INTEGER, INTENT(OUT) :: max_corder + INTEGER :: mounted_c END FUNCTION h5gget_info_c END INTERFACE - hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder) + hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF END SUBROUTINE h5gget_info_f @@ -1266,17 +1281,21 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! lapl_id - Link access property list +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it ! ! Programmer: M. S. Breitenfeld ! February 18, 2008 ! -! Modifications: N/A +! Modifications: +! - Added 'mounted' paramater +! M.S. Breitenfeld +! July 16, 2008 ! !---------------------------------------------------------------------- SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & - storage_type, nlinks, max_corder, hdferr, lapl_id) + storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5gget_info_by_idx_f @@ -1297,7 +1316,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it + INTEGER :: mounted_c INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: group_name_len ! length of group name @@ -1305,7 +1326,7 @@ CONTAINS ! INTERFACE INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder) + storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_IDX_C'::h5gget_info_by_idx_c @@ -1321,6 +1342,7 @@ CONTAINS INTEGER, INTENT(OUT) :: max_corder INTEGER(SIZE_T) :: group_name_len + INTEGER :: mounted_c END FUNCTION h5gget_info_by_idx_c END INTERFACE @@ -1328,11 +1350,19 @@ CONTAINS group_name_len = LEN(group_name) lapl_id_default = H5P_DEFAULT_F - IF(present(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id hdferr = h5gget_info_by_idx_c(loc_id, group_name, group_name_len, & index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder) + storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF END SUBROUTINE h5gget_info_by_idx_f @@ -1357,17 +1387,20 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! lapl_id - Link access property list +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it ! ! Programmer: M. S. Breitenfeld ! February 18, 2008 ! -! Modifications: N/A -! +! Modifications: +! - Added 'mounted' paramater +! M.S. Breitenfeld +! July 16, 2008 !---------------------------------------------------------------------- SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & - storage_type, nlinks, max_corder, hdferr, lapl_id) + storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5gget_info_by_name_f @@ -1385,7 +1418,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it + INTEGER :: mounted_c INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: group_name_len ! length of group name @@ -1393,7 +1428,7 @@ CONTAINS ! INTERFACE INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder) + storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_NAME_C'::h5gget_info_by_name_c @@ -1406,6 +1441,7 @@ CONTAINS INTEGER, INTENT(OUT) :: max_corder INTEGER(SIZE_T) :: group_name_len + INTEGER :: mounted_c END FUNCTION h5gget_info_by_name_c END INTERFACE @@ -1416,7 +1452,15 @@ CONTAINS IF(PRESENT(lapl_id)) lapl_id_default = lapl_id hdferr = h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder) + storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF END SUBROUTINE h5gget_info_by_name_f |