summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Aff.f90
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-05-14 18:50:15 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-05-14 18:50:15 (GMT)
commita30c706f7952c68a5bc0da3482a259f96c4c4a02 (patch)
tree7e2c1dd2f10a8ab006ee27516556734a6680c7ed /fortran/src/H5Aff.f90
parent86790dab743b1ed55f106001185c70e1e77f40be (diff)
downloadhdf5-a30c706f7952c68a5bc0da3482a259f96c4c4a02.zip
hdf5-a30c706f7952c68a5bc0da3482a259f96c4c4a02.tar.gz
hdf5-a30c706f7952c68a5bc0da3482a259f96c4c4a02.tar.bz2
[svn-r14995] Purpose:
Changed the interface for the get_name_by_idx_f routine Description: Changed the 'size' which is the correct size of the returned buffer to be an optional parameter.
Diffstat (limited to 'fortran/src/H5Aff.f90')
-rw-r--r--fortran/src/H5Aff.f9023
1 files changed, 14 insertions, 9 deletions
diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90
index cad5231..9834914 100644
--- a/fortran/src/H5Aff.f90
+++ b/fortran/src/H5Aff.f90
@@ -2785,7 +2785,7 @@ CONTAINS
! H5_INDEX_UNKNOWN_F = -1 - Unknown index type
! H5_INDEX_NAME_F - Index on names
! H5_INDEX_CRT_ORDER_F - Index on creation order
-! H5_INDEX_N _F - Number of indices defined
+! H5_INDEX_N_F - Number of indices defined
!
! order - Order in which to iterate over index; Possible values are:
!
@@ -2797,16 +2797,15 @@ CONTAINS
!
! order - Index traversal order
! n - Attribute’s position in index
-! size - Size, in bytes, of attribute name
!
! Outputs:
! name - Attribute name
-! name_size_out - Size of Attribute name returned from function
! hdferr: - error code
! Success: 0
! Failure: -1
! Optional parameters:
! lapl_id - Link access property list
+! size - Size, in bytes, of attribute name
!
! Programmer: M.S. Breitenfeld
! January, 2008
@@ -2815,7 +2814,7 @@ CONTAINS
!----------------------------------------------------------------------
SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, &
- n, name, size, hdferr, lapl_id)
+ n, name, hdferr, size, lapl_id)
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$attributes dllexport :: h5aget_name_by_idx_f
@@ -2839,9 +2838,8 @@ CONTAINS
INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index
- CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name
+ CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name
- INTEGER(SIZE_T), INTENT(INOUT) :: size ! Buffer size ! *TEST* check for 0 value *CHECK* should this return the correct value
INTEGER, INTENT(OUT) :: hdferr ! Error code:
! Returns attribute name size,
@@ -2849,12 +2847,14 @@ CONTAINS
INTEGER(SIZE_T) :: obj_namelen
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
INTEGER(HID_T) :: lapl_id_default
+ INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, of the attribute
+ INTEGER(SIZE_T) :: size_default
!
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, &
- n, name, size, lapl_id_default)
+ n, name, size_default, lapl_id_default)
USE H5GLOBAL
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_BY_IDX_C'::h5aget_name_by_idx_c
@@ -2867,7 +2867,7 @@ CONTAINS
INTEGER(HSIZE_T), INTENT(IN) :: n
CHARACTER(LEN=*), INTENT(OUT) :: name
- INTEGER(SIZE_T), INTENT(INOUT) :: size
+ INTEGER(SIZE_T) :: size_default
INTEGER(HID_T) :: lapl_id_default
INTEGER(SIZE_T) :: obj_namelen
END FUNCTION h5aget_name_by_idx_c
@@ -2877,8 +2877,13 @@ CONTAINS
lapl_id_default = H5P_DEFAULT_F
IF(PRESENT(lapl_id)) lapl_id_default = lapl_id
+ size_default = LEN(name)
+
hdferr = h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, &
- n, name, size, lapl_id_default)
+ n, name, size_default, lapl_id_default)
+
+ IF(PRESENT(size)) size = size_default
+
END SUBROUTINE h5aget_name_by_idx_f