[svn-r10561] Purpose: Maintenance

Description: Added missing h5get_member_class_f function

Solution:

Platforms tested: heping; it is a simple change. I will
                  watch daily tests and take care of failures.

Misc. update:
This commit is contained in:
Elena Pourmal 2005-04-06 17:53:03 -05:00
parent 686e4f3501
commit b72f2c328b
5 changed files with 127 additions and 1 deletions

View File

@ -1633,3 +1633,33 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
if ( status < 0 ) ret_value = -1;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_member_class_c
* Purpose: Call H5Tget_member_class to detrmine ithe class of the compound
* datatype member
* Inputs: type_id - identifier of the dataspace
* member_no - member's index
* Outputs: class - member's class
* and negative on failure.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, April 6, 2005
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
{
int ret_value = 0;
hid_t c_type_id;
unsigned c_member_no;
H5T_class_t c_class;
c_type_id = (hid_t)*type_id;
c_member_no = (unsigned)*member_no;
c_class = H5Tget_member_class(c_type_id, c_member_no);
if ( c_class == H5T_NO_CLASS ) ret_value = -1;
*class = (int_f)c_class;
return ret_value;
}

View File

@ -3178,5 +3178,74 @@
END SUBROUTINE h5tis_variable_str_f
!----------------------------------------------------------------------
! Name: h5tget_member_class_f
!
! Purpose: Returns datatype class of compound datatype member.
!
! Inputs:
! type_id - - datartpe identifier
! member_no - index of compound datatype member
! Outputs:
! class - class type for compound dadtype member
! Can be one of the follwoing classes:
! H5T_NO_CLASS_F (error)
! H5T_INTEGER_F
! H5T_FLOAT_F
! H5T_TIME_F
! H5T_STRING_F
! H5T_BITFIELD_F
! H5T_OPAQUE_F
! H5T_COMPOUND_F
! H5T_REFERENCE_F
! H5T_ENUM_F
! H5T_VLEN_F
! H5T_ARRAY_F
! hdferr: - error code
! Success: 0
! Failure: -1
! Optional parameters:
! NONE
!
! Programmer: Elena Pourmal
! April 6, 2005
!
! Modifications:
!
! Comment:
!----------------------------------------------------------------------
SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$attributes dllexport :: h5tget_member_class_f
!DEC$endif
!
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
INTEGER, INTENT(IN) :: member_no ! Member number
INTEGER, INTENT(OUT) :: class ! Member class
INTEGER, INTENT(OUT) :: hdferr ! Error code
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5tget_member_class_c(type_id, member_no, class)
USE H5GLOBAL
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5TGET_MEMBER_CLASS_C'::h5tget_member_class_c
!DEC$ ENDIF
INTEGER(HID_T), INTENT(IN) :: type_id
INTEGER, INTENT(IN) :: member_no
INTEGER, INTENT(OUT) :: class
END FUNCTION h5tget_member_class_c
END INTERFACE
hdferr = h5tget_member_class_c(type_id, member_no, class)
END SUBROUTINE h5tget_member_class_f
!----------------------------------------------------------------------
END MODULE H5T

View File

@ -301,6 +301,7 @@ H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
# define nh5tget_super_c FC_FUNC_(h5tget_super_c, H5TGET_SUPER_C)
# define nh5tvlen_create_c FC_FUNC_(h5tvlen_create_c, H5TVLEN_CREATE_C)
# define nh5tis_variable_str_c FC_FUNC_(h5tis_variable_str_c, H5TIS_VARIABLE_STR_C)
# define nh5tget_member_class_c FC_FUNC_(h5tget_member_class_c, H5TGET_MEMBER_CLASS_C)
H5_FCDLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id);
@ -358,6 +359,7 @@ H5_FCDLL int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims);
H5_FCDLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id);
H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id);
H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class );
/*
* Functions from H5Pf.c

View File

@ -334,6 +334,12 @@
write(*,*) "Wrong member type returned for character member"
total_error = total_error + 1
endif
CALL h5tget_member_class_f(dtype_id, i-1, class, error)
CALL check("h5tget_member_class_f",error, total_error)
if (class .ne. H5T_STRING_F) then
write(*,*) "Wrong class returned for character member"
total_error = total_error + 1
endif
CASE("integer_field")
if(offset_out .ne. type_sizec) then
write(*,*) "Offset of the integer member is incorrect"
@ -347,6 +353,12 @@
write(*,*) "Wrong member type returned for integer memebr"
total_error = total_error + 1
endif
CALL h5tget_member_class_f(dtype_id, i-1, class, error)
CALL check("h5tget_member_class_f",error, total_error)
if (class .ne. H5T_INTEGER_F) then
write(*,*) "Wrong class returned for INTEGER member"
total_error = total_error + 1
endif
CASE("double_field")
if(offset_out .ne. (type_sizec+type_sizei)) then
write(*,*) "Offset of the double precision member is incorrect"
@ -360,6 +372,12 @@
write(*,*) "Wrong member type returned for double precision memebr"
total_error = total_error + 1
endif
CALL h5tget_member_class_f(dtype_id, i-1, class, error)
CALL check("h5tget_member_class_f",error, total_error)
if (class .ne. H5T_FLOAT_F) then
write(*,*) "Wrong class returned for double precision member"
total_error = total_error + 1
endif
CASE("real_field")
if(offset_out .ne. (type_sizec+type_sizei+type_sized)) then
write(*,*) "Offset of the real member is incorrect"
@ -373,6 +391,12 @@
write(*,*) "Wrong member type returned for real memebr"
total_error = total_error + 1
endif
CALL h5tget_member_class_f(dtype_id, i-1, class, error)
CALL check("h5tget_member_class_f",error, total_error)
if (class .ne. H5T_FLOAT_F) then
write(*,*) "Wrong class returned for real member"
total_error = total_error + 1
endif
CASE DEFAULT
write(*,*) "Wrong member's name"
total_error = total_error + 1

View File

@ -174,7 +174,8 @@ New Features
Fortran Library:
----------------
- added missing h5tget_member_class_f function
EIP 2005/04/06
- added new functions h5fget_name_f and h5fget_filesize_f
EIP 2004/07/08
- h5dwrite/read_f and h5awrite/read_f functions only accept dims parameter