diff options
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5Ff.c | 17 | ||||
-rw-r--r-- | fortran/src/H5Fff.f90 | 29 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 4 | ||||
-rw-r--r-- | fortran/test/tH5F.f90 | 8 |
4 files changed, 35 insertions, 23 deletions
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 4910aca..fbfb0b2 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -404,17 +404,18 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) return ret_value; } -/****if* H5Ff/h5fis_hdf5_c +/****if* H5Ff/h5fis_accessible_c * NAME - * h5fis_hdf5_c + * h5fis_accessible_c * PURPOSE - * Call H5Fis_hdf5 to determone if the file is an HDF5 file + * Call H5Fis_accessible to determone if the file is accessible with fapl * INPUTS * name - name of the file * namelen - name length + * acc_prp - identifier of access property list * OUTPUTS - * flag - 0 if file is not HDF5 file , positive if a file - * is an HDF5 file, and negative on failure. + * flag - 0 if file is not accessible , positive if a file + * is accessible, and negative on failure. * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -425,14 +426,16 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) * SOURCE */ int_f -nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) +nh5fis_accessible_c (_fcd name, int_f *namelen, hid_t_f *acc_prp, int_f *flag) /******/ { int ret_value = -1; char *c_name; int_f c_namelen; + hid_t c_acc_prp; htri_t status; + c_acc_prp = (hid_t)*acc_prp; /* * Convert FORTRAN name to C name */ @@ -443,7 +446,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) /* * Call H5Fopen function. */ - status = H5Fis_hdf5(c_name); + status = H5Fis_accessible(c_name, c_acc_prp); *flag = (int_f)status; if (status >= 0) ret_value = 0; diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index faa1967..c3af8c4 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -494,19 +494,21 @@ CONTAINS END SUBROUTINE h5fget_access_plist_f -!****s* H5F/h5fis_hdf5_f +!****s* H5F/h5fis_accessible_f ! ! NAME -! h5fis_hdf5_f +! h5fis_accessible_f ! ! PURPOSE -! Determines whether a file is in the HDF5 format. +! Determines whether a file is accessible with the fapl. ! ! INPUTS ! name - name of the file to check ! OUTPUTS -! status - indicates if file is and HDF5 file +! status - indicates if file is accessible ! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! access_prp - file access property list identifier ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -517,36 +519,43 @@ CONTAINS ! port). February 28, 2001 ! ! SOURCE - SUBROUTINE h5fis_hdf5_f(name, status, hdferr) + SUBROUTINE h5fis_accessible_f(name, status, hdferr, access_prp) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file LOGICAL, INTENT(OUT) :: status ! Indicates if file ! is an HDF5 file INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier !***** INTEGER :: namelen ! Length of the name character string + INTEGER(HID_T) :: access_prp_default INTEGER :: flag ! "TRUE/FALSE" flag from C routine ! to define status value. INTERFACE - INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) + INTEGER FUNCTION h5fis_accessible_c(name, namelen, access_prp_default, flag) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FIS_HDF5_C':: h5fis_hdf5_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FIS_ACCESSIBLE_C':: h5fis_accessible_c !DEC$ENDIF !DEC$ATTRIBUTES reference :: name CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: access_prp_default INTEGER :: flag - END FUNCTION h5fis_hdf5_c + END FUNCTION h5fis_accessible_c END INTERFACE namelen = LEN_TRIM(name) - hdferr = h5fis_hdf5_c(name, namelen, flag) + access_prp_default = H5P_DEFAULT_F + IF (PRESENT(access_prp)) access_prp_default = access_prp + hdferr = h5fis_accessible_c(name, namelen, access_prp_default, flag) status = .TRUE. IF (flag .EQ. 0) status = .FALSE. - END SUBROUTINE h5fis_hdf5_f + END SUBROUTINE h5fis_accessible_f !****s* H5F/h5fclose_f ! ! NAME diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 4b02b6c..6b2728b 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -84,7 +84,7 @@ typedef struct H5O_info_t_f { #define nh5fflush_c H5_FC_FUNC_(h5fflush_c, H5FFLUSH_C) #define nh5fclose_c H5_FC_FUNC_(h5fclose_c, H5FCLOSE_C) #define nh5fopen_c H5_FC_FUNC_(h5fopen_c, H5FOPEN_C) -#define nh5fis_hdf5_c H5_FC_FUNC_(h5fis_hdf5_c, H5FIS_HDF5_C) +#define nh5fis_accessible_c H5_FC_FUNC_(h5fis_accessible_c, H5FIS_ACCESSIBLE_C) #define nh5fmount_c H5_FC_FUNC_(h5fmount_c, H5FMOUNT_C) #define nh5funmount_c H5_FC_FUNC_(h5funmount_c, H5FUNMOUNT_C) #define nh5freopen_c H5_FC_FUNC_(h5freopen_c, H5FREOPEN_C) @@ -99,7 +99,7 @@ typedef struct H5O_info_t_f { H5_FCDLL int_f nh5fcreate_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id); H5_FCDLL int_f nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id); -H5_FCDLL int_f nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag); +H5_FCDLL int_f nh5fis_accessible_c (_fcd name, int_f *namelen, hid_t_f *acc_prp, int_f *flag); H5_FCDLL int_f nh5fclose_c (hid_t_f *file_id); H5_FCDLL int_f nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp); H5_FCDLL int_f nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen); diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90 index d8f683c..a7a1f70 100644 --- a/fortran/test/tH5F.f90 +++ b/fortran/test/tH5F.f90 @@ -188,15 +188,15 @@ ! !test whether files are in hdf5 format ! - CALL h5fis_hdf5_f(fix_filename1, status, error) - CALL check("h5fis_hdf5_f",error,total_error) + CALL h5fis_accessible_f(fix_filename1, status, error) + CALL check("h5fis_accessible_f",error,total_error) IF ( .NOT. status ) THEN write(*,*) "File ", fix_filename1, " is not in hdf5 format" stop END IF - CALL h5fis_hdf5_f(fix_filename2, status, error) - CALL check("h5fis_hdf5_f",error,total_error) + CALL h5fis_accessible_f(fix_filename2, status, error) + CALL check("h5fis_accessible_f",error,total_error) IF ( .NOT. status ) THEN write(*,*) "File ", fix_filename2, " is not in hdf5 format" stop |