diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-09-17 17:03:42 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-09-17 17:03:42 (GMT) |
commit | c0bb2c979bdff34fd15534034d1de48388fdf90e (patch) | |
tree | 8effa84e4751284ca513da6ad4eed1128710936d /fortran/src | |
parent | 7dc63bdf270925373cff2951f7303fddb74e6a16 (diff) | |
download | hdf5-c0bb2c979bdff34fd15534034d1de48388fdf90e.zip hdf5-c0bb2c979bdff34fd15534034d1de48388fdf90e.tar.gz hdf5-c0bb2c979bdff34fd15534034d1de48388fdf90e.tar.bz2 |
[svn-r17486] Description:
Merged changes in the trunk/fortran to 1.8.
svn merge -r 17222:17485 https://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran
Brings bugfixes into 1.8 for:
Bug [1652] h5lget_info_by_idx_f missing/broken functionality
and
Bug [1653] H5_LINK_* values defined in H5f90global.f90 are incorrect
Tested: jam (ifort)
smirom (gfortran)
linew (f90)
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Lf.c | 12 | ||||
-rw-r--r-- | fortran/src/H5Lff.f90 | 32 | ||||
-rw-r--r-- | fortran/src/H5Of.c | 25 | ||||
-rw-r--r-- | fortran/src/H5Off.f90 | 44 | ||||
-rw-r--r-- | fortran/src/H5f90global.f90 | 10 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 12 | ||||
-rw-r--r-- | fortran/src/hdf5_fortrandll.def | 1 |
7 files changed, 109 insertions, 27 deletions
diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 4378f33..2832d44 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -396,7 +396,7 @@ done: int_f nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, - int_f *address, hsize_t_f *val_size, + haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) { char *c_link_name = NULL; /* Buffer to hold C string */ @@ -421,8 +421,8 @@ nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, *corder_valid = 0; if(link_buff.corder_valid > 0) *corder_valid = 1; *link_type = (int_f)link_buff.type; - *address = (int_f)link_buff.u.address; - *val_size = (hsize_t)link_buff.u.val_size; + *address = (haddr_t_f)link_buff.u.address; + *val_size = (size_t_f)link_buff.u.val_size; done: return ret_value; @@ -453,7 +453,7 @@ done: int_f nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, - int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size, hid_t_f *lapl_id) + int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) { char *c_group_name = NULL; /* Buffer to hold C string */ H5_index_t c_index_field; @@ -483,7 +483,9 @@ nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, *corder = (int_f)link_buff.corder; *cset = (int_f)link_buff.cset; - *data_size = (hsize_t)link_buff.u.val_size; + *link_type = (int_f)link_buff.type; + *address = (haddr_t_f)link_buff.u.address; + *val_size = (size_t_f)link_buff.u.val_size; done: return ret_value; diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 index b1a0fd9..0023e14 100644 --- a/fortran/src/H5Lff.f90 +++ b/fortran/src/H5Lff.f90 @@ -574,7 +574,7 @@ CONTAINS ! ! cset - indicates the character set used for link’s name. ! corder - specifies the link’s creation order position. -!corder_valid - indicates whether the value in corder is valid. +!f_corder_valid - indicates whether the value in corder is valid. ! link_type - specifies the link class: ! H5L_LINK_HARD_F - Hard link ! H5L_LINK_SOFT_F - Soft link @@ -612,8 +612,8 @@ CONTAINS ! H5L_LINK_SOFT_F - Soft link ! H5L_LINK_EXTERNAL_F - External link ! H5L_LINK_ERROR _F - Error - INTEGER, INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(HSIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value + INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value 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 @@ -638,8 +638,8 @@ CONTAINS INTEGER, INTENT(OUT) :: cset INTEGER, INTENT(OUT) :: corder INTEGER, INTENT(OUT) :: link_type - INTEGER, INTENT(OUT) :: address - INTEGER(HSIZE_T), INTENT(OUT) :: val_size + INTEGER(HADDR_T), INTENT(OUT) :: address + INTEGER(SIZE_T), INTENT(OUT) :: val_size INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: link_namelen INTEGER :: corder_valid @@ -691,7 +691,7 @@ CONTAINS ! !---------------------------------------------------------------------- SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) + link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group @@ -706,10 +706,16 @@ CONTAINS ! H5_ITER_DEC_F - Decreasing order ! H5_ITER_NATIVE_F - No particular order, whatever is fastest INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: + ! H5L_LINK_HARD_F - Hard link + ! H5L_LINK_SOFT_F - Soft link + ! H5L_LINK_EXTERNAL_F - External link + ! H5L_LINK_ERROR _F - Error LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! Indicates the size, in the number of characters, of the attribute for symbolic link 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 @@ -721,22 +727,24 @@ CONTAINS ! INTERFACE INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - corder_valid, corder, cset, data_size, lapl_id_default) + link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_BY_IDX_C'::h5lget_info_by_idx_c !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name INTEGER(SIZE_T) :: group_namelen INTEGER, INTENT(IN) :: index_field INTEGER, INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER :: corder_valid + INTEGER, INTENT(OUT) :: link_type + INTEGER :: corder_valid INTEGER, INTENT(OUT) :: corder INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size + INTEGER(HADDR_T), INTENT(OUT) :: address + INTEGER(SIZE_T), INTENT(OUT) :: val_size INTEGER(HID_T) :: lapl_id_default END FUNCTION h5lget_info_by_idx_c END INTERFACE @@ -747,7 +755,7 @@ CONTAINS IF(PRESENT(lapl_id)) lapl_id_default = lapl_id hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - corder_valid, corder, cset, data_size, lapl_id_default) + link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) f_corder_valid =.FALSE. IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 5282dd6..56cbfeb 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -97,3 +97,28 @@ nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid return ret_value; } +/*---------------------------------------------------------------------------- + * Name: h5oopen_by_addr_c + * Purpose: Calls H5open_by_addr + * Inputs: loc_id - File or group identifier + * addr - Object’s address in the file + * Outputs: obj_id - Dataset identifier + * Returns: 0 on success, -1 on failure + * Programmer: M. Scot Breitenfeld + * September 14, 2009 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id) +{ + int_f ret_value = 0; /* Return value */ + + /* + * Call H5Oopen_by_address function. + */ + if((*obj_id = (hid_t_f)H5Oopen_by_addr((hid_t)*loc_id, (haddr_t)*addr)) < 0) + HGOTO_DONE(FAIL); + + done: + return ret_value; +} diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index a541502..0328fbc 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -153,5 +153,49 @@ CONTAINS END SUBROUTINE h5oopen_f +!---------------------------------------------------------------------- +! Name: h5oopen_by_addr_f +! +! Purpose: Opens an object using its address within an HDF5 file. +! +! Inputs: +! loc_id - File or group identifier +! addr - Object’s address in the file +! Outputs: +! obj_id - Object identifier for the opened object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! September 14, 2009 +! +! Modifications: N/A +! +!---------------------------------------------------------------------- + + SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER(HADDR_T), INTENT(IN) :: addr ! Object’s address in the file + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! Success: 0 + ! Failure: -1 + INTERFACE + INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_BY_ADDR_C'::h5oopen_by_addr_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HADDR_T), INTENT(IN) :: addr + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5oopen_by_addr_c + END INTERFACE + + hdferr = h5oopen_by_addr_c(loc_id, addr, obj_id) + + END SUBROUTINE h5oopen_by_addr_f END MODULE H5O diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index e037d12..3fc247f 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -473,10 +473,10 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_LINK_F INTEGER :: H5L_LINK_ERROR_F INTEGER :: H5L_LINK_HARD_F INTEGER :: H5L_LINK_SOFT_F + INTEGER :: H5L_LINK_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F @@ -485,10 +485,10 @@ MODULE H5GLOBAL !DEC$endif COMMON /H5L_FLAGS/ H5L_flags - EQUIVALENCE(H5L_flags(1), H5L_LINK_F) - EQUIVALENCE(H5L_flags(2), H5L_LINK_ERROR_F) - EQUIVALENCE(H5L_flags(3), H5L_LINK_HARD_F) - EQUIVALENCE(H5L_flags(4), H5L_LINK_SOFT_F) + EQUIVALENCE(H5L_flags(1), H5L_LINK_ERROR_F) + EQUIVALENCE(H5L_flags(2), H5L_LINK_HARD_F) + EQUIVALENCE(H5L_flags(3), H5L_LINK_SOFT_F) + EQUIVALENCE(H5L_flags(4), H5L_LINK_EXTERNAL_F) EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 15dc41d..7f16359 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -739,11 +739,13 @@ H5_FCDLL int_f nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_ * Functions from H5Of.c */ -# define nh5olink_c H5_FC_FUNC_(h5olink_c, H5OLINK_C) -# define nh5oopen_c H5_FC_FUNC_(h5oopen_c, H5OOPEN_C) +# define nh5olink_c H5_FC_FUNC_(h5olink_c, H5OLINK_C) +# define nh5oopen_c H5_FC_FUNC_(h5oopen_c, H5OOPEN_C) +# define nh5oopen_by_addr_c H5_FC_FUNC_(h5oopen_by_addr_c, H5OOPEN_BY_ADDR_C) H5_FCDLL int_f nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id); +H5_FCDLL int_f nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id); H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); /* @@ -1201,11 +1203,11 @@ H5_FCDLL int_f nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f * H5_FCDLL int_f nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists); H5_FCDLL int_f nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, - int_f *address, hsize_t_f *link_len, + haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id); H5_FCDLL int_f nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, hsize_t_f *n, - int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size, hid_t_f *lapl_id); + int_f *index_field, int_f *order, hsize_t_f *n, + int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id); H5_FCDLL int_f nh5lis_registered_c(int_f *link_cls_id); H5_FCDLL int_f nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); diff --git a/fortran/src/hdf5_fortrandll.def b/fortran/src/hdf5_fortrandll.def index 057dc13..5f45350 100644 --- a/fortran/src/hdf5_fortrandll.def +++ b/fortran/src/hdf5_fortrandll.def @@ -286,6 +286,7 @@ H5L_mp_H5LGET_NAME_BY_IDX_F ; H5O
H5O_mp_H5OLINK_F
H5O_mp_H5OOPEN_F
+H5O_mp_H5OOPEN_BY_ADDR_F
; H5P
H5P_mp_H5PCREATE_F
H5P_mp_H5PSET_PRESERVE_F
|