diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-05-13 19:29:07 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-05-13 19:29:07 (GMT) |
commit | 0423a2ce6e5052ee838aa8be2b33f4ee78d62a5a (patch) | |
tree | e7488faa51aba8302dc05c75b7014e72788bb215 | |
parent | 8e0bce9dabef2d78e11d7c12e83bb2789acac756 (diff) | |
download | hdf5-0423a2ce6e5052ee838aa8be2b33f4ee78d62a5a.zip hdf5-0423a2ce6e5052ee838aa8be2b33f4ee78d62a5a.tar.gz hdf5-0423a2ce6e5052ee838aa8be2b33f4ee78d62a5a.tar.bz2 |
[svn-r16948] merge 16947
#1522 (B1) h5ltread_dataset_string_f error with g95
ISSUE: h5ltread_dataset_string_f causes library assertion with g95.
SOLUTION: convert the fortran string buffer to a C buffer with HD5f2cstring, and pass this string to the C function
TEST: added a test call in the fortran test lite program
DOCS: added the note in RELEASE.txt "- Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions had memory problems with the g95 fortran compiler. (PVN - 5/13/2009) 1522
tested: linux g95, windows fortran intel 11
-rwxr-xr-x | hl/fortran/src/H5LTf90proto.h | 1020 | ||||
-rwxr-xr-x | hl/fortran/src/H5LTfc.c | 25 | ||||
-rwxr-xr-x | hl/fortran/src/H5LTff.f90 | 14 | ||||
-rw-r--r-- | hl/fortran/test/tstlite.f90 | 70 | ||||
-rw-r--r-- | release_docs/RELEASE.txt | 4 |
5 files changed, 615 insertions, 518 deletions
diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 247a3e6..8a9d6c0 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -1,17 +1,17 @@ - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LTf90proto_H @@ -28,8 +28,8 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); /* - * Functions from H5LTfc.c - */ +* Functions from H5LTfc.c +*/ # define nh5ltmake_dataset_c H5_FC_FUNC_(h5ltmake_dataset_c, H5LTMAKE_DATASET_C) # define nh5ltmake_dataset_int1_c H5_FC_FUNC_(h5ltmake_dataset_int1_c, H5LTMAKE_DATASET_INT1_C) # define nh5ltmake_dataset_int2_c H5_FC_FUNC_(h5ltmake_dataset_int2_c, H5LTMAKE_DATASET_INT2_C) @@ -89,9 +89,9 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); # define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) /*------------------------------------------------------------------------- - * Image - *------------------------------------------------------------------------- - */ +* Image +*------------------------------------------------------------------------- +*/ # define nh5immake_image_8bit_c H5_FC_FUNC_(h5immake_image_8bit_c, H5IMMAKE_IMAGE_8BIT_C) # define nh5immake_image_24bit_c H5_FC_FUNC_(h5immake_image_24bit_c, H5IMMAKE_IMAGE_24BIT_C) # define nh5imread_image_c H5_FC_FUNC_(h5imread_image_c, H5IMREAD_IMAGE_C) @@ -106,9 +106,9 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); # define nh5imis_palette_c H5_FC_FUNC_(h5imis_palette_c, H5IMIS_PALETTE_C) /*------------------------------------------------------------------------- - * Table - *------------------------------------------------------------------------- - */ +* Table +*------------------------------------------------------------------------- +*/ # define nh5tbmake_table_c H5_FC_FUNC_(h5tbmake_table_c, H5TBMAKE_TABLE_C) # define nh5tbwrite_field_name_c H5_FC_FUNC_(h5tbwrite_field_name_c, H5TBWRITE_FIELD_NAME_C) # define nh5tbwrite_field_name_int_c H5_FC_FUNC_(h5tbwrite_field_name_int_c, H5TBWRITE_FIELD_NAME_INT_C) @@ -152,182 +152,182 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, H5_DLL int_f nh5ltmake_dataset_int1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_int2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_int3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_fl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_fl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_fl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_dl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_dl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_dl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nint1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nint2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nint3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nfl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nfl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_nfl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_ndl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_ndl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f nh5ltmake_dataset_ndl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); + int_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); H5_DLL int_f @@ -336,253 +336,254 @@ nh5ltread_dataset_c (hid_t_f *loc_id, _fcd name, hid_t_f *type_id, void *buf, - hsize_t_f *dims); + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_int1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_int2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_int3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_fl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_fl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_fl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_dl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_dl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_dl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nint1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nint2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nint3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nfl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nfl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_nfl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_ndl1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_ndl2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltread_dataset_ndl3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); + int_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf, + hsize_t_f *dims); H5_DLL int_f nh5ltset_attribute_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + size_t_f *size, + void *buf); H5_DLL int_f nh5ltset_attribute_float_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + size_t_f *size, + void *buf); H5_DLL int_f nh5ltset_attribute_double_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + size_t_f *size, + void *buf); H5_DLL int_f nh5ltset_attribute_string_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + int_f *buflen, + void *buf); H5_DLL int_f nh5ltget_attribute_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + void *buf); H5_DLL int_f nh5ltget_attribute_float_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + void *buf); H5_DLL int_f nh5ltget_attribute_double_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + void *buf); H5_DLL int_f nh5ltget_attribute_string_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - void *buf); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + void *buf); H5_DLL int_f nh5ltget_dataset_ndims_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank); + int_f *namelen, + _fcd name, + int_f *rank); H5_DLL int_f @@ -595,34 +596,35 @@ int_f nh5ltget_dataset_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, - hsize_t_f *dims, + hsize_t_f *dims, int_f *type_class, - size_t_f *type_size); + size_t_f *type_size); H5_DLL int_f nh5ltget_attribute_ndims_c(hid_t_f *loc_id, - int_f *namelen, - _fcd dsetname, - int_f *attrnamelen, - _fcd attrname, - int_f *rank); + int_f *namelen, + _fcd dsetname, + int_f *attrnamelen, + _fcd attrname, + int_f *rank); H5_DLL int_f nh5ltget_attribute_info_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *attrnamelen, - _fcd attrname, - hsize_t_f *dims, - int_f *type_class, - size_t_f *type_size); + int_f *namelen, + _fcd name, + int_f *attrnamelen, + _fcd attrname, + hsize_t_f *dims, + int_f *type_class, + size_t_f *type_size); H5_DLL int_f nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, _fcd name, + int_f *buflen, char *buf); H5_DLL @@ -633,18 +635,18 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, char *buf); /*------------------------------------------------------------------------- - * Image - *------------------------------------------------------------------------- - */ +* Image +*------------------------------------------------------------------------- +*/ H5_DLL int_f nh5immake_image_8bit_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *width, - hsize_t_f *height, - int_f *buf); + int_f *namelen, + _fcd name, + hsize_t_f *width, + hsize_t_f *height, + int_f *buf); H5_DLL int_f nh5imread_image_c (hid_t_f *loc_id, @@ -657,22 +659,22 @@ int_f nh5immake_image_24bit_c (hid_t_f *loc_id, int_f *namelen, _fcd name, - int_f *ilen, + int_f *ilen, _fcd il, hsize_t_f *width, hsize_t_f *height, - void *buf); + void *buf); H5_DLL int_f nh5imget_image_info_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *width, - hsize_t_f *height, - hsize_t_f *planes, - hsize_t_f *npals, - int_f *ilen, - _fcd interlace); + int_f *namelen, + _fcd name, + hsize_t_f *width, + hsize_t_f *height, + hsize_t_f *planes, + hsize_t_f *npals, + int_f *ilen, + _fcd interlace); H5_DLL @@ -701,71 +703,71 @@ nh5imlink_palette_c (hid_t_f *loc_id, H5_DLL int_f nh5imunlink_palette_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *ilen, - _fcd pal_name); + int_f *namelen, + _fcd name, + int_f *ilen, + _fcd pal_name); H5_DLL int_f nh5imget_npalettes_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *npals); + int_f *namelen, + _fcd name, + hsize_t_f *npals); H5_DLL int_f nh5imget_palette_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, - int_f *pal_number, - hsize_t_f *dims); + _fcd name, + int_f *pal_number, + hsize_t_f *dims); H5_DLL int_f nh5imget_palette_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *pal_number, - void *buf); + int_f *namelen, + _fcd name, + int_f *pal_number, + void *buf); H5_DLL int_f nh5imis_palette_c(hid_t_f *loc_id, int_f *namelen, - _fcd name); + _fcd name); /*------------------------------------------------------------------------- - * Table - *------------------------------------------------------------------------- - */ +* Table +*------------------------------------------------------------------------- +*/ H5_DLL int_f nh5tbmake_table_c(int_f *namelen1, - _fcd name1, - hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *nfields, - hsize_t_f *nrecords, - size_t_f *type_size, - size_t_f *field_offset, - hid_t_f *field_types, - hsize_t_f *chunk_size, - int_f *compress, - int_f *len, /* field_names lenghts */ - _fcd buf); /* field_names */ + _fcd name1, + hid_t_f *loc_id, + int_f *namelen, + _fcd name, + hsize_t_f *nfields, + hsize_t_f *nrecords, + size_t_f *type_size, + size_t_f *field_offset, + hid_t_f *field_types, + hsize_t_f *chunk_size, + int_f *compress, + int_f *len, /* field_names lenghts */ + _fcd buf); /* field_names */ H5_DLL int_f nh5tbwrite_field_name_c(hid_t_f *loc_id, int_f *namelen, _fcd name, - int_f *namelen1, + int_f *namelen1, _fcd field_name, hsize_t_f *start, hsize_t_f *nrecords, @@ -775,165 +777,165 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, H5_DLL int_f nh5tbwrite_field_name_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_name_fl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_name_dl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_name_st_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_name_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_name_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_name_fl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_name_dl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_name_st_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_index_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_index_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_index_fl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_index_dl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbwrite_field_index_st_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f @@ -949,53 +951,53 @@ nh5tbread_field_index_c(hid_t_f *loc_id, H5_DLL int_f nh5tbread_field_index_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_index_fl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_index_dl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbread_field_index_st_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); + int_f *namelen, + _fcd name, + int_f *field_index, + hsize_t_f *start, + hsize_t_f *nrecords, + size_t_f *type_size, + void *buf); H5_DLL int_f nh5tbinsert_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, - int_f *namelen1, + int_f *namelen1, _fcd field_name, hid_t_f *field_type, int_f *position, @@ -1004,71 +1006,71 @@ nh5tbinsert_field_c(hid_t_f *loc_id, H5_DLL int_f nh5tbinsert_field_int_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hid_t_f *field_type, + int_f *position, + void *buf); H5_DLL int_f nh5tbinsert_field_fl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hid_t_f *field_type, + int_f *position, + void *buf); H5_DLL int_f nh5tbinsert_field_dl_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hid_t_f *field_type, + int_f *position, + void *buf); H5_DLL int_f nh5tbinsert_field_st_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); + int_f *namelen, + _fcd name, + int_f *namelen1, + _fcd field_name, + hid_t_f *field_type, + int_f *position, + void *buf); H5_DLL int_f nh5tbdelete_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, - int_f *namelen1, - _fcd field_name); + int_f *namelen1, + _fcd field_name); H5_DLL int_f nh5tbget_table_info_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *nfields, - hsize_t_f *nrecords); + int_f *namelen, + _fcd name, + hsize_t_f *nfields, + hsize_t_f *nrecords); H5_DLL int_f nh5tbget_field_info_c(hid_t_f *loc_id, - int_f *namelen, - _fcd name, - hsize_t_f *nfields, - size_t_f *field_sizes, - size_t_f *field_offsets, - size_t_f *type_size, - int_f *namelen2, /* field_names lenghts */ - _fcd field_names) ; /* field_names */ + int_f *namelen, + _fcd name, + hsize_t_f *nfields, + size_t_f *field_sizes, + size_t_f *field_offsets, + size_t_f *type_size, + int_f *namelen2, /* field_names lenghts */ + _fcd field_names) ; /* field_names */ diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 412b19e..039385a 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -561,6 +561,7 @@ int_f nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, _fcd name, + int_f *buflen, char *buf) { int ret_value = -1; @@ -568,6 +569,8 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, hid_t c_loc_id; char *c_name = NULL; int c_namelen; + char *c_buf = NULL; + int c_buflen; /* * convert FORTRAN name to C name @@ -577,12 +580,17 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, if (c_name == NULL) goto done; + c_buflen = *buflen; + c_buf = (char *)HD5f2cstring(buf, c_buflen); + if (c_buf == NULL) + goto done; + /* * call H5LTmake_dataset_string function. */ c_loc_id = (hid_t)*loc_id; - ret = H5LTmake_dataset_string(c_loc_id,c_name,buf); + ret = H5LTmake_dataset_string(c_loc_id,c_name,c_buf); if (ret < 0) goto done; @@ -592,6 +600,8 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, done: if(c_name!=NULL) free(c_name); + if(c_buf!=NULL) + free(c_buf); return ret_value; } @@ -907,6 +917,7 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, _fcd dsetname, int_f *attrnamelen, _fcd attrname, + int_f *buflen, void *buf) { int ret_value = -1; @@ -916,6 +927,8 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, char *c_attrname = NULL; int c_namelen; int c_attrnamelen; + char *c_buf = NULL; + int c_buflen; /* * convert FORTRAN name to C name @@ -930,12 +943,18 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, if (c_attrname == NULL) goto done; + c_buflen = *buflen; + c_buf = (char *)HD5f2cstring(buf, c_buflen); + if (c_buf == NULL) + goto done; + + /* * call H5LTset_attribute_string function. */ c_loc_id = (hid_t)*loc_id; - ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,buf); + ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,c_buf); if (ret < 0) goto done; @@ -948,6 +967,8 @@ done: free(c_name); if(c_attrname!=NULL) free(c_attrname); + if(c_buf!=NULL) + free(c_buf); return ret_value; } diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index 45d9a23..c6a6396 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -2453,9 +2453,10 @@ subroutine h5ltmake_dataset_string_f(loc_id,& character(len=*), intent(in) :: buf ! data buffer integer :: errcode ! error code integer :: namelen ! name length + integer :: buflen ! buffer length interface - integer function h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buf) + integer function h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) use h5global !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_STRING_C'::h5ltmake_dataset_string_c @@ -2463,13 +2464,15 @@ subroutine h5ltmake_dataset_string_f(loc_id,& !DEC$ATTRIBUTES reference :: dset_name integer(hid_t), intent(in) :: loc_id ! file or group identifier integer :: namelen ! lenght of name buffer + integer :: buflen ! lenght of data buffer character(len=*), intent(in) :: dset_name ! name of the dataset character(len=*), intent(in) :: buf ! data buffer end function h5ltmake_dataset_string_c end interface namelen = len(dset_name) - errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buf) + buflen = len(buf) + errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) end subroutine h5ltmake_dataset_string_f @@ -2775,9 +2778,10 @@ subroutine h5ltset_attribute_string_f(loc_id,& character(len=*), intent(in) :: buf ! data buffer integer :: namelen ! name length integer :: attrlen ! name length + integer :: buflen ! data buffer length interface - integer function h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + integer function h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) use h5global !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_STRING_C'::h5ltset_attribute_string_c @@ -2787,6 +2791,7 @@ subroutine h5ltset_attribute_string_f(loc_id,& integer(hid_t), intent(in) :: loc_id ! file or group identifier integer :: namelen ! lenght of name buffer integer :: attrlen ! lenght of attr name buffer + integer :: buflen ! data buffer length character(len=*), intent(in) :: dset_name ! name of the dataset character(len=*), intent(in) :: attr_name ! name of the attribute character(len=*), intent(in) :: buf ! data buffer @@ -2795,7 +2800,8 @@ subroutine h5ltset_attribute_string_f(loc_id,& namelen = len(dset_name) attrlen = len(attr_name) - errcode = h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + buflen = len(buf) + errcode = h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) end subroutine h5ltset_attribute_string_f diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index 9332c10..168bb99 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -717,6 +717,40 @@ end do call passed() + +!------------------------------------------------------------------------- +! string +!------------------------------------------------------------------------- + +call test_begin(' Make/Read datasets (string) ') + + +! +! write dataset. +! +call h5ltmake_dataset_string_f(file_id, dsetname5, buf1, errcode) + +! +! read dataset. +! +call h5ltread_dataset_string_f(file_id, dsetname5, buf1r, errcode) + +! +! compare read and write buffers. +! +if ( buf1 .ne. buf1r ) then + print *, 'read buffer differs from write buffer' + print *, buf1, ' and ', buf1r + stop +endif + +call passed() + + + + + + call test_begin(' Get dataset dimensions/info ') !------------------------------------------------------------------------- @@ -799,8 +833,8 @@ character(LEN=5), parameter :: attrname2 = "attr2" ! Attribute name character(LEN=5), parameter :: attrname3 = "attr3" ! Attribute name character(LEN=5), parameter :: attrname4 = "attr4" ! Attribute name character(LEN=5), parameter :: attrname5 = "attr5" ! Attribute name -character(LEN=9), parameter :: buf1 = "mystring" ! Data buffer -character(LEN=9) :: bufr1 ! Data buffer +character(LEN=8), parameter :: buf1 = "mystring" ! Data buffer +character(LEN=8) :: bufr1 ! Data buffer integer, dimension(DIM1) :: buf2 ! Data buffer integer, dimension(DIM1) :: bufr2 ! Data buffer real, dimension(DIM1) :: buf3 ! Data buffer @@ -936,6 +970,38 @@ end do call passed() + + +!------------------------------------------------------------------------- +! string +!------------------------------------------------------------------------- + +call test_begin(' Set/Get attributes string ') + + +! +! write attribute. +! +call h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode) + +! +! read attribute. +! +call h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode) + +! +! compare read and write buffers. +! + +if ( buf1 .ne. bufr1 ) then + print *, 'read buffer differs from write buffer' + print *, buf1, ' and ', bufr1 + stop + endif + + +call passed() + !------------------------------------------------------------------------- ! get attribute rank !------------------------------------------------------------------------- diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1553004..84e7b49 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -122,7 +122,9 @@ Bug Fixes since HDF5-1.8.3 Fortran High-Level APIs: ------ - - None + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + had memory problems with the g95 fortran compiler. (PVN – 5/13/2009) 1522 + Platforms Tested |