diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-07-04 20:39:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 20:39:32 (GMT) |
commit | 9f13ecfa2e93840d1cc45dbf0bfcf8b955814931 (patch) | |
tree | 63c6760e4d794ee72b276721917e1d721b906df6 /fortran/src/H5Tf.c | |
parent | 4aa40365623cf35643b262781f92578220c42bbb (diff) | |
download | hdf5-9f13ecfa2e93840d1cc45dbf0bfcf8b955814931.zip hdf5-9f13ecfa2e93840d1cc45dbf0bfcf8b955814931.tar.gz hdf5-9f13ecfa2e93840d1cc45dbf0bfcf8b955814931.tar.bz2 |
Add .clang-format and bin/format_source from hdf5_1_12_1. (#822)
Reformat source with clang 10.0.1.
Diffstat (limited to 'fortran/src/H5Tf.c')
-rw-r--r-- | fortran/src/H5Tf.c | 1610 |
1 files changed, 828 insertions, 782 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index c40abae..1b9cbd1 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -17,7 +17,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** -*/ + */ #include "H5f90.h" @@ -41,32 +41,32 @@ * HISTORY * * SOURCE -*/ + */ int_f -h5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) +h5topen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) /******/ { char *c_name = NULL; hid_t c_type_id; - int ret_value = -1; + int ret_value = -1; /* * Convert FORTRAN name to C name */ - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) goto done; /* * Call H5Topen2 function. */ - if((c_type_id = H5Topen2((hid_t)*loc_id, c_name, (hid_t)*tapl_id)) < 0) + if ((c_type_id = H5Topen2((hid_t)*loc_id, c_name, (hid_t)*tapl_id)) < 0) goto done; *type_id = (hid_t_f)c_type_id; ret_value = 0; done: - if(c_name) + if (c_name) HDfree(c_name); return ret_value; @@ -95,27 +95,28 @@ done: * - Added passing optional parameters for version 1.8 * M. Scot Breitenfeld * SOURCE -*/ + */ int_f -h5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, - hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) +h5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, + hid_t_f *tapl_id) /******/ { - char *c_name = NULL; - int ret_value = -1; + char *c_name = NULL; + int ret_value = -1; /* Convert FORTRAN name to C name */ - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) goto done; /* Call H5Tcommit2 function */ - if(H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*lcpl_id, (hid_t)*tcpl_id, (hid_t)*tapl_id) < 0) + if (H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*lcpl_id, (hid_t)*tcpl_id, + (hid_t)*tapl_id) < 0) goto done; ret_value = 0; done: - if(c_name) + if (c_name) HDfree(c_name); return ret_value; } @@ -135,18 +136,19 @@ done: * HISTORY * * SOURCE -*/ + */ int_f -h5tclose_c ( hid_t_f *type_id ) +h5tclose_c(hid_t_f *type_id) /******/ { - int ret_value = 0; - hid_t c_type_id; + int ret_value = 0; + hid_t c_type_id; - c_type_id = *type_id; - if ( H5Tclose(c_type_id) < 0 ) ret_value = -1; - return ret_value; + c_type_id = *type_id; + if (H5Tclose(c_type_id) < 0) + ret_value = -1; + return ret_value; } /****if* H5Tf/h5tcopy_c @@ -166,21 +168,22 @@ h5tclose_c ( hid_t_f *type_id ) * HISTORY * * SOURCE -*/ + */ int_f -h5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) +h5tcopy_c(hid_t_f *type_id, hid_t_f *new_type_id) /******/ { - int ret_value = 0; - hid_t c_type_id; - hid_t c_new_type_id; - - c_type_id = *type_id; - c_new_type_id = H5Tcopy(c_type_id); - if ( c_new_type_id < 0 ) ret_value = -1; - *new_type_id = (hid_t_f)c_new_type_id; - return ret_value; + int ret_value = 0; + hid_t c_type_id; + hid_t c_new_type_id; + + c_type_id = *type_id; + c_new_type_id = H5Tcopy(c_type_id); + if (c_new_type_id < 0) + ret_value = -1; + *new_type_id = (hid_t_f)c_new_type_id; + return ret_value; } /****if* H5Tf/h5tequal_c @@ -201,23 +204,24 @@ h5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) +h5tequal_c(hid_t_f *type1_id, hid_t_f *type2_id, int_f *c_flag) /******/ { - int ret_value = -1; - hid_t c_type1_id, c_type2_id; - htri_t status; - - c_type1_id = *type1_id; - c_type2_id = *type2_id; - status = H5Tequal(c_type1_id, c_type2_id); - if ( status < 0 ) return ret_value; - *c_flag = (int_f)status; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type1_id, c_type2_id; + htri_t status; + + c_type1_id = *type1_id; + c_type2_id = *type2_id; + status = H5Tequal(c_type1_id, c_type2_id); + if (status < 0) + return ret_value; + *c_flag = (int_f)status; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_class_c @@ -249,37 +253,37 @@ h5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_class_c ( hid_t_f *type_id , int_f *classtype) +h5tget_class_c(hid_t_f *type_id, int_f *classtype) /******/ { - int ret_value = 0; - hid_t c_type_id; - H5T_class_t c_classtype; - - c_type_id = *type_id; - c_classtype = H5Tget_class(c_type_id); - if (c_classtype == H5T_NO_CLASS ) { - /* *classtype = H5T_NO_CLASS_F; */ - *classtype = (int_f)H5T_NO_CLASS; - ret_value = -1; - return ret_value; - } - *classtype = c_classtype; -/* - if (c_classtype == H5T_INTEGER) *classtype = H5T_INTEGER_F; - if (c_classtype == H5T_FLOAT) *classtype = H5T_FLOAT_F; - if (c_classtype == H5T_TIME) *classtype = H5T_TIME_F; - if (c_classtype == H5T_STRING) *classtype = H5T_STRING_F; - if (c_classtype == H5T_BITFIELD) *classtype = H5T_BITFIELD_F; - if (c_classtype == H5T_OPAQUE) *classtype = H5T_OPAQUE_F; - if (c_classtype == H5T_COMPOUND) *classtype = H5T_COMPOUND_F; - if (c_classtype == H5T_REFERENCE) *classtype = H5T_REFERENCE_F; - if (c_classtype == H5T_ENUM) *classtype = H5T_ENUM_F; -*/ - return ret_value; + int ret_value = 0; + hid_t c_type_id; + H5T_class_t c_classtype; + + c_type_id = *type_id; + c_classtype = H5Tget_class(c_type_id); + if (c_classtype == H5T_NO_CLASS) { + /* *classtype = H5T_NO_CLASS_F; */ + *classtype = (int_f)H5T_NO_CLASS; + ret_value = -1; + return ret_value; + } + *classtype = c_classtype; + /* + if (c_classtype == H5T_INTEGER) *classtype = H5T_INTEGER_F; + if (c_classtype == H5T_FLOAT) *classtype = H5T_FLOAT_F; + if (c_classtype == H5T_TIME) *classtype = H5T_TIME_F; + if (c_classtype == H5T_STRING) *classtype = H5T_STRING_F; + if (c_classtype == H5T_BITFIELD) *classtype = H5T_BITFIELD_F; + if (c_classtype == H5T_OPAQUE) *classtype = H5T_OPAQUE_F; + if (c_classtype == H5T_COMPOUND) *classtype = H5T_COMPOUND_F; + if (c_classtype == H5T_REFERENCE) *classtype = H5T_REFERENCE_F; + if (c_classtype == H5T_ENUM) *classtype = H5T_ENUM_F; + */ + return ret_value; } /****if* H5Tf/h5tget_order_c @@ -302,29 +306,29 @@ h5tget_class_c ( hid_t_f *type_id , int_f *classtype) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_order_c ( hid_t_f *type_id , int_f *order) +h5tget_order_c(hid_t_f *type_id, int_f *order) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_order_t c_order; - - c_type_id = *type_id; - c_order = H5Tget_order(c_type_id); - if ( c_order < 0 ) return ret_value; - *order = (int_f)c_order; - ret_value = 0; -/* - if ( c_order == H5T_ORDER_LE) *order = H5T_ORDER_LE_F; - if ( c_order == H5T_ORDER_BE) *order = H5T_ORDER_BE_F; - if ( c_order == H5T_ORDER_VAX) *order = H5T_ORDER_VAX_F; -*/ - return ret_value; -} + int ret_value = -1; + hid_t c_type_id; + H5T_order_t c_order; + c_type_id = *type_id; + c_order = H5Tget_order(c_type_id); + if (c_order < 0) + return ret_value; + *order = (int_f)c_order; + ret_value = 0; + /* + if ( c_order == H5T_ORDER_LE) *order = H5T_ORDER_LE_F; + if ( c_order == H5T_ORDER_BE) *order = H5T_ORDER_BE_F; + if ( c_order == H5T_ORDER_VAX) *order = H5T_ORDER_VAX_F; + */ + return ret_value; +} /****if* H5Tf/h5tset_order_c * NAME @@ -345,26 +349,27 @@ h5tget_order_c ( hid_t_f *type_id , int_f *order) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_order_c ( hid_t_f *type_id , int_f *order) +h5tset_order_c(hid_t_f *type_id, int_f *order) /******/ { - int ret_value = 0; - hid_t c_type_id; - H5T_order_t c_order; - herr_t status; - c_order = (H5T_order_t)*order; -/* - if ( *order == H5T_ORDER_LE_F) c_order = H5T_ORDER_LE; - if ( *order == H5T_ORDER_BE_F) c_order = H5T_ORDER_BE; - if ( *order == H5T_ORDER_VAX_F) c_order = H5T_ORDER_VAX; -*/ - c_type_id = *type_id; - status = H5Tset_order(c_type_id, c_order); - if ( status < 0 ) ret_value = -1; - return ret_value; + int ret_value = 0; + hid_t c_type_id; + H5T_order_t c_order; + herr_t status; + c_order = (H5T_order_t)*order; + /* + if ( *order == H5T_ORDER_LE_F) c_order = H5T_ORDER_LE; + if ( *order == H5T_ORDER_BE_F) c_order = H5T_ORDER_BE; + if ( *order == H5T_ORDER_VAX_F) c_order = H5T_ORDER_VAX; + */ + c_type_id = *type_id; + status = H5Tset_order(c_type_id, c_order); + if (status < 0) + ret_value = -1; + return ret_value; } /****if* H5Tf/h5tget_size_c @@ -384,22 +389,23 @@ h5tset_order_c ( hid_t_f *type_id , int_f *order) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_size_c ( hid_t_f *type_id , size_t_f *size) +h5tget_size_c(hid_t_f *type_id, size_t_f *size) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_size; - - c_type_id = *type_id; - c_size = H5Tget_size(c_type_id); - if ( c_size == 0 ) return ret_value; - *size = (size_t_f)c_size ; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_size; + + c_type_id = *type_id; + c_size = H5Tget_size(c_type_id); + if (c_size == 0) + return ret_value; + *size = (size_t_f)c_size; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_size_c @@ -419,23 +425,24 @@ h5tget_size_c ( hid_t_f *type_id , size_t_f *size) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_size_c ( hid_t_f *type_id , size_t_f *size) +h5tset_size_c(hid_t_f *type_id, size_t_f *size) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_size; - herr_t status; - - c_size = (size_t)*size; - c_type_id = *type_id; - status = H5Tset_size(c_type_id, c_size); - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_size; + herr_t status; + + c_size = (size_t)*size; + c_type_id = *type_id; + status = H5Tset_size(c_type_id, c_size); + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_precision_c @@ -455,22 +462,23 @@ h5tset_size_c ( hid_t_f *type_id , size_t_f *size) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) +h5tget_precision_c(hid_t_f *type_id, size_t_f *precision) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_precision; - - c_type_id = *type_id; - c_precision = H5Tget_precision(c_type_id); - if ( c_precision == 0 ) return ret_value; - *precision = (size_t_f)c_precision ; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_precision; + + c_type_id = *type_id; + c_precision = H5Tget_precision(c_type_id); + if (c_precision == 0) + return ret_value; + *precision = (size_t_f)c_precision; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_precision_c @@ -489,23 +497,24 @@ h5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) +h5tset_precision_c(hid_t_f *type_id, size_t_f *precision) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_precision; - herr_t status; - - c_type_id = *type_id; - c_precision = (size_t)*precision; - status = H5Tset_precision(c_type_id, c_precision); - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_precision; + herr_t status; + + c_type_id = *type_id; + c_precision = (size_t)*precision; + status = H5Tset_precision(c_type_id, c_precision); + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_offset_c @@ -526,23 +535,24 @@ h5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) +h5tget_offset_c(hid_t_f *type_id, size_t_f *offset) /******/ { - int ret_value = -1; - hid_t c_type_id; - int c_offset; + int ret_value = -1; + hid_t c_type_id; + int c_offset; - c_type_id = *type_id; - c_offset = H5Tget_offset(c_type_id); - if ( c_offset < 0 ) return ret_value; + c_type_id = *type_id; + c_offset = H5Tget_offset(c_type_id); + if (c_offset < 0) + return ret_value; - *offset = (size_t_f)c_offset ; - ret_value = 0; - return ret_value; + *offset = (size_t_f)c_offset; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_offset_c @@ -562,23 +572,24 @@ h5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) +h5tset_offset_c(hid_t_f *type_id, size_t_f *offset) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_offset; - herr_t status; - - c_offset = (size_t)*offset; - c_type_id = *type_id; - status = H5Tset_offset(c_type_id, c_offset); - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_offset; + herr_t status; + + c_offset = (size_t)*offset; + c_type_id = *type_id; + status = H5Tset_offset(c_type_id, c_offset); + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_pad_c @@ -601,25 +612,26 @@ h5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) +h5tget_pad_c(hid_t_f *type_id, int_f *lsbpad, int_f *msbpad) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - H5T_pad_t c_lsb, c_msb; - - c_type_id = *type_id; - status = H5Tget_pad(c_type_id, &c_lsb, &c_msb); - if ( status < 0 ) return ret_value; - - *lsbpad = (int_f) c_lsb; - *msbpad = (int_f) c_msb; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + H5T_pad_t c_lsb, c_msb; + + c_type_id = *type_id; + status = H5Tget_pad(c_type_id, &c_lsb, &c_msb); + if (status < 0) + return ret_value; + + *lsbpad = (int_f)c_lsb; + *msbpad = (int_f)c_msb; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_pad_c @@ -643,24 +655,25 @@ h5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) +h5tset_pad_c(hid_t_f *type_id, int_f *lsbpad, int_f *msbpad) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - H5T_pad_t c_lsb, c_msb; - - c_type_id = *type_id; - c_lsb = (H5T_pad_t)*lsbpad; - c_msb = (H5T_pad_t)*msbpad; - status = H5Tset_pad(c_type_id, c_lsb, c_msb); - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + H5T_pad_t c_lsb, c_msb; + + c_type_id = *type_id; + c_lsb = (H5T_pad_t)*lsbpad; + c_msb = (H5T_pad_t)*msbpad; + status = H5Tset_pad(c_type_id, c_lsb, c_msb); + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_sign_c @@ -680,22 +693,23 @@ h5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_sign_c ( hid_t_f *type_id , int_f *sign) +h5tget_sign_c(hid_t_f *type_id, int_f *sign) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_sign_t c_sign; - - c_type_id = *type_id; - c_sign = H5Tget_sign(c_type_id); - if ( c_sign == -1 ) return ret_value; - *sign = (int_f)c_sign ; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + H5T_sign_t c_sign; + + c_type_id = *type_id; + c_sign = H5Tget_sign(c_type_id); + if (c_sign == -1) + return ret_value; + *sign = (int_f)c_sign; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_sign_c @@ -714,24 +728,25 @@ h5tget_sign_c ( hid_t_f *type_id , int_f *sign) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_sign_c ( hid_t_f *type_id , int_f* sign) +h5tset_sign_c(hid_t_f *type_id, int_f *sign) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_sign_t c_sign; - herr_t status; - - c_type_id = *type_id; - c_sign = (H5T_sign_t)*sign; - status = H5Tset_sign(c_type_id, c_sign); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + H5T_sign_t c_sign; + herr_t status; + + c_type_id = *type_id; + c_sign = (H5T_sign_t)*sign; + status = H5Tset_sign(c_type_id, c_sign); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_fields_c @@ -755,27 +770,29 @@ h5tset_sign_c ( hid_t_f *type_id , int_f* sign) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +h5tget_fields_c(hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f *esize, size_t_f *mpos, + size_t_f *msize) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; - - c_type_id = *type_id; - status = H5Tget_fields(c_type_id, &c_spos, &c_epos, &c_esize, &c_mpos, &c_msize); - if ( status < 0 ) return ret_value; - *spos = (size_t_f) c_spos; - *epos = (size_t_f) c_epos; - *esize = (size_t_f) c_esize; - *mpos = (size_t_f) c_mpos; - *msize = (size_t_f) c_msize; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + + c_type_id = *type_id; + status = H5Tget_fields(c_type_id, &c_spos, &c_epos, &c_esize, &c_mpos, &c_msize); + if (status < 0) + return ret_value; + *spos = (size_t_f)c_spos; + *epos = (size_t_f)c_epos; + *esize = (size_t_f)c_esize; + *mpos = (size_t_f)c_mpos; + *msize = (size_t_f)c_msize; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_fields_c @@ -798,28 +815,30 @@ h5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* e * HISTORY * * SOURCE -*/ + */ int_f -h5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +h5tset_fields_c(hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f *esize, size_t_f *mpos, + size_t_f *msize) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; - - c_spos = (size_t)*spos; - c_epos = (size_t)*epos; - c_esize = (size_t)*esize; - c_mpos = (size_t)*mpos; - c_msize = (size_t)*msize; - c_type_id = *type_id; - status = H5Tset_fields(c_type_id, c_spos, c_epos, c_esize, c_mpos, c_msize); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + + c_spos = (size_t)*spos; + c_epos = (size_t)*epos; + c_esize = (size_t)*esize; + c_mpos = (size_t)*mpos; + c_msize = (size_t)*msize; + c_type_id = *type_id; + status = H5Tset_fields(c_type_id, c_spos, c_epos, c_esize, c_mpos, c_msize); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_ebias_c @@ -840,23 +859,24 @@ h5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* es * HISTORY * * SOURCE -*/ + */ int_f -h5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +h5tget_ebias_c(hid_t_f *type_id, size_t_f *ebias) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_ebias; + int ret_value = -1; + hid_t c_type_id; + size_t c_ebias; - c_type_id = *type_id; - c_ebias = H5Tget_ebias(c_type_id); - if ( c_ebias == 0 ) return ret_value; + c_type_id = *type_id; + c_ebias = H5Tget_ebias(c_type_id); + if (c_ebias == 0) + return ret_value; - *ebias = (size_t_f)c_ebias; - ret_value = 0; - return ret_value; + *ebias = (size_t_f)c_ebias; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_ebias_c @@ -876,24 +896,25 @@ h5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +h5tset_ebias_c(hid_t_f *type_id, size_t_f *ebias) /******/ { - int ret_value = -1; - hid_t c_type_id; - size_t c_ebias; - herr_t status; - - c_type_id = *type_id; - c_ebias = (size_t)*ebias; - status = H5Tset_ebias(c_type_id, c_ebias); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + size_t c_ebias; + herr_t status; + + c_type_id = *type_id; + c_ebias = (size_t)*ebias; + status = H5Tset_ebias(c_type_id, c_ebias); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_norm_c @@ -914,23 +935,24 @@ h5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_norm_c ( hid_t_f *type_id , int_f *norm) +h5tget_norm_c(hid_t_f *type_id, int_f *norm) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_norm_t c_norm; + int ret_value = -1; + hid_t c_type_id; + H5T_norm_t c_norm; - c_type_id = *type_id; - c_norm = H5Tget_norm(c_type_id); - if ( c_norm == H5T_NORM_ERROR ) return ret_value; + c_type_id = *type_id; + c_norm = H5Tget_norm(c_type_id); + if (c_norm == H5T_NORM_ERROR) + return ret_value; - *norm = (int_f)c_norm; - ret_value = 0; - return ret_value; + *norm = (int_f)c_norm; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_norm_c @@ -950,24 +972,25 @@ h5tget_norm_c ( hid_t_f *type_id , int_f *norm) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_norm_c ( hid_t_f *type_id , int_f *norm) +h5tset_norm_c(hid_t_f *type_id, int_f *norm) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_norm_t c_norm; - herr_t status; - - c_type_id = *type_id; - c_norm = (H5T_norm_t)*norm; - status = H5Tset_norm(c_type_id, c_norm); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + H5T_norm_t c_norm; + herr_t status; + + c_type_id = *type_id; + c_norm = (H5T_norm_t)*norm; + status = H5Tset_norm(c_type_id, c_norm); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_inpad_c @@ -990,23 +1013,24 @@ h5tset_norm_c ( hid_t_f *type_id , int_f *norm) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) +h5tget_inpad_c(hid_t_f *type_id, int_f *padtype) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_pad_t c_padtype; + int ret_value = -1; + hid_t c_type_id; + H5T_pad_t c_padtype; - c_type_id = *type_id; - c_padtype = H5Tget_inpad(c_type_id); - if ( c_padtype == H5T_PAD_ERROR ) return ret_value; + c_type_id = *type_id; + c_padtype = H5Tget_inpad(c_type_id); + if (c_padtype == H5T_PAD_ERROR) + return ret_value; - *padtype = (int_f) c_padtype; - ret_value = 0; - return ret_value; + *padtype = (int_f)c_padtype; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_inpad_c @@ -1030,24 +1054,25 @@ h5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) +h5tset_inpad_c(hid_t_f *type_id, int_f *padtype) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - H5T_pad_t c_padtype; - - c_type_id = *type_id; - c_padtype = (H5T_pad_t)*padtype; - status = H5Tset_inpad(c_type_id, c_padtype); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + H5T_pad_t c_padtype; + + c_type_id = *type_id; + c_padtype = (H5T_pad_t)*padtype; + status = H5Tset_inpad(c_type_id, c_padtype); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_cset_c @@ -1069,23 +1094,24 @@ h5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_cset_c ( hid_t_f *type_id , int_f * cset) +h5tget_cset_c(hid_t_f *type_id, int_f *cset) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_cset_t c_cset; + int ret_value = -1; + hid_t c_type_id; + H5T_cset_t c_cset; - c_type_id = *type_id; - c_cset = H5Tget_cset(c_type_id); - if ( c_cset == H5T_CSET_ERROR ) return ret_value; + c_type_id = *type_id; + c_cset = H5Tget_cset(c_type_id); + if (c_cset == H5T_CSET_ERROR) + return ret_value; - *cset = (int_f) c_cset; - ret_value = 0; - return ret_value; + *cset = (int_f)c_cset; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_cset_c @@ -1108,24 +1134,25 @@ h5tget_cset_c ( hid_t_f *type_id , int_f * cset) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_cset_c ( hid_t_f *type_id, int_f * cset) +h5tset_cset_c(hid_t_f *type_id, int_f *cset) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - H5T_cset_t c_cset; - - c_type_id = *type_id; - c_cset = (H5T_cset_t)*cset; - status = H5Tset_cset(c_type_id, c_cset); - - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + H5T_cset_t c_cset; + + c_type_id = *type_id; + c_cset = (H5T_cset_t)*cset; + status = H5Tset_cset(c_type_id, c_cset); + + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_strpad_c @@ -1146,22 +1173,23 @@ h5tset_cset_c ( hid_t_f *type_id, int_f * cset) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) +h5tget_strpad_c(hid_t_f *type_id, int_f *strpad) /******/ { - int ret_value = -1; - hid_t c_type_id; - H5T_str_t c_strpad; + int ret_value = -1; + hid_t c_type_id; + H5T_str_t c_strpad; - c_type_id = *type_id; - c_strpad = H5Tget_strpad(c_type_id); - if ( c_strpad == H5T_STR_ERROR ) return ret_value; + c_type_id = *type_id; + c_strpad = H5Tget_strpad(c_type_id); + if (c_strpad == H5T_STR_ERROR) + return ret_value; - *strpad = (int_f) c_strpad; - ret_value = 0; - return ret_value; + *strpad = (int_f)c_strpad; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_strpad_c @@ -1184,24 +1212,25 @@ h5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) +h5tset_strpad_c(hid_t_f *type_id, int_f *strpad) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; - H5T_str_t c_strpad; - - c_type_id = *type_id; - c_strpad = (H5T_str_t)*strpad; - status = H5Tset_strpad(c_type_id, c_strpad); - if ( status < 0 ) return ret_value; - - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + herr_t status; + H5T_str_t c_strpad; + + c_type_id = *type_id; + c_strpad = (H5T_str_t)*strpad; + status = H5Tset_strpad(c_type_id, c_strpad); + if (status < 0) + return ret_value; + + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_nmembers_c @@ -1222,21 +1251,22 @@ h5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) +h5tget_nmembers_c(hid_t_f *type_id, int_f *num_members) /******/ { - int ret_value = -1; - hid_t c_type_id; + int ret_value = -1; + hid_t c_type_id; - c_type_id = *type_id; - *num_members = (int_f)H5Tget_nmembers(c_type_id); - if (*num_members < 0 ) return ret_value; + c_type_id = *type_id; + *num_members = (int_f)H5Tget_nmembers(c_type_id); + if (*num_members < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_member_name_c @@ -1258,27 +1288,28 @@ h5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) * Elena Pourmal * Added namelen parameter to return length of the name to Fortran user * SOURCE -*/ + */ int_f -h5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) +h5tget_member_name_c(hid_t_f *type_id, int_f *idx, _fcd member_name, int_f *namelen) /******/ { - int ret_value = -1; - hid_t c_type_id; - unsigned c_index; - char *c_name; - - c_type_id = *type_id; - c_index = (unsigned)*idx; - c_name = H5Tget_member_name(c_type_id, c_index); - if (c_name == NULL ) return ret_value; - - HD5packFstring(c_name, _fcdtocp(member_name), strlen(c_name)); - *namelen = (int_f)strlen(c_name); - H5free_memory(c_name); - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + unsigned c_index; + char * c_name; + + c_type_id = *type_id; + c_index = (unsigned)*idx; + c_name = H5Tget_member_name(c_type_id, c_index); + if (c_name == NULL) + return ret_value; + + HD5packFstring(c_name, _fcdtocp(member_name), strlen(c_name)); + *namelen = (int_f)strlen(c_name); + H5free_memory(c_name); + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_member_index_c * NAME @@ -1300,37 +1331,38 @@ h5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *na * HISTORY * * SOURCE -*/ + */ int_f -h5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) +h5tget_member_index_c(hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) /******/ { - int ret_value = -1; - char *c_name; - hid_t c_type_id; - int c_index; - - /* - * Convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) return ret_value; - - /* - * Call H5Tget_member_index function. - */ - c_type_id = (hid_t)*type_id; - c_index = H5Tget_member_index(c_type_id, c_name); - - if (c_index < 0) goto DONE; - *idx = (int_f)c_index; + int ret_value = -1; + char *c_name; + hid_t c_type_id; + int c_index; + + /* + * Convert FORTRAN name to C name + */ + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); + if (c_name == NULL) + return ret_value; + + /* + * Call H5Tget_member_index function. + */ + c_type_id = (hid_t)*type_id; + c_index = H5Tget_member_index(c_type_id, c_name); + + if (c_index < 0) + goto DONE; + *idx = (int_f)c_index; DONE: - HDfree(c_name); - ret_value = 0; - return ret_value; + HDfree(c_name); + ret_value = 0; + return ret_value; } - /****if* H5Tf/h5tget_member_offset_c * NAME * h5tget_member_offset_c @@ -1352,19 +1384,19 @@ DONE: * HISTORY * * SOURCE -*/ + */ int_f -h5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) +h5tget_member_offset_c(hid_t_f *type_id, int_f *member_no, size_t_f *offset) /******/ { - int ret_value = -1; - size_t c_offset; + int ret_value = -1; + size_t c_offset; - c_offset = H5Tget_member_offset((hid_t)*type_id, (unsigned)*member_no); - *offset = (size_t_f)c_offset; - ret_value = 0; - return ret_value; + c_offset = H5Tget_member_offset((hid_t)*type_id, (unsigned)*member_no); + *offset = (size_t_f)c_offset; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_array_dims_c @@ -1385,23 +1417,23 @@ h5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) +h5tget_array_dims_c(hid_t_f *type_id, hsize_t_f *dims) /******/ { hsize_t c_dims[H5S_MAX_RANK]; - int rank, i; - int ret_value = -1; + int rank, i; + int ret_value = -1; - if((rank = H5Tget_array_ndims((hid_t)*type_id)) < 0) + if ((rank = H5Tget_array_ndims((hid_t)*type_id)) < 0) goto DONE; - if(H5Tget_array_dims2((hid_t)*type_id, c_dims) < 0) + if (H5Tget_array_dims2((hid_t)*type_id, c_dims) < 0) goto DONE; - for(i = 0; i < rank; i++) + for (i = 0; i < rank; i++) dims[(rank - i) - 1] = (hsize_t_f)c_dims[i]; ret_value = 0; @@ -1428,23 +1460,24 @@ DONE: * HISTORY * * SOURCE -*/ + */ int_f -h5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) +h5tget_array_ndims_c(hid_t_f *type_id, int_f *ndims) /******/ { - int ret_value = -1; - hid_t c_type_id; - int c_ndims; + int ret_value = -1; + hid_t c_type_id; + int c_ndims; - c_type_id = (hid_t)*type_id; - c_ndims = H5Tget_array_ndims(c_type_id); - if (c_ndims < 0) return ret_value; + c_type_id = (hid_t)*type_id; + c_ndims = H5Tget_array_ndims(c_type_id); + if (c_ndims < 0) + return ret_value; - *ndims = (int_f)c_ndims; - ret_value = 0; - return ret_value; + *ndims = (int_f)c_ndims; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_super_c @@ -1465,26 +1498,26 @@ h5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) +h5tget_super_c(hid_t_f *type_id, hid_t_f *base_type_id) /******/ { - int ret_value = -1; - hid_t c_type_id; - hid_t c_base_type_id; + int ret_value = -1; + hid_t c_type_id; + hid_t c_base_type_id; - c_type_id = (hid_t)*type_id; - c_base_type_id = H5Tget_super(c_type_id); - if (c_base_type_id < 0) return ret_value; + c_type_id = (hid_t)*type_id; + c_base_type_id = H5Tget_super(c_type_id); + if (c_base_type_id < 0) + return ret_value; - *base_type_id = (hid_t_f)c_base_type_id; - ret_value = 0; - return ret_value; + *base_type_id = (hid_t_f)c_base_type_id; + ret_value = 0; + return ret_value; } - /****if* H5Tf/h5tget_member_type_c * NAME * h5tget_member_type_c @@ -1504,22 +1537,22 @@ h5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) +h5tget_member_type_c(hid_t_f *type_id, int_f *field_idx, hid_t_f *datatype) /******/ { - int ret_value = -1; + int ret_value = -1; - *datatype = (hid_t_f)H5Tget_member_type((hid_t)*type_id, (unsigned)*field_idx); - if(*datatype < 0) return ret_value; + *datatype = (hid_t_f)H5Tget_member_type((hid_t)*type_id, (unsigned)*field_idx); + if (*datatype < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } - /****if* H5Tf/h5tcreate_c * NAME * h5tcreate_c @@ -1536,24 +1569,25 @@ h5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) * HISTORY * * SOURCE -*/ + */ int_f h5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) /******/ { - int ret_value = -1; - H5T_class_t c_class; - size_t c_size; + int ret_value = -1; + H5T_class_t c_class; + size_t c_size; - c_size =(size_t) *size; - c_class = (H5T_class_t) *cls; + c_size = (size_t)*size; + c_class = (H5T_class_t)*cls; - *type_id = (hid_t_f)H5Tcreate(c_class, c_size); - if(*type_id < 0) return ret_value; + *type_id = (hid_t_f)H5Tcreate(c_class, c_size); + if (*type_id < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tinsert_c @@ -1575,28 +1609,29 @@ h5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) +h5tinsert_c(hid_t_f *type_id, _fcd name, int_f *namelen, size_t_f *offset, hid_t_f *field_id) /******/ { - int ret_value = -1; - char* c_name; - herr_t error; + int ret_value = -1; + char * c_name; + herr_t error; - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) return ret_value; + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); + if (c_name == NULL) + return ret_value; - error = H5Tinsert((hid_t)*type_id, c_name, (size_t)*offset, (hid_t)*field_id); + error = H5Tinsert((hid_t)*type_id, c_name, (size_t)*offset, (hid_t)*field_id); - HDfree(c_name); - if(error < 0) return ret_value; - ret_value = 0; - return ret_value; + HDfree(c_name); + if (error < 0) + return ret_value; + ret_value = 0; + return ret_value; } - /****if* H5Tf/h5tpack_c * NAME * h5tpack_c @@ -1614,22 +1649,23 @@ h5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t * HISTORY * * SOURCE -*/ + */ int_f -h5tpack_c(hid_t_f * type_id) +h5tpack_c(hid_t_f *type_id) /******/ { - int ret_value = -1; - hid_t c_type_id; - herr_t status; + int ret_value = -1; + hid_t c_type_id; + herr_t status; - c_type_id = *type_id; - status = H5Tpack(c_type_id); - if (status < 0) return ret_value; + c_type_id = *type_id; + status = H5Tpack(c_type_id); + if (status < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tarray_create_c @@ -1650,34 +1686,32 @@ h5tpack_c(hid_t_f * type_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) +h5tarray_create_c(hid_t_f *base_id, int_f *rank, hsize_t_f *dims, hid_t_f *type_id) /******/ { - hsize_t c_dims[H5S_MAX_RANK]; - hid_t c_type_id; - unsigned u; /* Local index variable */ - int ret_value = -1; - + hsize_t c_dims[H5S_MAX_RANK]; + hid_t c_type_id; + unsigned u; /* Local index variable */ + int ret_value = -1; /* * Transpose dimension arrays because of C-FORTRAN storage order */ - for(u = 0; u < (unsigned)*rank ; u++) - c_dims[u] = (hsize_t)dims[((unsigned)*rank - u) - 1]; + for (u = 0; u < (unsigned)*rank; u++) + c_dims[u] = (hsize_t)dims[((unsigned)*rank - u) - 1]; - if((c_type_id = H5Tarray_create2((hid_t)*base_id, (unsigned)*rank, c_dims)) < 0) + if ((c_type_id = H5Tarray_create2((hid_t)*base_id, (unsigned)*rank, c_dims)) < 0) goto DONE; - *type_id = (hid_t_f)c_type_id; + *type_id = (hid_t_f)c_type_id; ret_value = 0; DONE: return ret_value; } - /****if* H5Tf/h5tenum_create_c * NAME * h5tenum_create_c @@ -1696,20 +1730,21 @@ DONE: * HISTORY * * SOURCE -*/ + */ int_f -h5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) +h5tenum_create_c(hid_t_f *parent_id, hid_t_f *new_type_id) /******/ { - int ret_value = 0; - hid_t c_new_type_id; + int ret_value = 0; + hid_t c_new_type_id; - c_new_type_id = H5Tenum_create((hid_t)*parent_id); - if ( c_new_type_id < 0 ) ret_value = -1; + c_new_type_id = H5Tenum_create((hid_t)*parent_id); + if (c_new_type_id < 0) + ret_value = -1; - *new_type_id = (hid_t_f)c_new_type_id; - return ret_value; + *new_type_id = (hid_t_f)c_new_type_id; + return ret_value; } /****if* H5Tf/h5tenum_insert_c @@ -1732,31 +1767,32 @@ h5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) * it should not be cast to an int (which might be 4 bytes). Instead the value * is written as the size of an int_f. * SOURCE -*/ + */ int_f -h5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +h5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f *namelen, int_f *value) /******/ { - int ret_value = -1; - char* c_name; - herr_t error; - int_f c_value; + int ret_value = -1; + char * c_name; + herr_t error; + int_f c_value; - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) return ret_value; + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); + if (c_name == NULL) + return ret_value; - c_value = *value; - error = H5Tenum_insert((hid_t)*type_id, c_name, &c_value); + c_value = *value; + error = H5Tenum_insert((hid_t)*type_id, c_name, &c_value); - HDfree(c_name); - if(error < 0) return ret_value; + HDfree(c_name); + if (error < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } - /****if* H5Tf/h5tenum_nameof_c * NAME * h5tenum_nameof_c @@ -1776,29 +1812,30 @@ h5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * HISTORY * * SOURCE -*/ + */ int_f -h5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) +h5tenum_nameof_c(hid_t_f *type_id, int_f *value, _fcd name, size_t_f *namelen) /******/ { - int ret_value = -1; - hid_t c_type_id; - char* c_name; - size_t c_namelen; - herr_t error; - int_f c_value; - c_value = *value; - c_namelen = ((size_t)*namelen) +1; - c_name = (char *)HDmalloc(sizeof(char)*c_namelen); - c_type_id = (hid_t)*type_id; - error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen); - HD5packFstring(c_name, _fcdtocp(name), strlen(c_name)); - HDfree(c_name); - - if(error < 0) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + char * c_name; + size_t c_namelen; + herr_t error; + int_f c_value; + c_value = *value; + c_namelen = ((size_t)*namelen) + 1; + c_name = (char *)HDmalloc(sizeof(char) * c_namelen); + c_type_id = (hid_t)*type_id; + error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen); + HD5packFstring(c_name, _fcdtocp(name), strlen(c_name)); + HDfree(c_name); + + if (error < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tenum_valueof_c @@ -1820,26 +1857,27 @@ h5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * HISTORY * * SOURCE -*/ + */ int_f -h5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +h5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f *namelen, int_f *value) /******/ { - int ret_value = -1; - char* c_name; - herr_t error; - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) return ret_value; - - error = H5Tenum_valueof((hid_t)*type_id, c_name, value); - HDfree(c_name); - - if(error < 0) return ret_value; - ret_value = 0; - return ret_value; -} + int ret_value = -1; + char * c_name; + herr_t error; + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); + if (c_name == NULL) + return ret_value; + + error = H5Tenum_valueof((hid_t)*type_id, c_name, value); + HDfree(c_name); + if (error < 0) + return ret_value; + ret_value = 0; + return ret_value; +} /****if* H5Tf/h5tget_member_value_c * NAME @@ -1859,22 +1897,23 @@ h5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) +h5tget_member_value_c(hid_t_f *type_id, int_f *member_no, int_f *value) /******/ { - int ret_value = -1; - int c_value; - herr_t error; + int ret_value = -1; + int c_value; + herr_t error; - error = H5Tget_member_value((hid_t)*type_id, (unsigned)*member_no, &c_value); - if(error < 0) return ret_value; + error = H5Tget_member_value((hid_t)*type_id, (unsigned)*member_no, &c_value); + if (error < 0) + return ret_value; - *value = (int_f)c_value; - ret_value = 0; - return ret_value; + *value = (int_f)c_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tset_tag_c @@ -1897,23 +1936,24 @@ h5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) * HISTORY * * SOURCE -*/ + */ int_f -h5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) +h5tset_tag_c(hid_t_f *type_id, _fcd tag, int_f *namelen) /******/ { - int ret_value = -1; - herr_t status; - char* c_tag; + int ret_value = -1; + herr_t status; + char * c_tag; - c_tag = (char *)HD5f2cstring(tag, (size_t)*namelen); + c_tag = (char *)HD5f2cstring(tag, (size_t)*namelen); - status = H5Tset_tag((hid_t)*type_id, c_tag); - HDfree(c_tag); - if ( status < 0 ) return ret_value; + status = H5Tset_tag((hid_t)*type_id, c_tag); + HDfree(c_tag); + if (status < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_tag_c @@ -1935,24 +1975,25 @@ h5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) +h5tget_tag_c(hid_t_f *type_id, _fcd tag, size_t_f *tag_size, int_f *taglen) /******/ { - int ret_value = -1; - hid_t c_type_id; - char *c_tag; - - c_type_id = *type_id; - c_tag = H5Tget_tag(c_type_id); - if (c_tag == NULL ) return ret_value; - - HD5packFstring(c_tag, _fcdtocp(tag), (size_t)*tag_size); - *taglen = (int_f)HDstrlen(c_tag); - H5free_memory(c_tag); - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + char *c_tag; + + c_type_id = *type_id; + c_tag = H5Tget_tag(c_type_id); + if (c_tag == NULL) + return ret_value; + + HD5packFstring(c_tag, _fcdtocp(tag), (size_t)*tag_size); + *taglen = (int_f)HDstrlen(c_tag); + H5free_memory(c_tag); + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tvlen_create_c * NAME @@ -1971,21 +2012,22 @@ h5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) * HISTORY * * SOURCE -*/ + */ int_f -h5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) +h5tvlen_create_c(hid_t_f *type_id, hid_t_f *vltype_id) /******/ { - int ret_value = -1; - hid_t c_type_id; - hid_t c_vltype_id; - - c_type_id = (hid_t)*type_id; - c_vltype_id = H5Tvlen_create(c_type_id); - if (c_vltype_id < 0 ) return ret_value; - *vltype_id = (hid_t_f)c_vltype_id; - ret_value = 0; - return ret_value; + int ret_value = -1; + hid_t c_type_id; + hid_t c_vltype_id; + + c_type_id = (hid_t)*type_id; + c_vltype_id = H5Tvlen_create(c_type_id); + if (c_vltype_id < 0) + return ret_value; + *vltype_id = (hid_t_f)c_vltype_id; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tis_variable_str_c * NAME @@ -2006,21 +2048,22 @@ h5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) +h5tis_variable_str_c(hid_t_f *type_id, int_f *flag) /******/ { - int ret_value = 0; - hid_t c_type_id; - htri_t status; - - c_type_id = (hid_t)*type_id; - status = H5Tis_variable_str(c_type_id); - *flag = (int_f)status; - if ( status < 0 ) ret_value = -1; - return ret_value; + int ret_value = 0; + hid_t c_type_id; + htri_t status; + + c_type_id = (hid_t)*type_id; + status = H5Tis_variable_str(c_type_id); + *flag = (int_f)status; + if (status < 0) + ret_value = -1; + return ret_value; } /****if* H5Tf/h5tget_member_class_c * NAME @@ -2042,24 +2085,25 @@ h5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * HISTORY * * SOURCE -*/ + */ int_f -h5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) +h5tget_member_class_c(hid_t_f *type_id, int_f *member_no, int_f *cls) /******/ { - 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; - *cls = (int_f)c_class; - return ret_value; + 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; + *cls = (int_f)c_class; + return ret_value; } /****if* H5Tf/h5tcommit_anon_c @@ -2080,22 +2124,21 @@ h5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) * HISTORY * * SOURCE -*/ + */ int_f -h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, - hid_t_f *tcpl_id, hid_t_f *tapl_id) +h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) /******/ { - int ret_value = -1; + int ret_value = -1; - /* Call H5Tcommit_anon function */ - if(H5Tcommit_anon((hid_t)*loc_id, (hid_t)*dtype_id, (hid_t)*tcpl_id, (hid_t)*tapl_id) < 0) - goto done; + /* Call H5Tcommit_anon function */ + if (H5Tcommit_anon((hid_t)*loc_id, (hid_t)*dtype_id, (hid_t)*tcpl_id, (hid_t)*tapl_id) < 0) + goto done; - ret_value = 0; + ret_value = 0; - done: - return ret_value; +done: + return ret_value; } /****if* H5Tf/h5tcommitted_c @@ -2114,19 +2157,18 @@ h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, * HISTORY * * SOURCE -*/ + */ int_f h5tcommitted_c(hid_t_f *dtype_id) /******/ { - int_f ret_value; + int_f ret_value; - /* Call H5Tcommitted function */ + /* Call H5Tcommitted function */ - ret_value=(int_f)H5Tcommitted((hid_t)*dtype_id); - - return ret_value; + ret_value = (int_f)H5Tcommitted((hid_t)*dtype_id); + return ret_value; } /****if* H5Tf/h5tdecode_c @@ -2149,30 +2191,30 @@ h5tcommitted_c(hid_t_f *dtype_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tdecode_c ( _fcd buf, hid_t_f *obj_id ) +h5tdecode_c(_fcd buf, hid_t_f *obj_id) /******/ { - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - hid_t c_obj_id; + int ret_value = -1; + unsigned char *c_buf = NULL; /* Buffer to hold C string */ + hid_t c_obj_id; - /* - * Call H5Tdecode function. - */ + /* + * Call H5Tdecode function. + */ - c_buf = (unsigned char*)buf; + c_buf = (unsigned char *)buf; - c_obj_id = H5Tdecode(c_buf); - if(c_obj_id < 0) - return ret_value; + c_obj_id = H5Tdecode(c_buf); + if (c_obj_id < 0) + return ret_value; - *obj_id = (hid_t_f)c_obj_id; - ret_value = 0; + *obj_id = (hid_t_f)c_obj_id; + ret_value = 0; - return ret_value; + return ret_value; } /****if* H5Tf/h5tencode_c @@ -2193,56 +2235,56 @@ h5tdecode_c ( _fcd buf, hid_t_f *obj_id ) * HISTORY * * SOURCE -*/ + */ int_f -h5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +h5tencode_c(_fcd buf, hid_t_f *obj_id, size_t_f *nalloc) /******/ { - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - size_t c_size; + int ret_value = -1; + unsigned char *c_buf = NULL; /* Buffer to hold C string */ + size_t c_size; - /* return just the size of the allocated buffer; - * equivalent to C routine for which 'name' is set equal to NULL - */ + /* return just the size of the allocated buffer; + * equivalent to C routine for which 'name' is set equal to NULL + */ - if (*nalloc == 0) { + if (*nalloc == 0) { - if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0) - return ret_value; + if (H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0) + return ret_value; - *nalloc = (size_t_f)c_size; + *nalloc = (size_t_f)c_size; - ret_value = 0; - return ret_value; - } + ret_value = 0; + return ret_value; + } - /* - * Allocate buffer - */ - c_size = (size_t)*nalloc; - if(NULL == (c_buf = (unsigned char *)HDmalloc(c_size))) - return ret_value; + /* + * Allocate buffer + */ + c_size = (size_t)*nalloc; + if (NULL == (c_buf = (unsigned char *)HDmalloc(c_size))) + return ret_value; - /* - * Call H5Tencode function. - */ - if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0) - return ret_value; + /* + * Call H5Tencode function. + */ + if (H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0) + return ret_value; - /* copy the C buffer to the FORTRAN buffer. - * Can not use HD5packFstring because we don't want to - * eliminate the NUL terminator or pad remaining space - * with blanks. - */ + /* copy the C buffer to the FORTRAN buffer. + * Can not use HD5packFstring because we don't want to + * eliminate the NUL terminator or pad remaining space + * with blanks. + */ - HDmemcpy(_fcdtocp(buf),(char *)c_buf,c_size); + HDmemcpy(_fcdtocp(buf), (char *)c_buf, c_size); - ret_value = 0; - if(c_buf) - HDfree(c_buf); - return ret_value; + ret_value = 0; + if (c_buf) + HDfree(c_buf); + return ret_value; } /****if* H5Tf/h5tget_create_plist_c @@ -2262,13 +2304,13 @@ h5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) * HISTORY * N/A * SOURCE -*/ + */ int_f -h5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) +h5tget_create_plist_c(hid_t_f *dtype_id, hid_t_f *dtpl_id) /******/ { - int_f ret_value=-1; /* Return value */ + int_f ret_value = -1; /* Return value */ if ((*dtpl_id = (hid_t_f)H5Tget_create_plist((hid_t)*dtype_id)) < 0) return ret_value; @@ -2296,20 +2338,21 @@ h5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) * HISTORY * * SOURCE -*/ + */ int_f -h5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) +h5tcompiler_conv_c(hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) /******/ { - int ret_value = -1; - htri_t status; - - status = H5Tcompiler_conv( (hid_t)*src_id , (hid_t)*dst_id); - if ( status < 0 ) return ret_value; - *c_flag = (int_f)status; - ret_value = 0; - return ret_value; + int ret_value = -1; + htri_t status; + + status = H5Tcompiler_conv((hid_t)*src_id, (hid_t)*dst_id); + if (status < 0) + return ret_value; + *c_flag = (int_f)status; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tget_native_type_c * NAME @@ -2330,20 +2373,21 @@ h5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) * HISTORY * * SOURCE -*/ + */ int_f h5tget_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; + 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; } /****if* H5Tf/h5tconvert_c @@ -2370,18 +2414,20 @@ h5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_ * December 8, 2008 * * SOURCE -*/ + */ int_f -h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void *background, hid_t_f *plist_id) +h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void *background, + hid_t_f *plist_id) /******/ { - int ret_value = -1; - hid_t status; + int ret_value = -1; + hid_t status; - status = H5Tconvert( (hid_t)*src_id, (hid_t)*dst_id, (size_t)*nelmts, buf, background, (hid_t)*plist_id ); - if ( status < 0 ) return ret_value; - ret_value = 0; - return ret_value; + status = H5Tconvert((hid_t)*src_id, (hid_t)*dst_id, (size_t)*nelmts, buf, background, (hid_t)*plist_id); + if (status < 0) + return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Tf/h5tenum_insert_ptr_c @@ -2403,28 +2449,28 @@ h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void * February 6, 2015 * * SOURCE -*/ + */ int_f -h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value) +h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f *namelen, void *value) /******/ { - int ret_value = -1; - hid_t status; - char *c_name; + int ret_value = -1; + hid_t status; + char *c_name; - /* - * Convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) return ret_value; + /* + * Convert FORTRAN name to C name + */ + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); + if (c_name == NULL) + return ret_value; - status = H5Tenum_insert( (hid_t)*type_id, c_name, value); + status = H5Tenum_insert((hid_t)*type_id, c_name, value); - HDfree(c_name); - if ( status < 0 ) return ret_value; + HDfree(c_name); + if (status < 0) + return ret_value; - ret_value = 0; - return ret_value; + ret_value = 0; + return ret_value; } - - |