diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-06-20 16:38:54 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-06-20 16:38:54 (GMT) |
commit | b950312318e798a71bb7d128029f03dedefd3285 (patch) | |
tree | 44e434979186dd2190a1434d154d22b4ad6347fe /fortran | |
parent | b5938a75afcf16b827158518bf9730c99cefb7c9 (diff) | |
download | hdf5-b950312318e798a71bb7d128029f03dedefd3285.zip hdf5-b950312318e798a71bb7d128029f03dedefd3285.tar.gz hdf5-b950312318e798a71bb7d128029f03dedefd3285.tar.bz2 |
[svn-r15255] Description:
Added the function h5tget_native_type and associated
requirements.
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5Tf.c | 26 | ||||
-rw-r--r-- | fortran/src/H5Tff.f90 | 57 | ||||
-rw-r--r-- | fortran/src/H5_f.c | 2 | ||||
-rw-r--r-- | fortran/src/H5f90global.f90 | 7 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 3 |
5 files changed, 92 insertions, 3 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 633389b..5fc415a 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1840,3 +1840,29 @@ nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) ret_value = 0; return ret_value; } + +/*---------------------------------------------------------------------------- + * Name: h5tget_native_type_c + * Purpose: Call H5Tget_native_type + * Inputs: + * dtype_id - Datatype identifier for the dataset datatype. + * direction - Direction of search. + * Outputs: native_dtype_id - The native datatype identifier for the specified dataset datatype + * Returns: 0 on success, -1 on failure + * Programmer: M.S. Breitenfeld + * June 18, 2008 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id) +{ + int ret_value = -1; + hid_t status; + + status = H5Tget_native_type( (hid_t)*dtype_id, (H5T_direction_t)*direction); + if ( status < 0 ) return ret_value; + *native_dtype_id = (hid_t_f)status; + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index 8aa267e..0ea88c5 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -3646,4 +3646,61 @@ CONTAINS END SUBROUTINE h5tcompiler_conv_f +!---------------------------------------------------------------------- +! Name: h5tget_native_type_f +! +! Purpose: Returns the native datatype of a specified datatype. +! +! Inputs: +! dtype_id - Datatype identifier for the dataset datatype. +! * +! direction - Direction of search: +! H5T_DIR_DEFAULT = 0, /*default direction is inscendent */ +! H5T_DIR_ASCEND = 1, /*in inscendent order */ +! H5T_DIR_DESCEND = 2 /*in descendent order */ +! * NOTE: In C it is defined as a structure: H5T_direction_t +! +! Outputs: +! native_dtype_id - The native datatype identifier for the specified dataset datatype +! hdferr: - Error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: M.S. Breitenfeld +! June 18, 2008 +! +! Modifications: N/A +! +!---------------------------------------------------------------------- + + SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5tget_native_type_f +!DEC$endif + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier + INTEGER, INTENT(IN) :: direction ! Direction of search: + ! H5T_DIR_ASCEND_F = 1 in inscendent order + ! H5T_DIR_DESCEND_F = 2 in descendent order + INTEGER(HID_T), INTENT(OUT) :: native_dtype_id ! The native datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTERFACE + INTEGER FUNCTION h5tget_native_type_c(dtype_id, direction, native_dtype_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_NATIVE_TYPE_C'::h5tget_native_type_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER, INTENT(IN) :: direction + INTEGER(HID_T), INTENT(OUT) :: native_dtype_id + END FUNCTION h5tget_native_type_c + END INTERFACE + + hdferr = h5tget_native_type_c(dtype_id, direction, native_dtype_id) + END SUBROUTINE h5tget_native_type_f + END MODULE H5T diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 8df766c..efc478d 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -484,6 +484,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5t_flags[28] = (int_f)H5T_STR_ERROR; h5t_flags[29] = (int_f)H5T_VLEN; h5t_flags[30] = (int_f)H5T_ARRAY; + h5t_flags[31] = (int_f)H5T_DIR_ASCEND; + h5t_flags[32] = (int_f)H5T_DIR_DESCEND; /* * H5Z flags */ diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 251e49c..bf2d715 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -625,11 +625,10 @@ EQUIVALENCE(H5S_flags(19), H5S_SEL_HYPERSLABS_F) EQUIVALENCE(H5S_flags(20), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 31 + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 33 INTEGER H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ @@ -667,6 +666,8 @@ INTEGER :: H5T_STR_NULLPAD_F INTEGER :: H5T_STR_SPACEPAD_F INTEGER :: H5T_STR_ERROR_F + INTEGER :: H5T_DIR_ASCEND_F + INTEGER :: H5T_DIR_DESCEND_F EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) @@ -699,6 +700,8 @@ EQUIVALENCE(H5T_flags(29), H5T_STR_ERROR_F) EQUIVALENCE(H5T_flags(30), H5T_VLEN_F) EQUIVALENCE(H5T_flags(31), H5T_ARRAY_F) + EQUIVALENCE(H5T_flags(32), H5T_DIR_ASCEND_F) + EQUIVALENCE(H5T_flags(33), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index b06be58..9275331 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -666,6 +666,7 @@ H5_FCDLL int_f nh5arename_c( hid_t_f *loc_id, # define nh5tencode_c H5_FC_FUNC_(h5tencode_c, H5TENCODE_C) # define nh5tget_create_plist_c H5_FC_FUNC_(h5tget_create_plist_c, H5TGET_CREATE_PLIST_C) # define nh5tcompiler_conv_c H5_FC_FUNC_(h5tcompiler_conv_c, H5TCOMPILER_CONV_C) +# define nh5tget_native_type_c H5_FC_FUNC_(h5tget_native_type_c, H5TGET_NATIVE_TYPE_C) H5_FCDLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id); H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id ); @@ -728,7 +729,7 @@ H5_FCDLL int_f nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ); H5_FCDLL int_f nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); H5_FCDLL int_f nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id); H5_FCDLL int_f nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag); - +H5_FCDLL int_f nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id); /* * Functions from H5Of.c |