diff options
Diffstat (limited to 'fortran/src/H5Rff.f90')
-rw-r--r-- | fortran/src/H5Rff.f90 | 153 |
1 files changed, 149 insertions, 4 deletions
diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 6400f43..a4f4a65 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -58,6 +58,12 @@ END INTERFACE + INTERFACE h5rget_name_f + + MODULE PROCEDURE h5rget_name_object_f + MODULE PROCEDURE h5rget_name_region_f + + END INTERFACE CONTAINS @@ -243,7 +249,6 @@ INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: ref_type ! Reference type INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference ! INTEGER, EXTERNAL :: h5h5rdereference_object_c @@ -309,7 +314,6 @@ INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: ref_type ! Reference type INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference ! INTEGER, EXTERNAL :: h5rdereference_region_c @@ -328,7 +332,6 @@ END FUNCTION h5rdereference_region_c END INTERFACE - ref_type = H5R_DATASET_REGION_F ref_f = ref%ref hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) @@ -475,4 +478,146 @@ END SUBROUTINE h5rget_object_type_obj_f - END MODULE H5R +!---------------------------------------------------------------------- +! Name: h5rget_name_object_f +! +! Purpose: Retrieves a name of a referenced object. +! +! Inputs: +! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! size - The size of the name buffer. +! +! Programmer: M.S. Breitenfeld +! March 28, 2008 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + + SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5rget_name_object_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + INTERFACE + INTEGER FUNCTION h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_OBJECT_C':: h5rget_name_object_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(SIZE_T) :: size_default + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER(HADDR_T) :: ref_f + + INTEGER(SIZE_T) :: name_len + END FUNCTION h5rget_name_object_c + END INTERFACE + + name_len=LEN(name) + + ref_f = ref%ref + hdferr = h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_object_f + +!---------------------------------------------------------------------- +! Name: h5rget_name_region_f +! +! Purpose: Retrieves a name of a dataset region. +! +! Inputs: +! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! size - The size of the name buffer. +! +! Programmer: M.S. Breitenfeld +! March 28, 2008 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + + SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5rget_name_region_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + INTERFACE + INTEGER FUNCTION h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_REGION_C':: h5rget_name_region_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(SIZE_T) :: size_default + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER :: ref_f(REF_REG_BUF_LEN) + + INTEGER(SIZE_T) :: name_len + END FUNCTION h5rget_name_region_c + END INTERFACE + + name_len=LEN(name) + + ref_f = ref%ref + hdferr = h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_region_f + +END MODULE H5R |