summaryrefslogtreecommitdiffstats
path: root/Lib/venv/scripts
ModeNameSize
d---------common76logstatsplain
d---------nt82logstatsplain
d---------posix81logstatsplain
ine description # for a project that appears at the top of each page and should give viewer a diff --git a/configure b/configure index 54133a1..da768bc 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Id: configure.ac 30170 2016-07-12 17:11:59Z byrn . +# From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.18-snap2. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.18-snap2' -PACKAGE_STRING='HDF5 1.8.18-snap2' +PACKAGE_VERSION='1.8.19-snap0' +PACKAGE_STRING='HDF5 1.8.19-snap0' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1473,7 +1473,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.8.18-snap2 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.19-snap0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1543,7 +1543,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.18-snap2:";; + short | recursive ) echo "Configuration of HDF5 1.8.19-snap0:";; esac cat <<\_ACEOF @@ -1733,7 +1733,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.18-snap2 +HDF5 configure 1.8.19-snap0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2670,7 +2670,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.8.18-snap2, which was +It was created by HDF5 $as_me 1.8.19-snap0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3541,7 +3541,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.18-snap2' + VERSION='1.8.19-snap0' cat >>confdefs.h <<_ACEOF @@ -28448,7 +28448,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.18-snap2 +HDF5 config.lt 1.8.19-snap0 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -30564,7 +30564,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.18-snap2, which was +This file was extended by HDF5 $as_me 1.8.19-snap0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30630,7 +30630,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.18-snap2 +HDF5 config.status 1.8.19-snap0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index d303244..78f725b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.18-snap2], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.19-snap0], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 6ca95c54..36591d3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 621dacd..1461830 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cc1b4e2..a1fe8aa 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.18-snap2 currently under development +HDF5 version 1.8.19-snap0 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index ee5ccb9..2926cd4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 18 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap2" /* For pre-releases like snap0 */ +#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.18-snap2" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap0" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 52fbb7b6309bbfef53865d7732431ce3ae3200e3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Oct 2016 14:12:16 -0500 Subject: Update to latest cnahages used in buildbot status --- config/cmake/scripts/CTestScript.cmake | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index a056cfb..75e61ee 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -41,7 +41,7 @@ else(NOT SITE_OS_NAME) set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") endif() if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") endif() set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") endif(NOT SITE_OS_NAME) @@ -98,15 +98,15 @@ else(CTEST_USE_TAR_SOURCE) set(NEED_REPOSITORY_CHECKOUT 1) endif() - if(${NEED_REPOSITORY_CHECKOUT}) + if(${NEED_REPOSITORY_CHECKOUT}) if(REPOSITORY_BRANCH) - set(GITUpdateOptions "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") else() - set(GITUpdateOptions "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") endif() - set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${GITUpdateOptions}") + set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") else() - set(GITUpdateOptions "pull") + set(CTEST_GIT_options "pull") endif() set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") else(CTEST_USE_GIT_SOURCE) @@ -134,12 +134,12 @@ else(CTEST_USE_TAR_SOURCE) endif() if(${NEED_REPOSITORY_CHECKOUT}) set(CTEST_CHECKOUT_COMMAND - "${CTEST_SVN_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else(${NEED_REPOSITORY_CHECKOUT}) + "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") + else() if(CTEST_REPO_VERSION) set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") endif() - endif(${NEED_REPOSITORY_CHECKOUT}) + endif() endif(CTEST_USE_GIT_SOURCE) endif(LOCAL_UPDATE) endif(CTEST_USE_TAR_SOURCE) @@ -191,14 +191,14 @@ endforeach(req) if(LOCAL_MEMCHECK_TEST) find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) else() if(LOCAL_COVERAGE_TEST) find_program(CTEST_COVERAGE_COMMAND NAMES gcov) endif() set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) endif() @@ -240,20 +240,20 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - if(${res} LESS 0 OR ${res} GREATER 0) - message(FATAL_ERROR "Failed configure: ${res}\n") - endif() if(LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) endif() + if(${res} LESS 0 OR ${res} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif() ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) - if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - message(FATAL_ERROR "Failed build: ${res} with Errors=${errval}\n") - endif() if(LOCAL_SUBMIT) ctest_submit (PARTS Build) endif() + if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif() if(NOT LOCAL_SKIP_TEST) if(NOT LOCAL_MEMCHECK_TEST) @@ -262,13 +262,13 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") ctest_submit (PARTS Test) endif() if(${res} LESS 0 OR ${res} GREATER 0) - message(FATAL_ERROR "Failed tests: ${res}\n") + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") endif() else() ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) if(LOCAL_SUBMIT) ctest_submit (PARTS MemCheck) - endif(LOCAL_SUBMIT) + endif() endif() if(LOCAL_COVERAGE_TEST) ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) @@ -278,7 +278,7 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") endif() endif(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE) + if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) ##----------------------------------------------- ## Package the product ##----------------------------------------------- @@ -290,7 +290,7 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") ) file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") if(cpackResult GREATER 0) - message (FATAL_ERROR "Failed packaging: ${cpackResult}\n") + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") endif() - endif(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE) + endif() #----------------------------------------------------------------------------- -- cgit v0.12 From 25eb5a4f240190a466c5b62a8e80f067d43fe6d6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Oct 2016 14:22:44 -0500 Subject: Update with changes from buildbot process --- config/cmake/scripts/HDF518config.cmake | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 5cc73cf..55e4667 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -19,21 +19,21 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # VS201264 * Visual Studio 11 2012 Win64 # # INSTALLDIR - root folder where hdf5 is installed -# CTEST_BUILD_CONFIGURATION - Release, Debug, etc +# CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder # STATIC_LIBRARIES - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.8.16) +set(CTEST_SOURCE_VERSION 1.8.18) set(CTEST_SOURCE_VERSEXT "") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.8 root folder -#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.8.16 #STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO @@ -52,7 +52,7 @@ endif() # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") @@ -69,28 +69,32 @@ else() elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") endif() endif() if(NOT DEFINED INSTALLDIR) if(WIN32) - set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + set(INSTALLDIR "C:\\Program\ Files\\HDF_Group\\HDF5\\${CTEST_SOURCE_VERSION}") else() - set(INSTALLDIR "/usr/local/myhdf5") + set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") endif() endif() -if(NOT DEFINED CTEST_BUILD_CONFIGURATION) - set(CTEST_BUILD_CONFIGURATION "Release") +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE "Release") endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") endif() if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") +else() + set(STATICLIBRARIES "NO") endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") +else() + set(FORTRANLIBRARIES "YES") endif() set(CTEST_BINARY_NAME "build") @@ -162,7 +166,7 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16") +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_18") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### @@ -214,7 +218,8 @@ endif() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH='${INSTALLDIR}'") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### -- cgit v0.12 From 32f59543a791b21c8456ed4e9ed58bc14d88ef41 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 27 Oct 2016 20:14:01 -0500 Subject: Updated RELEASE.txt for C++ API and Packet Table APIs for 1.8.18. --- release_docs/RELEASE.txt | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cc1b4e2..172550e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -152,12 +152,30 @@ Bug Fixes since HDF5-1.8.17 C++ API ------- - - None + - The macros H5_NO_NAMESPACE is deprecated from the HDF5 C++ API library. + In future releases, the macros H5_NO_STD and OLD_HEADER_FILENAME may + also be removed. + (BMR, 2016/10/27, HDFFV-9532) High-Level APIs: --------------- - - None + + Packet Table APIs: + ------------------ + - The high-level API Packet Table (PT) did not write data correctly when + the datatype is a compound type that has string type as one of the + members. This problem started in 1.8.15, after the fix of HDFFV-9042 + was applied, which caused the Packet Table to use native type to access + the data. It should be up to the application to specify whether the + buffer to be read into memory in the machine’s native architecture. + Thus, the PT is fixed to not use native type but to make a copy of the + user's provided datatype during creation or the packet table's datatype + during opening. If an application wishes to use native type to read the + data, then the application will request that. However, the Packet Table + doesn't provide a way to specify memory datatype in this release. + Please refer to the Known Problems section for a work-around. + (BMR, 2016/10/27, HDFFV-9758) Fortran High-Level APIs: @@ -344,6 +362,18 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== +* Currently, the Packet Table doesn't provide a way to specify memory datatype + when the packet table is read. To work around this limitation, an + application can use the following approach: + + For the C API of the Packet Table + - call the PT API H5PTget_type to get the datatype of the packet table + - call the C API H5Tget_native_type to get the native type of that datatype + + For the C++ API of the Packet Table + - call the member function PacketTable::GetDatatype to get the datatype + of the packet table + - call the C API H5Tget_native_type to get the native type of that datatype + (BMR, 2016/10/27, HDFFV-9758) + * On windows platforms in debug configurations, the VFD flush1 tests will fail with the split and multi VFD drivers. These tests will display a modal debug dialog which must be answered or wait for the test timeout to expire. -- cgit v0.12 From eb854bba5122197c8563e289d31ac05cc0efd7e7 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 31 Oct 2016 12:39:49 -0500 Subject: Translate svn command to git command. Remove unncessary references to svn. --- bin/pkgscrpts/build_and_package_hdf5_binaries.sh | 10 ---------- bin/pkgscrpts/testbinaries.sh | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/bin/pkgscrpts/build_and_package_hdf5_binaries.sh b/bin/pkgscrpts/build_and_package_hdf5_binaries.sh index 1f6699b..e0bf7f7 100644 --- a/bin/pkgscrpts/build_and_package_hdf5_binaries.sh +++ b/bin/pkgscrpts/build_and_package_hdf5_binaries.sh @@ -140,16 +140,6 @@ fi #(tail -4 $LOGFILE | grep -s "^*** finished .* in $HOSTNAME ***" > /dev/null 2>&1) || # (echo "****snaptest launcher FAILED to complete in $HOSTNAME****" >> $FAILEDLOG) -#CURRENT_DIR=`pwd` -#cd $HOME/snapshots-bin-${sw}${SWVERSTR}/current -#pwd -#SVN_URL=`svn info | grep URL` -#BRANCHNAME=`echo $SVN_URL | sed -e 's/URL:.*\///' | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` -#REVISION=`svn info | grep Revision` -#LAST_INFO=`svn info | grep "Last Changed"` -#TEST_TITLE="$HOSTNAME ${BRANCHNAME}${SWVERSTR}_Daily_Tests_${TODAY}" -#TITLE="${BRANCHNAME} Tests on $TODAY" -#cd $CURRENT_DIR # Check result if [ -f $FAILEDLOG ]; then diff --git a/bin/pkgscrpts/testbinaries.sh b/bin/pkgscrpts/testbinaries.sh index eb6279f..b93c7d9 100644 --- a/bin/pkgscrpts/testbinaries.sh +++ b/bin/pkgscrpts/testbinaries.sh @@ -444,7 +444,7 @@ for f in $FILE_LIST ; do if test -d hdf5-examples ; then rm -rf hdf5-examples fi - svn co https://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/ hdf5-examples > checkout.log + git clone https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5-examples.git hdf5-examples > checkout.log CC=$THIS_DIR/$EXTRACTED/bin/h5cc export CC -- cgit v0.12 From 360fe1e0f583bbf541957d838b27d0f667904825 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 31 Oct 2016 14:53:14 -0500 Subject: Identify generated files with property --- fortran/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c3ae5c4..e617979 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -144,6 +144,8 @@ add_custom_command ( WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5match_types ) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) #----------------------------------------------------------------------------- # f90CStub lib -- cgit v0.12 From 0fbd91aaf224a2de55594cdc929f93c92832da4f Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 3 May 2016 13:41:37 -0500 Subject: [svn-r29860] Increment LT interface version numbers according to symbol additions for libhdf5, libhdf5_hl, libhdf5_hl_cpp, libhdf5_cpp and symbols removed for libhdf5_cpp. --- config/lt_vers.am | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config/lt_vers.am b/config/lt_vers.am index 273ce6c..815bb3d 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -18,9 +18,9 @@ # See libtool versioning documentation online. # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. -LT_VERS_INTERFACE = 11 -LT_VERS_REVISION = 1 -LT_VERS_AGE = 1 +LT_VERS_INTERFACE = 12 +LT_VERS_REVISION = 0 +LT_VERS_AGE = 2 ## If the API changes *at all*, increment LT_VERS_INTERFACE and ## reset LT_VERS_REVISION to 0. @@ -41,21 +41,21 @@ LT_VERS_AGE = 1 ## the effects of the H5_V1_x_COMPAT flag. ## Version numbers for wrapper shared library files. -LT_CXX_VERS_INTERFACE = 11 -LT_CXX_VERS_REVISION = 1 +LT_CXX_VERS_INTERFACE = 12 +LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 3 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 10 -LT_HL_VERS_REVISION = 3 -LT_HL_VERS_AGE = 0 +LT_HL_VERS_INTERFACE = 11 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 1 -LT_HL_CXX_VERS_INTERFACE = 10 -LT_HL_CXX_VERS_REVISION = 3 -LT_HL_CXX_VERS_AGE = 0 +LT_HL_CXX_VERS_INTERFACE = 12 +LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 LT_HL_F_VERS_REVISION = 3 -- cgit v0.12 From fe6487068117d1d31fbf565d376db4be3de1ebb9 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 10 Nov 2016 12:59:03 -0600 Subject: Description: Replaced an incorrect work-around note with info about future feature. --- release_docs/RELEASE.txt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 56d1773..a1c7049 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -173,8 +173,8 @@ Bug Fixes since HDF5-1.8.17 user's provided datatype during creation or the packet table's datatype during opening. If an application wishes to use native type to read the data, then the application will request that. However, the Packet Table - doesn't provide a way to specify memory datatype in this release. - Please refer to the Known Problems section for a work-around. + doesn't provide a way to specify memory datatype in this release. This + feature will be available in future releases, HDFFV-10023. (BMR, 2016/10/27, HDFFV-9758) @@ -362,18 +362,6 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== -* Currently, the Packet Table doesn't provide a way to specify memory datatype - when the packet table is read. To work around this limitation, an - application can use the following approach: - + For the C API of the Packet Table - - call the PT API H5PTget_type to get the datatype of the packet table - - call the C API H5Tget_native_type to get the native type of that datatype - + For the C++ API of the Packet Table - - call the member function PacketTable::GetDatatype to get the datatype - of the packet table - - call the C API H5Tget_native_type to get the native type of that datatype - (BMR, 2016/10/27, HDFFV-9758) - * On windows platforms in debug configurations, the VFD flush1 tests will fail with the split and multi VFD drivers. These tests will display a modal debug dialog which must be answered or wait for the test timeout to expire. -- cgit v0.12 From 286e0d744d970777284b616e8ec9e7c96344ac66 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Dec 2016 10:05:42 -0600 Subject: HDFFV-10046 Add callback functions to plugin test --- test/dynlib4.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/test/dynlib4.c b/test/dynlib4.c index 8da0270..316962a 100644 --- a/test/dynlib4.c +++ b/test/dynlib4.c @@ -25,6 +25,8 @@ static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); +herr_t H5Z_filter_can_apply(hid_t dcpl, hid_t type, hid_t space); +herr_t H5Z_filter_set_local(hid_t dcpl, hid_t type, hid_t space); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIB4[1] = {{ @@ -32,14 +34,41 @@ const H5Z_class2_t H5Z_DYNLIB4[1] = {{ H5Z_FILTER_DYNLIB4, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ "dynlib4", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ + (H5Z_can_apply_func_t)(H5Z_filter_can_apply), /* The "can apply" callback */ + (H5Z_set_local_func_t)(H5Z_filter_set_local), /* The "set local" callback */ (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */ }}; H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB4;} +herr_t H5Z_filter_can_apply(hid_t dcpl, hid_t type, hid_t space) { + H5I_type_t dcpl_type; + + dcpl_type = H5Iget_type(dcpl); + if (dcpl_type < 0) { + PUSH_ERR("H5Z_filter_can_apply", H5E_CALLBACK, "dcpl not valid"); + return -1; + } + + return 1; +} + +herr_t H5Z_filter_set_local(hid_t dcpl, hid_t type, hid_t space) { + herr_t r; + unsigned int flags; + size_t nelements = 4; + unsigned int values[] = {0,0,0,0}; + + r = H5Pget_filter_by_id2(dcpl, H5Z_FILTER_DYNLIB4, &flags, &nelements, values, 0, NULL, NULL); + if (r < 0) { + PUSH_ERR("H5Z_filter_set_local", H5E_CALLBACK, "dcpl fails get_filter_by_id2"); + return -1; + } + + return 1; +} + /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib4 * -- cgit v0.12 From 5fa2d1e8c4022a9d37785f939c4a45866447f930 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 7 Dec 2016 14:38:23 -0600 Subject: HDFFV-10036: HDF5 Fails to compile fortran tests with NAG and -i8 and -r8 flags Fix. --- fortran/test/tf_F08.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fortran/test/tf_F08.f90 b/fortran/test/tf_F08.f90 index 9844702..6d6a817 100644 --- a/fortran/test/tf_F08.f90 +++ b/fortran/test/tf_F08.f90 @@ -45,11 +45,12 @@ MODULE TH5_MISC_PROVISIONAL INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors ! generic compound datatype - TYPE, BIND(C) :: comp_datatype + TYPE :: comp_datatype + SEQUENCE REAL :: a INTEGER :: x DOUBLE PRECISION :: y - CHARACTER(LEN=1) :: z + CHARACTER(KIND=C_CHAR) :: z END TYPE comp_datatype PUBLIC :: H5_SIZEOF -- cgit v0.12 From 35f0e16e34e5f7691a39693ee4da4e67b1bed69b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Jan 2017 14:05:25 -0600 Subject: HDFFV-9994 port changes from develop. CMake folder changes brought up to standard. --- MANIFEST | 7 + config/cmake_ext_mod/CheckTypeSize.cmake | 22 +-- config/cmake_ext_mod/ConfigureChecks.cmake | 208 ++++++++++---------- config/cmake_ext_mod/FindSZIP.cmake | 42 ++-- config/cmake_ext_mod/HDFCXXTests.cpp | 35 ++++ config/cmake_ext_mod/HDFLibMacros.cmake | 34 ++-- config/cmake_ext_mod/HDFMacros.cmake | 106 +++++----- config/cmake_ext_mod/HDFTests.c | 49 +---- config/cmake_ext_mod/HDFUseFortran.cmake | 21 +- config/cmake_ext_mod/grepTest.cmake | 20 +- config/cmake_ext_mod/prunTest.cmake | 145 -------------- config/cmake_ext_mod/runTest.cmake | 34 ++-- configure | 7 +- configure.ac | 5 +- tools/h5diff/CMakeLists.txt | 32 ++- tools/h5diff/CMakeTests.cmake | 122 +++++++----- tools/h5diff/Makefile.am | 16 ++ tools/h5diff/Makefile.in | 177 +++++++++++------ tools/h5diff/dynlib_diff.c | 94 +++++++++ tools/h5diff/h5diff_plugin.sh.in | 299 +++++++++++++++++++++++++++++ tools/h5diff/testfiles/h5diff_ud.txt | 11 ++ tools/h5diff/testfiles/h5diff_udfail.txt | 12 ++ tools/h5diff/testfiles/tudfilter.h5 | Bin 0 -> 4816 bytes tools/h5diff/testfiles/tudfilter2.h5 | Bin 0 -> 4816 bytes tools/h5diff/testh5diff.sh.in | 170 ++++++++-------- tools/h5dump/CMakeLists.txt | 33 +++- tools/h5dump/CMakeTests.cmake | 188 +++++++++--------- tools/h5dump/CMakeTestsPBITS.cmake | 21 +- tools/h5dump/CMakeTestsXML.cmake | 29 ++- tools/h5dump/Makefile.am | 14 ++ tools/h5dump/Makefile.in | 176 +++++++++++------ tools/h5dump/dynlib_dump.c | 94 +++++++++ tools/h5dump/h5dump_plugin.sh.in | 226 ++++++++++++++++++++++ tools/h5dump/h5dumpgentest.c | 191 +++++++++++++++--- tools/h5dump/testh5dump.sh.in | 56 +++--- tools/h5dump/testh5dumppbits.sh.in | 2 +- tools/h5dump/testh5dumpxml.sh.in | 2 +- tools/h5ls/CMakeLists.txt | 30 ++- tools/h5ls/CMakeTests.cmake | 63 +++++- tools/h5ls/Makefile.am | 16 ++ tools/h5ls/Makefile.in | 186 ++++++++++++------ tools/h5ls/dynlib_ls.c | 94 +++++++++ tools/h5ls/h5ls_plugin.sh.in | 238 +++++++++++++++++++++++ tools/h5ls/testh5ls.sh.in | 55 +++--- tools/lib/h5diff.c | 12 +- tools/lib/h5diff_dset.c | 54 +++--- tools/lib/h5tools_dump.c | 4 +- tools/lib/h5tools_str.c | 2 +- tools/testfiles/tudfilter.ddl | 30 +++ tools/testfiles/tudfilter.h5 | Bin 0 -> 4816 bytes tools/testfiles/tudfilter.ls | 23 +++ 51 files changed, 2519 insertions(+), 988 deletions(-) delete mode 100644 config/cmake_ext_mod/prunTest.cmake create mode 100644 tools/h5diff/dynlib_diff.c create mode 100644 tools/h5diff/h5diff_plugin.sh.in create mode 100644 tools/h5diff/testfiles/h5diff_ud.txt create mode 100644 tools/h5diff/testfiles/h5diff_udfail.txt create mode 100644 tools/h5diff/testfiles/tudfilter.h5 create mode 100644 tools/h5diff/testfiles/tudfilter2.h5 create mode 100644 tools/h5dump/dynlib_dump.c create mode 100644 tools/h5dump/h5dump_plugin.sh.in create mode 100644 tools/h5ls/dynlib_ls.c create mode 100644 tools/h5ls/h5ls_plugin.sh.in create mode 100644 tools/testfiles/tudfilter.ddl create mode 100644 tools/testfiles/tudfilter.h5 create mode 100644 tools/testfiles/tudfilter.ls diff --git a/MANIFEST b/MANIFEST index f462b1d..a4775ff 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1485,6 +1485,9 @@ ./tools/testfiles/tstring2.ddl ./tools/testfiles/tstringe.ddl ./tools/testfiles/tszip.ddl +./tools/testfiles/tudfilter.ddl +./tools/testfiles/tudfilter.h5 +./tools/testfiles/tudfilter.ls ./tools/testfiles/tudlink.h5 ./tools/testfiles/tudlink.h5.xml ./tools/testfiles/tudlink-1.ddl @@ -1996,6 +1999,10 @@ ./tools/h5diff/testfiles/tmptest.he5 ./tools/h5diff/testfiles/h5diff_tmp2.txt ./tools/h5diff/testfiles/tmpSingleSiteBethe.output.h5 +./tools/h5diff/testfiles/tudfilter.h5 +./tools/h5diff/testfiles/tudfilter2.h5 +./tools/h5diff/testfiles/h5diff_ud.txt +./tools/h5diff/testfiles/h5diff_udfail.txt #test files for h5repack ./tools/h5repack/testfiles/README diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index 5095a27..85b1c6c 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -10,21 +10,21 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - set (MACRO_CHECK_TYPE_SIZE_FLAGS + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) if ("${def}") set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") - endif ("${def}") - endforeach (def) + endif () + endforeach () message (STATUS "Check size of ${TYPE}") if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_TYPE_SIZE_ADD_LIBRARIES + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () try_run (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c @@ -35,16 +35,16 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) if (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - done") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - else (HAVE_${VARIABLE}) + else () message (STATUS "Check size of ${TYPE} - failed") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - endif (HAVE_${VARIABLE}) - endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + endif () + endif () set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -ENDMACRO (HDF_CHECK_TYPE_SIZE) +ENDMACRO () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 9589295..1872cd5 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -11,9 +11,9 @@ include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -if(CMAKE_CXX_COMPILER) +if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) -endif(CMAKE_CXX_COMPILER) +endif () #----------------------------------------------------------------------------- # APPLE/Darwin setup @@ -28,17 +28,17 @@ if (APPLE) "variable has been set to a blank value which will build the default architecture for this system.") endif () set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif (APPLE) +endif () # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) -endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +endif () # Check for Solaris if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (${HDF_PREFIX}_HAVE_SOLARIS 1) -endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +endif () #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it @@ -49,8 +49,8 @@ MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) if (${VARIABLE}) set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - endif (${VARIABLE}) -ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + endif () +ENDMACRO () # ---------------------------------------------------------------------- # WINDOWS Hard code Values @@ -62,7 +62,7 @@ if (WIN32) set (${HDF_PREFIX}_HAVE_MINGW 1) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - endif (MINGW) + endif () set (${HDF_PREFIX}_HAVE_WIN32_API 1) set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") if (NOT UNIX AND NOT MINGW) @@ -70,9 +70,9 @@ if (WIN32) set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") if (MSVC) set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1) - endif (MSVC) - endif (NOT UNIX AND NOT MINGW) -endif (WIN32) + endif () + endif () +endif () if (WINDOWS) set (${HDF_PREFIX}_HAVE_STDDEF_H 1) @@ -84,20 +84,20 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_LONGJMP 1) if (NOT MINGW) set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) - endif (NOT MINGW) + endif () if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) - endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + endif () set (${HDF_PREFIX}_HAVE_FUNCTION 1) set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) set (${HDF_PREFIX}_HAVE_TIMEZONE 1) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) if (MINGW) set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) - endif (MINGW) + endif () set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) -endif (WINDOWS) +endif () # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -105,7 +105,7 @@ endif (WINDOWS) if (CYGWIN) set (${HDF_PREFIX}_HAVE_LSEEK64 0) -endif (CYGWIN) +endif () #----------------------------------------------------------------------------- # Check for the math library "m" @@ -115,7 +115,7 @@ if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) -endif (NOT WINDOWS) +endif () # UCB (BSD) compatibility library CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) @@ -126,11 +126,11 @@ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) set (USE_INCLUDES "") if (WINDOWS) set (USE_INCLUDES ${USE_INCLUDES} "windows.h") -endif (WINDOWS) +endif () if (NOT WINDOWS) TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) -endif (NOT WINDOWS) +endif () # For other specific tests, use this MACRO. MACRO (HDF_FUNCTION_TEST OTHER_TEST) @@ -139,7 +139,7 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif (CMAKE_REQUIRED_LIBRARIES) + endif () foreach (def HAVE_SYS_TIME_H @@ -149,14 +149,14 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif ("${${HDF_PREFIX}_${def}}") - endforeach (def) + endif () + endforeach () if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -169,16 +169,16 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") message (STATUS "Performing Other Test ${OTHER_TEST} - Success") - else (${OTHER_TEST}) + else () message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif (${OTHER_TEST}) - endif ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") -ENDMACRO (HDF_FUNCTION_TEST) + endif () + endif () +ENDMACRO () #----------------------------------------------------------------------------- # Check for these functions before the time headers are checked @@ -192,8 +192,8 @@ MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) if (${VARIABLE}) set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - endif (${VARIABLE}) -ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) + endif () +ENDMACRO () #----------------------------------------------------------------------------- # Check for the existence of certain header files @@ -219,8 +219,8 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - endif (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) -endif (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + endif () +endif () # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) @@ -229,16 +229,16 @@ CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_ CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) -endif (NOT CYGWIN) +endif () CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) -else (CMAKE_SYSTEM_NAME MATCHES "OSF") +else () set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -endif (CMAKE_SYSTEM_NAME MATCHES "OSF") +endif () CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) @@ -295,29 +295,29 @@ if (NOT WINDOWS) # check should be generalized for all POSIX systems as it # is in the Autotools. if (TEST_LFS_WORKS_COMPILE) - if (TEST_LFS_WORKS_RUN MATCHES 0) + if (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) message (STATUS "${msg}... yes") - else (TEST_LFS_WORKS_RUN MATCHES 0) + else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif (TEST_LFS_WORKS_RUN MATCHES 0) - else (TEST_LFS_WORKS_COMPILE ) + endif () + else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - endif (TEST_LFS_WORKS_COMPILE) - endif (HDF_ENABLE_LARGE_FILE) + endif () + endif () set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) - endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN) -endif (NOT WINDOWS) + endif () +endif () add_definitions (${HDF_EXTRA_FLAGS}) @@ -331,7 +331,7 @@ if (NOT WINDOWS OR MINGW) CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64) CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64) CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64) - endif (${HDF_PREFIX}_HAVE_OFF64_T) + endif () CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO) @@ -340,8 +340,8 @@ if (NOT WINDOWS OR MINGW) if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) - endif (HAVE_STAT64_STRUCT) -endif (NOT WINDOWS OR MINGW) + endif () +endif () #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types @@ -354,8 +354,8 @@ MACRO (HDF_CHECK_TYPE_SIZE type var) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") # message (STATUS "Size of ${aType} was NOT Found") - endif (NOT ${aVar}) -ENDMACRO (HDF_CHECK_TYPE_SIZE) + endif () +ENDMACRO () HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR) HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT) @@ -363,12 +363,12 @@ HDF_CHECK_TYPE_SIZE (int ${HDF_PREFIX}_SIZEOF_INT) HDF_CHECK_TYPE_SIZE (unsigned ${HDF_PREFIX}_SIZEOF_UNSIGNED) if (NOT APPLE) HDF_CHECK_TYPE_SIZE (long ${HDF_PREFIX}_SIZEOF_LONG) -endif (NOT APPLE) +endif () HDF_CHECK_TYPE_SIZE ("long long" ${HDF_PREFIX}_SIZEOF_LONG_LONG) HDF_CHECK_TYPE_SIZE (__int64 ${HDF_PREFIX}_SIZEOF___INT64) if (NOT ${HDF_PREFIX}_SIZEOF___INT64) set (${HDF_PREFIX}_SIZEOF___INT64 0) -endif (NOT ${HDF_PREFIX}_SIZEOF___INT64) +endif () HDF_CHECK_TYPE_SIZE (float ${HDF_PREFIX}_SIZEOF_FLOAT) HDF_CHECK_TYPE_SIZE (double ${HDF_PREFIX}_SIZEOF_DOUBLE) @@ -407,17 +407,17 @@ if (NOT APPLE) HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) - endif (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + endif () if (NOT WINDOWS) HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) - endif (NOT WINDOWS) -endif (NOT APPLE) + endif () +endif () HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) -endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) +endif () #----------------------------------------------------------------------------- # Extra C99 types @@ -428,9 +428,9 @@ CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) if (HAVE_STDBOOL_H) set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) -else (HAVE_STDBOOL_H) +else () HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) -endif (HAVE_STDBOOL_H) +endif () if (NOT WINDOWS) #----------------------------------------------------------------------------- @@ -459,11 +459,11 @@ if (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF_FUNCTION_TEST (${test}) - endforeach (test) + endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) # HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - endif (NOT CYGWIN AND NOT MINGW) + endif () # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -481,7 +481,7 @@ if (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO) - endif (NOT CYGWIN AND NOT MINGW) + endif () CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD) @@ -490,23 +490,31 @@ if (NOT WINDOWS) # if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) - endif (NOT CYGWIN AND NOT MINGW) -endif (NOT WINDOWS) + endif () +endif () #----------------------------------------------------------------------------- # Check for some functions that are used # CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM) +CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL) +CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK) CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK) CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF) CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL) CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME) CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE) +CHECK_FUNCTION_EXISTS (llround ${HDF_PREFIX}_HAVE_LLROUND) +CHECK_FUNCTION_EXISTS (llroundf ${HDF_PREFIX}_HAVE_LLROUNDF) +CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND) +CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF) CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT) CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R) CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM) +CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND) +CHECK_FUNCTION_EXISTS (roundf ${HDF_PREFIX}_HAVE_ROUNDF) CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO) CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL) @@ -531,8 +539,8 @@ CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF) if (NOT WINDOWS) if (${HDF_PREFIX}_HAVE_VSNPRINTF) HDF_FUNCTION_TEST (VSNPRINTF_WORKS) - endif (${HDF_PREFIX}_HAVE_VSNPRINTF) -endif (NOT WINDOWS) + endif () +endif () #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro @@ -542,9 +550,9 @@ if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) - endif (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) - endif (${HDF_PREFIX}_HAVE_SETJMP_H) -endif (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Check a bunch of other functions @@ -558,11 +566,10 @@ if (NOT WINDOWS) HAVE_C99_DESIGNATED_INITIALIZER SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T - CXX_HAVE_OFFSETOF ) HDF_FUNCTION_TEST (${test}) - endforeach (test) -endif (NOT WINDOWS) + endforeach () +endif () # For other CXX specific tests, use this MACRO. MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) @@ -571,7 +578,7 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif (CMAKE_REQUIRED_LIBRARIES) + endif () foreach (def HAVE_SYS_TIME_H @@ -581,14 +588,14 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif ("${${HDF_PREFIX}_${def}}") - endforeach (def) + endif () + endforeach () if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -601,16 +608,16 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - else (${OTHER_TEST} EQUAL 0) + else () message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif (${OTHER_TEST} EQUAL 0) - endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") -ENDMACRO (HDF_CXX_FUNCTION_TEST) + endif () + endif () +ENDMACRO () #----------------------------------------------------------------------------- # Check a bunch of cxx functions @@ -622,10 +629,11 @@ if (CMAKE_CXX_COMPILER_LOADED) ${HDF_PREFIX}_NO_STD BOOL_NOTDEFINED NO_STATIC_CAST + CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${test}) - endforeach (test) -endif (CMAKE_CXX_COMPILER_LOADED) + endforeach () +endif () #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available @@ -638,21 +646,21 @@ if (WINDOWS) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () if (CMAKE_REQUIRED_INCLUDES) set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else (CMAKE_REQUIRED_INCLUDES) + else () set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif (CMAKE_REQUIRED_INCLUDES) + endif () TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -666,7 +674,7 @@ if (WINDOWS) # if it did not compile make the return value fail code of 1 if (NOT HAVE_IOEO_COMPILED) set (HAVE_IOEO_EXITCODE 1) - endif (NOT HAVE_IOEO_COMPILED) + endif () # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") @@ -675,22 +683,22 @@ if (WINDOWS) "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + else () if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + else () set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + endif () message (STATUS "Performing Test InitOnceExecuteOnce - Failed") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) - endif ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") - endif (NOT HDF_NO_IOEO_TEST) -endif (WINDOWS) + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Determine how 'inline' is used @@ -698,7 +706,7 @@ endif (WINDOWS) foreach (inline_test inline __inline__ __inline) string (TOUPPER ${inline_test} INLINE_TEST_MACRO) HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO}) -endforeach (inline_test) +endforeach () #----------------------------------------------------------------------------- # Check how to print a Long Long integer @@ -709,7 +717,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) + endif () TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -721,24 +729,24 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) - else (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + else () message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") - endif (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) - else (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + endif () + else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" ) - endif (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + endif () if (PRINT_LL_FOUND) message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") - else (PRINT_LL_FOUND) + else () message (STATUS "Checking for appropriate format for 64 bit long: not found") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - endif (PRINT_LL_FOUND) -endif (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") + endif () +endif () # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 5f0f031..1709c2b 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -32,38 +32,37 @@ MACRO (SZIP_ADJUST_LIB_VARS basename) set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + endif () # if only the debug version was found, set the release variable also to the debug version if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + endif () if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + else () # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif () set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + endif () set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") if (${basename}_LIBRARY) set (${basename}_FOUND 1) - endif (${basename}_LIBRARY) - - endif (${basename}_INCLUDE_DIR ) + endif () + endif () # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) -ENDMACRO (SZIP_ADJUST_LIB_VARS) +ENDMACRO () # Look for the header file. @@ -93,10 +92,10 @@ FIND_PATH (SZIP_INCLUDE_DIR if (WIN32) set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -else (WIN32) +else () set (SZIP_SEARCH_DEBUG_NAMES "sz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -endif (WIN32) +endif () # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -120,16 +119,15 @@ if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) if (SZIP_LIBRARY_DEBUG) get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - elseif (SZIP_LIBRARY_RELEASE) + elseif () get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - endif (SZIP_LIBRARY_DEBUG) - -else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + endif () +else () set (SZIP_FOUND 0) set (SZIP_LIBRARIES) set (SZIP_INCLUDE_DIRS) -endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) +endif () # Report the results. if (NOT SZIP_FOUND) @@ -138,12 +136,12 @@ if (NOT SZIP_FOUND) ) if (NOT SZIP_FIND_QUIETLY) message (STATUS "${SZIP_DIR_MESSAGE}") - else (NOT SZIP_FIND_QUIETLY) + else () if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") - endif (SZIP_FIND_REQUIRED) - endif (NOT SZIP_FIND_QUIETLY) -endif (NOT SZIP_FOUND) + endif () + endif () +endif () if (SZIP_FOUND) include (CheckSymbolExists) @@ -161,7 +159,7 @@ if (SZIP_FOUND) set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -endif (SZIP_FOUND) +endif () if (FIND_SZIP_DEBUG) message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") @@ -169,4 +167,4 @@ if (FIND_SZIP_DEBUG) message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -endif (FIND_SZIP_DEBUG) +endif () diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index 6b47421..f5f6644 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -54,3 +54,38 @@ int main(void) { } #endif + +#ifdef CXX_HAVE_OFFSETOF + +#include +#include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} + +#endif diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2145a3d..7d19b7a 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -51,7 +51,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -68,13 +68,13 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) add_dependencies (JPEG jpeg-shared) set (JPEG_SHARED_LIBRARY "jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") set (JPEG_FOUND 1) set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) -endmacro (EXTERNAL_JPEG_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_JPEG_LIBRARY compress_type) @@ -85,8 +85,8 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_JPEG_LIBRARY) + endif () +endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) @@ -141,7 +141,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -158,13 +158,13 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) add_dependencies (SZIP szip-shared) set (SZIP_SHARED_LIBRARY "szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") set (SZIP_FOUND 1) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) -endmacro (EXTERNAL_SZIP_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_SZIP_LIBRARY compress_type) @@ -175,8 +175,8 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_SZIP_LIBRARY) + endif () +endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) @@ -228,14 +228,14 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) if (WIN32) set (ZLIB_LIB_NAME "zlib") - else (WIN32) + else () set (ZLIB_LIB_NAME "z") - endif (WIN32) + endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static add_library(zlib-static STATIC IMPORTED) @@ -250,13 +250,13 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) add_dependencies (ZLIB zlib-shared) set (ZLIB_SHARED_LIBRARY "zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") set (ZLIB_FOUND 1) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) -endmacro (EXTERNAL_ZLIB_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_ZLIB_LIBRARY compress_type) @@ -267,5 +267,5 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_ZLIB_LIBRARY) + endif () +endmacro () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 1d6b49a..67a92d1 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) -endmacro (SET_GLOBAL_VARIABLE) +endmacro () #------------------------------------------------------------------------------- macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -14,7 +14,7 @@ macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro (IDE_GENERATED_PROPERTIES) +endmacro () #------------------------------------------------------------------------------- macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -31,14 +31,14 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro (IDE_SOURCE_PROPERTIES) +endmacro () #------------------------------------------------------------------------------- macro (TARGET_NAMING libtarget libtype) if (${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") - endif (${libtype} MATCHES "SHARED") -endmacro (TARGET_NAMING) + endif () +endmacro () #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) @@ -52,8 +52,8 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif (WIN32 AND MSVC) -endmacro (INSTALL_TARGET_PDB) + endif () +endmacro () #------------------------------------------------------------------------------- macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) @@ -68,8 +68,8 @@ macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif (WIN32 AND MSVC) -endmacro (INSTALL_PROGRAM_PDB) + endif () +endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) @@ -77,19 +77,19 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) if (WIN32) set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_D") - else (WIN32) + else () set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif (WIN32) - else (${libtype} MATCHES "SHARED") + endif () + else () if (WIN32) set (LIB_RELEASE_NAME "lib${libname}") set (LIB_DEBUG_NAME "lib${libname}_D") - else (WIN32) + else () set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif (WIN32) - endif (${libtype} MATCHES "SHARED") + endif () + endif () set_target_properties (${libtarget} PROPERTIES @@ -107,9 +107,9 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) IMPORT_PREFIX "" PREFIX "" ) - endif (MINGW AND ${libtype} MATCHES "SHARED") + endif () -endmacro (HDF_SET_LIB_OPTIONS) +endmacro () #------------------------------------------------------------------------------- macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) @@ -117,12 +117,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") - endif (${importtype} MATCHES "IMPORT") + endif () if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) - else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) - endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") + endif () if (${libtype} MATCHES "SHARED") if (WIN32) @@ -131,54 +131,54 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else (MINGW) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - endif (MINGW) - else (WIN32) + endif () + else () if (CYGWIN) set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else (CYGWIN) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${libversion}" SOVERSION "${libversion}" ) - endif (CYGWIN) - endif (WIN32) - else (${libtype} MATCHES "SHARED") + endif () + endif () + else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - else (WIN32 AND NOT MINGW) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - endif (WIN32 AND NOT MINGW) - endif (${libtype} MATCHES "SHARED") + endif () + endif () -endmacro (HDF_IMPORT_SET_LIB_OPTIONS) +endmacro () #------------------------------------------------------------------------------- macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - else (MSVC) + else () set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - endif (MSVC) -endmacro (TARGET_C_PROPERTIES) + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) @@ -188,15 +188,15 @@ macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - endif (MSVC) -endmacro (TARGET_MSVC_PROPERTIES) + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - endif (WIN32) -endmacro (TARGET_FORTRAN_PROPERTIES) + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) @@ -207,15 +207,15 @@ macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkf COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - else (${libtype} MATCHES "SHARED") + else () set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - endif (${libtype} MATCHES "SHARED") - endif (MSVC) -endmacro (TARGET_FORTRAN_WIN_PROPERTIES) + endif () + endif () +endmacro () #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -228,16 +228,16 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_INSTALL_ENDING "msi") if (CMAKE_CL_64) set (BINARY_SYSTEM_NAME "win64") - else (CMAKE_CL_64) + else () set (BINARY_SYSTEM_NAME "win32") - endif (CMAKE_CL_64) + endif () if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.3") set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") - endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + endif () set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") @@ -249,36 +249,36 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") - else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") - endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + endif () elseif (APPLE) set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "dmg") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - else (WIN32) + else () set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "sh") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - endif (WIN32) + endif () if (target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") - endif (target_fortran) + endif () if (BUILD_SHARED_LIBS) set (LIB_TYPE "Static and Shared") - else (BUILD_SHARED_LIBS) + else () set (LIB_TYPE "Static") - endif (BUILD_SHARED_LIBS) + endif () configure_file ( ${HDF_RESOURCES_DIR}/README.txt.cmake.in ${CMAKE_BINARY_DIR}/README.txt @ONLY ) -endmacro (HDF_README_PROPERTIES) +endmacro () macro (HDFTEST_COPY_FILE src dest target) add_custom_command( diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 8478d1b..648f795 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -389,55 +389,20 @@ int main(void) } #endif -#ifdef CXX_HAVE_OFFSETOF - -#include -#include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus -extern "C" -# endif -int FC_DUMMY_MAIN() -{ return 1;} -#endif -#endif -int -main () -{ - - struct index_st - { - unsigned char type; - unsigned char num; - unsigned int len; - }; - typedef struct index_st index_t; - int x,y; - x = offsetof(struct index_st, len); - y = offsetof(index_t, num) - - ; - return 0; -} - -#endif - #ifdef HAVE_IOEO #include typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); int main () { - PGNSI pGNSI; - pGNSI = (PGNSI) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), + PGNSI pGNSI; + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), "InitOnceExecuteOnce"); - if(NULL == pGNSI) - return 1; - else - return 0; + if(NULL == pGNSI) + return 1; + else + return 0; } #endif /* HAVE_IOEO */ diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 275f2ea..6a81e3a 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -31,9 +31,9 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 "${CODE}" @@ -63,8 +63,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif () - -ENDMACRO (CHECK_FORTRAN_FEATURE) +ENDMACRO () #----------------------------------------------------------------------------- # Configure Checks which require Fortran compilation must go in here @@ -75,7 +74,7 @@ ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- # Check for Non-standard extension intrinsic function SIZEOF -set(FORTRAN_HAVE_SIZEOF FALSE) +set (FORTRAN_HAVE_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(sizeof " PROGRAM main @@ -86,7 +85,7 @@ CHECK_FORTRAN_FEATURE(sizeof ) # Check for F2008 standard intrinsic function C_SIZEOF -set(FORTRAN_HAVE_C_SIZEOF FALSE) +set (FORTRAN_HAVE_C_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(c_sizeof " PROGRAM main @@ -112,7 +111,7 @@ CHECK_FORTRAN_FEATURE(storage_size ) # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" -set(HAVE_ISO_FORTRAN_ENV FALSE) +set (HAVE_ISO_FORTRAN_ENV FALSE) CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV " PROGRAM main @@ -122,7 +121,7 @@ CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV HAVE_ISO_FORTRAN_ENV ) -set(FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) +set (FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) CHECK_FORTRAN_FEATURE(RealIsNotDouble " MODULE type_mod @@ -152,7 +151,7 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble #----------------------------------------------------------------------------- # Checks if the ISO_C_BINDING module meets all the requirements #----------------------------------------------------------------------------- -set(FORTRAN_HAVE_ISO_C_BINDING FALSE) +set (FORTRAN_HAVE_ISO_C_BINDING FALSE) CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main @@ -175,5 +174,5 @@ if (CMAKE_Fortran_COMPILER MATCHES ifort) if (WIN32) set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - endif (WIN32) -endif (CMAKE_Fortran_COMPILER MATCHES ifort) + endif () +endif () diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index a090057..31c8421 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -4,25 +4,25 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) +endif () #if (NOT TEST_ARGS) # message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) +#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif (NOT TEST_OUTPUT) +endif () #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +#endif () if (NOT TEST_FILTER) message (STATUS "Require TEST_FILTER to be defined") -endif (NOT TEST_FILTER) +endif () if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_REFERENCE) +endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") @@ -48,7 +48,7 @@ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -endif (${TEST_RESULT} STREQUAL "0") +endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") @@ -56,8 +56,8 @@ if (${TEST_EXPECT} STREQUAL "1") string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif (NOT ${TEST_RESULT} STREQUAL "0") -endif (${TEST_EXPECT} STREQUAL "1") + endif () +endif () # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake_ext_mod/prunTest.cmake b/config/cmake_ext_mod/prunTest.cmake deleted file mode 100644 index 38ecb7e..0000000 --- a/config/cmake_ext_mod/prunTest.cmake +++ /dev/null @@ -1,145 +0,0 @@ -# runTest.cmake executes a command and captures the output in a file. File is then compared -# against a reference file. Exit status of command can also be compared. -cmake_policy(SET CMP0007 NEW) - -# arguments checking -if (NOT TEST_PROGRAM) - message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) -if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) -if (NOT TEST_OUTPUT) - message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif (NOT TEST_OUTPUT) -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif (NOT TEST_FILTER) -if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -set (ERROR_APPEND 1) - -message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -if (TEST_ENV_VAR) - set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -endif (TEST_ENV_VAR) - -# run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( - COMMAND ${TEST_PROGRAM} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR -) - -message (STATUS "COMMAND Result: ${TEST_RESULT}") - -file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) -file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - -if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - -if (TEST_APPEND) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -endif (TEST_APPEND) - -message (STATUS "COMMAND Error: ${TEST_ERROR}") - -if (TEST_MASK) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK) - -if (TEST_MASK_MOD) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK_MOD) - -if (TEST_MASK_ERROR) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK_ERROR) - -if (TEST_FILTER) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_FILTER) - -#if (TEST_REF_FILTER) -# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") -# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) -# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") -# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#endif (TEST_REF_FILTER) - -if (NOT TEST_SKIP_COMPARE) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - endif (WIN32 AND NOT MINGW) - - # now compare the output with the reference - EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - LIST (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) - LIST (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") - MATH (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - LIST (GET test_act ${line} str_act) - LIST (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif (NOT "${str_act}" STREQUAL "") - endif (NOT "${str_act}" STREQUAL "${str_ref}") - endforeach (line RANGE 0 ${_FP_LEN}) - endif (NOT ${len_act} STREQUAL "0") - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif (NOT ${len_act} STREQUAL ${len_ref}) - endif (NOT ${TEST_RESULT} STREQUAL 0) - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - endif (NOT ${TEST_RESULT} STREQUAL 0) -endif (NOT TEST_SKIP_COMPARE) - -# everything went fine... -message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") - diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 1d8b12e..804c80f 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -6,9 +6,6 @@ cmake_policy(SET CMP0007 NEW) if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") endif () @@ -18,9 +15,6 @@ endif () if (NOT TEST_EXPECT) message (STATUS "Require TEST_EXPECT to be defined") endif () -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif () if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") endif () @@ -69,6 +63,16 @@ else () ) endif () +if (TEST_REGEX) + # TEST_REGEX should always be matched + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) + if (${REGEX_RESULT} STREQUAL "0") + message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") + endif () +endif () + message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled @@ -84,7 +88,13 @@ endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + message (STATUS "Output :\n${TEST_STREAM}") + endif() + endif() + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -125,7 +135,7 @@ if (TEST_MASK_ERROR) else () file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") endif () -endif (TEST_MASK_ERROR) +endif () # remove text from the output file if (TEST_FILTER) @@ -175,7 +185,7 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () - endif (NOT ${TEST_RESULT} STREQUAL 0) + endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -214,7 +224,7 @@ if (NOT TEST_SKIP_COMPARE) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () - endforeach (line RANGE 0 ${_FP_LEN}) + endforeach () else () if (${len_act} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") @@ -234,8 +244,8 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () - endif (TEST_ERRREF) -endif (NOT TEST_SKIP_COMPARE) + endif () +endif () # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/configure b/configure index 8958ff1..954d612 100755 --- a/configure +++ b/configure @@ -30717,7 +30717,7 @@ else fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5repack/h5repack_plugin.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile tools/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/h5dump_plugin.sh tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/Makefile tools/h5ls/h5ls_plugin.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/h5diff_plugin.sh tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5repack/h5repack_plugin.sh tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile tools/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" cat >confcache <<\_ACEOF @@ -31999,13 +31999,17 @@ do "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; + "tools/h5dump/h5dump_plugin.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/h5dump_plugin.sh" ;; "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; + "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; + "tools/h5ls/h5ls_plugin.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/h5ls_plugin.sh" ;; "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; "tools/h5import/h5importtestutil.sh") CONFIG_FILES="$CONFIG_FILES tools/h5import/h5importtestutil.sh" ;; "tools/h5diff/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5diff/Makefile" ;; + "tools/h5diff/h5diff_plugin.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/h5diff_plugin.sh" ;; "tools/h5diff/testh5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testh5diff.sh" ;; "tools/h5diff/testph5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testph5diff.sh" ;; "tools/h5jam/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5jam/Makefile" ;; @@ -32013,7 +32017,6 @@ do "tools/h5repack/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5repack/Makefile" ;; "tools/h5repack/h5repack.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack.sh" ;; "tools/h5repack/h5repack_plugin.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack_plugin.sh" ;; - "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; "tools/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5copy/Makefile" ;; "tools/h5copy/testh5copy.sh") CONFIG_FILES="$CONFIG_FILES tools/h5copy/testh5copy.sh" ;; "tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;; diff --git a/configure.ac b/configure.ac index 42295a1..28a3c8a 100644 --- a/configure.ac +++ b/configure.ac @@ -2929,13 +2929,17 @@ AC_CONFIG_FILES([src/libhdf5.settings testpar/Makefile tools/Makefile tools/h5dump/Makefile + tools/h5dump/h5dump_plugin.sh tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh + tools/h5ls/Makefile + tools/h5ls/h5ls_plugin.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile + tools/h5diff/h5diff_plugin.sh tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile @@ -2943,7 +2947,6 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5repack/h5repack_plugin.sh - tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 5876045..fcb1a30 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5DIFF) #----------------------------------------------------------------------------- @@ -45,7 +45,35 @@ if (BUILD_TESTING) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5diffgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () + + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) include (CMakeTests.cmake) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index f2a7ab3..91e0cab 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -50,6 +50,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 ) set (LIST_OTHER_TEST_FILES @@ -227,6 +229,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt ) set (LIST_WIN_TEST_FILES @@ -238,6 +242,9 @@ # Make testfiles dir under build dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (H5_HAVE_PARALLEL) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") + endif () # # copy test files from source to build dir @@ -245,6 +252,9 @@ foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") + endif () endforeach () @@ -255,11 +265,17 @@ foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () else () foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) @@ -281,12 +297,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err - ) + else () add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -299,78 +310,85 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) endif () - ENDMACRO (ADD_H5_TEST file) + ENDMACRO () MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME PH5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err - ) + else () add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=P_${resultfile}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" # -D "TEST_APPEND=EXIT CODE: [0-9]" # -D "TEST_REF_FILTER=EXIT CODE: 0" -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF_RESOURCES_EXT_DIR}/prunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_PH5_TEST file) - - # ADD_H5_NO_OUTPUT_TEST - # Purpose to verify only exitcode without output comparison - # Don't use this if possible; this may be removed. - MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) - # If using memchecker add tests without using scripts + endif () + ENDMACRO () + + MACRO (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run add_test ( - NAME H5DIFF-${testname}-clear-objects + NAME H5DIFF_UD-${testname}-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err ) - # if there was a previous test - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + if (${resultcode} STREQUAL "2") + add_test ( + NAME H5DIFF_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5DIFF_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) endif () - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - - add_test (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) - if (NOT ${resultcode} STREQUAL "0") - set_tests_properties (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) endif () - - if (HDF5_ENABLE_USING_MEMCHECKER) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else (HDF5_ENABLE_USING_MEMCHECKER) - set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_NO_OUTPUT_TEST) + ENDMACRO () ############################################################################## ############################################################################## @@ -784,9 +802,9 @@ set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DIFF-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # ############################################################################ # # Common usage @@ -1357,3 +1375,9 @@ ADD_H5_TEST (h5diff_643 1 -v -d 5 --use-system-epsilon ${FILE1} ${FILE2} /g1/dse ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) + +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) +ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) diff --git a/tools/h5diff/Makefile.am b/tools/h5diff/Makefile.am index 7e3b620..0d01f14 100644 --- a/tools/h5diff/Makefile.am +++ b/tools/h5diff/Makefile.am @@ -44,6 +44,11 @@ check_PROGRAMS=$(TEST_PROG) check_SCRIPTS=$(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. SCRIPT_DEPEND=h5diff$(EXEEXT) $(H5PDIFF) testh5diff.sh +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5diff_plugin.sh +endif +endif # Source files for the program h5diff_SOURCES=h5diff_main.c h5diff_common.c @@ -53,9 +58,20 @@ h5diffgentest_SOURCES=h5diffgentest.c # Programs depend on the main HDF5 library and tools library LDADD=$(LIBH5TOOLS) $(LIBHDF5) +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibdiff.la + libdynlibdiff_la_SOURCES=dynlib_diff.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + # Temporary files. *.h5 are generated by h5diff. They should # be copied to the testfiles/ directory if update is required CHECK_CLEANFILES+=*.h5 expect_sorted actual_sorted +DISTCLEANFILES=h5diff_plugin.sh + include $(top_srcdir)/config/conclude.am diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 92ec96d..a6bb1d1 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -31,6 +31,7 @@ # HDF5 Library Makefile(.in) # + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -107,6 +108,7 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = h5diff$(EXEEXT) $(am__EXEEXT_1) check_PROGRAMS = $(am__EXEEXT_2) +@HAVE_SHARED_CONDITIONAL_TRUE@@USE_PLUGINS_CONDITIONAL_TRUE@am__append_1 = h5diff_plugin.sh TESTS = $(am__EXEEXT_2) $(TEST_SCRIPT) subdir = tools/h5diff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -117,20 +119,55 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testh5diff.sh testph5diff.sh +CONFIG_CLEAN_FILES = h5diff_plugin.sh testh5diff.sh testph5diff.sh CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libdynlibdiff_la_LIBADD = +am__libdynlibdiff_la_SOURCES_DIST = dynlib_diff.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdiff_la_OBJECTS = \ +@HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_diff.lo +libdynlibdiff_la_OBJECTS = $(am_libdynlibdiff_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdiff_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) @BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = ph5diff$(EXEEXT) -am__installdirs = "$(DESTDIR)$(bindir)" am__EXEEXT_2 = h5diffgentest$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_h5diff_OBJECTS = h5diff_main.$(OBJEXT) h5diff_common.$(OBJEXT) h5diff_OBJECTS = $(am_h5diff_OBJECTS) h5diff_LDADD = $(LDADD) h5diff_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = h5diff_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(h5diff_LDFLAGS) $(LDFLAGS) -o $@ @@ -176,10 +213,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(h5diff_SOURCES) $(h5diffgentest_SOURCES) \ - $(ph5diff_SOURCES) -DIST_SOURCES = $(h5diff_SOURCES) $(h5diffgentest_SOURCES) \ - $(ph5diff_SOURCES) +SOURCES = $(libdynlibdiff_la_SOURCES) $(h5diff_SOURCES) \ + $(h5diffgentest_SOURCES) $(ph5diff_SOURCES) +DIST_SOURCES = $(am__libdynlibdiff_la_SOURCES_DIST) $(h5diff_SOURCES) \ + $(h5diffgentest_SOURCES) $(ph5diff_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -226,33 +263,6 @@ am__tty_colors = { \ std=''; \ fi; \ } -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -406,10 +416,10 @@ am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.sh.log=.log) SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/testh5diff.sh.in \ - $(srcdir)/testph5diff.sh.in $(top_srcdir)/bin/depcomp \ - $(top_srcdir)/bin/mkinstalldirs $(top_srcdir)/bin/test-driver \ - $(top_srcdir)/config/commence.am \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5diff_plugin.sh.in \ + $(srcdir)/testh5diff.sh.in $(srcdir)/testph5diff.sh.in \ + $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ + $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -696,7 +706,7 @@ h5diff_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Test programs and scripts TEST_PROG = h5diffgentest -TEST_SCRIPT = testh5diff.sh +TEST_SCRIPT = testh5diff.sh $(am__append_1) check_SCRIPTS = $(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. SCRIPT_DEPEND = h5diff$(EXEEXT) $(H5PDIFF) testh5diff.sh @@ -708,6 +718,9 @@ h5diffgentest_SOURCES = h5diffgentest.c # Programs depend on the main HDF5 library and tools library LDADD = $(LIBH5TOOLS) $(LIBHDF5) +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdiff.la +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff_la_SOURCES = dynlib_diff.c +DISTCLEANFILES = h5diff_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -762,10 +775,50 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +h5diff_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5diff_plugin.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5diff.sh: $(top_builddir)/config.status $(srcdir)/testh5diff.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testph5diff.sh: $(top_builddir)/config.status $(srcdir)/testph5diff.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -843,6 +896,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_diff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5diff_common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5diff_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5diffgentest.Po@am__quote@ @@ -1113,9 +1167,11 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1147,14 +1203,16 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool mostlyclean-am + clean-libLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1180,8 +1238,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS - +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1220,25 +1279,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libtool cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic \ + clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS + uninstall-binPROGRAMS uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -1254,6 +1314,11 @@ uninstall-am: uninstall-binPROGRAMS help: @$(top_srcdir)/bin/makehelp +@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/tools/h5diff/dynlib_diff.c b/tools/h5diff/dynlib_diff.c new file mode 100644 index 0000000..0d8be2b --- /dev/null +++ b/tools/h5diff/dynlib_diff.c @@ -0,0 +1,94 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Divide the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Multiply the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib2() */ + diff --git a/tools/h5diff/h5diff_plugin.sh.in b/tools/h5diff/h5diff_plugin.sh.in new file mode 100644 index 0000000..3f39d4c --- /dev/null +++ b/tools/h5diff/h5diff_plugin.sh.in @@ -0,0 +1,299 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# 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 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. +# +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +# Determine backward compatibility options enabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +H5DIFF=h5diff # The tool name +H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary + +nerrors=0 +verbose=yes +h5haveexitcode=yes # default is yes + +TEST_NAME=h5diff_ud_plugin +FROM_DIR=`pwd`/.libs +PLUGIN_LIB="$FROM_DIR/libdynlibdiff.*" +PLUGIN_LIBDIR=testdir3 + +RM='rm -rf' +CMP='cmp -s' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +# source dirs +SRC_TOOLS="$srcdir/.." + +# testfiles source dirs for tools +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" + +TESTDIR=./testplug +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5DIFF_TESTFILES/tudfilter.h5 +$SRC_H5DIFF_TESTFILES/tudfilter2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_ud.txt +$SRC_H5DIFF_TESTFILES/h5diff_udfail.txt +" + +# Main Body +# Create test directories if not exists yet. +test -d $PLUGIN_LIBDIR || mkdir -p $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR)" + exit $EXIT_FAILURE +fi + +# copy plugin library for test +$CP $PLUGIN_LIB $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB) for test." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_TESTFILES_AND_TESTDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=$SRC_H5DIFF_TESTFILES + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $TESTDIR + fi +} + +# Parse option +# -p run ph5diff tests +# -h print help page +while [ $# -gt 0 ]; do + case "$1" in + -p) # reset the tool name and bin to run ph5diff tests + TESTNAME=ph5diff + H5DIFF=ph5diff # The tool name + H5DIFF_BIN=`pwd`/$H5DIFF + pmode=yes + shift + ;; + -h) # print help page + echo "$0 [-p] [-h]" + echo " -p run ph5diff tests" + echo " -h print help page" + shift + exit 0 + ;; + *) # unknown option + echo "$0: Unknown option ($1)" + exit 1 + ;; + esac +done + +# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell corretly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + +# Run a test and print PASS or *FAIL*. If a test fails then increment +# the `nerrors' global variable and (if $verbose is set) display the +# difference between the actual output and the expected output. The +# expected output is given as the first argument to this function and +# the actual output file is calculated by replacing the `.ddl' with +# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a +# non-zero value. +# +# Need eval before the RUNCMD command because some machines like +# AIX, has RUNPARALLEL in the style as +# MP_PROCS=3 MP_TASKS_PER_NODE=3 poe ./a.out +# that throws the shell script off. +# +TOOLTEST() { + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .txt`.out" + actual_err="$TESTDIR/`basename $1 .txt`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + if test -n "$pmode"; then + RUNCMD=$RUNPARALLEL + else + RUNCMD=$RUNSERIAL + fi + + # Run test. + TESTING $H5DIFF $@ + ( + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + ) >$actual 2>$actual_err + EXIT_CODE=$? + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + cat $actual_err >> $actual + # don't add exit code check in pmode, as it causes failure. (exit code + # is from mpirun not tool) + # if any problem occurs relate to an exit code, it will be caught in + # serial mode, so the test is fullfilled. + if test $h5haveexitcode = 'yes' -a -z "$pmode"; then + echo "EXIT CODE: $EXIT_CODE" >> $actual + fi + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + echo " PASSED" + elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then + echo "*FAILED*" + echo " Expected result ($expect) differs from actual result ($actual)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + else + # parallel mode output are often of different ordering from serial + # output. If the sorted expected and actual files compare the same, + # it is safe to assume the actual output match the expected file. + expect_sorted=expect_sorted + actual_sorted=actual_sorted + sort $expect -o $expect_sorted + sort $actual -o $actual_sorted + # remove "EXIT CODE:" line from expect file. test for exit code + # is done by serial mode. + grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit + mv $expect_sorted.noexit $expect_sorted + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi + fi + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual_sorted $expect_sorted + fi +} + +############################################################################## +### T H E T E S T S +############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + +# Run the test +TOOLTEST h5diff_ud.txt -v tudfilter.h5 tudfilter2.h5 + +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All Plugin API tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + +# Clean up temporary files/directories and leave +$RM $PLUGIN_LIBDIR + +exit $exit_code diff --git a/tools/h5diff/testfiles/h5diff_ud.txt b/tools/h5diff/testfiles/h5diff_ud.txt new file mode 100644 index 0000000..7c9bb5e --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_ud.txt @@ -0,0 +1,11 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dynlib2 + +group : and +0 differences found +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_udfail.txt b/tools/h5diff/testfiles/h5diff_udfail.txt new file mode 100644 index 0000000..7eb1155 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_udfail.txt @@ -0,0 +1,12 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dynlib2 + +group : and +0 differences found +dataset: and +0 differences found +warning: dataset cannot be read, user defined filter is not available +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/tudfilter.h5 b/tools/h5diff/testfiles/tudfilter.h5 new file mode 100644 index 0000000..a1f6d80 Binary files /dev/null and b/tools/h5diff/testfiles/tudfilter.h5 differ diff --git a/tools/h5diff/testfiles/tudfilter2.h5 b/tools/h5diff/testfiles/tudfilter2.h5 new file mode 100644 index 0000000..a1f6d80 Binary files /dev/null and b/tools/h5diff/testfiles/tudfilter2.h5 differ diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 3be0b80..5748128 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -331,10 +331,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -348,7 +348,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5DIFF_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -369,16 +369,16 @@ while [ $# -gt 0 ]; do shift ;; -h) # print help page - echo "$0 [-p] [-h]" - echo " -p run ph5diff tests" - echo " -h print help page" - shift - exit 0 - ;; + echo "$0 [-p] [-h]" + echo " -p run ph5diff tests" + echo " -h print help page" + shift + exit 0 + ;; *) # unknown option echo "$0: Unknown option ($1)" - exit 1 - ;; + exit 1 + ;; esac done @@ -429,11 +429,11 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? # save actual and actual_err in case they are needed later. @@ -442,9 +442,9 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err cat $actual_err >> $actual - # don't add exit code check in pmode, as it causes failure. (exit code + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) - # if any problem occurs relate to an exit code, it will be caught in + # if any problem occurs relate to an exit code, it will be caught in # serial mode, so the test is fullfilled. if test $h5haveexitcode = 'yes' -a -z "$pmode"; then echo "EXIT CODE: $EXIT_CODE" >> $actual @@ -462,7 +462,7 @@ TOOLTEST() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' else - # parallel mode output are often of different ordering from serial + # parallel mode output are often of different ordering from serial # output. If the sorted expected and actual files compare the same, # it is safe to assume the actual output match the expected file. expect_sorted=expect_sorted @@ -473,44 +473,44 @@ TOOLTEST() { # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" - fi - fi + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi + fi fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav - rm -f $actual_sorted $expect_sorted + rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual_sorted $expect_sorted fi } # Print a "SKIP" message SKIP() { - TESTING $H5DIFF $@ - echo " -SKIP-" + TESTING $H5DIFF $@ + echo " -SKIP-" } ############################################################################## -# The tests +# The tests # To avoid the printing of the complete full path of the test file, that hides -# all the other parameters for long paths, the printing of the command line +# all the other parameters for long paths, the printing of the command line # is done first in # TESTING with the name only of the test file $TOOL, not its full path $TESTFILE ############################################################################## @@ -525,13 +525,13 @@ COPY_TESTFILES_TO_TESTDIR TOOLTEST h5diff_10.txt -h # 1.1 normal mode -TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5 # 1.2 normal mode with objects TOOLTEST h5diff_12.txt h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 # 1.3 report mode -TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5 # 1.4 report mode with objects TOOLTEST h5diff_14.txt -r h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 @@ -549,7 +549,7 @@ TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 h5diff_basic1.h5 h5diff_basic TOOLTEST h5diff_16_3.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10 # 1.7 verbose mode -TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5 # 1.7 test 32-bit INFINITY TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_COPY @@ -557,8 +557,8 @@ TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_C # 1.7 test 64-bit INFINITY TOOLTEST h5diff_172.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp20 /g1/fp20_COPY -# 1.8 quiet mode -TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5 +# 1.8 quiet mode +TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5 # 1.8 -v and -q TOOLTEST h5diff_18_1.txt -v -q h5diff_basic1.h5 h5diff_basic2.h5 @@ -588,7 +588,7 @@ TOOLTEST h5diff_23.txt -v h5diff_types.h5 h5diff_types.h5 g1 g1 TOOLTEST h5diff_24.txt -v h5diff_types.h5 h5diff_types.h5 t1 t1 # 2.5 -TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1 +TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1 # 2.6 TOOLTEST h5diff_26.txt -v h5diff_types.h5 h5diff_types.h5 g1 g2 @@ -642,7 +642,7 @@ TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b # 5.8 (region reference) TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg -# test for both dset and attr with same type but with different size +# test for both dset and attr with same type but with different size # ( HDDFV-7942 ) TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b @@ -652,14 +652,14 @@ TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b # 6.0: Check if the command line number of arguments is less than 3 -TOOLTEST h5diff_600.txt h5diff_basic1.h5 +TOOLTEST h5diff_600.txt h5diff_basic1.h5 -# 6.1: Check if non-exist object name is specified +# 6.1: Check if non-exist object name is specified TOOLTEST h5diff_601.txt h5diff_basic1.h5 h5diff_basic1.h5 nono_obj # ############################################################################## -# # -d +# # -d # ############################################################################## @@ -678,7 +678,7 @@ TOOLTEST h5diff_606.txt -d 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse # 6.7: string TOOLTEST h5diff_607.txt -d "1" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 -# 6.8: use system epsilon +# 6.8: use system epsilon TOOLTEST h5diff_608.txt --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.9: number larger than biggest difference @@ -762,7 +762,7 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # ############################################################################## # 7. attributes # ############################################################################## -TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 # temporary test to verify HDF5-8625 TOOLTEST h5diff_tmp1.txt tmptest2.he5 tmptest.he5 # temporary test to verify HDF5-8639 @@ -772,10 +772,10 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen # attrs with verbose option level # ################################################## -TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5 # same attr number , all same attr name TOOLTEST h5diff_704.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g @@ -789,7 +789,7 @@ TOOLTEST h5diff_706.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /nty # different attr number , same attr name (intersected) TOOLTEST h5diff_707.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g2 -# different attr number , all different attr name +# different attr number , all different attr name TOOLTEST h5diff_708.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g3 # when no attributes exist in both objects @@ -801,32 +801,32 @@ TOOLTEST h5diff_710.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 # ############################################################################## # 8. all dataset datatypes # ############################################################################## -TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5 +TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5 # 9. compare a file with itself TOOLTEST h5diff_90.txt -v h5diff_basic2.h5 h5diff_basic2.h5 # 10. read by hyperslab, print indexes -TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5 +TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5 # 11. floating point comparison # double value -TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 +TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # float value -TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 +TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 -# with --use-system-epsilon for double value -TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 +# with --use-system-epsilon for double value +TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # with --use-system-epsilon for float value -TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 +TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 # not comparable -c flag -TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 +TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 -TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 +TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 TOOLTEST h5diff_202.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset2 g2/dset3 @@ -842,9 +842,9 @@ TOOLTEST h5diff_206.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset7 g2/dset8 TOOLTEST h5diff_207.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset8 g2/dset9 # not comparable in dataspace of zero dimension size -TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5 +TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5 -# non-comparable dataset with comparable attribute, and other comparable datasets. +# non-comparable dataset with comparable attribute, and other comparable datasets. # Also test non-compatible attributes with different type, dimention, rank. # All the comparables should display differences. TOOLTEST h5diff_220.txt -c non_comparables1.h5 non_comparables2.h5 /g1 @@ -862,7 +862,7 @@ TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 TOOLTEST h5diff_223.txt -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes # swap files TOOLTEST h5diff_224.txt -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes - + # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## @@ -958,28 +958,28 @@ TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_e TOOLTEST h5diff_450.txt --follow-symlinks -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) -TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 +TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # try --no-dangling-links without --follow-symlinks options TOOLTEST h5diff_452.txt --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (FILE to FILE) -TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 +TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (obj to obj) -TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist # dangling link found for soft links (obj to obj) Both dangle links -TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist +TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist # dangling link found for ext links (FILE to FILE) -TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 +TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 # dangling link found for ext links (obj to obj). target file exist -TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1 +TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1 # dangling link found for ext links (obj to obj). target file NOT exist -TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2 +TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2 # dangling link found for ext links (obj to obj). Both dangle links TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_noexist2 @@ -993,14 +993,14 @@ TOOLTEST h5diff_466.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangl # soft link vs. soft dangling TOOLTEST h5diff_467.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2 # ext dangling vs. ext dangling -TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 # ext link vs. ext dangling TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 #---------------------------------------- -# dangling links without follow symlink +# dangling links without follow symlink # (HDFFV-7998) -# test - soft dangle links (same and different paths), +# test - soft dangle links (same and different paths), # - external dangle links (same and different paths) TOOLTEST h5diff_471.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 TOOLTEST h5diff_472.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 @@ -1011,7 +1011,7 @@ TOOLTEST h5diff_475.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_li # ############################################################################## # # test for group diff recursivly # ############################################################################## -# root +# root TOOLTEST h5diff_500.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / TOOLTEST h5diff_501.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / @@ -1045,7 +1045,7 @@ TOOLTEST h5diff_513.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_ TOOLTEST h5diff_514.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11 ############################################################################### -# Test for group recursive diff via multi-linked external links +# Test for group recursive diff via multi-linked external links # With follow-symlinks, file h5diff_grp_recurse_ext1.h5 and h5diff_grp_recurse_ext2-1.h5 should # be same with the external links. ############################################################################### @@ -1068,7 +1068,7 @@ TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 h5diff_exclude1-1.h5 h5d TOOLTEST h5diff_481.txt -v h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 # -# Different structure, different names. +# Different structure, different names. # # Exclude all the different objects. Expect return - same TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5 @@ -1099,9 +1099,9 @@ TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 # ############################################################################## -# # Test mutually exclusive options +# # Test mutually exclusive options # ############################################################################## -# Test with -d , -p and --use-system-epsilon. +# Test with -d , -p and --use-system-epsilon. TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_642.txt -v -p 0.05 -d 5 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 38cf12d..c81765c 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5DUMP) #----------------------------------------------------------------------------- @@ -23,6 +23,35 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") set (H5_DEP_EXECUTABLES h5dump) if (BUILD_TESTING) + + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- @@ -34,7 +63,7 @@ if (BUILD_TESTING) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5dumpgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index d563e44..55635d4 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -165,6 +165,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tstringe.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tszip.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudfilter.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tuserfilter.ddl @@ -281,6 +282,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr3.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5 @@ -328,26 +330,26 @@ foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) get_filename_component (fname "${tst_h5_file}" NAME) HDFTEST_COPY_FILE("${tst_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") - endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - else (WIN32) + else () HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files") - endif (WIN32) - endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + endif () + endforeach () foreach (tst_other_file ${HDF5_REFERENCE_FILES}) get_filename_component (fname "${tst_other_file}" NAME) HDFTEST_COPY_FILE("${tst_other_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") - endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) + endforeach () foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) get_filename_component (fname "${tst_error_file}" NAME) HDFTEST_COPY_FILE("${tst_error_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") - endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + endforeach () # -------------------------------------------------------------------- # Special file handling @@ -357,9 +359,9 @@ if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") - else (WIN32) + else () HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files") - endif (WIN32) + endif () add_custom_target(h5dump_std_files ALL COMMENT "Copying files needed by h5dump_std tests" DEPENDS ${h5dump_std_files_list}) ############################################################################## @@ -375,15 +377,9 @@ set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DUMP-${testname}") - else (HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5DUMP-h5dump-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove h5dump-${testname}.out h5dump-${testname}.out.err - ) - set_tests_properties (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + else () add_test ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -395,9 +391,8 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) + endif () + ENDMACRO () MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") @@ -406,11 +401,11 @@ NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else (${testtype} STREQUAL "SKIP") + endif () + else () ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_SKIP_H5_TEST) + endif () + ENDMACRO () MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts @@ -419,15 +414,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err + -E remove ${resultfile}.bin ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -442,8 +437,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + endif () + ENDMACRO () MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts @@ -452,15 +447,15 @@ set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err + -E remove ${resultfile}-N.bin ) set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -471,12 +466,12 @@ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" -D "TEST_OUTPUT=${resultfile}-N.out" -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_REFERENCE=${resultfile}-N.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_N file) + endif () + ENDMACRO () MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts @@ -485,15 +480,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err + -E remove ${resultfile}.txt ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -515,8 +510,8 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_EXPORT file) + endif () + ENDMACRO () MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts @@ -525,15 +520,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err + -E remove ${ddlfile}.txt ${resultfile}.txt ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -562,8 +557,8 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) + endif () + ENDMACRO () MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -586,18 +581,12 @@ ) set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_EXPORT_TEST file) + endif () + ENDMACRO () MACRO (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -609,19 +598,12 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_MASK_TEST file) + endif () + ENDMACRO () MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -634,19 +616,12 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_TEST file) + endif () + ENDMACRO () MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -661,9 +636,8 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) + endif () + ENDMACRO () MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts @@ -671,7 +645,7 @@ add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5 + -E remove ${resultfile}.bin ${resultfile}.h5 ) set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -692,12 +666,39 @@ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_IMPORT file) + endif () + ENDMACRO () + + MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_UD-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/std/${resultfile}.out + testfiles/std/${resultfile}.out.err + ) + add_test ( + NAME H5DUMP_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) + endif () + ENDMACRO () ############################################################################## ############################################################################## -### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +### T H E T E S T S ### ############################################################################## ############################################################################## @@ -1051,9 +1052,9 @@ set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DUMP-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () ADD_HELP_TEST(help 0 -h) @@ -1110,10 +1111,10 @@ ADD_H5_TEST_N (tattr-2 0 --enable-error-stack -N /\\\\/attr1 --any_path /attr4 --any_path=/attr5 tattr.h5) # test for header and error messages ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) - # test for displaying attributes in shared datatype (also in group and dataset) - ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) # test for displaying at least 9 attributes on root from a be machine ADD_H5_TEST (tattr-4_be 0 --enable-error-stack tattr4_be.h5) + # test for displaying attributes in shared datatype (also in group and dataset) + ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) # test for displaying soft links and user-defined links ADD_H5_TEST (tslink-1 0 --enable-error-stack tslink.h5) @@ -1333,11 +1334,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () if (USE_FILTER_DEFLATE) # data read internal filters @@ -1345,8 +1346,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - endif (HDF5_ENABLE_SZIP_SUPPORT) - endif (USE_FILTER_DEFLATE) + endif () + endif () # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1381,14 +1382,14 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) @@ -1433,3 +1434,8 @@ # test for non-existing file ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5) + +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index 72f8dfb..e6265dc 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -88,18 +88,18 @@ foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) get_filename_component(fname "${pbits_h5_file}" NAME) HDFTEST_COPY_FILE("${pbits_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach () foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/pbits/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach () foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach () add_custom_target(h5dump_pbits_files ALL COMMENT "Copying files needed by h5dump_pbits tests" DEPENDS ${h5dump_pbits_files_list}) ############################################################################## @@ -121,12 +121,6 @@ endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -137,9 +131,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_PBITS_TEST file) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -263,9 +256,9 @@ set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - endif (NOT "${last_pbits_test}" STREQUAL "") + endif () set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # test failure handling # Missing file name diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 44d24df..6cdc81c 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -130,12 +130,12 @@ foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) get_filename_component(fname "${tst_xml_h5_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach () foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) get_filename_component(fname "${tst_xml_other_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_other_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach () add_custom_target(h5dump_xml_files ALL COMMENT "Copying files needed by h5dump_xml tests" DEPENDS ${h5dump_xml_files_list}) ############################################################################## @@ -151,11 +151,11 @@ NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else (${testtype} STREQUAL "SKIP") + endif () + else () ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_XML_SKIP_H5_TEST) + endif () + ENDMACRO () MACRO (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -167,13 +167,7 @@ if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5DUMP-XML-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + else () add_test ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -185,9 +179,8 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_XML_H5_TEST file) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -333,9 +326,9 @@ set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - endif (NOT "${last_xml_test}" STREQUAL "") + endif () set (last_test "H5DUMP-XML-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index cee4801..6d95bb2 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -30,6 +30,11 @@ TEST_SCRIPT=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh check_PROGRAMS=$(TEST_PROG) binread check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=h5dump$(EXEEXT) +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5dump_plugin.sh +endif +endif # Our main target, the h5dump tool. bin_PROGRAMS=h5dump @@ -43,6 +48,15 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) # Source files for the program h5dump_SOURCES=h5dump.c h5dump_ddl.c h5dump_xml.c +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibdump.la + libdynlibdump_la_SOURCES=dynlib_dump.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 83309aa..cc6b465 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -31,6 +31,7 @@ # HDF5 Library Makefile(.in) # + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -106,6 +107,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = $(am__EXEEXT_1) binread$(EXEEXT) +@HAVE_SHARED_CONDITIONAL_TRUE@@USE_PLUGINS_CONDITIONAL_TRUE@am__append_1 = h5dump_plugin.sh bin_PROGRAMS = h5dump$(EXEEXT) TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = tools/h5dump @@ -117,19 +119,55 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh +CONFIG_CLEAN_FILES = h5dump_plugin.sh testh5dump.sh testh5dumppbits.sh \ + testh5dumpxml.sh CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libdynlibdump_la_LIBADD = +am__libdynlibdump_la_SOURCES_DIST = dynlib_dump.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdump_la_OBJECTS = \ +@HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_dump.lo +libdynlibdump_la_OBJECTS = $(am_libdynlibdump_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdump_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) am__EXEEXT_1 = h5dumpgentest$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) binread_SOURCES = binread.c binread_OBJECTS = binread.$(OBJEXT) binread_LDADD = $(LDADD) binread_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = am_h5dump_OBJECTS = h5dump.$(OBJEXT) h5dump_ddl.$(OBJEXT) \ h5dump_xml.$(OBJEXT) h5dump_OBJECTS = $(am_h5dump_OBJECTS) @@ -176,8 +214,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = binread.c $(h5dump_SOURCES) h5dumpgentest.c -DIST_SOURCES = binread.c $(h5dump_SOURCES) h5dumpgentest.c +SOURCES = $(libdynlibdump_la_SOURCES) binread.c $(h5dump_SOURCES) \ + h5dumpgentest.c +DIST_SOURCES = $(am__libdynlibdump_la_SOURCES_DIST) binread.c \ + $(h5dump_SOURCES) h5dumpgentest.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -224,33 +264,6 @@ am__tty_colors = { \ std=''; \ fi; \ } -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -404,10 +417,11 @@ am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.sh.log=.log) SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/testh5dump.sh.in \ - $(srcdir)/testh5dumppbits.sh.in $(srcdir)/testh5dumpxml.sh.in \ - $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ - $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5dump_plugin.sh.in \ + $(srcdir)/testh5dump.sh.in $(srcdir)/testh5dumppbits.sh.in \ + $(srcdir)/testh5dumpxml.sh.in $(top_srcdir)/bin/depcomp \ + $(top_srcdir)/bin/mkinstalldirs $(top_srcdir)/bin/test-driver \ + $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -685,7 +699,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin # Test programs and scripts TEST_PROG = h5dumpgentest -TEST_SCRIPT = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh +TEST_SCRIPT = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh \ + $(am__append_1) check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5dump$(EXEEXT) @@ -697,6 +712,8 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) # Source files for the program h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdump.la +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump_la_SOURCES = dynlib_dump.c DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -752,12 +769,52 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +h5dump_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5dump_plugin.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5dump.sh: $(top_builddir)/config.status $(srcdir)/testh5dump.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5dumppbits.sh: $(top_builddir)/config.status $(srcdir)/testh5dumppbits.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5dumpxml.sh: $(top_builddir)/config.status $(srcdir)/testh5dumpxml.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -836,6 +893,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump_ddl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump_xml.Po@am__quote@ @@ -1106,9 +1164,11 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1145,10 +1205,11 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool mostlyclean-am + clean-libLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1174,8 +1235,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS - +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1214,25 +1276,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libtool cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic \ + clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS + uninstall-binPROGRAMS uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -1248,6 +1311,11 @@ uninstall-am: uninstall-binPROGRAMS help: @$(top_srcdir)/bin/makehelp +@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/tools/h5dump/dynlib_dump.c b/tools/h5dump/dynlib_dump.c new file mode 100644 index 0000000..0d8be2b --- /dev/null +++ b/tools/h5dump/dynlib_dump.c @@ -0,0 +1,94 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Divide the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Multiply the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib2() */ + diff --git a/tools/h5dump/h5dump_plugin.sh.in b/tools/h5dump/h5dump_plugin.sh.in new file mode 100644 index 0000000..d3274da --- /dev/null +++ b/tools/h5dump/h5dump_plugin.sh.in @@ -0,0 +1,226 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# 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 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. +# +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +# Determine backward compatibility options enabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +DUMPER=h5dump # The tool name +DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary + +nerrors=0 +verbose=yes +h5haveexitcode=yes # default is yes + +TEST_NAME=h5dump_ud_plugin +FROM_DIR=`pwd`/.libs +PLUGIN_LIB="$FROM_DIR/libdynlibdump.*" +PLUGIN_LIBDIR=testdir3 + +RM='rm -rf' +GREP='grep' +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +# source dirs +SRC_TOOLS="$srcdir/../" + +# testfiles source dirs for tools +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" + +TESTDIR=./testplug +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/tudfilter.h5 +$SRC_H5DUMP_TESTFILES/tudfilter.ddl +" + +# RUNSERIAL is used. Check if it can return exit code from executable correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell correctly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + +# Main Body +# Create test directories if not exists yet. +test -d $PLUGIN_LIBDIR || mkdir -p $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR)" + exit $EXIT_FAILURE +fi + +# copy plugin library for test +$CP $PLUGIN_LIB $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB) for test." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_TESTFILES_AND_TESTDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=$SRC_H5DUMP_TESTFILES + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $TESTDIR + fi +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + +# Run a test and print PASS or *FAIL*. If a test fails then increment +# the `nerrors' global variable and (if $verbose is set) display the +# difference between the actual output and the expected output. The +# expected output is given as the first argument to this function and +# the actual output file is calculated by replacing the `.ddl' with +# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a +# non-zero value. +# If $1 == ignorecase then do caseless CMP and DIFF. +# ADD_H5_TEST +TOOLTEST() { + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + cat $actual_err >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual > /dev/null 2>&1 ; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + fi + +} + +############################################################################## +### T H E T E S T S +############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + +# Run the test +TOOLTEST tudfilter.ddl --enable-error-stack tudfilter.h5 + +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All Plugin API tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + +# Clean up temporary files/directories and leave +$RM $PLUGIN_LIBDIR + +exit $exit_code diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 058ea90..284e42b 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -113,6 +113,7 @@ #define FILE81 "tints4dims.h5" #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" +#define FILE84 "tudfilter.h5" /*------------------------------------------------------------------------- * prototypes @@ -152,6 +153,23 @@ const H5Z_class2_t H5Z_MYFILTER[1] = {{ myfilter, /* The actual filter function */ }}; +#define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, @@ -618,7 +636,7 @@ static int gent_softlink2(void) fileid1 = H5Fcreate(FILE4_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fileid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", FILE4_1); status = FAIL; goto out; } @@ -629,7 +647,7 @@ static int gent_softlink2(void) gid1 = H5Gcreate2(fileid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -637,7 +655,7 @@ static int gent_softlink2(void) gid2 = H5Gcreate2(fileid1, "group_empty", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -649,7 +667,7 @@ static int gent_softlink2(void) status = H5Tcommit2(fileid1, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -677,7 +695,7 @@ static int gent_softlink2(void) H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset1 < 0) { - fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -685,7 +703,7 @@ static int gent_softlink2(void) status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); status = FAIL; goto out; } @@ -698,7 +716,7 @@ static int gent_softlink2(void) H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset2 < 0) { - fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -706,7 +724,7 @@ static int gent_softlink2(void) status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); status = FAIL; goto out; } @@ -721,7 +739,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/dset1", fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -730,7 +748,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/dtype", fileid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -739,7 +757,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/group1", fileid1, "soft_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -748,7 +766,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/group_empty", fileid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -757,7 +775,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("not_yet", fileid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -769,7 +787,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/dset1", gid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -778,7 +796,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/dset2", gid1, "soft_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -787,7 +805,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/dtype", gid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -796,7 +814,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("/group_empty", gid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -805,7 +823,7 @@ static int gent_softlink2(void) status = H5Lcreate_soft("not_yet", gid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -815,31 +833,31 @@ static int gent_softlink2(void) * Close/release resources. */ if(dataspace >= 0 && H5Sclose(dataspace) < 0) { - fprintf(stderr, "Error: %s> H5Sclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Sclose failed.\n", FILE4_1); status = FAIL; } if(gid1 >= 0 && H5Gclose(gid1) < 0) { - fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); status = FAIL; } if(gid2 >= 0 && H5Gclose(gid2) < 0) { - fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); status = FAIL; } if(datatype >= 0 && H5Tclose(datatype) < 0) { - fprintf(stderr, "Error: %s> H5Tclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Tclose failed.\n", FILE4_1); status = FAIL; } if(dset1 >= 0 && H5Dclose(dset1) < 0) { - fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); status = FAIL; } if(dset2 >= 0 && H5Dclose(dset2) < 0) { - fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); status = FAIL; } if(fileid1 >= 0 && H5Fclose(fileid1) < 0) { - fprintf(stderr, "Error: %s> H5Fclose failed.\n", FILE4_1); + HDfprintf(stderr, "Error: %s> H5Fclose failed.\n", FILE4_1); status = FAIL; } @@ -915,7 +933,7 @@ static void gent_udlink(void) /* This ud link will dangle, but that's okay */ fid = H5Fcreate(FILE54, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); H5Lcreate_ud(fid, "udlink1", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - strcpy(buf, "foo"); + HDstrcpy(buf, "foo"); H5Lcreate_ud(fid, "udlink2", (H5L_type_t)MY_LINKCLASS, buf, 4, H5P_DEFAULT, H5P_DEFAULT); H5Fclose(fid); @@ -1820,7 +1838,7 @@ static void gent_str(void) { for(l = 0; l < 10; l++) comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); for(k = 0 ; k < 12; k++) - strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); + HDstrcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); } dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2452,7 +2470,7 @@ static void gent_nestcomp(void) */ status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); if(status < 0) - fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); + HDfprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); /* * Release resources @@ -10119,7 +10137,7 @@ static void gent_vlenstr_array(void) if ((dset = H5Dcreate2(file, F83_DATASETNAME2, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + HDfprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); H5Dclose(dset); } @@ -10132,6 +10150,119 @@ static void gent_vlenstr_array(void) H5Fclose(file); } +/*------------------------------------------------------------------------- + * Function: gent_udfilter + * + * Purpose: Generate a file to be used in testing user defined filter plugin3. + *------------------------------------------------------------------------- + */ +static void gent_udfilter(void) +{ + hid_t fid; /* file id */ + hid_t dcpl; /* dataset creation property list */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ + + hsize_t dims1[RANK] = {DIM1,DIM2}; + hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; + int buf1[DIM1][DIM2]; + int i, j, n, ret; + + for(i=n=0; i=0); + + /* create a space */ + sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); + + dcpl = H5Pcreate(H5P_DATASET_CREATE); + HDassert(dcpl>=0); + + ret = H5Pset_layout(dcpl, H5D_CHUNKED); + HDassert(ret >= 0); + + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + HDassert(ret >= 0); + + ret = H5Zregister (H5Z_DYNLIB2); + HDassert(ret >= 0); + + ret = H5Pset_filter (dcpl, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL); + HDassert(ret >= 0); + + ret=make_dset(fid, "dynlib2", sid, H5T_NATIVE_INT, dcpl, buf1); + HDassert(ret >= 0); + + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); + HDassert(ret >= 0); + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret = H5Sclose(sid); + HDassert(ret >= 0); + + ret = H5Pclose(dcpl); + HDassert(ret >= 0); + + ret = H5Fclose(fid); + HDassert(ret >= 0); +} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. tools tests will load + * and use this filter as a plugin library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Divide the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Multiply the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib2() */ + /*------------------------------------------------------------------------- * Function: main @@ -10227,6 +10358,8 @@ int main(void) gent_intsfourdims(); + gent_udfilter(); + return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index a5e8c4e..a9302ef 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -404,10 +404,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -421,7 +421,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5DUMP_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -452,14 +452,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -548,7 +548,7 @@ TOOLTEST2() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -556,7 +556,7 @@ TOOLTEST2() { } -# same as TOOLTEST2 but compares generated file to expected ddl file +# same as TOOLTEST2 but compares generated file to expected ddl file # and compares the generated data file to the expected data file # used for the binary tests that expect a full path in -o without -b # ADD_H5_TEST_EXPORT @@ -614,7 +614,7 @@ TOOLTEST2A() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err $actualmeta @@ -653,7 +653,7 @@ TOOLTEST2B() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -870,7 +870,7 @@ TOOLTEST_HELP() { echo " Expected output (*.txt) differs from actual output (*.out)" nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actual_err @@ -883,7 +883,7 @@ SKIP() { TESTING $DUMPER $@ echo " -SKIP-" } - + # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { @@ -894,7 +894,7 @@ PRINT_H5DIFF() { # Call the h5diff tool # -DIFFTEST() +DIFFTEST() { PRINT_H5DIFF $@ ( @@ -908,7 +908,7 @@ DIFFTEST() else echo " PASSED" fi - + } # Print a line-line message left justified in a field of 70 characters @@ -921,7 +921,7 @@ PRINT_H5IMPORT() { # Call the h5import tool # -IMPORTTEST() +IMPORTTEST() { # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" @@ -932,7 +932,7 @@ IMPORTTEST() PRINT_H5IMPORT $@ ( cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -941,7 +941,7 @@ IMPORTTEST() else echo " PASSED" fi - + } @@ -1032,7 +1032,7 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5 -# test for unamed type +# test for unamed type TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 @@ -1055,7 +1055,7 @@ TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5 # test for loop detection TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5 -# test for string +# test for string TOOLTEST tstr-1.ddl --enable-error-stack tstr.h5 TOOLTEST tstr-2.ddl --enable-error-stack tstr2.h5 @@ -1156,7 +1156,7 @@ TOOLTEST tcompact.ddl --enable-error-stack -H -p -d compact tfilters.h5 TOOLTEST tcontiguos.ddl --enable-error-stack -H -p -d contiguous tfilters.h5 # chunked TOOLTEST tchunked.ddl --enable-error-stack -H -p -d chunked tfilters.h5 -# external +# external TOOLTEST texternal.ddl --enable-error-stack -H -p -d external tfilters.h5 # fill values @@ -1225,7 +1225,7 @@ fi # test for displaying objects with very long names TOOLTEST tlonglinks.ddl --enable-error-stack tlonglinks.h5 -# dimensions over 4GB, print boundary +# dimensions over 4GB, print boundary TOOLTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5 # hyperslab read @@ -1233,7 +1233,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # - + # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 @@ -1272,7 +1272,7 @@ IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5 DIFFTEST tbinary.h5 out3D.h5 /integer /integer TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 - + # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then rm -f out[1-4].bin @@ -1280,7 +1280,7 @@ if test -z "$HDF5_NOCLEANUP"; then rm -f out3.h5 fi -# test for dataset region references +# test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 4211c63..446020a 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -190,7 +190,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5DUMP_TESTFILES/pbits INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index 1efde85..33a67c0 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -221,7 +221,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5DUMP_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 139f440..80bd2f7 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5LS) #----------------------------------------------------------------------------- @@ -22,6 +22,34 @@ set (H5_DEP_EXECUTABLES if (BUILD_TESTING) + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + include (CMakeTests.cmake) endif (BUILD_TESTING) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index eda990d..f790ed9 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -29,6 +29,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) @@ -86,6 +87,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls + ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls @@ -98,7 +100,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files") - endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5ls_files ALL COMMENT "Copying files needed by h5ls tests" DEPENDS ${h5ls_files_list}) ############################################################################## @@ -118,14 +120,33 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( - NAME H5LS-${resultfile}-clear-objects + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + ENDMACRO () + + MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5LS_UD-${testname}-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err ) add_test ( - NAME H5LS-${resultfile} + NAME H5LS_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS=${ARGN}" @@ -133,11 +154,13 @@ -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -258,11 +281,25 @@ tvldtypes2be.out tvldtypes2be.out.err ) + set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5LS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () + +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# filters are defined. + +# detect whether the encoder is present. + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif () + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif () # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -393,3 +430,9 @@ else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) endif (H5_WORDS_BIGENDIAN) + +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -v -d tudfilter.h5) + \ No newline at end of file diff --git a/tools/h5ls/Makefile.am b/tools/h5ls/Makefile.am index 408ce93..bee5d79 100644 --- a/tools/h5ls/Makefile.am +++ b/tools/h5ls/Makefile.am @@ -27,6 +27,11 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib TEST_SCRIPT=testh5ls.sh check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=h5ls$(EXEEXT) +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5ls_plugin.sh +endif +endif # This is our main target, the h5ls tool bin_PROGRAMS=h5ls @@ -37,4 +42,15 @@ h5ls_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibls.la + libdynlibls_la_SOURCES=dynlib_ls.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + +DISTCLEANFILES=h5ls_plugin.sh + include $(top_srcdir)/config/conclude.am diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 97fa0c6..317fb8b 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -31,6 +31,7 @@ # HDF5 Library Makefile(.in) # + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -105,6 +106,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@HAVE_SHARED_CONDITIONAL_TRUE@@USE_PLUGINS_CONDITIONAL_TRUE@am__append_1 = h5ls_plugin.sh bin_PROGRAMS = h5ls$(EXEEXT) TESTS = $(TEST_SCRIPT) subdir = tools/h5ls @@ -116,18 +118,53 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testh5ls.sh +CONFIG_CLEAN_FILES = h5ls_plugin.sh testh5ls.sh CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libdynlibls_la_LIBADD = +am__libdynlibls_la_SOURCES_DIST = dynlib_ls.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibls_la_OBJECTS = \ +@HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_ls.lo +libdynlibls_la_OBJECTS = $(am_libdynlibls_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibls_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) PROGRAMS = $(bin_PROGRAMS) h5ls_SOURCES = h5ls.c h5ls_OBJECTS = h5ls.$(OBJEXT) h5ls_LDADD = $(LDADD) h5ls_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = h5ls_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(h5ls_LDFLAGS) $(LDFLAGS) -o $@ @@ -165,8 +202,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = h5ls.c -DIST_SOURCES = h5ls.c +SOURCES = $(libdynlibls_la_SOURCES) h5ls.c +DIST_SOURCES = $(am__libdynlibls_la_SOURCES_DIST) h5ls.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -213,33 +250,6 @@ am__tty_colors = { \ std=''; \ fi; \ } -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -391,9 +401,10 @@ am__set_b = \ *) \ b='$*';; \ esac -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/testh5ls.sh.in \ - $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ - $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5ls_plugin.sh.in \ + $(srcdir)/testh5ls.sh.in $(top_srcdir)/bin/depcomp \ + $(top_srcdir)/bin/mkinstalldirs $(top_srcdir)/bin/test-driver \ + $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -667,7 +678,7 @@ TRACE = perl $(top_srcdir)/bin/trace CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Test programs and scripts -TEST_SCRIPT = testh5ls.sh +TEST_SCRIPT = testh5ls.sh $(am__append_1) check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5ls$(EXEEXT) @@ -676,6 +687,9 @@ h5ls_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibls.la +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibls_la_SOURCES = dynlib_ls.c +DISTCLEANFILES = h5ls_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -730,8 +744,48 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +h5ls_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5ls_plugin.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5ls.sh: $(top_builddir)/config.status $(srcdir)/testh5ls.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -792,6 +846,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_ls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5ls.Po@am__quote@ .c.o: @@ -1052,9 +1107,11 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1086,13 +1143,16 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1118,8 +1178,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS - +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1158,24 +1219,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-binPROGRAMS clean-generic clean-libtool \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \ - uninstall uninstall-am uninstall-binPROGRAMS + check-am clean clean-binPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -1191,6 +1254,11 @@ uninstall-am: uninstall-binPROGRAMS help: @$(top_srcdir)/bin/makehelp +@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/tools/h5ls/dynlib_ls.c b/tools/h5ls/dynlib_ls.c new file mode 100644 index 0000000..0d8be2b --- /dev/null +++ b/tools/h5ls/dynlib_ls.c @@ -0,0 +1,94 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Divide the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Multiply the original value with MULTIPLIER */ + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib2() */ + diff --git a/tools/h5ls/h5ls_plugin.sh.in b/tools/h5ls/h5ls_plugin.sh.in new file mode 100644 index 0000000..460ff6a --- /dev/null +++ b/tools/h5ls/h5ls_plugin.sh.in @@ -0,0 +1,238 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# 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 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. +# +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +# Determine backward compatibility options enabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +H5LS=h5ls # The tool name +H5LS_BIN=`pwd`/$H5LS # The path of the tool binary + +nerrors=0 +verbose=yes +h5haveexitcode=yes # default is yes + +TEST_NAME=ud_plugin +FROM_DIR=`pwd`/.libs +PLUGIN_LIB="$FROM_DIR/libdynlibls.*" +PLUGIN_LIBDIR=testdir3 + +RM='rm -rf' +GREP='grep' +CMP='cmp -s' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +# source dirs +SRC_TOOLS="$srcdir/.." + +# testfiles source dirs for tools +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" + +TESTDIR=./testplug +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_TOOLS_TESTFILES/tudfilter.h5 +$SRC_TOOLS_TESTFILES/tudfilter.ls +" + +# RUNSERIAL is used. Check if it can return exit code from executable correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell correctly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + +# Main Body +# Create test directories if not exists yet. +test -d $PLUGIN_LIBDIR || mkdir -p $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR)" + exit $EXIT_FAILURE +fi + +# copy plugin library for test +$CP $PLUGIN_LIB $PLUGIN_LIBDIR +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB) for test." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_TESTFILES_AND_TESTDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=$SRC_H5LS_TESTFILES + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $TESTDIR + fi +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' +} + +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + +# Run a test and print PASS or *FAIL*. For now, if h5ls can complete +# with exit status 0, consider it pass. If a test fails then increment +# the `nerrors' global variable and (if $verbose is set) display up to $NLINS +# lines of the actual output from the tool test. The actual output is not +# removed if $HDF5_NOCLEANUP has a non-zero value. +# Arguemnts: +# $1 -- actual output filename to use +# $2 and on -- argument for the h5ls tool +TOOLTEST() { + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ls`.out" + actual_err="$TESTDIR/`basename $1 .ls`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + retvalexpect=$1 + shift + + # Run test. + # Stderr is included in stdout so that the diff can detect + # any unexpected output from that stream too. + TESTING $H5LS $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $H5LS_BIN "$@" + ) >$actual 2>$actual_err + + exitcode=$? + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + cat $actual_err >> $actual + if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi + elif [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi +} + +############################################################################## +### T H E T E S T S +############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + +# Run the test +TOOLTEST tudfilter.ls 0 -w80 -v -d tudfilter.h5 + +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All Plugin API tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + +# Clean up temporary files/directories and leave +$RM $PLUGIN_LIBDIR + +exit $exit_code diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index bf40bfa..4e138e1 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -17,6 +17,9 @@ srcdir=@srcdir@ +USE_FILTER_SZIP="@USE_FILTER_SZIP@" +USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" + TESTNAME=h5ls EXIT_SUCCESS=0 EXIT_FAILURE=1 @@ -178,10 +181,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -195,7 +198,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5LS_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -236,10 +239,10 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" - ) >$actual 2>$actual_err - + ) >$actual 2>$actual_err + exitcode=$? # save actual and actual_err in case they are needed later. cp $actual $actual_sav @@ -248,37 +251,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -337,7 +340,7 @@ TOOLTEST textlinksrc-3-old.ls 0 -w80 -Er textlinksrc.h5/ext_link1 TOOLTEST textlinksrc-6-old.ls 0 -w80 -E textlinksrc.h5 TOOLTEST textlinksrc-7-old.ls 0 -w80 -E textlinksrc.h5/ext_link1 -# tests for no-dangling-links +# tests for no-dangling-links # if this option is given on dangling link, h5ls should return exit code 1 # when used alone , expect to print out help and return exit code 1 TOOLTEST textlinksrc-nodangle-1.ls 1 -w80 --no-dangling-links textlinksrc.h5 @@ -372,7 +375,7 @@ TOOLTEST tnestcomp-4.ls 0 -w80 -r -d -l -S tnestedcomp.h5 # test for loop detection TOOLTEST tloop-1.ls 0 -w80 -r -d tloop.h5 -# test for string +# test for string TOOLTEST tstr-1.ls 0 -w80 -r -d tstr.h5 # test test file created from lib SAF team @@ -403,15 +406,15 @@ fi # test for non-existing file TOOLTEST nosuchfile.ls 1 nosuchfile.h5 -# test for variable length data types in verbose mode +# test for variable length data types in verbose mode if test $WORDS_BIGENDIAN != "yes"; then TOOLTEST tvldtypes2le.ls 0 -v tvldtypes1.h5 else TOOLTEST tvldtypes2be.ls 0 -v tvldtypes1.h5 -fi +fi -# test for dataset region references data types in verbose mode +# test for dataset region references data types in verbose mode if test $WORDS_BIGENDIAN != "yes"; then TOOLTEST tdataregle.ls 0 -v tdatareg.h5 else diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 2eb66f9..d7f5cb5 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -479,7 +479,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dgangling link is error */ + opts->err_stat = 1; /* make dangling link is error */ goto done; } @@ -511,7 +511,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dgangling link is error */ + opts->err_stat = 1; /* make dangling link is error */ goto done; } @@ -592,8 +592,8 @@ hsize_t h5diff(const char *fname1, trav_info_t *info1_grp = NULL; trav_info_t *info2_grp = NULL; /* local pointer */ - trav_info_t *info1_lp; - trav_info_t *info2_lp; + trav_info_t *info1_lp = NULL; + trav_info_t *info2_lp = NULL; /* link info from specified object */ H5L_info_t src_linfo1; H5L_info_t src_linfo2; @@ -1555,7 +1555,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* gangling link is error */ + /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); goto out; @@ -1573,7 +1573,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* gangling link is error */ + /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); goto out; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 157978d..17eeafe 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -71,9 +71,7 @@ hsize_t diff_dataset( hid_t file1_id, if((dcpl1 = H5Dget_create_plist(did1)) < 0) goto error; if((dcpl2 = H5Dget_create_plist(did2)) < 0) - { goto error; - } /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that @@ -91,6 +89,9 @@ hsize_t diff_dataset( hid_t file1_id, obj2_name, options); } + else + goto error; + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -324,7 +325,7 @@ hsize_t diff_datasetid( hid_t did1, parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } - + can_compare=0; options->not_cmp=1; } @@ -676,31 +677,30 @@ int diff_can_type( hid_t f_tid1, /* file data type */ HDassert(tclass1==tclass2); switch (tclass1) { - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_COMPOUND: - case H5T_STRING: - case H5T_ARRAY: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_REFERENCE: - - break; - - default: /*H5T_TIME */ - + case H5T_TIME: + if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { + parallel_print("Not comparable: <%s> and <%s> are of class %s\n", + obj1_name,obj2_name,get_class(tclass2) ); + } /* end if */ + can_compare = 0; + options->not_cmp = 1; + return can_compare; - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { - parallel_print("Not comparable: <%s> and <%s> are of class %s\n", - obj1_name,obj2_name,get_class(tclass2) ); - } - can_compare = 0; - options->not_cmp = 1; - return can_compare; - } + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_COMPOUND: + case H5T_STRING: + case H5T_ARRAY: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_REFERENCE: + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + break; + } /* end switch */ /*------------------------------------------------------------------------- * check for equal file datatype; warning only diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 3928837..665c2e8 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -3156,7 +3156,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; case H5Z_FILTER_SZIP: - { szip_options_mask = cd_values[0];; szip_pixels_per_block = cd_values[1]; @@ -3219,7 +3218,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } break; case H5Z_FILTER_NBIT: h5tools_str_append(&buffer, "%s", NBIT); @@ -3389,6 +3387,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_ALLOC_TIME_LATE: h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_LATE"); break; + case H5D_ALLOC_TIME_ERROR: + case H5D_ALLOC_TIME_DEFAULT: default: HDassert(0); break; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 7f65c91..e62c7b0 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -736,7 +736,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai long double templdouble; HDmemcpy(&templdouble, vp, sizeof(long double)); - h5tools_str_append(str, "%Lf", templdouble); + h5tools_str_append(str, OPT(info->fmt_double, "%Lf"), templdouble); #endif } break; diff --git a/tools/testfiles/tudfilter.ddl b/tools/testfiles/tudfilter.ddl new file mode 100644 index 0000000..5bdceec --- /dev/null +++ b/tools/testfiles/tudfilter.ddl @@ -0,0 +1,30 @@ +HDF5 "tudfilter.h5" { +GROUP "/" { + DATASET "dynlib2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) } + DATA { + (0,0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (1,0): 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + (2,0): 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + (3,0): 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + (4,0): 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + (5,0): 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + (6,0): 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + (7,0): 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + (8,0): 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + (9,0): 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + (10,0): 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + (11,0): 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + (12,0): 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + (13,0): 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + (14,0): 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + (15,0): 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + (16,0): 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + (17,0): 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + (18,0): 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + (19,0): 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 + } + } +} +} diff --git a/tools/testfiles/tudfilter.h5 b/tools/testfiles/tudfilter.h5 new file mode 100644 index 0000000..a1f6d80 Binary files /dev/null and b/tools/testfiles/tudfilter.h5 differ diff --git a/tools/testfiles/tudfilter.ls b/tools/testfiles/tudfilter.ls new file mode 100644 index 0000000..7ca8682 --- /dev/null +++ b/tools/testfiles/tudfilter.ls @@ -0,0 +1,23 @@ +Opened "tudfilter.h5" with sec2 driver. +dynlib2 Dataset {20/20, 10/10} + Location: 1:800 + Links: 1 + Chunks: {10, 5} 200 bytes + Storage: 800 logical bytes, 800 allocated bytes, 100.00% utilization + Filter-0: dynlib2-258 {} + Type: native int + Data: + (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + (1,9) 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + (3,5) 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + (5,1) 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + (6,7) 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + (8,3) 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + (9,9) 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + (11,2) 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + (12,5) 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + (13,8) 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + (15,1) 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + (16,4) 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + (17,7) 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + (19,0) 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 -- cgit v0.12 From d22b02cf2996519b1e1291ce27f91a7b7b118822 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Jan 2017 14:33:46 -0600 Subject: Add copy of N files --- tools/h5dump/CMakeTests.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 55635d4..fb3c253 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -183,6 +183,14 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ) + set (HDF5_N_REFERENCE_FILES + tall-3 + tattr-2 + tcomp-2 + thlink-4 + thlink-5 + tslink-2 + ) set (HDF5_REFERENCE_EXP_FILES tall-6.exp tnoddlfile.exp @@ -345,6 +353,9 @@ get_filename_component (fname "${tst_other_file}" NAME) HDFTEST_COPY_FILE("${tst_other_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") endforeach () + foreach (tst_h5N_file ${HDF5_N_REFERENCE_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SOURCE_DIR}/testfiles/${tst_h5N_file}.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_h5N_file}-N.ddl" "h5dump_std_files") + endforeach () foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) get_filename_component (fname "${tst_error_file}" NAME) -- cgit v0.12 From 2d3f62805a5dd3c0d2498319d473a3601c4021cf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Jan 2017 14:39:59 -0600 Subject: Remove callback functions that will fail (HDFFV-10046) --- test/dynlib4.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/test/dynlib4.c b/test/dynlib4.c index 316962a..8da0270 100644 --- a/test/dynlib4.c +++ b/test/dynlib4.c @@ -25,8 +25,6 @@ static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); -herr_t H5Z_filter_can_apply(hid_t dcpl, hid_t type, hid_t space); -herr_t H5Z_filter_set_local(hid_t dcpl, hid_t type, hid_t space); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIB4[1] = {{ @@ -34,41 +32,14 @@ const H5Z_class2_t H5Z_DYNLIB4[1] = {{ H5Z_FILTER_DYNLIB4, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ "dynlib4", /* Filter name for debugging */ - (H5Z_can_apply_func_t)(H5Z_filter_can_apply), /* The "can apply" callback */ - (H5Z_set_local_func_t)(H5Z_filter_set_local), /* The "set local" callback */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */ }}; H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB4;} -herr_t H5Z_filter_can_apply(hid_t dcpl, hid_t type, hid_t space) { - H5I_type_t dcpl_type; - - dcpl_type = H5Iget_type(dcpl); - if (dcpl_type < 0) { - PUSH_ERR("H5Z_filter_can_apply", H5E_CALLBACK, "dcpl not valid"); - return -1; - } - - return 1; -} - -herr_t H5Z_filter_set_local(hid_t dcpl, hid_t type, hid_t space) { - herr_t r; - unsigned int flags; - size_t nelements = 4; - unsigned int values[] = {0,0,0,0}; - - r = H5Pget_filter_by_id2(dcpl, H5Z_FILTER_DYNLIB4, &flags, &nelements, values, 0, NULL, NULL); - if (r < 0) { - PUSH_ERR("H5Z_filter_set_local", H5E_CALLBACK, "dcpl fails get_filter_by_id2"); - return -1; - } - - return 1; -} - /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib4 * -- cgit v0.12 From 4f3f30e63dfeb712142430e314679575f76ddba4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Jan 2017 14:42:39 -0600 Subject: Update CMake required to version 3.2.2 --- CMakeLists.txt | 2 +- c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/scripts/CTestScript.cmake | 2 +- config/cmake/scripts/HDF518config.cmake | 2 +- examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- release_docs/INSTALL_CMake.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 4 ++-- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- testpar/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- tools/h5copy/CMakeLists.txt | 2 +- tools/h5import/CMakeLists.txt | 2 +- tools/h5jam/CMakeLists.txt | 2 +- tools/h5repack/CMakeLists.txt | 2 +- tools/h5stat/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/misc/CMakeLists.txt | 2 +- tools/perform/CMakeLists.txt | 2 +- 42 files changed, 43 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cdee64..efd008f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 6f288a0..7945c3e 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index cfcdd8d..a86c16f 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 0adbaa1..2ffceb4 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 2ee2edf..c6f76c9 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index e1cb781..cc78c2b 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 75e61ee..c7704c6 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 55e4667..fd061ce 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -4,7 +4,7 @@ ### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7953161..aa5a8f3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index c725047..d4e3c11 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 5241286..c7a951a 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e617979..bc6fe75 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index d8e6fe5..3077c53 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 4f21419..03bb36d 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index bed8291..18fe9f7 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 36f4c30..927f219 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 77a50bf..3703889 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index a8d7152..c237823 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index de5b363..a2f9429 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index f5e6f5e..195d10c 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 892169c..da50ead 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 87838a0..bd250d0 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 95990cc..3f10d49 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index d84ed4d..2475265 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 1e91a47..77c69f2 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index bf598c4..f07608c 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 560b1f2..482bf91 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5 ${HDF5_HL_TOOLS_BINARY_DIR}/gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 9e6e828..60815f1 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 4b8059d..728228f 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -654,7 +654,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index bcff184..80c9668 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -180,7 +180,7 @@ Given the preconditions in section I, create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -226,7 +226,7 @@ NOTE: this file is available at the HDF web site: ======================================================================== ctest ======================================================================== -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 75754fe..4447d18 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 949a228..9e169fe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 05f74dc..c88e3e8 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index fd47379..841e979 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 23db8bb..c59675d 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 8951be7..05cd226 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index fba6734..c74f7a6 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index f4f48b7..54f918b 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index d8f8a35..2bee88c 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index d04d099..caa81bf 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 12d5a52..68f97d4 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_MISC) #----------------------------------------------------------------------------- diff --git a/tools/perform/CMakeLists.txt b/tools/perform/CMakeLists.txt index 3a60a84..d80f4e4 100644 --- a/tools/perform/CMakeLists.txt +++ b/tools/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- -- cgit v0.12 From 3969477d261c816df053bad628f2d48a930e75b5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 19 Jan 2017 10:43:06 -0600 Subject: Update with new and removed files --- MANIFEST | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index a4775ff..7ef11d3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1018,6 +1018,7 @@ ./tools/h5dump/Makefile.am ./tools/h5dump/Makefile.in +./tools/h5dump/dynlib_dump.c ./tools/h5dump/h5dump.c ./tools/h5dump/h5dump.h ./tools/h5dump/h5dump_defines.h @@ -1027,6 +1028,7 @@ ./tools/h5dump/h5dump_xml.c ./tools/h5dump/h5dump_xml.h ./tools/h5dump/h5dumpgentest.c +./tools/h5dump/h5dump_plugin.sh.in ./tools/h5dump/testh5dump.sh.in ./tools/h5dump/testh5dumppbits.sh.in ./tools/h5dump/testh5dumpxml.sh.in @@ -1094,11 +1096,13 @@ # h5diff sources ./tools/h5diff/Makefile.am ./tools/h5diff/Makefile.in +./tools/h5diff/dynlib_diff.c ./tools/h5diff/h5diff_common.c ./tools/h5diff/h5diff_common.h ./tools/h5diff/h5diff_main.c ./tools/h5diff/ph5diff_main.c ./tools/h5diff/h5diffgentest.c +./tools/h5diff/h5diff_plugin.sh.in ./tools/h5diff/testh5diff.sh.in ./tools/h5diff/testph5diff.sh.in @@ -1124,7 +1128,9 @@ # h5ls sources ./tools/h5ls/Makefile.am ./tools/h5ls/Makefile.in +./tools/h5ls/dynlib_ls.c ./tools/h5ls/h5ls.c +./tools/h5ls/h5ls_plugin.sh.in ./tools/h5ls/testh5ls.sh.in # h5copy sources @@ -2308,7 +2314,6 @@ ./config/cmake_ext_mod/HDFUseFortran.cmake ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in -./config/cmake_ext_mod/prunTest.cmake ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in -- cgit v0.12 From 363c5e67a5b2c2f7e53af6c89f337dcf01fbb47e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Jan 2017 15:49:43 -0600 Subject: HDFFV-10118 port plugin tools test fix to 1.8 --- tools/h5diff/dynlib_diff.c | 57 +++++++++++++++++------------------ tools/h5diff/testfiles/tudfilter.h5 | Bin 4816 -> 4816 bytes tools/h5diff/testfiles/tudfilter2.h5 | Bin 4816 -> 4816 bytes tools/h5dump/dynlib_dump.c | 57 +++++++++++++++++------------------ tools/h5dump/h5dumpgentest.c | 55 ++++++++++++++++++++------------- tools/h5ls/CMakeTests.cmake | 4 +-- tools/h5ls/dynlib_ls.c | 57 +++++++++++++++++------------------ tools/h5ls/h5ls_plugin.sh.in | 2 +- tools/testfiles/tudfilter.h5 | Bin 4816 -> 4816 bytes tools/testfiles/tudfilter.ls | 28 ++++------------- 10 files changed, 124 insertions(+), 136 deletions(-) diff --git a/tools/h5diff/dynlib_diff.c b/tools/h5diff/dynlib_diff.c index 0d8be2b..d80777d 100644 --- a/tools/h5diff/dynlib_diff.c +++ b/tools/h5diff/dynlib_diff.c @@ -12,59 +12,52 @@ * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) */ #include #include #include "H5PLextern.h" -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 -static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB2[1] = {{ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB2, /* Filter id number */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "dynlib2", /* Filter name for debugging */ + "dynlibud", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;} /*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib2 + * Function: H5Z_filter_dynlibud * - * Purpose: A dynlib2 filter method that multiplies the original value + * Purpose: A dynlib2 filter method that multiplies the original value * during write and divide the original value during read. It - * will be built as a shared library. plugin.c test will load - * and use this filter library. - * - * Return: Success: Data chunk size - * - * Failure: 0 + * will be built as a shared library. plugin.c test will load + * and use this filter library. * - * Programmer: Raymond Lu - * 29 March 2013 + * Return: Success: Data chunk size * + * Failure: 0 *------------------------------------------------------------------------- */ static size_t -H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr = (int *)*buf; /* Pointer to the data values */ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ size_t buf_left = *buf_size; /* Amount of data buffer left to process */ /* Check for the correct number of parameters */ @@ -75,20 +68,24 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, cd_values = cd_values; if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Divide the original value with MULTIPLIER */ + /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ /= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end if */ else { /*write*/ - /* Multiply the original value with MULTIPLIER */ + /* Add the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ *= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end else */ return nbytes; -} /* end H5Z_filter_dynlib2() */ +} /* end H5Z_filter_dynlibud() */ diff --git a/tools/h5diff/testfiles/tudfilter.h5 b/tools/h5diff/testfiles/tudfilter.h5 index a1f6d80..a61a954 100644 Binary files a/tools/h5diff/testfiles/tudfilter.h5 and b/tools/h5diff/testfiles/tudfilter.h5 differ diff --git a/tools/h5diff/testfiles/tudfilter2.h5 b/tools/h5diff/testfiles/tudfilter2.h5 index a1f6d80..a61a954 100644 Binary files a/tools/h5diff/testfiles/tudfilter2.h5 and b/tools/h5diff/testfiles/tudfilter2.h5 differ diff --git a/tools/h5dump/dynlib_dump.c b/tools/h5dump/dynlib_dump.c index 0d8be2b..d80777d 100644 --- a/tools/h5dump/dynlib_dump.c +++ b/tools/h5dump/dynlib_dump.c @@ -12,59 +12,52 @@ * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) */ #include #include #include "H5PLextern.h" -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 -static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB2[1] = {{ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB2, /* Filter id number */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "dynlib2", /* Filter name for debugging */ + "dynlibud", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;} /*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib2 + * Function: H5Z_filter_dynlibud * - * Purpose: A dynlib2 filter method that multiplies the original value + * Purpose: A dynlib2 filter method that multiplies the original value * during write and divide the original value during read. It - * will be built as a shared library. plugin.c test will load - * and use this filter library. - * - * Return: Success: Data chunk size - * - * Failure: 0 + * will be built as a shared library. plugin.c test will load + * and use this filter library. * - * Programmer: Raymond Lu - * 29 March 2013 + * Return: Success: Data chunk size * + * Failure: 0 *------------------------------------------------------------------------- */ static size_t -H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr = (int *)*buf; /* Pointer to the data values */ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ size_t buf_left = *buf_size; /* Amount of data buffer left to process */ /* Check for the correct number of parameters */ @@ -75,20 +68,24 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, cd_values = cd_values; if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Divide the original value with MULTIPLIER */ + /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ /= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end if */ else { /*write*/ - /* Multiply the original value with MULTIPLIER */ + /* Add the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ *= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end else */ return nbytes; -} /* end H5Z_filter_dynlib2() */ +} /* end H5Z_filter_dynlibud() */ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 284e42b..72eb2e0 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -153,21 +153,21 @@ const H5Z_class2_t H5Z_MYFILTER[1] = {{ myfilter, /* The actual filter function */ }}; -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 -static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB2[1] = {{ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB2, /* Filter id number */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "dynlib2", /* Filter name for debugging */ + "dynlibud", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ }}; @@ -10160,6 +10160,7 @@ static void gent_udfilter(void) { hid_t fid; /* file id */ hid_t dcpl; /* dataset creation property list */ + hid_t dsid; /* dataset ID */ hid_t sid; /* dataspace ID */ hid_t tid; /* datatype ID */ @@ -10190,13 +10191,22 @@ static void gent_udfilter(void) ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); HDassert(ret >= 0); - ret = H5Zregister (H5Z_DYNLIB2); + ret = H5Zregister (H5Z_DYNLIBUD); HDassert(ret >= 0); - ret = H5Pset_filter (dcpl, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL); + ret = H5Pset_filter (dcpl, H5Z_FILTER_DYNLIBUD, H5Z_FLAG_MANDATORY, 0, NULL); HDassert(ret >= 0); - ret=make_dset(fid, "dynlib2", sid, H5T_NATIVE_INT, dcpl, buf1); + /* create the dataset */ + dsid = H5Dcreate2(fid, "dynlibud", H5T_STD_I32LE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + HDassert(dsid >= 0); + + /* write */ + ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1); + HDassert(ret >= 0); + + /* close */ + ret = H5Dclose(dsid); HDassert(ret >= 0); /* remove the filters from the dcpl */ @@ -10218,9 +10228,9 @@ static void gent_udfilter(void) } /*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib2 + * Function: H5Z_filter_dynlibud * - * Purpose: A dynlib2 filter method that multiplies the original value + * Purpose: A dynlibud filter method that multiplies the original value * during write and divide the original value during read. It * will be built as a shared library. tools tests will load * and use this filter as a plugin library. @@ -10231,11 +10241,11 @@ static void gent_udfilter(void) *------------------------------------------------------------------------- */ static size_t -H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr = (int *)*buf; /* Pointer to the data values */ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ size_t buf_left = *buf_size; /* Amount of data buffer left to process */ /* Check for the correct number of parameters */ @@ -10246,23 +10256,26 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, cd_values = cd_values; if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Divide the original value with MULTIPLIER */ + /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ /= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end if */ else { /*write*/ - /* Multiply the original value with MULTIPLIER */ + /* Add the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ *= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end else */ return nbytes; -} /* end H5Z_filter_dynlib2() */ - +} /* end H5Z_filter_dynlibud() */ /*------------------------------------------------------------------------- * Function: main diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index f790ed9..1646fa9 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -434,5 +434,5 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## -ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -v -d tudfilter.h5) - \ No newline at end of file +ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5) + diff --git a/tools/h5ls/dynlib_ls.c b/tools/h5ls/dynlib_ls.c index 0d8be2b..d80777d 100644 --- a/tools/h5ls/dynlib_ls.c +++ b/tools/h5ls/dynlib_ls.c @@ -12,59 +12,52 @@ * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) */ #include #include #include "H5PLextern.h" -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 -static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB2[1] = {{ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB2, /* Filter id number */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "dynlib2", /* Filter name for debugging */ + "dynlibud", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;} /*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib2 + * Function: H5Z_filter_dynlibud * - * Purpose: A dynlib2 filter method that multiplies the original value + * Purpose: A dynlib2 filter method that multiplies the original value * during write and divide the original value during read. It - * will be built as a shared library. plugin.c test will load - * and use this filter library. - * - * Return: Success: Data chunk size - * - * Failure: 0 + * will be built as a shared library. plugin.c test will load + * and use this filter library. * - * Programmer: Raymond Lu - * 29 March 2013 + * Return: Success: Data chunk size * + * Failure: 0 *------------------------------------------------------------------------- */ static size_t -H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr = (int *)*buf; /* Pointer to the data values */ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ size_t buf_left = *buf_size; /* Amount of data buffer left to process */ /* Check for the correct number of parameters */ @@ -75,20 +68,24 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, cd_values = cd_values; if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Divide the original value with MULTIPLIER */ + /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ /= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end if */ else { /*write*/ - /* Multiply the original value with MULTIPLIER */ + /* Add the original value with MULTIPLIER */ while(buf_left > 0) { - *int_ptr++ *= MULTIPLIER; - buf_left -= sizeof(int); + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); } /* end while */ } /* end else */ return nbytes; -} /* end H5Z_filter_dynlib2() */ +} /* end H5Z_filter_dynlibud() */ diff --git a/tools/h5ls/h5ls_plugin.sh.in b/tools/h5ls/h5ls_plugin.sh.in index 460ff6a..52428bb 100644 --- a/tools/h5ls/h5ls_plugin.sh.in +++ b/tools/h5ls/h5ls_plugin.sh.in @@ -218,7 +218,7 @@ TOOLTEST() { COPY_TESTFILES_TO_TESTDIR # Run the test -TOOLTEST tudfilter.ls 0 -w80 -v -d tudfilter.h5 +TOOLTEST tudfilter.ls 0 -w80 -d tudfilter.h5 # print results if test $nerrors -ne 0 ; then diff --git a/tools/testfiles/tudfilter.h5 b/tools/testfiles/tudfilter.h5 index a1f6d80..a61a954 100644 Binary files a/tools/testfiles/tudfilter.h5 and b/tools/testfiles/tudfilter.h5 differ diff --git a/tools/testfiles/tudfilter.ls b/tools/testfiles/tudfilter.ls index 7ca8682..e9be094 100644 --- a/tools/testfiles/tudfilter.ls +++ b/tools/testfiles/tudfilter.ls @@ -1,23 +1,7 @@ -Opened "tudfilter.h5" with sec2 driver. -dynlib2 Dataset {20/20, 10/10} - Location: 1:800 - Links: 1 - Chunks: {10, 5} 200 bytes - Storage: 800 logical bytes, 800 allocated bytes, 100.00% utilization - Filter-0: dynlib2-258 {} - Type: native int +dynlib2 Dataset {20, 10} Data: - (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - (1,9) 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - (3,5) 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - (5,1) 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - (6,7) 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - (8,3) 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - (9,9) 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - (11,2) 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - (12,5) 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - (13,8) 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - (15,1) 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - (16,4) 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - (17,7) 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - (19,0) 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 + (0,0) Unable to print data. +H5tools-DIAG: Error detected in HDF5:tools (1.8.19) thread 0: + #000: /home/byrn/HDF_Projects/hdf5_18/dev/tools/lib/h5tools_dump.c line 1621 in h5tools_dump_simple_dset(): H5Dread failed + major: Failure in tools library + minor: error in function -- cgit v0.12 From bbaf0809568b8e31442c9633d99006c7a80b5aff Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Jan 2017 16:27:06 -0600 Subject: HDFFV-10118 correct dataset name --- tools/h5diff/testfiles/h5diff_ud.txt | 4 ++-- tools/h5diff/testfiles/h5diff_udfail.txt | 6 +++--- tools/testfiles/tudfilter.ls | 21 +++++++++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/tools/h5diff/testfiles/h5diff_ud.txt b/tools/h5diff/testfiles/h5diff_ud.txt index 7c9bb5e..ddda3ff 100644 --- a/tools/h5diff/testfiles/h5diff_ud.txt +++ b/tools/h5diff/testfiles/h5diff_ud.txt @@ -2,10 +2,10 @@ file1 file2 --------------------------------------- x x / - x x /dynlib2 + x x /dynlibud group : and 0 differences found -dataset: and +dataset: and 0 differences found EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_udfail.txt b/tools/h5diff/testfiles/h5diff_udfail.txt index 7eb1155..c154c6b 100644 --- a/tools/h5diff/testfiles/h5diff_udfail.txt +++ b/tools/h5diff/testfiles/h5diff_udfail.txt @@ -2,11 +2,11 @@ file1 file2 --------------------------------------- x x / - x x /dynlib2 + x x /dynlibud group : and 0 differences found -dataset: and +dataset: and 0 differences found -warning: dataset cannot be read, user defined filter is not available +warning: dataset cannot be read, user defined filter is not available EXIT CODE: 2 diff --git a/tools/testfiles/tudfilter.ls b/tools/testfiles/tudfilter.ls index e9be094..1882888 100644 --- a/tools/testfiles/tudfilter.ls +++ b/tools/testfiles/tudfilter.ls @@ -1,7 +1,16 @@ -dynlib2 Dataset {20, 10} +dynlibud Dataset {20, 10} Data: - (0,0) Unable to print data. -H5tools-DIAG: Error detected in HDF5:tools (1.8.19) thread 0: - #000: /home/byrn/HDF_Projects/hdf5_18/dev/tools/lib/h5tools_dump.c line 1621 in h5tools_dump_simple_dset(): H5Dread failed - major: Failure in tools library - minor: error in function + (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + (1,9) 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + (3,5) 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + (5,1) 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + (6,7) 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + (8,3) 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + (9,9) 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + (11,2) 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + (12,5) 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + (13,8) 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + (15,1) 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + (16,4) 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + (17,7) 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + (19,0) 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 -- cgit v0.12 From 2db4c7411126b2da7eaa875c5219820eea6978b3 Mon Sep 17 00:00:00 2001 From: lrknox Date: Sat, 21 Jan 2017 09:04:49 -0600 Subject: Change dataset name in expected output file to match name change in test data file. --- tools/testfiles/tudfilter.ddl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testfiles/tudfilter.ddl b/tools/testfiles/tudfilter.ddl index 5bdceec..b2aa7e6 100644 --- a/tools/testfiles/tudfilter.ddl +++ b/tools/testfiles/tudfilter.ddl @@ -1,6 +1,6 @@ HDF5 "tudfilter.h5" { GROUP "/" { - DATASET "dynlib2" { + DATASET "dynlibud" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) } DATA { -- cgit v0.12 From 13a9bbb56d2ebacdf3324d99cf6671cbd40832fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Jan 2017 08:55:13 -0600 Subject: HDFFV-10112 correct form of comment --- tools/h5dump/h5dumpgentest.c | 142 ++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 72eb2e0..ca55696 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -9995,74 +9995,80 @@ static void gent_compound_complex2(void) H5Sclose(space); } -// /* CompoundComplex2D */ -// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { -// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); -// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); -// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); -// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); -// if ((space = H5Screate_simple(F82_RANK2, &nelmts, NULL)) >= 0) { -// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { -// for(i = 0; i < nelmts; i++) { -// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; -// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); -// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); -// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); -// } -// -// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); -// H5Dclose(dset); -// } -// H5Sclose(space); -// } -// H5Tclose(type); -// } -// -// /* CompoundComplex3D */ -// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { -// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); -// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); -// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); -// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); -// if ((space = H5Screate_simple(F82_RANK3, &nelmts, NULL)) >= 0) { -// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { -// for(i = 0; i < nelmts; i++) { -// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; -// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); -// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); -// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); -// } -// -// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); -// H5Dclose(dset); -// } -// H5Sclose(space); -// } -// H5Tclose(type); -// } -// -// /* CompoundComplex4D */ -// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { -// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); -// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); -// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); -// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); -// if ((space = H5Screate_simple(F82_RANK4, &nelmts, NULL)) >= 0) { -// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { -// for(i = 0; i < nelmts; i++) { -// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; -// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); -// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); -// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); -// } -// -// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); -// H5Dclose(dset); -// } -// H5Sclose(space); -// } -// H5Tclose(type); -// } + /* CompoundComplex2D */ +/* + if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { + H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); + H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); + H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); + H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); + if ((space = H5Screate_simple(F82_RANK2, &nelmts, NULL)) >= 0) { + if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + for(i = 0; i < nelmts; i++) { + buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; + buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); + buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + } + + H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + H5Dclose(dset); + } + H5Sclose(space); + } + H5Tclose(type); + } + +*/ + /* CompoundComplex3D */ +/* + if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { + H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); + H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); + H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); + H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); + if ((space = H5Screate_simple(F82_RANK3, &nelmts, NULL)) >= 0) { + if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + for(i = 0; i < nelmts; i++) { + buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; + buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); + buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + } + + H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + H5Dclose(dset); + } + H5Sclose(space); + } + H5Tclose(type); + } + +*/ + /* CompoundComplex4D */ +/* + if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { + H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); + H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); + H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); + H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); + if ((space = H5Screate_simple(F82_RANK4, &nelmts, NULL)) >= 0) { + if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + for(i = 0; i < nelmts; i++) { + buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; + buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); + buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + } + + H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + H5Dclose(dset); + } + H5Sclose(space); + } + H5Tclose(type); + } +*/ H5Fclose(file); } -- cgit v0.12 From dd9b45489d1f072958e8adbd66ba38f3491eff3c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 23 Jan 2017 11:24:38 -0500 Subject: Removed some C++-style comments from H5Omtime.c. Fixes HDFFV-10110. --- src/H5Omtime.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index fdd9a31..58cc2c1 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -179,10 +179,11 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; struct tm tm; void *ret_value = NULL; /* Return value */ -#if _MSC_VER >= 1900 // VS 2015 -// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global -// variable declared in time.h. That variable was deprecated and in VS 2015 -// is removed, with _get_timezone replacing it. +#if _MSC_VER >= 1900 /* VS 2015 */ + /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global + * variable declared in time.h. That variable was deprecated and in VS 2015 + * is removed, with _get_timezone replacing it. + */ long timezone = 0; #endif @@ -225,7 +226,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* BSD-like systems */ the_time += tm.tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) - #if _MSC_VER >= 1900 // VS 2015 + #if _MSC_VER >= 1900 /* VS 2015 */ HDget_timezone(&timezone); #endif /* GNU/Linux systems */ -- cgit v0.12 From 78ea0a0c081a1cf07795fffa2100057538510f81 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Feb 2017 15:30:08 -0600 Subject: HDFFV-9875 Bring changes from develop branch --- CMakeFilters.cmake | 54 +++---- CMakeInstallation.cmake | 140 ++++++++++--------- CMakeLists.txt | 224 +++++++++++++++--------------- CTestConfig.cmake | 10 +- UserMacros.cmake | 5 +- c++/CMakeLists.txt | 6 +- c++/examples/CMakeLists.txt | 10 +- c++/examples/CMakeTests.cmake | 49 +++++-- c++/src/CMakeLists.txt | 7 +- c++/test/CMakeTests.cmake | 25 +++- config/cmake/ConfigureChecks.cmake | 84 +++++------ config/cmake/HDF5Macros.cmake | 24 ++-- config/cmake/HDFCompilerFlags.cmake | 204 +++++++++++++++------------ config/cmake/UserMacros/Windows_MT.cmake | 17 ++- config/cmake/hdf5-config-version.cmake.in | 22 +-- config/cmake/scripts/CTestScript.cmake | 6 +- config/cmake/userblockTest.cmake | 32 ++--- config/cmake/vfdTest.cmake | 45 ++++-- config/cmake_ext_mod/HDFLibMacros.cmake | 9 ++ config/cmake_ext_mod/HDFMacros.cmake | 54 ++++--- examples/CMakeLists.txt | 10 +- examples/CMakeTests.cmake | 92 +++++++++--- fortran/CMakeLists.txt | 10 +- fortran/examples/CMakeLists.txt | 16 +-- fortran/examples/CMakeTests.cmake | 86 +++++++++--- fortran/src/CMakeLists.txt | 82 +++++------ fortran/test/CMakeLists.txt | 52 +++---- fortran/test/CMakeTests.cmake | 6 +- fortran/testpar/CMakeLists.txt | 4 +- hl/CMakeLists.txt | 8 +- hl/c++/CMakeLists.txt | 4 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/examples/CMakeTests.cmake | 17 ++- hl/c++/src/CMakeLists.txt | 7 +- hl/c++/test/CMakeTests.cmake | 15 +- hl/examples/CMakeLists.txt | 4 +- hl/examples/CMakeTests.cmake | 27 +++- hl/fortran/CMakeLists.txt | 4 +- hl/fortran/examples/CMakeLists.txt | 6 +- hl/fortran/examples/CMakeTests.cmake | 2 +- hl/fortran/src/CMakeLists.txt | 28 ++-- hl/fortran/test/CMakeLists.txt | 8 +- hl/fortran/test/CMakeTests.cmake | 2 +- hl/src/CMakeLists.txt | 7 +- hl/test/CMakeLists.txt | 16 +-- hl/test/CMakeTests.cmake | 19 ++- hl/tools/gif2h5/CMakeLists.txt | 22 +-- hl/tools/gif2h5/CMakeTests.cmake | 4 + release_docs/INSTALL_CMake.txt | 2 +- src/CMakeLists.txt | 35 ++--- test/CMakeLists.txt | 62 ++++----- test/CMakeTests.cmake | 189 +++++++++++++++---------- testpar/CMakeTests.cmake | 20 +-- tools/CMakeLists.txt | 2 +- tools/h5copy/CMakeLists.txt | 37 +++-- tools/h5copy/CMakeTests.cmake | 72 +++++----- tools/h5diff/CMakeLists.txt | 53 ++++--- tools/h5dump/CMakeLists.txt | 41 ++++-- tools/h5dump/CMakeTestsPBITS.cmake | 2 +- tools/h5import/CMakeLists.txt | 23 +-- tools/h5import/CMakeTests.cmake | 34 ++--- tools/h5jam/CMakeLists.txt | 23 +-- tools/h5jam/CMakeTests.cmake | 56 ++++---- tools/h5ls/CMakeLists.txt | 39 ++++-- tools/h5ls/CMakeTests.cmake | 14 +- tools/h5repack/CMakeLists.txt | 37 +++-- tools/h5repack/CMakeTests.cmake | 130 ++++++++--------- tools/h5stat/CMakeLists.txt | 37 +++-- tools/h5stat/CMakeTests.cmake | 18 +-- tools/lib/CMakeLists.txt | 7 +- tools/lib/h5diff_array.c | 4 - tools/misc/CMakeLists.txt | 29 ++-- tools/misc/CMakeTests.cmake | 26 ++-- tools/perform/CMakeLists.txt | 12 +- tools/perform/CMakeTests.cmake | 6 +- 75 files changed, 1496 insertions(+), 1101 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index b7aa77d..700ef15 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -17,14 +17,14 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${HDF5_SOURCE_DIR}) - endif (NOT TGZPATH) + endif () set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + else () set (ZLIB_USE_EXTERNAL 0) set (SZIP_USE_EXTERNAL 0) - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") -endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif () +endif () #----------------------------------------------------------------------------- # Option for ZLib support @@ -39,9 +39,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (ZLIB_FOUND) set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) - endif (ZLIB_FOUND) - endif (NOT ZLIB_FOUND) - endif (NOT ZLIB_USE_EXTERNAL) + endif () + endif () + endif () if (ZLIB_FOUND) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) @@ -49,33 +49,33 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (H5_ZLIB_HEADER "zlib.h") set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else (ZLIB_FOUND) + else () if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) message (STATUS "Filter ZLIB is built") - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + else () message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (ZLIB_FOUND) - else (NOT H5_ZLIB_HEADER) + endif () + endif () + else () # This project is being called from within another and ZLib is already configured set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) - endif (NOT H5_ZLIB_HEADER) + endif () if (H5_HAVE_FILTER_DEFLATE) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") -endif (HDF5_ENABLE_Z_LIB_SUPPORT) +endif () #----------------------------------------------------------------------------- # Option for SzLib support @@ -90,37 +90,37 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (SZIP_FOUND) set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) - endif (SZIP_FOUND) - endif (NOT SZIP_FOUND) - endif (NOT SZIP_USE_EXTERNAL) + endif () + endif () + endif () if (SZIP_FOUND) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) - else (SZIP_FOUND) + else () if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) message (STATUS "Filter SZIP is built") - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (SZIP_FOUND) + endif () + endif () if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - endif (H5_HAVE_FILTER_SZIP) + endif () if (HDF5_ENABLE_SZIP_ENCODING) set (H5_HAVE_SZIP_ENCODER 1) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - endif (HDF5_ENABLE_SZIP_ENCODING) -endif (HDF5_ENABLE_SZIP_SUPPORT) + endif () +endif () diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 140bac3..2e3083b 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -10,7 +10,7 @@ if (WIN32) file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT) endif() find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -21,31 +21,33 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - install ( - EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - COMPONENT configinstall - ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) - -#----------------------------------------------------------------------------- -# Export all exported targets to the build tree for use by parent project -#----------------------------------------------------------------------------- -if (NOT HDF5_EXTERNALLY_CONFIGURED) - export ( - TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + if (HDF5_EXPORTED_TARGETS) + install ( + EXPORT ${HDF5_EXPORTED_TARGETS} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + COMPONENT configinstall + ) + endif () + + #----------------------------------------------------------------------------- + # Export all exported targets to the build tree for use by parent project + #----------------------------------------------------------------------------- + if (NOT HDF5_EXTERNALLY_CONFIGURED) + export ( + TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + ) + endif () +endif () #----------------------------------------------------------------------------- # Set includes needed for build @@ -95,7 +97,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) +endif () #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory @@ -110,16 +112,16 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) +endif () #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- if (H5_WORDS_BIGENDIAN) set (BYTESEX big-endian) -else (H5_WORDS_BIGENDIAN) +else () set (BYTESEX little-endian) -endif (H5_WORDS_BIGENDIAN) +endif () configure_file ( ${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY @@ -160,8 +162,8 @@ if (HDF5_PACK_EXAMPLES) DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") -endif (HDF5_PACK_EXAMPLES) + endif () +endif () #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -173,7 +175,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- if (WIN32) configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install @@ -196,7 +198,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - endif (WIN32) + endif () if (HDF5_PACK_INSTALL_DOCS) set (release_files ${release_files} @@ -209,40 +211,40 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - endif (WIN32) + endif () if (CYGWIN) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - endif (CYGWIN) + endif () if (HDF5_ENABLE_PARALLEL) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - endif (HDF5_ENABLE_PARALLEL) - endif (HDF5_PACK_INSTALL_DOCS) + endif () + endif () install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_HOST_UNIX) set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - else (CMAKE_HOST_UNIX) + else () GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) set (CMAKE_GENERIC_PROGRAM_FILES) - endif (CMAKE_HOST_UNIX) -endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + endif () +endif () #----------------------------------------------------------------------------- # Set the cpack variables @@ -252,9 +254,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") if (CDASH_LOCAL) set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - else (CDASH_LOCAL) + else () set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") - endif (CDASH_LOCAL) + endif () set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "") @@ -262,13 +264,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + endif () set (CPACK_PACKAGE_RELOCATABLE TRUE) if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${OVERRIDE_INSTALL_VERSION}") - else (OVERRIDE_INSTALL_VERSION) + else () set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - endif (OVERRIDE_INSTALL_VERSION) + endif () set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") @@ -277,7 +279,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (NSIS_EXECUTABLE) list (APPEND CPACK_GENERATOR "NSIS") - endif (NSIS_EXECUTABLE) + endif () # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) @@ -286,10 +288,10 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (CMAKE_CL_64) set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - else (CMAKE_CL_64) + else () set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - endif (CMAKE_CL_64) + endif () # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. set (CPACK_NSIS_MUI_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico") @@ -299,15 +301,15 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}") if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${OVERRIDE_INSTALL_VERSION}") - else (OVERRIDE_INSTALL_VERSION) + else () set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - endif (OVERRIDE_INSTALL_VERSION) + endif () set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) if (WIX_EXECUTABLE) list (APPEND CPACK_GENERATOR "WIX") - endif (WIX_EXECUTABLE) + endif () #WiX variables set (CPACK_WIX_UNINSTALL "1") # .. variable:: CPACK_WIX_LICENSE_RTF @@ -350,7 +352,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}") if (BUILD_SHARED_LIBS) set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml") - endif (BUILD_SHARED_LIBS) + endif () elseif (APPLE) list (APPEND CPACK_GENERATOR "STGZ") list (APPEND CPACK_GENERATOR "DragNDrop") @@ -385,8 +387,8 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo DESTINATION .. ) - endif (HDF5_PACK_MACOSX_FRAMEWORK AND HDF5_BUILD_FRAMEWORKS) - else (WIN32) + endif () + else () list (APPEND CPACK_GENERATOR "STGZ") set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) @@ -424,12 +426,12 @@ The HDF5 data model, file format, API, library, and tools are open and distribut #----------------------------------------------------------------------------- # configure_file ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) # set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - endif (WIN32) + endif () # By default, do not warn when built on machines using only VS Express: if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) - endif (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + endif () include (InstallRequiredSystemLibraries) set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") @@ -439,23 +441,23 @@ The HDF5 data model, file format, API, library, and tools are open and distribut if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") - else (WIN32) + else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - endif (WIN32) - endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + endif () + endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/") - else (WIN32) + else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - endif (WIN32) - endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (HDF5_PACKAGE_EXTLIBS) + endif () + endif () + endif () + endif () include (CPack) @@ -519,7 +521,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_FORTRAN) + endif () if (HDF5_BUILD_CPP_LIB) cpack_add_component (cpplibraries @@ -534,7 +536,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_CPP_LIB) + endif () if (HDF5_BUILD_TOOLS) cpack_add_component (toolsapplications @@ -555,7 +557,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_TOOLS) + endif () if (HDF5_BUILD_HL_LIB) cpack_add_component (hllibraries @@ -589,7 +591,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_CPP_LIB) + endif () if (HDF5_BUILD_FORTRAN) cpack_add_component (hlfortlibraries DISPLAY_NAME "HDF5 HL Fortran Libraries" @@ -597,7 +599,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Runtime INSTALL_TYPES Full Developer User ) - endif (HDF5_BUILD_FORTRAN) - endif (HDF5_BUILD_HL_LIB) + endif () + endif () -endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) +endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index efd008f..d03ea86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,13 +76,13 @@ endif () # # Override the zlib header file # if (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "zlib.h") -# else (VTK_USE_SYSTEM_ZLIB) +# else () # set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project # set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") # set (ZLIB_LIBRARIES vtkzlib) -# endif (VTK_USE_SYSTEM_ZLIB) -# endif (HDF5_ENABLE_Z_LIB_SUPPORT) +# endif () +# endif () # # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) @@ -100,7 +100,7 @@ option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) mark_as_advanced (HDF5_USE_FOLDERS) if (HDF5_USE_FOLDERS) set_property (GLOBAL PROPERTY USE_FOLDERS ON) -endif (HDF5_USE_FOLDERS) +endif () option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) mark_as_advanced (HDF5_NO_PACKAGES) option (ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF) @@ -185,41 +185,41 @@ set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) if (APPLE) option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) -endif (APPLE) +endif () if (NOT HDF5_INSTALL_BIN_DIR) set (HDF5_INSTALL_BIN_DIR bin) -endif (NOT HDF5_INSTALL_BIN_DIR) +endif () if (NOT HDF5_INSTALL_LIB_DIR) if (APPLE) set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif (APPLE) + endif () set (HDF5_INSTALL_LIB_DIR lib) -endif (NOT HDF5_INSTALL_LIB_DIR) +endif () if (NOT HDF5_INSTALL_INCLUDE_DIR) set (HDF5_INSTALL_INCLUDE_DIR include) -endif (NOT HDF5_INSTALL_INCLUDE_DIR) +endif () if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) - else (HDF5_BUILD_FRAMEWORKS) + else () set (HDF5_INSTALL_EXTRA_DIR share) - endif (HDF5_BUILD_FRAMEWORKS) + endif () set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif (APPLE) + endif () set (HDF5_INSTALL_DATA_DIR share) set (HDF5_INSTALL_CMAKE_DIR share/cmake) - else (NOT WIN32) + else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) - endif (NOT WIN32) -endif (NOT HDF5_INSTALL_DATA_DIR) + endif () +endif () -if(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") +if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) -endif(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") +endif () #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -306,9 +306,9 @@ set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +else () set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +endif () set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") set (HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") @@ -346,16 +346,19 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) if (WIN32) set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) - else (WIN32) + set (CMAKE_PDB_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." + ) + else () set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - endif (WIN32) -else (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +else () # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use @@ -363,7 +366,7 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") -endif (NOT HDF5_EXPORTED_TARGETS) +endif () #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, @@ -389,17 +392,17 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries") -endif (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- -# Option to Build Shared and Static libs, default is static +# Option to Build Shared and Static libs, default is both #----------------------------------------------------------------------------- option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) if (BUILD_SHARED_LIBS) set (H5_ENABLE_SHARED_LIB YES) set (LINK_SHARED_LIBS ${LINK_LIBS}) -endif (BUILD_SHARED_LIBS) +endif () set (H5_ENABLE_STATIC_LIB YES) set (CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -411,8 +414,8 @@ if (BUILD_STATIC_EXECS) if (NOT WIN32) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - endif (NOT WIN32) -endif (BUILD_STATIC_EXECS) + endif () +endif () #----------------------------------------------------------------------------- # Option to use code coverage @@ -422,7 +425,7 @@ if (HDF5_ENABLE_COVERAGE) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -endif (HDF5_ENABLE_COVERAGE) +endif () #----------------------------------------------------------------------------- # Option to indicate using dmalloc @@ -431,7 +434,7 @@ endif (HDF5_ENABLE_COVERAGE) # if (HDF5_ENABLE_USING_DMALLOC) # find_package (DMALLOC) # set (H5_HAVE_DMALLOC DMALLOC_FOUND) -# endif (HDF5_ENABLE_USING_DMALLOC) +# endif () #----------------------------------------------------------------------------- # Option to indicate using a memory checker @@ -439,7 +442,7 @@ endif (HDF5_ENABLE_COVERAGE) option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) if (HDF5_ENABLE_USING_MEMCHECKER) set (H5_USING_MEMCHECKER 1) -endif (HDF5_ENABLE_USING_MEMCHECKER) +endif () #----------------------------------------------------------------------------- # Option to use deprecated public API symbols @@ -447,9 +450,9 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) if (HDF5_ENABLE_DEPRECATED_SYMBOLS) set (H5_NO_DEPRECATED_SYMBOLS 0) -else (HDF5_ENABLE_DEPRECATED_SYMBOLS) +else () set (H5_NO_DEPRECATED_SYMBOLS 1) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif () #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -464,24 +467,24 @@ if (WIN32) add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) add_definitions (-D_CRT_SECURE_NO_WARNINGS) add_definitions (-D_CONSOLE) - endif (NOT CYGWIN) -endif (WIN32) + endif () +endif () if (MSVC) set (CMAKE_MFC_FLAG 0) set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "") -endif (MSVC) +endif () set (MAKE_SYSTEM) if (CMAKE_BUILD_TOOL MATCHES "make") set (MAKE_SYSTEM 1) -endif (CMAKE_BUILD_TOOL MATCHES "make") +endif () set (CFG_INIT "/${CMAKE_CFG_INTDIR}") if (MAKE_SYSTEM) set (CFG_INIT "") -endif (MAKE_SYSTEM) +endif () #----------------------------------------------------------------------------- # Add some definitions for Debug Builds @@ -493,19 +496,19 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) # Enable tracing of the API if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif (HDF5_ENABLE_TRACE) + endif () # Enable instrumenting of the library's internal operations option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) if (HDF5_ENABLE_INSTRUMENT) set (H5_HAVE_INSTRUMENTED_LIBRARY 1) - endif (HDF5_ENABLE_INSTRUMENT) + endif () mark_as_advanced (HDF5_ENABLE_INSTRUMENT) -else (CMAKE_BUILD_TYPE MATCHES Debug) +else () add_definitions (-DNDEBUG) if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif (HDF5_ENABLE_TRACE) -endif (CMAKE_BUILD_TYPE MATCHES Debug) + endif () +endif () #----------------------------------------------------------------------------- # Option to embed library info into executables @@ -513,7 +516,7 @@ endif (CMAKE_BUILD_TYPE MATCHES Debug) option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) if (HDF5_ENABLE_EMBEDDED_LIBINFO) set (H5_HAVE_EMBEDDED_LIBINFO 1) -endif (HDF5_ENABLE_EMBEDDED_LIBINFO) +endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) @@ -538,10 +541,10 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - else (MPI_C_FOUND) + else () message (STATUS "Parallel libraries not found") - endif (MPI_C_FOUND) -endif (HDF5_ENABLE_PARALLEL) + endif () +endif () # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) @@ -549,8 +552,8 @@ if (H5_HAVE_PARALLEL) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES}) if (MPI_C_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif (MPI_C_LINK_FLAGS) -endif (H5_HAVE_PARALLEL) + endif () +endif () set (DEFAULT_API_VERSION "v18") #----------------------------------------------------------------------------- @@ -561,7 +564,7 @@ set (H5_USE_16_API_DEFAULT 0) if (HDF5_USE_16_API_DEFAULT) set (H5_USE_16_API_DEFAULT 1) set (DEFAULT_API_VERSION "v16") -endif (HDF5_USE_16_API_DEFAULT) +endif () #----------------------------------------------------------------------------- # Include user macros @@ -582,13 +585,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + endif () if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - endif (HDF5_PACKAGE_EXTLIBS) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to use threadsafe #----------------------------------------------------------------------------- @@ -600,65 +603,65 @@ if (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) + endif () + endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_FORTRAN) + endif () + endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_CPP_LIB) + endif () + endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_HL_LIB) + endif () + endif () if (H5_HAVE_IOEO) message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) - else (H5_HAVE_IOEO) + else () if (NOT H5_HAVE_PTHREAD_H) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") - endif (NOT H5_HAVE_PTHREAD_H) - endif (H5_HAVE_IOEO) + endif () + endif () set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) if (NOT Threads_FOUND) message (STATUS " **** thread-safe package not found - threads still might work **** ") - endif (NOT Threads_FOUND) -endif (HDF5_ENABLE_THREADSAFE) + endif () +endif () #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) - endif (BUILD_SHARED_LIBS) - endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + endif () + endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} SZIP) - endif (BUILD_SHARED_LIBS) - endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) -endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif () + endif () +endif () #----------------------------------------------------------------------------- # Dashboard and Testing Settings @@ -675,7 +678,7 @@ if (BUILD_TESTING) if (HDF5_TEST_VFD) option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) mark_as_advanced (HDF5_TEST_FHEAP_VFD) - endif (HDF5_TEST_VFD) + endif () option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) @@ -690,14 +693,14 @@ if (BUILD_TESTING) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + endif () if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - endif (H5_HAVE_PARALLEL) - endif (NOT HDF5_EXTERNALLY_CONFIGURED) -endif (BUILD_TESTING) + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to build HDF5 Tools @@ -706,8 +709,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - endif (HDF5_BUILD_TOOLS) -endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + endif () +endif () #----------------------------------------------------------------------------- # Option to build examples @@ -716,8 +719,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/ex option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - endif (HDF5_BUILD_EXAMPLES) -endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + endif () +endif () #----------------------------------------------------------------------------- # Option to build High Level API's @@ -727,8 +730,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - endif (HDF5_BUILD_HL_LIB) -endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + endif () +endif () #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -746,27 +749,28 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") set (SKIP_HDF5_FORTRAN_SHARED ON) - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (BUILD_SHARED_LIBS AND APPLE) + endif () + endif () option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) + include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) - endif (NOT FORTRAN_HAVE_ISO_C_BINDING) - endif (HDF5_ENABLE_F2003) + endif () + endif () add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") - endif (HDF5_BUILD_HL_LIB) - endif (HDF5_BUILD_FORTRAN) -endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library @@ -778,22 +782,22 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) + endif () + endif () if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) - endif (CMAKE_NO_STD_NAMESPACE) + endif () add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++) - endif (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") - endif (HDF5_BUILD_HL_LIB) - endif (HDF5_BUILD_CPP_LIB) -endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Check if Fortran's default real is double precision. If it is and HL is @@ -802,8 +806,8 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++" if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB ) if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ") - endif (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) - endif (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB ) + endif () + endif () #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 9e95b4c..22752f6 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -11,10 +11,10 @@ set (CTEST_DROP_METHOD "http") if (CDASH_LOCAL) set (CTEST_DROP_SITE "cdash-internal.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF5.1.8") -else (CDASH_LOCAL) +else () set (CTEST_DROP_SITE "cdash.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF518") -endif (CDASH_LOCAL) +endif () set (CTEST_DROP_SITE_CDASH TRUE) set (UPDATE_TYPE git) @@ -23,9 +23,9 @@ set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds= set (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -set (CTEST_TEST_TIMEOUT 1200 CACHE STRING - "Maximum time allowed before CTest will kill the test.") -set (DART_TESTING_TIMEOUT 1200 CACHE STRING +set (CTEST_TEST_TIMEOUT 1200 CACHE STRING + "Maximum time allowed before CTest will kill the test.") +set (DART_TESTING_TIMEOUT 1200 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING diff --git a/UserMacros.cmake b/UserMacros.cmake index 65ea5d4..4593753 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -9,14 +9,13 @@ #----------------------------------------------------------------------------- MACRO (MACRO_USER_DEFINED_LIBS) set (USER_DEFINED_VALUE "FALSE") -ENDMACRO (MACRO_USER_DEFINED_LIBS) +ENDMACRO () #------------------------------------------------------------------------------- option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -endif (BUILD_USER_DEFINED_LIBS) +endif () #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- - \ No newline at end of file diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 7945c3e..c9c4815 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_SKIP_MPICXX") add_definitions ("-DMPICH_IGNORE_CXX_SEEK") -endif (H5_HAVE_PARALLEL) +endif () add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) @@ -34,11 +34,11 @@ add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index a86c16f..e5b0b4a 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required (VERSION 3.2.2) +PROJECT (HDF5_CPP_EXAMPLES) + # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. # -------------------------------------------------------------------- -PROJECT (HDF5_CPP_EXAMPLES) - #----------------------------------------------------------------------------- # Define examples #----------------------------------------------------------------------------- @@ -38,7 +38,7 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach (example ${examples}) +endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) @@ -46,8 +46,8 @@ foreach (example ${tutr_examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach (example ${tutr_examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 4db8c68..8b5c6b9 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ add_test ( NAME CPP_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Group.h5 SDS.h5 SDScompound.h5 @@ -17,16 +17,29 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex-clear-objects") foreach (example ${examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_${example}") - endforeach (example ${examples}) + endforeach () #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) @@ -34,7 +47,7 @@ add_test ( NAME CPP_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove h5tutr_cmprss.h5 h5tutr_dset.h5 h5tutr_extend.h5 @@ -44,18 +57,30 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_tutr-clear-objects") - + foreach (example ${tutr_examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_${example}") - endforeach (example ${tutr_examples}) + endforeach () #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar) - \ No newline at end of file diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 2ffceb4..0a76d6f 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -102,7 +102,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_CPP_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -122,7 +122,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) install ( TARGETS @@ -135,4 +136,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT cpplibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 91c36b0..cf07ab3 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -19,7 +19,20 @@ add_test ( tfattrs.h5 ) -add_test (NAME CPP_testhdf5 COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_testhdf5 COMMAND $) +else () + add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_testhdf5.txt" + #-D "TEST_REFERENCE=cpp_testhdf5.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) if (HDF5_TEST_VFD) @@ -35,7 +48,7 @@ if (HDF5_TEST_VFD) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -64,12 +77,12 @@ if (HDF5_TEST_VFD) ) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_VFD_TEST) + endif () + ENDMACRO () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 606fae9..7a1a4b0 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -10,7 +10,7 @@ include (${HDF_RESOURCES_EXT_DIR}/ConfigureChecks.cmake) option (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) if (HDF5_Enable_Clear_File_Buffers) set (H5_CLEAR_MEMORY 1) -endif (HDF5_Enable_Clear_File_Buffers) +endif () MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- @@ -19,7 +19,7 @@ MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) if (HDF5_STRICT_FORMAT_CHECKS) set (H5_STRICT_FORMAT_CHECKS 1) -endif (HDF5_STRICT_FORMAT_CHECKS) +endif () MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- @@ -28,7 +28,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) if (HDF5_METADATA_TRACE_FILE) set (H5_METADATA_TRACE_FILE 1) -endif (HDF5_METADATA_TRACE_FILE) +endif () MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # ---------------------------------------------------------------------- @@ -40,7 +40,7 @@ MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) if (HDF5_WANT_DATA_ACCURACY) set (H5_WANT_DATA_ACCURACY 1) -endif (HDF5_WANT_DATA_ACCURACY) +endif () MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # ---------------------------------------------------------------------- @@ -52,7 +52,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) if (HDF5_WANT_DCONV_EXCEPTION) set (H5_WANT_DCONV_EXCEPTION 1) -endif (HDF5_WANT_DCONV_EXCEPTION) +endif () MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # ---------------------------------------------------------------------- @@ -61,7 +61,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) if (HDF5_ENABLE_CODESTACK) set (H5_HAVE_CODESTACK 1) -endif (HDF5_ENABLE_CODESTACK) +endif () MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) #----------------------------------------------------------------------------- @@ -70,7 +70,7 @@ MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) if (HDF5_ENABLE_HSIZET) set (${HDF_PREFIX}_HAVE_LARGE_HSIZET 1) -endif (HDF5_ENABLE_HSIZET) +endif () # so far we have no check for this set (H5_HAVE_TMPFILE 1) @@ -84,10 +84,10 @@ set (H5_DEFAULT_VFD H5FD_SEC2) if (NOT DEFINED "H5_DEFAULT_PLUGINDIR") if (WINDOWS) set (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%\\\\hdf5\\\\lib\\\\plugin") - else (WINDOWS) + else () set (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") - endif (WINDOWS) -endif (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + endif () +endif () if (WINDOWS) set (H5_HAVE_WINDOWS 1) @@ -96,7 +96,7 @@ if (WINDOWS) # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) set (H5_HAVE_WINDOW_PATH 1) -endif (WINDOWS) +endif () # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -117,15 +117,15 @@ if (NOT WINDOWS) elseif (CLOCK_GETTIME_IN_LIBPOSIX4) set (H5_HAVE_CLOCK_GETTIME 1) list (APPEND LINK_LIBS posix4) - endif (CLOCK_GETTIME_IN_LIBC) -endif (NOT WINDOWS) + endif () +endif () #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Check if Direct I/O driver works #----------------------------------------------------------------------------- if (NOT WINDOWS) - option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF) if (HDF5_ENABLE_DIRECT_VFD) set (msg "Performing TEST_DIRECT_VFD_WORKS") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") @@ -136,26 +136,26 @@ if (NOT WINDOWS) OUTPUT_VARIABLE OUTPUT ) if (TEST_DIRECT_VFD_WORKS_COMPILE) - if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) HDF_FUNCTION_TEST (HAVE_DIRECT) set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") add_definitions ("-D_GNU_SOURCE") - else (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) - else (TEST_DIRECT_VFD_WORKS_COMPILE ) + endif () + else ( ) set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - endif (TEST_DIRECT_VFD_WORKS_COMPILE) - endif (HDF5_ENABLE_DIRECT_VFD) -endif (NOT WINDOWS) + endif () + endif () +endif () #----------------------------------------------------------------------------- @@ -171,41 +171,41 @@ MACRO (H5ConversionTests TEST msg) OUTPUT_VARIABLE OUTPUT ) if (${TEST}_COMPILE) - if (${TEST}_RUN MATCHES 0) + if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else (${TEST}_RUN MATCHES 0) + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif (${TEST}_RUN MATCHES 0) - else (${TEST}_COMPILE ) + endif () + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - endif (${TEST}_COMPILE) + endif () - endif ("${TEST}" MATCHES "^${TEST}$") -ENDMACRO (H5ConversionTests) + endif () +ENDMACRO () #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- -MACRO (H5MiscConversionTest VAR TEST msg) +MACRO (H5MiscConversionTest VAR TEST msg) if ("${TEST}" MATCHES "^${TEST}$") if (${VAR}) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else (${VAR}) + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - endif (${VAR}) - endif ("${TEST}" MATCHES "^${TEST}$") -ENDMACRO (H5MiscConversionTest) + endif () + endif () +ENDMACRO () #----------------------------------------------------------------------------- # Check various conversion capabilities @@ -213,9 +213,9 @@ ENDMACRO (H5MiscConversionTest) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm to convert -# 'long double' to '(unsigned) long' values. (This flag should only be set for -# the IBM Power6 Linux. When the bit sequence of long double is -# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +# 'long double' to '(unsigned) long' values. (This flag should only be set for +# the IBM Power6 Linux. When the bit sequence of long double is +# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long # is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. @@ -223,10 +223,10 @@ ENDMACRO (H5MiscConversionTest) H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm -# to convert some values of '(unsigned) long' to 'long double' values. -# (This flag should be off for all machines, except for IBM Power6 Linux, -# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., -# ..., 7fffff..., the compiler uses a unknown algorithm. We define a +# to convert some values of '(unsigned) long' to 'long double' values. +# (This flag should be off for all machines, except for IBM Power6 Linux, +# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +# ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm") @@ -255,7 +255,7 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # ----------------------------------------------------------------------- # wrapper script variables -# +# set (prefix ${CMAKE_INSTALL_PREFIX}) set (exec_prefix "\${prefix}") set (libdir "${exec_prefix}/lib") @@ -266,4 +266,4 @@ set (CXX ${CMAKE_CXX_COMPILER}) set (FC ${CMAKE_Fortran_COMPILER}) foreach (LINK_LIB ${LINK_LIBS}) set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach (LINK_LIB ${LINK_LIBS}) +endforeach () diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index d88e672..747e043 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -5,21 +5,21 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (${libtype} MATCHES "SHARED") if (ARGN) set (PACKAGE_SOVERSION ${ARGN}) - else (ARGN) + else () set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION}) - endif (ARGN) + endif () if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - else (WIN32) + else () set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - endif (WIN32) + endif () set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${PACKAGE_SOVERSION}") - else (WIN32) + else () set_target_properties (${libtarget} PROPERTIES SOVERSION ${PACKAGE_SOVERSION}) - endif (WIN32) - endif (${libtype} MATCHES "SHARED") + endif () + endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries @@ -31,7 +31,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - endif (HDF5_BUILD_WITH_INSTALL_NAME) + endif () if (HDF5_BUILD_FRAMEWORKS) if (${libtype} MATCHES "SHARED") # adapt target to build frameworks instead of dylibs @@ -42,8 +42,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) MACOSX_FRAMEWORK_IDENTIFIER org.hdfgroup.${libtarget} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${HDF5_PACKAGE_VERSION_MAJOR} MACOSX_FRAMEWORK_BUNDLE_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - endif (${libtype} MATCHES "SHARED") - endif (HDF5_BUILD_FRAMEWORKS) - endif (APPLE) + endif () + endif () + endif () -endmacro (H5_SET_LIB_OPTIONS) +endmacro () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index c637c73..238e363 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,21 +12,21 @@ if (CMAKE_COMPILER_IS_GNUCC) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99") + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") endif () - else (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99") + else () + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -41,22 +41,22 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - endif (MSVC) + endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif (WIN32) + endif () # Borland uses -w- to suppress warnings. if (BORLAND) set (HDF5_WARNINGS_BLOCKED 1) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - endif (BORLAND) + endif () # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif (NOT HDF5_WARNINGS_BLOCKED) -endif (HDF5_DISABLE_COMPILER_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,10 +64,22 @@ endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS_5 "${CMAKE_C_FLAGS_5} -Wcast-qual") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs") + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + endif () + + #----------------------------------------------------------------------------- + # Option to allow the user to enable developer warnings + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) + if (HDF5_ENABLE_DEV_WARNINGS) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winline -Waggregate-return") + else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-inline -Wno-aggregate-return") + endif () + # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") @@ -83,75 +95,102 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wpacked -Wdisabled-optimization") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn") + else () + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wno-missing-noreturn") + endif () # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wunreachable-code") - endif() + set (H5_CFLAGS1_5 "${H5_CFLAGS1_5} -Wformat=2") # Append warning flags from gcc-3.3* case set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") # Append more extra warning flags that only gcc 4.1+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wunsafe-loop-optimizations") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-strict-overflow") # Append more extra warning flags that only gcc 4.3+ know about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") - endif() + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wjump-misses-init -Wunsuffixed-float-constants") + endif () # Append more extra warning flags that only gcc 4.6+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const") + endif () + endif () + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wunreachable-code") + endif () # Append more extra warning flags that only gcc 4.7+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn") + endif () + endif () # Append more extra warning flags that only gcc 4.8+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wsuggest-attribute=format") - endif() + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format") + endif () + endif () # Append more extra warning flags that only gcc 4.9+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdate-time -Wopenmp-simd") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time -Wopenmp-simd") + endif () # (There was no release of gcc 5.0) # Append more extra warning flags that only gcc 5.1+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) - set (H5_CFLAGS6 "${H5_CFLAGS6} -Warray-bounds=2 -Wc99-c11-compat") - endif() + set (H5_CFLAGS3 "${H5_CFLAGS3} -Warray-bounds=2 -Wc99-c11-compat") + endif () + + # Append more extra warning flags that only gcc 6.x+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") + endif () -endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings @@ -159,16 +198,23 @@ endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) if (HDF5_ENABLE_ALL_WARNINGS) if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - else (MSVC) + if (HDF5_ENABLE_DEV_WARNINGS) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + else () + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () + else () if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_ALL_WARNINGS) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2}") + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -180,12 +226,12 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - else (MSVC) + else () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_GROUPZERO_WARNINGS) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -197,10 +243,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPONE_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -212,10 +258,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTWO_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -227,10 +273,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -239,28 +285,8 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) if (HDF5_ENABLE_GROUPFOUR_WARNINGS) if (NOT MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -if (HDF5_ENABLE_GROUPFIVE_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPSIX_WARNINGS "Enable group six warnings" OFF) -if (HDF5_ENABLE_GROUPSIX_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS6}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPSIX_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse @@ -268,7 +294,7 @@ endif (HDF5_ENABLE_GROUPSIX_WARNINGS) #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) +endif () +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCXX) +endif () diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index a54f22c..d30d4d5 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -3,7 +3,7 @@ ######################################################## # To use this option, copy both the macro and option code -# into the root UserMacros.cmake file. +# into the root UserMacros.cmake file. # OR add an include to the root UserMacros.cmake file: # INCLUDE(path_to_file/WINDOWS_MT.cmake) @@ -19,23 +19,22 @@ MACRO (TARGET_STATIC_CRT_FLAGS) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/MD") string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif (${flag_var} MATCHES "/MD") - endforeach (flag_var) + endif () + endforeach () foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/libs:dll") string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - endif (${flag_var} MATCHES "/libs:dll") - endforeach (flag_var) + endif () + endforeach () set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - endif (MSVC AND NOT BUILD_SHARED_LIBS) -ENDMACRO (TARGET_STATIC_CRT_FLAGS) + endif () +ENDMACRO () #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -endif (BUILD_STATIC_CRT_LIBS) - \ No newline at end of file +endif () diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 5911fa7..45a832e 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -14,24 +14,24 @@ if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - + set (PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") set (PACKAGE_VERSION_EXACT TRUE) - + if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") # not using this yet - endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") + endif () + endif () + else () + set (PACKAGE_VERSION_COMPATIBLE FALSE) + endif () + endif () endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index c7704c6..3937cfc 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -73,10 +73,10 @@ if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) endif() @@ -201,7 +201,7 @@ else() "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) endif() - + #----------------------------------------------------------------------------- ## -- set output to english set($ENV{LC_MESSAGES} "en_EN") diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 0775cbe..43db733 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -4,28 +4,28 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -endif (NOT TEST_PROGRAM) +endif () if (NOT TEST_GET_PROGRAM) message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -endif (NOT TEST_GET_PROGRAM) +endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_HFILE) message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -endif (NOT TEST_HFILE) +endif () if (NOT TEST_UFILE) message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -endif (NOT TEST_UFILE) +endif () if (NOT TEST_CHECKUB) message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -endif (NOT TEST_CHECKUB) +endif () #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +#endif () #if (NOT TEST_OFILE) # message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#endif (NOT TEST_OFILE) +#endif () set (TEST_U_STRING_LEN 0) set (TEST_O_STRING_LEN 0) @@ -53,9 +53,9 @@ if (TEST_CHECKUB STREQUAL "YES") ) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - endif (NOT ${TEST_RESULT} STREQUAL "0") + endif () file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - endif (TEST_OFILE) + endif () MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) @@ -73,10 +73,10 @@ if (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - else (NOT TEST_O_STRING_LEN STREQUAL "0") + else () file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - endif (NOT TEST_O_STRING_LEN STREQUAL "0") + endif () #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -99,8 +99,8 @@ if (TEST_CHECKUB STREQUAL "YES") # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -else (TEST_CHECKUB STREQUAL "YES") + endif () +else () # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -112,8 +112,8 @@ else (TEST_CHECKUB STREQUAL "YES") ) if (NOT TEST_H_STRING_LEN STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - endif (NOT TEST_H_STRING_LEN STREQUAL "0") -endif (TEST_CHECKUB STREQUAL "YES") + endif () +endif () # everything went fine... message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 10f0a7b..9c93fb7 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -4,29 +4,36 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_VFD) message (FATAL_ERROR "Require TEST_VFD to be defined") -endif (NOT TEST_VFD) +endif () -set (ERROR_APPEND 1) +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif () message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") set (ENV{HDF5_DRIVER} "${TEST_VFD}") + # run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( +execute_process ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out ERROR_FILE ${TEST_OUTPUT}_${TEST_VFD}.err OUTPUT_VARIABLE TEST_OUT @@ -35,16 +42,24 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") +# if the .err file exists and ERRROR_APPEND is enabled if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) +endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + endif() + endif() + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") # everything went fine... message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") - diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 7d19b7a..9d50f50 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -17,6 +17,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "GIT") @@ -33,6 +34,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "TGZ") @@ -49,6 +51,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) endif () @@ -104,6 +107,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -121,6 +125,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -138,6 +143,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -194,6 +200,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "GIT") @@ -210,6 +217,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "TGZ") @@ -226,6 +234,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 67a92d1..ecf3be0 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -43,10 +43,16 @@ endmacro () #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${libtarget} OUTPUT_NAME_RELWITHDEBINFO) + get_target_property (target_type ${libtarget} TYPE) + if (${libtype} MATCHES "SHARED") + set (targetfilename $) + else () + get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) + set (targetfilename $/${target_name}.pdb) + endif () install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + ${targetfilename} DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo @@ -58,11 +64,9 @@ endmacro () #------------------------------------------------------------------------------- macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${progtarget} OUTPUT_NAME_RELWITHDEBINFO) - get_target_property (target_prefix ${progtarget} PREFIX) install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + $ DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo @@ -98,6 +102,18 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) + if (${libtype} MATCHES "STATIC") + if (WIN32) + set_target_properties (${libtarget} + PROPERTIES + COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME} + COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME} + COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME} + COMPILE_PDB_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" + ) + endif () + endif () #----- Use MSVC Naming conventions for Shared Libraries if (MINGW AND ${libtype} MATCHES "SHARED") @@ -108,7 +124,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) PREFIX "" ) endif () - endmacro () #------------------------------------------------------------------------------- @@ -135,7 +150,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) + ) endif () else () if (CYGWIN) @@ -164,7 +179,6 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) endif () endif () - endmacro () #------------------------------------------------------------------------------- @@ -172,22 +186,14 @@ macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") else () - set_target_properties (${wintarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "${addlinkflags}" - ) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") endif () endmacro () #------------------------------------------------------------------------------- macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) - set_target_properties (${wintarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "${addlinkflags}" - ) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") endif () endmacro () @@ -202,17 +208,9 @@ endmacro () macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (MSVC) if (${libtype} MATCHES "SHARED") - set_target_properties (${forttarget} - PROPERTIES - COMPILE_FLAGS "/dll ${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") else () - set_target_properties (${forttarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") endif () endif () endmacro () diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index aa5a8f3..c9dfed6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,8 +48,8 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) - endif (BUILD_SHARED_LIBS) -endforeach (example ${examples}) + endif () +endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) @@ -63,9 +63,9 @@ if (H5_HAVE_PARALLEL) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) - endif (BUILD_SHARED_LIBS) -endif (H5_HAVE_PARALLEL) + endif () +endif () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 42b42b3..e359ed7 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -8,19 +8,19 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared") file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w) - endif (BUILD_SHARED_LIBS) + endif () # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -49,29 +49,42 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-${example}") - endforeach (example ${examples}) + endforeach () if (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-shared-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -102,32 +115,71 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-shared-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-${example}") - endforeach (example ${examples}) - endif (BUILD_SHARED_LIBS) + endforeach () + endif () ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) - add_test (NAME EXAMPLES-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example.txt" + #-D "TEST_REFERENCE=ph5example.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-ph5example") if (BUILD_SHARED_LIBS) - add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example-shared.txt" + #-D "TEST_REFERENCE=ph5example-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-ph5example") - endif (BUILD_SHARED_LIBS) - endif (H5_HAVE_PARALLEL AND NOT WIN32) + endif () + endif () diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index d4e3c11..f7179cf 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -6,8 +6,8 @@ if (H5_HAVE_PARALLEL) set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif (MPI_Fortran_LINK_FLAGS) -endif (H5_HAVE_PARALLEL) + endif () +endif () #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -19,7 +19,7 @@ add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Testing @@ -28,5 +28,5 @@ if (BUILD_TESTING) add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) if (MPI_Fortran_FOUND) add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - endif (MPI_Fortran_FOUND) -endif (BUILD_TESTING) + endif () +endif () diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index c7a951a..6030f83 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -66,8 +66,8 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endforeach (example ${examples}) + endif () +endforeach () if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) @@ -98,9 +98,9 @@ if (HDF5_ENABLE_F2003) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) + endif () + endforeach () +endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) @@ -132,9 +132,9 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () +endif () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 63e75c2..e616979 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -26,7 +26,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-clear-objects") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( @@ -49,45 +49,97 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-shared-clear-objects") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () foreach (example ${examples}) - add_test (NAME f90_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex_${example} COMMAND $) + else () + add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}.txt" + #-D "TEST_REFERENCE=f90_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f90_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex-shared_${example} COMMAND $) + else () + add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f90_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-shared_${example}") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endforeach (example ${examples}) + endif () +endforeach () if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) - add_test (NAME f03_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex_${example} COMMAND $) + else () + add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}.txt" + #-D "TEST_REFERENCE=f03_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f03_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f03_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex-shared_${example} COMMAND $) + else () + add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f03_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f03_ex-shared_${example}") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) +endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () +endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index bc6fe75..689439c 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -8,16 +8,16 @@ if (WIN32) if (MSVC) if (NOT H5_HAVE_PARALLEL) set (H5_NOPAREXP ";") - endif (NOT H5_HAVE_PARALLEL) + endif () if (NOT HDF5_ENABLE_F2003) set (H5_NOF03EXP ";") - else (NOT HDF5_ENABLE_F2003) + else () set (H5_F03EXP ";") - endif (NOT HDF5_ENABLE_F2003) + endif () configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - endif (MSVC) - endif (BUILD_SHARED_LIBS) -endif (WIN32) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -33,9 +33,9 @@ if (FORTRAN_HAVE_STORAGE_SIZE) add_executable (H5test_FortranHavekind-shared ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_STORAGE_SIZE.f90 ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () set (H5_TEST_KIND_NAME "h5test_kind_storage_size_mod") -else (FORTRAN_HAVE_STORAGE_SIZE) +else () if (FORTRAN_HAVE_SIZEOF) add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 @@ -44,9 +44,9 @@ else (FORTRAN_HAVE_STORAGE_SIZE) add_executable (H5test_FortranHavekind-shared ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () set (H5_TEST_KIND_NAME "h5test_kind_sizeof_mod") - else (FORTRAN_HAVE_SIZEOF) + else () add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) @@ -54,21 +54,21 @@ else (FORTRAN_HAVE_STORAGE_SIZE) add_executable (H5test_FortranHavekind-shared ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - endif (FORTRAN_HAVE_SIZEOF) -endif (FORTRAN_HAVE_STORAGE_SIZE) + endif () + endif () +endif () if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5test_FortranHavekind-shared PROPERTIES COMPILE_FLAGS "/MT" ) - endif (BUILD_SHARED_LIBS) + endif () set_target_properties (H5test_FortranHavekind PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif (WIN32 AND MSVC) +endif () set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static @@ -78,7 +78,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () set (CMD $) add_custom_command ( @@ -98,12 +98,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif (BUILD_SHARED_LIBS) + endif () set_target_properties (H5fortran_detect PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif (WIN32 AND MSVC) +endif () set_target_properties (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) set (CMD $) @@ -119,15 +119,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else (WIN32) + else () set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else (WIN32) +else () set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif (WIN32) +endif () INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -174,7 +174,7 @@ if (H5_HAVE_PARALLEL) ${f90CStub_C_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c ) -endif (H5_HAVE_PARALLEL) +endif () set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) set (f90CStub_C_HDRS @@ -208,7 +208,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Fortran 2003 standard @@ -216,10 +216,10 @@ endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (HDF5_ENABLE_F2003) # F2003 features are enabled set (F_STATUS "_F03") -else (HDF5_ENABLE_F2003) +else () # F2003 features are not enabled set (F_STATUS "_F90") -endif (HDF5_ENABLE_F2003) +endif () #----------------------------------------------------------------------------- # Fortran Real Size @@ -227,10 +227,10 @@ endif (HDF5_ENABLE_F2003) if (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 4 bytes, so include double signatures set (F_DBLE "Include") -else (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +else () # default real is 8 bytes, so exclude double signatures set (F_DBLE "Exclude") -endif (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +endif () #----------------------------------------------------------------------------- # Fortran Modules @@ -277,12 +277,12 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 ) -else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +else () set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 ) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif () set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran) #----------------------------------------------------------------------------- @@ -294,7 +294,7 @@ TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES @@ -307,7 +307,7 @@ if (WIN32) set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -315,12 +315,12 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${MPI_Fortran_LIBRARIES}) - endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_F90_LIBSH_TARGET} PROPERTIES @@ -335,9 +335,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) + endif () set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -433,7 +433,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -442,7 +442,9 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () + INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) + #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) install ( TARGETS @@ -455,4 +457,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT fortlibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 3077c53..c362564 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -37,7 +37,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () # See if the F2008 intrinsic STORAGE_SIZE and C_SIZEOF are supported. If not then # fall back to F2003. If F2003 not supported then use F90 for the tests. @@ -47,18 +47,18 @@ if (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F08.f90 tf.f90) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F08.f90 tf.f90) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () elseif (HDF5_ENABLE_F2003) add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F03.f90 tf.f90) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F03.f90 tf.f90) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -else (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) + endif () +else () add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F90.f90 tf.f90) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F90.f90 tf.f90) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) + endif () +endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} @@ -78,12 +78,12 @@ if (WIN32) set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -104,8 +104,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () #----------------------------------------------------------------------------- # Add Tests @@ -138,7 +138,7 @@ target_link_libraries (testhdf5_fortran ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran @@ -172,14 +172,14 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (testhdf5_fortran-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 @@ -199,7 +199,7 @@ target_link_libraries (testhdf5_fortran_1_8 ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran @@ -224,14 +224,14 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (testhdf5_fortran_1_8-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) @@ -254,7 +254,7 @@ if (HDF5_ENABLE_F2003) ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran @@ -281,15 +281,15 @@ if (HDF5_ENABLE_F2003) ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fortranlib_test_F03-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (HDF5_ENABLE_F2003) + endif () +endif () #-- Adding test for fflush1 add_executable (fflush1 fflush1.f90) @@ -302,7 +302,7 @@ target_link_libraries (fflush1 ) if (WIN32 AND MSVC) target_link_libraries (fflush1 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran @@ -320,14 +320,14 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush1-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fflush1-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush1-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for fflush2 add_executable (fflush2 fflush2.f90) @@ -340,7 +340,7 @@ target_link_libraries (fflush2 ) if (WIN32 AND MSVC) target_link_libraries (fflush2 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran @@ -358,13 +358,13 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush2-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fflush2-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush2-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 154e70c..7cb1bd0 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -18,7 +18,7 @@ if (HDF5_ENABLE_F2003) add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) -endif (HDF5_ENABLE_F2003) +endif () #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1 COMMAND $) @@ -42,7 +42,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03) - endif (HDF5_ENABLE_F2003) + endif () #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1-shared COMMAND $) @@ -51,4 +51,4 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 add_test (NAME FORTRAN_fflush2-shared COMMAND $) set_tests_properties (FORTRAN_fflush2-shared PROPERTIES DEPENDS FORTRAN_fflush1-shared) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 03bb36d..ae88ebc 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -18,7 +18,7 @@ add_executable (parallel_test ) TARGET_NAMING (parallel_test STATIC) TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ") -target_link_libraries (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -26,7 +26,7 @@ target_link_libraries (parallel_test ) if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 18fe9f7..a47e023 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -17,16 +17,16 @@ add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -endif (HDF5_BUILD_TOOLS) +endif () #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #-- Build the Unit testing if requested if (NOT HDF5_EXTERNALLY_CONFIGURED) if (BUILD_TESTING) add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - endif (BUILD_TESTING) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 927f219..91bfa14 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -11,7 +11,7 @@ add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper @@ -19,4 +19,4 @@ endif (HDF5_BUILD_EXAMPLES) if (BUILD_TESTING) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 3703889..33ad1e5 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -23,4 +23,4 @@ set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index bac9fdf..86bdd93 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -8,9 +8,22 @@ add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove PTcppexampleFL.h5 ) -add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +else () + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ptExampleFL.txt" + #-D "TEST_REFERENCE=ptExampleFL.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index c237823..e872eb1 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -42,7 +42,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_CPP_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -62,7 +62,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) install ( TARGETS @@ -75,4 +76,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlcpplibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index e36b5aa..d41f79e 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -4,5 +4,18 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + +if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_CPP_ptableTest COMMAND $) +else () + add_test (NAME HL_CPP_ptableTest COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ptableTest.txt" + #-D "TEST_REFERENCE=hl_ptableTest.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 195d10c..1144e0f 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -32,10 +32,10 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (hl_ex_${example} STATIC " " " ") target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) -endforeach (example ${examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 6384aa5..5645155 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -12,7 +12,7 @@ set (HDF5_TEST_FILES foreach (h5_file ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "hl_ex_ex_ds1_files") -endforeach (h5_file ${HDF5_TEST_FILES}) +endforeach () add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list}) # Remove any output file left over from previous test run @@ -46,9 +46,22 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ set (last_test "HL_ex-clear-objects") foreach (example ${examples}) - add_test (NAME HL_ex_${example} COMMAND $) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "HL_ex_${example}") -endforeach (example ${examples}) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_ex_${example} COMMAND $) + else () + add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ex_${example}.txt" + #-D "TEST_REFERENCE=hl_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "HL_ex_${example}") +endforeach () diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index da50ead..c651ce9 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -11,11 +11,11 @@ add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index bd250d0..dfe6102 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -18,7 +18,7 @@ foreach (example ${examples}) add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} STATIC " " " ") - target_link_libraries (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -27,10 +27,10 @@ foreach (example ${examples}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -endforeach (example ${examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 954a01b..032190b 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -7,4 +7,4 @@ foreach (example ${examples}) add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) -endforeach (example ${examples}) +endforeach () diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 3f10d49..3c8bc46 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -5,15 +5,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else (WIN32) + else () set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else (WIN32) +else () set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Setup include Directories @@ -66,7 +66,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Fortran Modules @@ -94,7 +94,7 @@ if (WIN32) set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -102,7 +102,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") @@ -118,9 +118,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) + endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -158,7 +158,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -167,7 +167,9 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) + #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) install ( TARGETS @@ -180,4 +182,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlfortlibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 2475265..e2baa69 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -25,7 +25,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.f90) @@ -46,7 +46,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.f90) @@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.f90) @@ -88,6 +88,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () include (CMakeTests.cmake) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 499e255..5af9ced 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -61,4 +61,4 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 77c69f2..e15bc46 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -50,7 +50,7 @@ if (BUILD_SHARED_LIBS) ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIBSH_TARGET}") set (install_targets ${install_targets} ${HDF5_HL_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -70,7 +70,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) install ( TARGETS @@ -83,4 +84,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hllibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index f07608c..a9f54ec 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -14,8 +14,8 @@ PROJECT (HDF5_HL_TEST) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) +include_directories (${CMAKE_CURRENT_BINARY_DIR}) +include_directories (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Macro used to add a unit test @@ -30,7 +30,7 @@ MACRO (HL_ADD_EXE hl_name) ${HDF5_TEST_LIB_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO (HL_ADD_EXE) +ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) @@ -38,11 +38,11 @@ MACRO (HL_ADD_SHEXE hl_name) TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO (HL_ADD_SHEXE) +ENDMACRO () HL_ADD_EXE (test_ds) HL_ADD_EXE (test_dset_opt) @@ -56,8 +56,8 @@ TARGET_NAMING (hl_test_packet STATIC) TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} ) set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) @@ -71,10 +71,10 @@ if (HDF5_BUILD_GENERATORS) TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) -endif (HDF5_BUILD_GENERATORS) +endif () include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 619e991..e8b7079 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -35,14 +35,27 @@ add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tes # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name) - add_test (NAME HL_${hl_name} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_${hl_name} COMMAND $) + else () + add_test (NAME HL_${hl_name} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_${hl_name}.txt" + #-D "TEST_REFERENCE=hl_${hl_name}.out" + -D "TEST_FOLDER=${HDF5_HL_TEST_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} ) endif () -ENDMACRO (HL_ADD_TEST) +ENDMACRO () # Remove any output file left over from previous test run add_test ( @@ -76,7 +89,7 @@ add_test ( ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test}) -endif (NOT "${last_test}" STREQUAL "") +endif () set (last_test "HL_test-clear-objects") HL_add_test (test_ds) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 60815f1..9d7a406 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -50,19 +50,21 @@ if (BUILD_TESTING) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # add_test (NAME hl_h52gifgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -install ( - TARGETS - gif2h5 - h52gif - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications -) +if (HDF5_EXPORTED_TARGETS) + install ( + TARGETS + gif2h5 + h52gif + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications + ) +endif () diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 1cffe55..8a52f50 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -28,14 +28,18 @@ add_test ( ) add_test (NAME HL_TOOLS_gif2h5 COMMAND $ testfiles/image1.gif image1.h5) +set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES DEPENDS HL_TOOLS-clear-objects) add_test (NAME HL_TOOLS_h52gif COMMAND $ testfiles/h52giftst.h5 image1.gif -i image) +set_tests_properties (HL_TOOLS_h52gif PROPERTIES DEPENDS HL_TOOLS-clear-objects) add_test (NAME HL_TOOLS_h52gif_none COMMAND $ testfiles/h52giftst.h5 image.gif -i nosuch_image) set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES WILL_FAIL "true") +set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES DEPENDS HL_TOOLS-clear-objects) #add_test (NAME HL_TOOLS_h52gifpal COMMAND $ testfiles/h52giftst.h5 image.gif -i palette) #set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES WILL_FAIL "true") add_test (NAME HL_TOOLS_h52gif24bits COMMAND $ testfiles/ex_image2.h5 image24.gif -i image24bitpixel) set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES WILL_FAIL "true") +set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES DEPENDS HL_TOOLS-clear-objects) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 728228f..e60fe2d 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -620,7 +620,7 @@ if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" else (WINDOWS) H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -endif (WINDOWS) +endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4447d18..be301ac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -464,7 +464,7 @@ set (H5Z_SRCS if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -endif (H5_ZLIB_HEADER) +endif () set (H5Z_HDRS @@ -561,7 +561,7 @@ set (H5_PUBLIC_HEADERS if (WIN32) set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) set (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) -endif (WIN32) +endif () set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h @@ -614,7 +614,7 @@ add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") -endif (MSVC OR MINGW) +endif () set (CMD $) add_custom_command ( @@ -628,7 +628,7 @@ add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") -endif (MSVC OR MINGW) +endif () set (CMD $) add_custom_command ( @@ -674,8 +674,8 @@ if (GENERATE_ERROR_HEADERS) ) else (PERL_FOUND) message (STATUS "Cannot generate headers - perl not found") - endif (PERL_FOUND) -endif (GENERATE_ERROR_HEADERS) + endif () +endif () #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time @@ -696,10 +696,10 @@ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} dl) -endif (NOT WIN32) +endif ( if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) -endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES @@ -713,7 +713,7 @@ if (HDF5_ENABLE_DEBUG_APIS) COMPILE_DEFINITIONS "H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG" ) -endif (HDF5_ENABLE_DEBUG_APIS) +endif () set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) @@ -722,10 +722,10 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} dl) - endif (NOT WIN32) + endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) - endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES @@ -740,16 +740,16 @@ if (BUILD_SHARED_LIBS) "H5_HAVE_THREADSAFE" ) target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) - endif (HDF5_ENABLE_THREADSAFE) + endif () if (HDF5_ENABLE_DEBUG_APIS) set_property (TARGET ${HDF5_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG" ) - endif (HDF5_ENABLE_DEBUG_APIS) + endif () set (install_targets ${install_targets} ${HDF5_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -763,7 +763,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) COMPONENT headers ) -endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -771,7 +771,8 @@ endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) install ( TARGETS @@ -784,4 +785,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT libraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9e169fe..29857e5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,10 +30,10 @@ add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS} TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -endif (MSVC) +endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -endif (MINGW) +endif () target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -46,10 +46,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") - endif (MSVC) + endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") - endif (MINGW) + endif () target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES @@ -63,8 +63,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -95,10 +95,7 @@ endif (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - SHARED ${HDF5_PACKAGE_SOVERSION} - ) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- @@ -112,7 +109,7 @@ endif (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) - endforeach (test_lib ${TEST_PLUGIN_LIBS}) + endforeach () foreach (test_lib ${TEST2_PLUGIN_LIBS}) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") @@ -124,10 +121,7 @@ endif (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - SHARED ${HDF5_PACKAGE_SOVERSION} - ) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- @@ -141,7 +135,7 @@ endif (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) - endforeach (test_lib ${TEST2_PLUGIN_LIBS}) + endforeach () set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c @@ -183,7 +177,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) @@ -197,8 +191,8 @@ MACRO (ADD_H5_EXE file) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif (BUILD_SHARED_LIBS) -ENDMACRO (ADD_H5_EXE file) + endif () +ENDMACRO () set (H5_TESTS accum @@ -255,7 +249,7 @@ set (H5_TESTS foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -endforeach (test ${H5_TESTS}) +endforeach () ############################################################################## ############################################################################## @@ -275,7 +269,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache-shared SHARED " " " ") target_link_libraries (cache-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for cache_api add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) @@ -289,7 +283,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache_api-shared SHARED " " " ") target_link_libraries (cache_api-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache_api-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) @@ -308,8 +302,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #-- Adding test for ttsafe add_executable (ttsafe @@ -340,8 +334,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -356,8 +350,8 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) TARGET_C_PROPERTIES (err_compat-shared SHARED " " " ") target_link_libraries (err_compat-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (err_compat-shared PROPERTIES FOLDER test) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + endif () +endif () #-- Adding test for error_test add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) @@ -371,7 +365,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (error_test-shared SHARED " " " ") target_link_libraries (error_test-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (error_test-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for links_env add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) @@ -385,7 +379,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (links_env-shared SHARED " " " ") target_link_libraries (links_env-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (links_env-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) @@ -393,9 +387,9 @@ file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -else (\${TEST_RESULT} STREQUAL \"0\") +else () message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif (\${TEST_RESULT} STREQUAL \"0\") +endif () " ) @@ -408,12 +402,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -else (BUILD_SHARED_LIBS) +else () add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin STATIC) TARGET_C_PROPERTIES (plugin STATIC " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1336349..e8e1655 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -13,7 +13,7 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") -endif (BUILD_SHARED_LIBS) +endif () if (HDF5_TEST_VFD) set (VFD_LIST @@ -26,14 +26,14 @@ if (HDF5_TEST_VFD) ) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") #if (BUILD_SHARED_LIBS) # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif (BUILD_SHARED_LIBS) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + #endif () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -46,18 +46,18 @@ foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_tfile ${HDF5_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_tfile ${HDF5_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -74,18 +74,18 @@ foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (ref_file ${HDF5_REFERENCE_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (ref_file ${HDF5_REFERENCE_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory @@ -130,18 +130,18 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) @@ -197,8 +197,17 @@ if (HDF5_ENABLE_USING_MEMCHECKER) ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -else (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-testhdf5 COMMAND $) +else () + add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -228,14 +237,23 @@ else (HDF5_ENABLE_USING_MEMCHECKER) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-testhdf5 COMMAND $) + add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES DEPENDS H5TEST-shared-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () +endif () ############################################################################## ############################################################################## @@ -315,15 +333,15 @@ foreach (test ${H5_TESTS}) add_test (NAME H5TEST-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" ) - else (${test} STREQUAL "big" AND CYGWIN) + else () add_test (NAME H5TEST-${test} COMMAND $) - endif (${test} STREQUAL "big" AND CYGWIN) + endif () set_tests_properties (H5TEST-${test} PROPERTIES DEPENDS H5TEST-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endforeach (test ${H5_TESTS}) +endforeach () set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) @@ -404,22 +422,31 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) - else (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-shared-${test} COMMAND $) - endif (${test} STREQUAL "big" AND CYGWIN) + else () + add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-${test} PROPERTIES DEPENDS H5TEST-shared-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endforeach (test ${H5_TESTS}) + endforeach () set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 2400) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ############################################################################## @@ -504,7 +531,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif () #-- Adding test for error_test add_test (NAME H5TEST-clear-error_test-objects @@ -577,14 +604,27 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-cache COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-shared-cache COMMAND $) + else () + add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache-shared.txt" + #-D "TEST_REFERENCE=cache-shared.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 2400) - endif (NOT CYGWIN) + endif () #-- Adding test for cache_api add_test ( @@ -646,7 +686,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + endif () #-- Adding test for error_test add_test (NAME H5TEST-shared-clear-error_test-objects @@ -708,16 +748,16 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## if (WIN32) set (CMAKE_SEP "\;") -else (WIN32) +else () set (CMAKE_SEP ":") -endif (WIN32) +endif () add_test (NAME H5PLUGIN-plugin COMMAND $) set_tests_properties (H5PLUGIN-plugin PROPERTIES @@ -740,7 +780,7 @@ if (HDF5_TEST_VFD) ohdr stab gheap - cache +# cache cache_api pool hyperslab @@ -786,9 +826,10 @@ if (HDF5_TEST_VFD) unregister ) if (NOT CYGWIN) - set (H5_VFD_TESTS ${H5_VFD_TESTS} big) - endif (NOT CYGWIN) + set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) + endif () + # Windows only macro MACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") @@ -822,8 +863,8 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - else (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) @@ -831,9 +872,9 @@ if (HDF5_TEST_VFD) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" ) - endif (BUILD_SHARED_LIBS) - endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) - else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + endif () + endif() + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -863,9 +904,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") - else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") + endif () + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -880,7 +921,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -895,15 +936,15 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") - ENDMACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + endif () + endif () + ENDMACRO () MACRO (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else (WIN32) + else () add_test (NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -933,9 +974,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (WIN32) - endforeach (test ${H5_VFD_TESTS}) + endif () + endif () + endforeach () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) @@ -943,6 +984,9 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-testhdf5 PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-gheap PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1200) + if (NOT CYGWIN) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + endif () if (BUILD_SHARED_LIBS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) @@ -951,7 +995,10 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) - endif (BUILD_SHARED_LIBS) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -984,16 +1031,16 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (HDF5_TEST_FHEAP_VFD) - ENDMACRO (ADD_VFD_TEST) + endif () + endif () + ENDMACRO () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () ############################################################################## ############################################################################## @@ -1008,7 +1055,7 @@ if (HDF5_BUILD_GENERATORS) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) - ENDMACRO (ADD_H5_GENERATOR genfile) + ENDMACRO () # generator executables set (H5_GENERATORS @@ -1032,6 +1079,6 @@ if (HDF5_BUILD_GENERATORS) foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - endforeach (gen ${H5_GENERATORS}) + endforeach () -endif (HDF5_BUILD_GENERATORS) +endif () diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 3716ee6..86eaa03 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -9,7 +9,7 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -endforeach (testp ${H5P_TESTS}) +endforeach () # The following will only be correct on windows shared #set_tests_properties (TEST_PAR_t_pflush1 PROPERTIES WILL_FAIL "true") @@ -31,16 +31,16 @@ if (HDF5_TEST_VFD) t_pflush1 t_pflush2 ) - + if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) foreach (test ${H5P_VFD_TESTS}) add_test ( - NAME TEST_PAR_VFD-${vfdname}-${test} + NAME TEST_PAR_VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -50,13 +50,13 @@ if (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - endforeach (test ${H5P_VFD_TESTS}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_VFD_TEST) - + endforeach () + endif () + ENDMACRO () + # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 841e979..c9cc21b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -16,7 +16,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # -------------------------------------------------------------------- if (NOT BUILD_TESTING) add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) -endif (NOT BUILD_TESTING) +endif () #-- Add the h5diff and test executables add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5diff) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index c59675d..406ca12 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy") set (H5_DEP_EXECUTABLES h5copy) +if (BUILD_SHARED_LIBS) + add_executable (h5copy-shared ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) + TARGET_NAMING (h5copy-shared SHARED) + TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") + target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5copy-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) +endif () + if (BUILD_TESTING) if (HDF5_BUILD_GENERATORS) add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) @@ -27,10 +38,10 @@ if (BUILD_TESTING) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5copygentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -41,13 +52,17 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5copy-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5copy - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index 80b7d10..a2131d1 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -24,7 +24,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5copy_files") - endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) ############################################################################## @@ -45,7 +45,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_F-${testname} @@ -54,10 +54,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -68,9 +68,9 @@ SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_F_TEST) + endif () + endif () + ENDMACRO () MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -81,7 +81,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname} @@ -90,10 +90,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -104,9 +104,9 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST) + endif () + endif () + ENDMACRO () MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -117,7 +117,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname}-prefill @@ -126,10 +126,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname} @@ -145,9 +145,9 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST2) + endif () + endif () + ENDMACRO () MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -158,7 +158,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_SAME-${testname}-prefill @@ -167,10 +167,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_SAME-${testname} @@ -186,9 +186,9 @@ SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST_SAME) + endif () + endif () + ENDMACRO () # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target @@ -200,11 +200,11 @@ add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () # Remove any output file left over from previous test run add_test ( NAME H5COPY-CMP-${testname}-clear-objects @@ -227,8 +227,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP_TEST) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -288,9 +288,9 @@ set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5COPY-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index fcb1a30..41897da 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -21,6 +21,20 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff") set (H5_DEP_EXECUTABLES h5diff) +if (BUILD_SHARED_LIBS) + add_executable (h5diff-shared + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c + ) + TARGET_NAMING (h5diff-shared SHARED) + TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") + target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5diff-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) +endif () + if (H5_HAVE_PARALLEL) add_executable (ph5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c @@ -31,7 +45,7 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff") -endif (H5_HAVE_PARALLEL) +endif () if (BUILD_TESTING) # -------------------------------------------------------------------- @@ -77,7 +91,7 @@ if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -88,26 +102,29 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5diff - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) - -if (H5_HAVE_PARALLEL) - - #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5diff-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) install ( TARGETS - ph5diff + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) -endif (H5_HAVE_PARALLEL) + + if (H5_HAVE_PARALLEL) + #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + ph5diff + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) + endif () +endif () diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index c81765c..3a91e54 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -22,6 +22,21 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") set (H5_DEP_EXECUTABLES h5dump) +if (BUILD_SHARED_LIBS) + add_executable (h5dump-shared + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ) + TARGET_NAMING (h5dump-shared SHARED) + TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") + target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5dump-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) +endif () + if (BUILD_TESTING) #----------------------------------------------------------------------------- @@ -70,7 +85,7 @@ if (BUILD_TESTING) include (CMakeTestsPBITS.cmake) include (CMakeTestsXML.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -81,13 +96,17 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5dump - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5dump-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index e6265dc..c6bd78c 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -119,7 +119,7 @@ if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 05cd226..4831d5c 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -31,7 +31,7 @@ if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -42,13 +42,14 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5import - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + h5import + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 39217be..d1f1681 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -64,15 +64,15 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file}" "${PROJECT_BINARY_DIR}/testfiles/${conf_file}" "h5import_files") - endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach () foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5import_files") - endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5import_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5import_files ALL COMMENT "Copying files needed by h5import tests" DEPENDS ${h5import_files_list}) ############################################################################## @@ -87,7 +87,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -129,8 +129,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) + endif () + ENDMACRO () MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests @@ -162,7 +162,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - else ("${ARGN}" STREQUAL "BINARY") + else () add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -174,7 +174,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif ("${ARGN}" STREQUAL "BINARY") + endif () set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") add_test ( @@ -203,8 +203,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) + endif () + ENDMACRO () MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -212,15 +212,15 @@ NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + endif () + ENDMACRO () # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () ############################################################################## ############################################################################## @@ -387,7 +387,7 @@ dtxtstr.h5.dff.err ) set (last_test "H5IMPORT-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5IMPORT-h5importtest-clear-objects @@ -403,7 +403,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5IMPORT-clear-objects") add_test (NAME H5IMPORT-h5importtest COMMAND $) @@ -430,7 +430,7 @@ # ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5) - # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " + # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) @@ -470,6 +470,6 @@ ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5) ADD_H5_DUMPTEST (BINARY_I8_EOF "/dataset0" binin8w.h5 BINARY) - # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " + # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index c74f7a6..927a64c 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -54,11 +54,11 @@ if (BUILD_TESTING) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5jamgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -69,13 +69,14 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5jam h5unjam - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + h5jam h5unjam + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 6752c9a..3752e55 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -23,11 +23,11 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5jam_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5jam_files") - endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach () add_custom_target(h5jam_files ALL COMMENT "Copying files needed by h5jam tests" DEPENDS ${h5jam_files_list}) ############################################################################## @@ -46,8 +46,8 @@ add_test (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif (NOT "${resultcode}" STREQUAL "0") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -67,8 +67,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5JAM_OUTPUT) + endif () + ENDMACRO () # ============================================================ # TEST_H5UNJAM_OUTPUT @@ -80,8 +80,8 @@ add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif (NOT "${resultcode}" STREQUAL "0") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -101,8 +101,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5UNJAM_OUTPUT) + endif () + ENDMACRO () MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts @@ -143,8 +143,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECKFILE testname testdepends expected actual) + endif () + ENDMACRO() MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -171,7 +171,7 @@ add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) - else (NOT "${ufile}" STREQUAL "NONE") + else () if (NOT "${ARGN}" STREQUAL "--delete") add_test ( NAME H5JAM-${testname}-UNJAM_D-clear-objects @@ -191,12 +191,12 @@ ) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test "${outfile}.ufile.txt") - else (NOT "${ARGN}" STREQUAL "--delete") + else () add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") - endif (NOT "${ARGN}" STREQUAL "--delete") - endif (NOT "${ufile}" STREQUAL "NONE") + endif () + endif () if (NOT "${compare_test}" STREQUAL "") add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects @@ -221,7 +221,7 @@ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake" ) set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - endif (NOT "${compare_test}" STREQUAL "") + endif () add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB @@ -238,13 +238,13 @@ ) if (NOT "${compare_test}" STREQUAL "") set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - else (NOT "${compare_test}" STREQUAL "") + else () set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - endif (NOT "${compare_test}" STREQUAL "") + endif () CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(UNJAMTEST testname infile ufile outfile) + endif () + ENDMACRO() MACRO (JAMTEST testname jamfile infile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -252,7 +252,7 @@ NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) @@ -260,7 +260,7 @@ set (compare_orig testfiles/${infile}) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif ("${ARGN}" STREQUAL "--clobber") + endif () add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects @@ -286,8 +286,8 @@ ) set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST testname jamfile infile outfile) + endif () + ENDMACRO () MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -315,7 +315,7 @@ set (compare_orig ${chkfile}.cpy.h5) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif ("${ARGN}" STREQUAL "--clobber") + endif () add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects @@ -341,8 +341,8 @@ ) set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + endif () + ENDMACRO () ############################################################################## ############################################################################## diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 80bd2f7..0e49edb 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -16,9 +16,18 @@ target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls") -set (H5_DEP_EXECUTABLES - h5ls -) +set (H5_DEP_EXECUTABLES h5ls) + +if (BUILD_SHARED_LIBS) + add_executable (h5ls-shared ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) + TARGET_NAMING (h5ls-shared SHARED) + TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") + target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5ls-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) +endif () if (BUILD_TESTING) @@ -52,7 +61,7 @@ if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -63,13 +72,17 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5ls-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5ls - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 1646fa9..f995c74 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -410,9 +410,9 @@ # ( HDFFV-7838, ) if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - endif (H5_WORDS_BIGENDIAN) + endif () # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) @@ -420,19 +420,19 @@ # test for variable length data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - endif (H5_WORDS_BIGENDIAN) + endif () # test for dataset region references data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - endif (H5_WORDS_BIGENDIAN) + endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5) - + diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 54f918b..86611a9 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -29,6 +29,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack") set (H5_DEP_EXECUTABLES h5repack) +if (BUILD_SHARED_LIBS) + add_executable (h5repack-shared ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) + TARGET_NAMING (h5repack-shared SHARED) + TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") + target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5repack-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) +endif () + if (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables @@ -91,7 +102,7 @@ if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -102,13 +113,17 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5repack - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5repack-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 08420ff..ebc2055 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -17,7 +17,7 @@ if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () MACRO (ADD_VFD_TEST vfdname resultcode) add_test ( @@ -33,10 +33,10 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - ENDMACRO (ADD_VFD_TEST) - endif (HDF5_TEST_VFD) + ENDMACRO () + endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -100,7 +100,7 @@ foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_file}" NAME) HDFTEST_COPY_FILE("${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5repack_files") - endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5repack_files ALL COMMENT "Copying files needed by h5repack tests" DEPENDS ${h5repack_files_list}) ############################################################################## @@ -118,7 +118,7 @@ set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5REPACK-${testname}") - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -137,8 +137,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) + endif () + ENDMACRO () MACRO (ADD_H5_TEST_OLD testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") @@ -147,8 +147,8 @@ NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () add_test ( NAME H5REPACK_OLD-${testname} COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -161,8 +161,8 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST_OLD) + endif () + ENDMACRO () MACRO (ADD_H5_TEST testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") @@ -171,8 +171,8 @@ NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () add_test ( NAME H5REPACK-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -185,8 +185,8 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST) + endif () + ENDMACRO () MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") @@ -195,14 +195,14 @@ NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -215,12 +215,12 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_CMP_TEST) + endif () + ENDMACRO () MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") @@ -229,8 +229,8 @@ NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () # If using memchecker add tests without using scripts add_test ( NAME H5REPACK_DMP-${testname} @@ -251,9 +251,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_DMP_TEST) + endif () + endif () + ENDMACRO () MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") @@ -262,8 +262,8 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} @@ -291,7 +291,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else ("${resultcode}" STREQUAL "0") + else () if ("${testfilter}" STREQUAL "CHUNKED") set (nottestfilter "(CONTIGUOUS|COMPACT)") endif () @@ -314,10 +314,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - endif ("${resultcode}" STREQUAL "0") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_VERIFY_TEST) + endif () + endif () + endif () + ENDMACRO () MACRO (ADD_H5_TEST_META testname testfile) add_test ( @@ -336,7 +336,7 @@ add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) - ENDMACRO (ADD_H5_TEST_META) + ENDMACRO () MACRO (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -380,8 +380,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_UD_TEST) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -597,7 +597,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () ADD_HELP_TEST(help 0 -h) @@ -606,14 +606,14 @@ if (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "yes") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - else (HDF5_ENABLE_SZIP_ENCODING) + else () set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif (HDF5_ENABLE_SZIP_ENCODING) - else (HDF5_ENABLE_SZIP_SUPPORT) + endif () + else () set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif (HDF5_ENABLE_SZIP_SUPPORT) + endif () set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) add_test (NAME H5REPACK-h5repacktest COMMAND $) @@ -637,15 +637,15 @@ set (USE_FILTER_SZIP_ENCODER "no") if (HDF5_ENABLE_SZIP_ENCODING) set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - endif (HDF5_ENABLE_SZIP_ENCODING) + endif () if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -662,7 +662,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all @@ -670,7 +670,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object @@ -678,7 +678,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all @@ -686,7 +686,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object @@ -710,7 +710,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object @@ -718,7 +718,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -730,7 +730,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove @@ -738,7 +738,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy @@ -746,7 +746,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove @@ -754,7 +754,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy @@ -802,7 +802,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) + endif () ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions @@ -810,14 +810,14 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) set (arg ${FILE7} -f dset_szip:GZIP=1) set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit @@ -825,7 +825,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file @@ -833,7 +833,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -920,7 +920,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) @@ -928,7 +928,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters @@ -936,7 +936,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile @@ -945,7 +945,7 @@ set (TESTTYPE "LEGACY") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file @@ -1005,4 +1005,4 @@ foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) endforeach (vfd ${VFD_LIST}) - endif (HDF5_TEST_VFD) + endif () diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 2bee88c..8c9ec64 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat") set (H5_DEP_EXECUTABLES h5stat) +if (BUILD_SHARED_LIBS) + add_executable (h5stat-shared ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) + TARGET_NAMING (h5stat-shared SHARED) + TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") + target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5stat-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) +endif () + if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables @@ -30,10 +41,10 @@ if (BUILD_TESTING) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5stat_gentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -44,13 +55,17 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5stat-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5stat - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 48622c9..00ce250 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -50,11 +50,11 @@ foreach (ddl_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files") - endforeach (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5stat_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5stat_files ALL COMMENT "Copying files needed by h5stat tests" DEPENDS ${h5stat_files_list}) ############################################################################## @@ -69,10 +69,10 @@ add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5STAT-${resultfile}-clear-objects @@ -91,8 +91,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -171,9 +171,9 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5STAT-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) @@ -193,7 +193,7 @@ ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5) ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) -# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c # as of release 1.8.0-alpha4 ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) # h5stat_newgrat.h5 is generated by h5stat_gentest.c diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index caa81bf..4c145a4 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -63,7 +63,7 @@ if (BUILD_SHARED_LIBS) ) #set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ############################################################################## @@ -89,7 +89,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) install ( TARGETS @@ -102,4 +103,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT toolslibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1ee9054..e4b166f 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -13,10 +13,6 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 68f97d4..da1af42 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -42,7 +42,7 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- #if (NOT WIN32) # configure_file (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#endif (NOT WIN32) +#endif () if (BUILD_TESTING) # -------------------------------------------------------------------- @@ -55,7 +55,7 @@ if (BUILD_TESTING) target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test STATIC) @@ -64,7 +64,7 @@ if (BUILD_TESTING) set_target_properties (h5repart_test PROPERTIES FOLDER tools) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () ############################################################################## ############################################################################## @@ -75,15 +75,16 @@ endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) + INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) + INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5debug h5repart h5mkgrp - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + h5debug h5repart h5mkgrp + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index 6822be5..d065b63 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -31,7 +31,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5repart_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5repart_files ALL COMMENT "Copying files needed by h5repart tests" DEPENDS ${h5repart_files_list}) set (HDF5_MKGRP_TEST_FILES @@ -56,7 +56,7 @@ foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}" "h5mkgrp_files") - endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + endforeach () HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt" "${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt" "h5mkgrp_files") add_custom_target(h5mkgrp_files ALL COMMENT "Copying files needed by h5mkgrp tests" DEPENDS ${h5mkgrp_files_list}) @@ -80,7 +80,7 @@ ${resultfile}.out.err ) set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5MKGRP-${resultfile} @@ -90,8 +90,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) add_test ( NAME H5MKGRP-${resultfile}-h5ls @@ -106,13 +106,13 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) + endif () + ENDMACRO () MACRO (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -134,8 +134,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP resultfile resultcode) + endif () + ENDMACRO () ############################################################################## ############################################################################## @@ -158,7 +158,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. @@ -230,9 +230,9 @@ set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5MKGRP-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") diff --git a/tools/perform/CMakeLists.txt b/tools/perform/CMakeLists.txt index d80f4e4..a52b22b 100644 --- a/tools/perform/CMakeLists.txt +++ b/tools/perform/CMakeLists.txt @@ -37,10 +37,10 @@ if (HDF5_BUILD_PERFORM_STANDALONE) TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) - set_property (TARGET h5perf_serial_alone + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) -endif (HDF5_BUILD_PERFORM_STANDALONE) +endif () #-- Adding test for chunk set (chunk_SRCS @@ -82,7 +82,7 @@ if (BUILD_TESTING) TARGET_C_PROPERTIES (perf_meta STATIC " " " ") target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (perf_meta PROPERTIES FOLDER perform) -endif (BUILD_TESTING) +endif () #-- Adding test for zip_perf set (zip_perf_SRCS @@ -117,10 +117,10 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) - set_property (TARGET h5perf_alone + set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) - endif (HDF5_BUILD_PERFORM_STANDALONE) -endif (H5_HAVE_PARALLEL AND BUILD_TESTING) + endif () +endif () include (CMakeTests.cmake) diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 0ea40a3..137fb38 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -32,7 +32,7 @@ set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) -endif (HDF5_BUILD_PERFORM_STANDALONE) +endif () add_test (NAME PERFORM_chunk COMMAND $) @@ -50,5 +50,5 @@ if (H5_HAVE_PARALLEL) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (HDF5_BUILD_PERFORM_STANDALONE) -endif (H5_HAVE_PARALLEL) + endif () +endif () -- cgit v0.12 From e8b131c4c7bbe338ac4c39a12a06e38790771800 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Feb 2017 16:09:51 -0600 Subject: Correct typo --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be301ac..db12160 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -672,7 +672,7 @@ if (GENERATE_ERROR_HEADERS) add_custom_target(run_perl_scripts ALL DEPENDS ${HDF5_BINARY_DIR}/H5Edefin.h ${HDF5_BINARY_DIR}/H5version.h ${HDF5_BINARY_DIR}/H5overflow.h ) - else (PERL_FOUND) + else () message (STATUS "Cannot generate headers - perl not found") endif () endif () @@ -696,7 +696,7 @@ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} dl) -endif ( +endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) endif () -- cgit v0.12 From f89f36eecde75e434812fe5741391382861259ee Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Feb 2017 13:40:33 -0600 Subject: Disable SHARED VFD tests and remove links_env from defualt list --- test/CMakeTests.cmake | 198 +++++++++++++++++++++++++------------------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index e8e1655..5812cd5 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -822,7 +822,7 @@ if (HDF5_TEST_VFD) err_compat tcheck_version testmeta - links_env + #links_env unregister ) if (NOT CYGWIN) @@ -848,31 +848,31 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () + #if (BUILD_SHARED_LIBS) + # add_test (NAME VFD-${vfdname}-${test}-shared + # COMMAND "${CMAKE_COMMAND}" + # -D "TEST_PROGRAM=$" + # -D "TEST_ARGS:STRING=" + # -D "TEST_VFD:STRING=${vfdname}" + # -D "TEST_EXPECT=${resultcode}" + # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + # ) + # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + # ) + #endif () else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" - ) - endif () + #if (BUILD_SHARED_LIBS) + # add_test (NAME VFD-${vfdname}-${test}-shared + # COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" + # ) + #endif () endif() else () add_test (NAME VFD-${vfdname}-${vfdtest} @@ -889,22 +889,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () + #if (BUILD_SHARED_LIBS) + # add_test (NAME VFD-${vfdname}-${test}-shared + # COMMAND "${CMAKE_COMMAND}" + # -D "TEST_PROGRAM=$" + # -D "TEST_ARGS:STRING=" + # -D "TEST_VFD:STRING=${vfdname}" + # -D "TEST_EXPECT=${resultcode}" + # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + # ) + # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + # ) + #endif () endif () else () add_test (NAME VFD-${vfdname}-${vfdtest} @@ -921,22 +921,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") - add_test (NAME VFD-${vfdname}-${vfdtest}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () + #if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") + # add_test (NAME VFD-${vfdname}-${vfdtest}-shared + # COMMAND "${CMAKE_COMMAND}" + # -D "TEST_PROGRAM=$" + # -D "TEST_ARGS:STRING=" + # -D "TEST_VFD:STRING=${vfdname}" + # -D "TEST_EXPECT=${resultcode}" + # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + # ) + # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + # ) + #endif () endif () ENDMACRO () @@ -959,22 +959,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${test}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () + #if (BUILD_SHARED_LIBS) + # add_test (NAME VFD-${vfdname}-${test}-shared + # COMMAND "${CMAKE_COMMAND}" + # -D "TEST_PROGRAM=$" + # -D "TEST_ARGS:STRING=" + # -D "TEST_VFD:STRING=${vfdname}" + # -D "TEST_EXPECT=${resultcode}" + # -D "TEST_OUTPUT=${vfdname}-${test}-shared" + # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + # ) + # set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES + # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + # ) + #endif () endif () endforeach () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) @@ -987,18 +987,18 @@ if (HDF5_TEST_VFD) if (NOT CYGWIN) set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) endif () - if (BUILD_SHARED_LIBS) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) - set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-objcopy-shared PROPERTIES TIMEOUT 1000) - set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) - set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) - set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) - if (NOT CYGWIN AND NOT WIN32) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () + #if (BUILD_SHARED_LIBS) + # set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) + # set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) + # set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) + # set_tests_properties (VFD-${vfdname}-objcopy-shared PROPERTIES TIMEOUT 1000) + # set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) + # set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) + # set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) + # if (NOT CYGWIN AND NOT WIN32) + # set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + # endif () + #endif () if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -1015,23 +1015,23 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-fheap-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () + #if (BUILD_SHARED_LIBS) + # add_test (NAME VFD-${vfdname}-fheap-shared + # COMMAND "${CMAKE_COMMAND}" + # -D "TEST_PROGRAM=$" + # -D "TEST_ARGS:STRING=" + # -D "TEST_VFD:STRING=${vfdname}" + # -D "TEST_EXPECT=${resultcode}" + # -D "TEST_OUTPUT=${vfdname}-fheap-shared" + # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + # ) + # set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES + # TIMEOUT 1800 + # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + # ) + #endif () endif () ENDMACRO () -- cgit v0.12 From 65f15be58e6eee2b155e9ce1642921b1f52965e5 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 12 Feb 2017 20:57:47 -0600 Subject: Snapshot version 1.8 release 19 (snap0) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- configure | 22 +-- configure.ac | 2 +- failsection | 1 + hl/src/H5LTparse.c | 144 +++++++-------- hl/src/H5LTparse.h | 4 +- hl/test/test_packet_table_vlen.h5 | Bin 0 -> 40680 bytes hl/test/testfl_packet_table_vlen.h5 | Bin 0 -> 40124 bytes release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- src/H5public.h~ | 344 ++++++++++++++++++++++++++++++++++++ 12 files changed, 436 insertions(+), 91 deletions(-) create mode 100644 failsection create mode 100644 hl/test/test_packet_table_vlen.h5 create mode 100644 hl/test/testfl_packet_table_vlen.h5 create mode 100644 src/H5public.h~ diff --git a/README.txt b/README.txt index 4809028..d25c60b 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap0 currently under development +HDF5 version 1.8.19-snap1 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 35afded..2c56a97 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.19-snap0 currently under development" +PROJECT_NUMBER = "1.8.19-snap1 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/configure b/configure index 954d612..add3dc5 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap0. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap1. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.19-snap0' -PACKAGE_STRING='HDF5 1.8.19-snap0' +PACKAGE_VERSION='1.8.19-snap1' +PACKAGE_STRING='HDF5 1.8.19-snap1' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.8.19-snap0 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.19-snap1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.19-snap0:";; + short | recursive ) echo "Configuration of HDF5 1.8.19-snap1:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.19-snap0 +HDF5 configure 1.8.19-snap1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.8.19-snap0, which was +It was created by HDF5 $as_me 1.8.19-snap1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.19-snap0' + VERSION='1.8.19-snap1' cat >>confdefs.h <<_ACEOF @@ -29284,7 +29284,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.19-snap0 +HDF5 config.lt 1.8.19-snap1 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31319,7 +31319,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.19-snap0, which was +This file was extended by HDF5 $as_me 1.8.19-snap1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31385,7 +31385,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.19-snap0 +HDF5 config.status 1.8.19-snap1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 28a3c8a..35dbdc3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.19-snap0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.19-snap1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/failsection b/failsection new file mode 100644 index 0000000..eb66e3c --- /dev/null +++ b/failsection @@ -0,0 +1 @@ +make uninstall diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 36591d3..6ca95c54 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 1461830..621dacd 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/hl/test/test_packet_table_vlen.h5 b/hl/test/test_packet_table_vlen.h5 new file mode 100644 index 0000000..ee5ab70 Binary files /dev/null and b/hl/test/test_packet_table_vlen.h5 differ diff --git a/hl/test/testfl_packet_table_vlen.h5 b/hl/test/testfl_packet_table_vlen.h5 new file mode 100644 index 0000000..ab3a8e7 Binary files /dev/null and b/hl/test/testfl_packet_table_vlen.h5 differ diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ecaea0b..1b96576 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap0 currently under development +HDF5 version 1.8.19-snap1 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 2926cd4..353a55c 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -95,9 +95,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5public.h~ b/src/H5public.h~ new file mode 100644 index 0000000..2926cd4 --- /dev/null +++ b/src/H5public.h~ @@ -0,0 +1,344 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This file contains public declarations for the HDF5 module. + */ +#ifndef _H5public_H +#define _H5public_H + +/* Include files for public use... */ +/* + * Since H5pubconf.h is a generated header file, it is messy to try + * to put a #ifndef _H5pubconf_H ... #endif guard in it. + * HDF5 has set an internal rule that it is being included here. + * Source files should NOT include H5pubconf.h directly but include + * it via H5public.h. The #ifndef _H5public_H guard above would + * prevent repeated include. + */ +#include "H5pubconf.h" /*from configure */ + +/* API Version macro wrapper definitions */ +#include "H5version.h" + +#ifdef H5_HAVE_FEATURES_H +#include /*for setting POSIX, BSD, etc. compatibility */ +#endif +#ifdef H5_HAVE_SYS_TYPES_H +#include +#endif +#ifdef H5_STDC_HEADERS +# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +#endif +#ifndef __cplusplus +# ifdef H5_HAVE_STDINT_H +# include /*for C9x types */ +# endif +#else +# ifdef H5_HAVE_STDINT_H_CXX +# include /*for C9x types when include from C++ */ +# endif +#endif +#ifdef H5_HAVE_INTTYPES_H +# include /* For uint64_t on some platforms */ +#endif +#ifdef H5_HAVE_STDDEF_H +# include +#endif +#ifdef H5_HAVE_PARALLEL +# include +#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +# include +#endif +#endif + + +/* Include the Windows API adapter header early */ +#include "H5api_adpt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Macros for enabling/disabling particular GCC warnings */ +/* (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 + #define H5_GCC_DIAG_STR(s) #s + #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) + #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) + #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + + #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) + #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) +#else + #define H5_GCC_DIAG_OFF(x) + #define H5_GCC_DIAG_ON(x) +#endif + +/* Version numbers */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 8 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ + /* Empty string for real releases. */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap0" /* Full version string */ + +#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ + H5_VERS_RELEASE) + +/* macros for comparing the version */ +#define H5_VERSION_GE(Maj,Min,Rel) \ + (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \ + ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \ + (H5_VERS_MAJOR>Maj)) + +#define H5_VERSION_LE(Maj,Min,Rel) \ + (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || \ + ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } + */ +typedef unsigned int hbool_t; +typedef int htri_t; + +/* Define the ssize_t type if it not is defined */ +#if H5_SIZEOF_SSIZE_T==0 +/* Undefine this size, we will re-define it in one of the sections below */ +#undef H5_SIZEOF_SSIZE_T +#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT +typedef int ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_INT +#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG +typedef long ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG +#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG +typedef long long ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG +#else /* Can't find matching type for ssize_t */ +# error "nothing appropriate for ssize_t" +#endif +#endif + +/* + * The sizes of file objects have their own types defined here, use a 64-bit + * type. + */ +#if H5_SIZEOF_LONG_LONG >= 8 +H5_GCC_DIAG_OFF(long-long) +typedef unsigned long long hsize_t; +typedef signed long long hssize_t; +H5_GCC_DIAG_ON(long-long) +# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for hsize_t" +#endif + +/* + * File addresses have their own types. + */ +#if H5_SIZEOF_INT64_T>=8 + typedef uint64_t haddr_t; +# define HADDR_UNDEF ((haddr_t)(int64_t)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT64_T +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_INT>=8 + typedef unsigned haddr_t; +# define HADDR_UNDEF ((haddr_t)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_UNSIGNED +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_LONG>=8 + typedef unsigned long haddr_t; +# define HADDR_UNDEF ((haddr_t)(long)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_LONG_LONG>=8 + typedef unsigned long long haddr_t; +# define HADDR_UNDEF ((haddr_t)(long long)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT +# endif /* H5_HAVE_PARALLEL */ +#else +# error "nothing appropriate for haddr_t" +#endif +#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT +# define H5_PRINTF_HADDR_FMT "%u" +#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG +# define H5_PRINTF_HADDR_FMT "%lu" +#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG +# define H5_PRINTF_HADDR_FMT "%" H5_PRINTF_LL_WIDTH "u" +#else +# error "nothing appropriate for H5_PRINTF_HADDR_FMT" +#endif +#define HADDR_MAX (HADDR_UNDEF-1) + +/* uint32_t type is used for creation order field for messages. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_UINT32_T>=4 +#elif H5_SIZEOF_SHORT>=4 + typedef short uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=4 + typedef unsigned int uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=4 + typedef unsigned long uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG +#else +# error "nothing appropriate for uint32_t" +#endif + +/* int64_t type is used for creation order field for links. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_INT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef int int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef long long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for int64_t" +#endif + +/* uint64_t type is used for fields for H5O_info_t. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_UINT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef unsigned uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef unsigned long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef unsigned long long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for uint64_t" +#endif + +/* Common iteration orders */ +typedef enum { + H5_ITER_UNKNOWN = -1, /* Unknown order */ + H5_ITER_INC, /* Increasing order */ + H5_ITER_DEC, /* Decreasing order */ + H5_ITER_NATIVE, /* No particular order, whatever is fastest */ + H5_ITER_N /* Number of iteration orders */ +} H5_iter_order_t; + +/* Iteration callback values */ +/* (Actually, any postive value will cause the iterator to stop and pass back + * that positive value to the function that called the iterator) + */ +#define H5_ITER_ERROR (-1) +#define H5_ITER_CONT (0) +#define H5_ITER_STOP (1) + +/* + * The types of indices on links in groups/attributes on objects. + * Primarily used for " by index" routines and for iterating over + * links in groups/attributes on objects. + */ +typedef enum H5_index_t { + H5_INDEX_UNKNOWN = -1, /* Unknown index type */ + H5_INDEX_NAME, /* Index on names */ + H5_INDEX_CRT_ORDER, /* Index on creation order */ + H5_INDEX_N /* Number of indices defined */ +} H5_index_t; + +/* + * Storage info struct used by H5O_info_t and H5F_info_t + */ +typedef struct H5_ih_info_t { + hsize_t index_size; /* btree and/or list */ + hsize_t heap_size; +} H5_ih_info_t; + +/* Functions in H5.c */ +H5_DLL herr_t H5open(void); +H5_DLL herr_t H5close(void); +H5_DLL herr_t H5dont_atexit(void); +H5_DLL herr_t H5garbage_collect(void); +H5_DLL herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, + int arr_global_lim, int arr_list_lim, int blk_global_lim, + int blk_list_lim); +H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, + unsigned *relnum); +H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, + unsigned relnum); +H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); +H5_DLL herr_t H5free_memory(void *mem); +H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); +H5_DLL void *H5resize_memory(void *mem, size_t size); + +#ifdef __cplusplus +} +#endif +#endif /* _H5public_H */ + + -- cgit v0.12 From 31cb55251cbc3c67d9df989f99372d1e61c2b82b Mon Sep 17 00:00:00 2001 From: hdftest Date: Thu, 16 Feb 2017 10:19:04 -0600 Subject: Delete files inadvertently checked in with version changes following snapshot release. Add 2 test files to testfiles to be removed list in hl/test/Makefile.am. --- failsection | 1 - hl/test/Makefile.am | 2 +- hl/test/test_packet_table_vlen.h5 | Bin 40680 -> 0 bytes hl/test/testfl_packet_table_vlen.h5 | Bin 40124 -> 0 bytes src/H5public.h~ | 344 ------------------------------------ 5 files changed, 1 insertion(+), 346 deletions(-) delete mode 100644 failsection delete mode 100644 hl/test/test_packet_table_vlen.h5 delete mode 100644 hl/test/testfl_packet_table_vlen.h5 delete mode 100644 src/H5public.h~ diff --git a/failsection b/failsection deleted file mode 100644 index eb66e3c..0000000 --- a/failsection +++ /dev/null @@ -1 +0,0 @@ -make uninstall diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index 32d14b6..0738e93 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -47,7 +47,7 @@ endif CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_ds10.h5 \ test_image[1-3].h5 file_img[1-2].h5 test_lite[1-4].h5 test_table.h5 \ test_packet_table.h5 test_packet_compress.h5 test_detach.h5 \ - test_dectris.h5 + test_dectris.h5 test_packet_table_vlen.h5 testfl_packet_table_vlen.h5 # Sources for test_packet executable test_packet_SOURCES=test_packet.c test_packet_vlen.c diff --git a/hl/test/test_packet_table_vlen.h5 b/hl/test/test_packet_table_vlen.h5 deleted file mode 100644 index ee5ab70..0000000 Binary files a/hl/test/test_packet_table_vlen.h5 and /dev/null differ diff --git a/hl/test/testfl_packet_table_vlen.h5 b/hl/test/testfl_packet_table_vlen.h5 deleted file mode 100644 index ab3a8e7..0000000 Binary files a/hl/test/testfl_packet_table_vlen.h5 and /dev/null differ diff --git a/src/H5public.h~ b/src/H5public.h~ deleted file mode 100644 index 2926cd4..0000000 --- a/src/H5public.h~ +++ /dev/null @@ -1,344 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * This file contains public declarations for the HDF5 module. - */ -#ifndef _H5public_H -#define _H5public_H - -/* Include files for public use... */ -/* - * Since H5pubconf.h is a generated header file, it is messy to try - * to put a #ifndef _H5pubconf_H ... #endif guard in it. - * HDF5 has set an internal rule that it is being included here. - * Source files should NOT include H5pubconf.h directly but include - * it via H5public.h. The #ifndef _H5public_H guard above would - * prevent repeated include. - */ -#include "H5pubconf.h" /*from configure */ - -/* API Version macro wrapper definitions */ -#include "H5version.h" - -#ifdef H5_HAVE_FEATURES_H -#include /*for setting POSIX, BSD, etc. compatibility */ -#endif -#ifdef H5_HAVE_SYS_TYPES_H -#include -#endif -#ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ -#endif -#ifndef __cplusplus -# ifdef H5_HAVE_STDINT_H -# include /*for C9x types */ -# endif -#else -# ifdef H5_HAVE_STDINT_H_CXX -# include /*for C9x types when include from C++ */ -# endif -#endif -#ifdef H5_HAVE_INTTYPES_H -# include /* For uint64_t on some platforms */ -#endif -#ifdef H5_HAVE_STDDEF_H -# include -#endif -#ifdef H5_HAVE_PARALLEL -# include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ -# include -#endif -#endif - - -/* Include the Windows API adapter header early */ -#include "H5api_adpt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros for enabling/disabling particular GCC warnings */ -/* (see the following web-sites for more info: - * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html - * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas - */ -/* These pragmas are only implemented usefully in gcc 4.6+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define H5_GCC_DIAG_STR(s) #s - #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) - #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) - #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - - #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) - #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) -#else - #define H5_GCC_DIAG_OFF(x) - #define H5_GCC_DIAG_ON(x) -#endif - -/* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 8 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ - /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap0" /* Full version string */ - -#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ - H5_VERS_RELEASE) - -/* macros for comparing the version */ -#define H5_VERSION_GE(Maj,Min,Rel) \ - (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \ - ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \ - (H5_VERS_MAJOR>Maj)) - -#define H5_VERSION_LE(Maj,Min,Rel) \ - (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || \ - ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } - */ -typedef unsigned int hbool_t; -typedef int htri_t; - -/* Define the ssize_t type if it not is defined */ -#if H5_SIZEOF_SSIZE_T==0 -/* Undefine this size, we will re-define it in one of the sections below */ -#undef H5_SIZEOF_SSIZE_T -#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT -typedef int ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_INT -#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG -typedef long ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG -#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG -typedef long long ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG -#else /* Can't find matching type for ssize_t */ -# error "nothing appropriate for ssize_t" -#endif -#endif - -/* - * The sizes of file objects have their own types defined here, use a 64-bit - * type. - */ -#if H5_SIZEOF_LONG_LONG >= 8 -H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; -typedef signed long long hssize_t; -H5_GCC_DIAG_ON(long-long) -# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for hsize_t" -#endif - -/* - * File addresses have their own types. - */ -#if H5_SIZEOF_INT64_T>=8 - typedef uint64_t haddr_t; -# define HADDR_UNDEF ((haddr_t)(int64_t)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT64_T -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_INT>=8 - typedef unsigned haddr_t; -# define HADDR_UNDEF ((haddr_t)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_UNSIGNED -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_LONG>=8 - typedef unsigned long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long long)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT -# endif /* H5_HAVE_PARALLEL */ -#else -# error "nothing appropriate for haddr_t" -#endif -#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT -# define H5_PRINTF_HADDR_FMT "%u" -#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG -# define H5_PRINTF_HADDR_FMT "%lu" -#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG -# define H5_PRINTF_HADDR_FMT "%" H5_PRINTF_LL_WIDTH "u" -#else -# error "nothing appropriate for H5_PRINTF_HADDR_FMT" -#endif -#define HADDR_MAX (HADDR_UNDEF-1) - -/* uint32_t type is used for creation order field for messages. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_UINT32_T>=4 -#elif H5_SIZEOF_SHORT>=4 - typedef short uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT -#elif H5_SIZEOF_INT>=4 - typedef unsigned int uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=4 - typedef unsigned long uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG -#else -# error "nothing appropriate for uint32_t" -#endif - -/* int64_t type is used for creation order field for links. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_INT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef int int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef long long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for int64_t" -#endif - -/* uint64_t type is used for fields for H5O_info_t. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_UINT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef unsigned uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef unsigned long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for uint64_t" -#endif - -/* Common iteration orders */ -typedef enum { - H5_ITER_UNKNOWN = -1, /* Unknown order */ - H5_ITER_INC, /* Increasing order */ - H5_ITER_DEC, /* Decreasing order */ - H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ -} H5_iter_order_t; - -/* Iteration callback values */ -/* (Actually, any postive value will cause the iterator to stop and pass back - * that positive value to the function that called the iterator) - */ -#define H5_ITER_ERROR (-1) -#define H5_ITER_CONT (0) -#define H5_ITER_STOP (1) - -/* - * The types of indices on links in groups/attributes on objects. - * Primarily used for " by index" routines and for iterating over - * links in groups/attributes on objects. - */ -typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ -} H5_index_t; - -/* - * Storage info struct used by H5O_info_t and H5F_info_t - */ -typedef struct H5_ih_info_t { - hsize_t index_size; /* btree and/or list */ - hsize_t heap_size; -} H5_ih_info_t; - -/* Functions in H5.c */ -H5_DLL herr_t H5open(void); -H5_DLL herr_t H5close(void); -H5_DLL herr_t H5dont_atexit(void); -H5_DLL herr_t H5garbage_collect(void); -H5_DLL herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, - int blk_list_lim); -H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, - unsigned *relnum); -H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, - unsigned relnum); -H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); -H5_DLL herr_t H5free_memory(void *mem); -H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); -H5_DLL void *H5resize_memory(void *mem, size_t size); - -#ifdef __cplusplus -} -#endif -#endif /* _H5public_H */ - - -- cgit v0.12 From d17974de20d45b9a7976ef5e1a54442ae3da0d40 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 19 Feb 2017 20:50:59 -0600 Subject: Snapshot version 1.8 release 19 (snap1) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- configure | 22 +-- configure.ac | 2 +- failsection | 1 + hl/test/Makefile.in | 3 +- hl/test/test_packet_table_vlen.h5 | Bin 0 -> 40680 bytes hl/test/testfl_packet_table_vlen.h5 | Bin 0 -> 40124 bytes release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- src/H5public.h~ | 344 ++++++++++++++++++++++++++++++++++++ 11 files changed, 364 insertions(+), 18 deletions(-) create mode 100644 failsection create mode 100644 hl/test/test_packet_table_vlen.h5 create mode 100644 hl/test/testfl_packet_table_vlen.h5 create mode 100644 src/H5public.h~ diff --git a/README.txt b/README.txt index d25c60b..e81dcee 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap1 currently under development +HDF5 version 1.8.19-snap2 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 2c56a97..b059e5e 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.19-snap1 currently under development" +PROJECT_NUMBER = "1.8.19-snap2 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/configure b/configure index add3dc5..90b46a0 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap1. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap2. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.19-snap1' -PACKAGE_STRING='HDF5 1.8.19-snap1' +PACKAGE_VERSION='1.8.19-snap2' +PACKAGE_STRING='HDF5 1.8.19-snap2' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.8.19-snap1 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.19-snap2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.19-snap1:";; + short | recursive ) echo "Configuration of HDF5 1.8.19-snap2:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.19-snap1 +HDF5 configure 1.8.19-snap2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.8.19-snap1, which was +It was created by HDF5 $as_me 1.8.19-snap2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.19-snap1' + VERSION='1.8.19-snap2' cat >>confdefs.h <<_ACEOF @@ -29284,7 +29284,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.19-snap1 +HDF5 config.lt 1.8.19-snap2 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31319,7 +31319,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.19-snap1, which was +This file was extended by HDF5 $as_me 1.8.19-snap2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31385,7 +31385,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.19-snap1 +HDF5 config.status 1.8.19-snap2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 35dbdc3..f0eb713 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.19-snap1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.19-snap2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/failsection b/failsection new file mode 100644 index 0000000..eb66e3c --- /dev/null +++ b/failsection @@ -0,0 +1 @@ +make uninstall diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 6fd37b5..1a9b390 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -709,7 +709,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 \ combine_tables[1-2].h5 test_ds[1-9].h5 test_ds10.h5 \ test_image[1-3].h5 file_img[1-2].h5 test_lite[1-4].h5 \ test_table.h5 test_packet_table.h5 test_packet_compress.h5 \ - test_detach.h5 test_dectris.h5 + test_detach.h5 test_dectris.h5 test_packet_table_vlen.h5 \ + testfl_packet_table_vlen.h5 # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) diff --git a/hl/test/test_packet_table_vlen.h5 b/hl/test/test_packet_table_vlen.h5 new file mode 100644 index 0000000..aa7ec6b Binary files /dev/null and b/hl/test/test_packet_table_vlen.h5 differ diff --git a/hl/test/testfl_packet_table_vlen.h5 b/hl/test/testfl_packet_table_vlen.h5 new file mode 100644 index 0000000..483dd84 Binary files /dev/null and b/hl/test/testfl_packet_table_vlen.h5 differ diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1b96576..6655eb0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap1 currently under development +HDF5 version 1.8.19-snap2 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 353a55c..b8919c9 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -95,9 +95,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap2" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5public.h~ b/src/H5public.h~ new file mode 100644 index 0000000..353a55c --- /dev/null +++ b/src/H5public.h~ @@ -0,0 +1,344 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This file contains public declarations for the HDF5 module. + */ +#ifndef _H5public_H +#define _H5public_H + +/* Include files for public use... */ +/* + * Since H5pubconf.h is a generated header file, it is messy to try + * to put a #ifndef _H5pubconf_H ... #endif guard in it. + * HDF5 has set an internal rule that it is being included here. + * Source files should NOT include H5pubconf.h directly but include + * it via H5public.h. The #ifndef _H5public_H guard above would + * prevent repeated include. + */ +#include "H5pubconf.h" /*from configure */ + +/* API Version macro wrapper definitions */ +#include "H5version.h" + +#ifdef H5_HAVE_FEATURES_H +#include /*for setting POSIX, BSD, etc. compatibility */ +#endif +#ifdef H5_HAVE_SYS_TYPES_H +#include +#endif +#ifdef H5_STDC_HEADERS +# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +#endif +#ifndef __cplusplus +# ifdef H5_HAVE_STDINT_H +# include /*for C9x types */ +# endif +#else +# ifdef H5_HAVE_STDINT_H_CXX +# include /*for C9x types when include from C++ */ +# endif +#endif +#ifdef H5_HAVE_INTTYPES_H +# include /* For uint64_t on some platforms */ +#endif +#ifdef H5_HAVE_STDDEF_H +# include +#endif +#ifdef H5_HAVE_PARALLEL +# include +#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +# include +#endif +#endif + + +/* Include the Windows API adapter header early */ +#include "H5api_adpt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Macros for enabling/disabling particular GCC warnings */ +/* (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 + #define H5_GCC_DIAG_STR(s) #s + #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) + #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) + #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + + #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) + #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) +#else + #define H5_GCC_DIAG_OFF(x) + #define H5_GCC_DIAG_ON(x) +#endif + +/* Version numbers */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 8 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ + /* Empty string for real releases. */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap1" /* Full version string */ + +#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ + H5_VERS_RELEASE) + +/* macros for comparing the version */ +#define H5_VERSION_GE(Maj,Min,Rel) \ + (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \ + ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \ + (H5_VERS_MAJOR>Maj)) + +#define H5_VERSION_LE(Maj,Min,Rel) \ + (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || \ + ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } + */ +typedef unsigned int hbool_t; +typedef int htri_t; + +/* Define the ssize_t type if it not is defined */ +#if H5_SIZEOF_SSIZE_T==0 +/* Undefine this size, we will re-define it in one of the sections below */ +#undef H5_SIZEOF_SSIZE_T +#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT +typedef int ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_INT +#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG +typedef long ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG +#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG +typedef long long ssize_t; +# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG +#else /* Can't find matching type for ssize_t */ +# error "nothing appropriate for ssize_t" +#endif +#endif + +/* + * The sizes of file objects have their own types defined here, use a 64-bit + * type. + */ +#if H5_SIZEOF_LONG_LONG >= 8 +H5_GCC_DIAG_OFF(long-long) +typedef unsigned long long hsize_t; +typedef signed long long hssize_t; +H5_GCC_DIAG_ON(long-long) +# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for hsize_t" +#endif + +/* + * File addresses have their own types. + */ +#if H5_SIZEOF_INT64_T>=8 + typedef uint64_t haddr_t; +# define HADDR_UNDEF ((haddr_t)(int64_t)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT64_T +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_INT>=8 + typedef unsigned haddr_t; +# define HADDR_UNDEF ((haddr_t)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_UNSIGNED +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_LONG>=8 + typedef unsigned long haddr_t; +# define HADDR_UNDEF ((haddr_t)(long)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG +# endif /* H5_HAVE_PARALLEL */ +#elif H5_SIZEOF_LONG_LONG>=8 + typedef unsigned long long haddr_t; +# define HADDR_UNDEF ((haddr_t)(long long)(-1)) +# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG +# ifdef H5_HAVE_PARALLEL +# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT +# endif /* H5_HAVE_PARALLEL */ +#else +# error "nothing appropriate for haddr_t" +#endif +#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT +# define H5_PRINTF_HADDR_FMT "%u" +#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG +# define H5_PRINTF_HADDR_FMT "%lu" +#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG +# define H5_PRINTF_HADDR_FMT "%" H5_PRINTF_LL_WIDTH "u" +#else +# error "nothing appropriate for H5_PRINTF_HADDR_FMT" +#endif +#define HADDR_MAX (HADDR_UNDEF-1) + +/* uint32_t type is used for creation order field for messages. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_UINT32_T>=4 +#elif H5_SIZEOF_SHORT>=4 + typedef short uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=4 + typedef unsigned int uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=4 + typedef unsigned long uint32_t; +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG +#else +# error "nothing appropriate for uint32_t" +#endif + +/* int64_t type is used for creation order field for links. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_INT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef int int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef long long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for int64_t" +#endif + +/* uint64_t type is used for fields for H5O_info_t. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_UINT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef unsigned uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef unsigned long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef unsigned long long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for uint64_t" +#endif + +/* Common iteration orders */ +typedef enum { + H5_ITER_UNKNOWN = -1, /* Unknown order */ + H5_ITER_INC, /* Increasing order */ + H5_ITER_DEC, /* Decreasing order */ + H5_ITER_NATIVE, /* No particular order, whatever is fastest */ + H5_ITER_N /* Number of iteration orders */ +} H5_iter_order_t; + +/* Iteration callback values */ +/* (Actually, any postive value will cause the iterator to stop and pass back + * that positive value to the function that called the iterator) + */ +#define H5_ITER_ERROR (-1) +#define H5_ITER_CONT (0) +#define H5_ITER_STOP (1) + +/* + * The types of indices on links in groups/attributes on objects. + * Primarily used for " by index" routines and for iterating over + * links in groups/attributes on objects. + */ +typedef enum H5_index_t { + H5_INDEX_UNKNOWN = -1, /* Unknown index type */ + H5_INDEX_NAME, /* Index on names */ + H5_INDEX_CRT_ORDER, /* Index on creation order */ + H5_INDEX_N /* Number of indices defined */ +} H5_index_t; + +/* + * Storage info struct used by H5O_info_t and H5F_info_t + */ +typedef struct H5_ih_info_t { + hsize_t index_size; /* btree and/or list */ + hsize_t heap_size; +} H5_ih_info_t; + +/* Functions in H5.c */ +H5_DLL herr_t H5open(void); +H5_DLL herr_t H5close(void); +H5_DLL herr_t H5dont_atexit(void); +H5_DLL herr_t H5garbage_collect(void); +H5_DLL herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, + int arr_global_lim, int arr_list_lim, int blk_global_lim, + int blk_list_lim); +H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, + unsigned *relnum); +H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, + unsigned relnum); +H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); +H5_DLL herr_t H5free_memory(void *mem); +H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); +H5_DLL void *H5resize_memory(void *mem, size_t size); + +#ifdef __cplusplus +} +#endif +#endif /* _H5public_H */ + + -- cgit v0.12 From e627a2a45b6751294a14cab7f6617c48a5809482 Mon Sep 17 00:00:00 2001 From: hdftest Date: Wed, 22 Feb 2017 15:54:27 -0600 Subject: Delete files inadvertently checked in with version changes following snapshot release. (Changed daily test command to add specific files for commit instead of all new and modified files.) --- failsection | 1 - hl/test/test_packet_table_vlen.h5 | Bin 40680 -> 0 bytes hl/test/testfl_packet_table_vlen.h5 | Bin 40124 -> 0 bytes src/H5public.h~ | 344 ------------------------------------ 4 files changed, 345 deletions(-) delete mode 100644 failsection delete mode 100644 hl/test/test_packet_table_vlen.h5 delete mode 100644 hl/test/testfl_packet_table_vlen.h5 delete mode 100644 src/H5public.h~ diff --git a/failsection b/failsection deleted file mode 100644 index eb66e3c..0000000 --- a/failsection +++ /dev/null @@ -1 +0,0 @@ -make uninstall diff --git a/hl/test/test_packet_table_vlen.h5 b/hl/test/test_packet_table_vlen.h5 deleted file mode 100644 index aa7ec6b..0000000 Binary files a/hl/test/test_packet_table_vlen.h5 and /dev/null differ diff --git a/hl/test/testfl_packet_table_vlen.h5 b/hl/test/testfl_packet_table_vlen.h5 deleted file mode 100644 index 483dd84..0000000 Binary files a/hl/test/testfl_packet_table_vlen.h5 and /dev/null differ diff --git a/src/H5public.h~ b/src/H5public.h~ deleted file mode 100644 index 353a55c..0000000 --- a/src/H5public.h~ +++ /dev/null @@ -1,344 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * This file contains public declarations for the HDF5 module. - */ -#ifndef _H5public_H -#define _H5public_H - -/* Include files for public use... */ -/* - * Since H5pubconf.h is a generated header file, it is messy to try - * to put a #ifndef _H5pubconf_H ... #endif guard in it. - * HDF5 has set an internal rule that it is being included here. - * Source files should NOT include H5pubconf.h directly but include - * it via H5public.h. The #ifndef _H5public_H guard above would - * prevent repeated include. - */ -#include "H5pubconf.h" /*from configure */ - -/* API Version macro wrapper definitions */ -#include "H5version.h" - -#ifdef H5_HAVE_FEATURES_H -#include /*for setting POSIX, BSD, etc. compatibility */ -#endif -#ifdef H5_HAVE_SYS_TYPES_H -#include -#endif -#ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ -#endif -#ifndef __cplusplus -# ifdef H5_HAVE_STDINT_H -# include /*for C9x types */ -# endif -#else -# ifdef H5_HAVE_STDINT_H_CXX -# include /*for C9x types when include from C++ */ -# endif -#endif -#ifdef H5_HAVE_INTTYPES_H -# include /* For uint64_t on some platforms */ -#endif -#ifdef H5_HAVE_STDDEF_H -# include -#endif -#ifdef H5_HAVE_PARALLEL -# include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ -# include -#endif -#endif - - -/* Include the Windows API adapter header early */ -#include "H5api_adpt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros for enabling/disabling particular GCC warnings */ -/* (see the following web-sites for more info: - * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html - * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas - */ -/* These pragmas are only implemented usefully in gcc 4.6+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define H5_GCC_DIAG_STR(s) #s - #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) - #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) - #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - - #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) - #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) -#else - #define H5_GCC_DIAG_OFF(x) - #define H5_GCC_DIAG_ON(x) -#endif - -/* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 8 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ - /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap1" /* Full version string */ - -#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ - H5_VERS_RELEASE) - -/* macros for comparing the version */ -#define H5_VERSION_GE(Maj,Min,Rel) \ - (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \ - ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \ - (H5_VERS_MAJOR>Maj)) - -#define H5_VERSION_LE(Maj,Min,Rel) \ - (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || \ - ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } - */ -typedef unsigned int hbool_t; -typedef int htri_t; - -/* Define the ssize_t type if it not is defined */ -#if H5_SIZEOF_SSIZE_T==0 -/* Undefine this size, we will re-define it in one of the sections below */ -#undef H5_SIZEOF_SSIZE_T -#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT -typedef int ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_INT -#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG -typedef long ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG -#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG -typedef long long ssize_t; -# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG -#else /* Can't find matching type for ssize_t */ -# error "nothing appropriate for ssize_t" -#endif -#endif - -/* - * The sizes of file objects have their own types defined here, use a 64-bit - * type. - */ -#if H5_SIZEOF_LONG_LONG >= 8 -H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; -typedef signed long long hssize_t; -H5_GCC_DIAG_ON(long-long) -# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for hsize_t" -#endif - -/* - * File addresses have their own types. - */ -#if H5_SIZEOF_INT64_T>=8 - typedef uint64_t haddr_t; -# define HADDR_UNDEF ((haddr_t)(int64_t)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT64_T -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_INT>=8 - typedef unsigned haddr_t; -# define HADDR_UNDEF ((haddr_t)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_UNSIGNED -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_LONG>=8 - typedef unsigned long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG -# endif /* H5_HAVE_PARALLEL */ -#elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long long)(-1)) -# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG -# ifdef H5_HAVE_PARALLEL -# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT -# endif /* H5_HAVE_PARALLEL */ -#else -# error "nothing appropriate for haddr_t" -#endif -#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT -# define H5_PRINTF_HADDR_FMT "%u" -#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG -# define H5_PRINTF_HADDR_FMT "%lu" -#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG -# define H5_PRINTF_HADDR_FMT "%" H5_PRINTF_LL_WIDTH "u" -#else -# error "nothing appropriate for H5_PRINTF_HADDR_FMT" -#endif -#define HADDR_MAX (HADDR_UNDEF-1) - -/* uint32_t type is used for creation order field for messages. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_UINT32_T>=4 -#elif H5_SIZEOF_SHORT>=4 - typedef short uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT -#elif H5_SIZEOF_INT>=4 - typedef unsigned int uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=4 - typedef unsigned long uint32_t; -# undef H5_SIZEOF_UINT32_T -# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG -#else -# error "nothing appropriate for uint32_t" -#endif - -/* int64_t type is used for creation order field for links. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_INT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef int int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef long long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for int64_t" -#endif - -/* uint64_t type is used for fields for H5O_info_t. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_UINT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef unsigned uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef unsigned long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for uint64_t" -#endif - -/* Common iteration orders */ -typedef enum { - H5_ITER_UNKNOWN = -1, /* Unknown order */ - H5_ITER_INC, /* Increasing order */ - H5_ITER_DEC, /* Decreasing order */ - H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ -} H5_iter_order_t; - -/* Iteration callback values */ -/* (Actually, any postive value will cause the iterator to stop and pass back - * that positive value to the function that called the iterator) - */ -#define H5_ITER_ERROR (-1) -#define H5_ITER_CONT (0) -#define H5_ITER_STOP (1) - -/* - * The types of indices on links in groups/attributes on objects. - * Primarily used for " by index" routines and for iterating over - * links in groups/attributes on objects. - */ -typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ -} H5_index_t; - -/* - * Storage info struct used by H5O_info_t and H5F_info_t - */ -typedef struct H5_ih_info_t { - hsize_t index_size; /* btree and/or list */ - hsize_t heap_size; -} H5_ih_info_t; - -/* Functions in H5.c */ -H5_DLL herr_t H5open(void); -H5_DLL herr_t H5close(void); -H5_DLL herr_t H5dont_atexit(void); -H5_DLL herr_t H5garbage_collect(void); -H5_DLL herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, - int blk_list_lim); -H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, - unsigned *relnum); -H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, - unsigned relnum); -H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); -H5_DLL herr_t H5free_memory(void *mem); -H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); -H5_DLL void *H5resize_memory(void *mem, size_t size); - -#ifdef __cplusplus -} -#endif -#endif /* _H5public_H */ - - -- cgit v0.12 From 847c285c61eeb11ab83f9624b680421bd06c6747 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Feb 2017 11:45:13 -0500 Subject: Updated an error message in H5L.c to be more helpful. Fixes HDFFV-10141. --- src/H5L.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5L.c b/src/H5L.c index 9c81f98..8e59762 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2292,9 +2292,11 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, if(name == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") - /* Check for removing '.' */ + /* Check for non-existent (NULL) link. + * Note that this can also occur when attempting to remove '.' + */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "can't delete self") + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL") /* Remove the link from the group */ if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) -- cgit v0.12 From c7c014d4cd9039ad986197e627635978a72b4584 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Feb 2017 11:59:07 -0500 Subject: Updated the H5L.c error message after additional thought. Fix for HDFFV-10141. --- src/H5L.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5L.c b/src/H5L.c index 8e59762..a4c1022 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2296,7 +2296,7 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, * Note that this can also occur when attempting to remove '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL") + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") /* Remove the link from the group */ if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) -- cgit v0.12 From a87a2cf81571a1e0ed466942c389e574d6d9bab5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 28 Feb 2017 16:54:56 -0600 Subject: Merge CMake FindMPI changes and CMake documentation from develop --- config/cmake/HDF518_Examples.cmake.in | 14 +- config/cmake/README.txt.cmake.in | 2 +- config/cmake/scripts/CTestScript.cmake | 33 ++--- config/cmake_ext_mod/FindMPI.cmake | 31 ++-- config/cmake_ext_mod/runTest.cmake | 28 +++- fortran/testpar/CMakeLists.txt | 4 +- release_docs/INSTALL_CMake.txt | 195 ++++++++++++++---------- release_docs/RELEASE.txt | 17 ++- release_docs/USING_CMake_Examples.txt | 4 +- release_docs/USING_HDF5_CMake.txt | 264 +++++++++++++++------------------ release_docs/USING_HDF5_VS.txt | 2 +- 11 files changed, 321 insertions(+), 273 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index cc78c2b..4d86cf9 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -12,7 +12,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) @@ -35,10 +35,10 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") +else(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "NO") endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") @@ -67,7 +67,7 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRI # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") @@ -75,7 +75,7 @@ if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 9bd9eb2..c3e3165 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -42,7 +42,7 @@ To test the installation with the examples; with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATICLIBRARIES script option set to "NO". + Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". Other options can be changed by editing the HDF518_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 3937cfc..e525078 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -25,14 +25,11 @@ if(NOT SITE_OS_NAME) message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if(USE_AUTOTOOLS) - set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") - endif() if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + set(CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") endif() set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else(NOT SITE_OS_NAME) +else() ## machine name provided ## -------------------------- if(CMAKE_HOST_UNIX) @@ -44,7 +41,7 @@ else(NOT SITE_OS_NAME) set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") endif() set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif(NOT SITE_OS_NAME) +endif() #----------------------------------------------------------------------------- # MAC machines need special option @@ -59,12 +56,12 @@ if(APPLE) if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) + else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) + endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) +endif() #----------------------------------------------------------------------------- set(NEED_REPOSITORY_CHECKOUT 0) @@ -73,10 +70,10 @@ if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) endif() @@ -88,7 +85,7 @@ if(CTEST_USE_TAR_SOURCE) file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) set(LOCAL_SKIP_UPDATE "TRUE") -else(CTEST_USE_TAR_SOURCE) +else() if(LOCAL_UPDATE) if(CTEST_USE_GIT_SOURCE) find_program(CTEST_GIT_COMMAND NAMES git git.cmd) @@ -109,7 +106,7 @@ else(CTEST_USE_TAR_SOURCE) set(CTEST_GIT_options "pull") endif() set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else(CTEST_USE_GIT_SOURCE) + else() ## -------------------------- ## use subversion to get source #----------------------------------------------------------------------------- @@ -140,9 +137,9 @@ else(CTEST_USE_TAR_SOURCE) set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") endif() endif() - endif(CTEST_USE_GIT_SOURCE) - endif(LOCAL_UPDATE) -endif(CTEST_USE_TAR_SOURCE) + endif() + endif() +endif() #----------------------------------------------------------------------------- ## Clear the build directory @@ -183,7 +180,7 @@ foreach(req if(NOT DEFINED ${req}) message(FATAL_ERROR "The containing script must set ${req}") endif() -endforeach(req) +endforeach() #----------------------------------------------------------------------------- # Initialize the CTEST commands @@ -201,7 +198,7 @@ else() "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) endif() - + #----------------------------------------------------------------------------- ## -- set output to english set($ENV{LC_MESSAGES} "en_EN") diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 1a02f82..1fb07d4 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -114,9 +114,10 @@ include(GetPrerequisites) # # Start out with the generic MPI compiler names, as these are most commonly used. -set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r mpicc.bat) set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r + mpicxx.bat) set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r mpif77 mpif77_r mpf77 mpf77_r) @@ -128,9 +129,9 @@ set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpig77 mpig77_r mpg77 mpg77_r) # Intel MPI compiler names -set(_MPI_Intel_C_COMPILER_NAMES mpiicc) -set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) -set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +set(_MPI_Intel_C_COMPILER_NAMES mpiicc mpiicc.bat) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC mpiicpc.bat) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77 mpiifort.bat) # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -314,8 +315,9 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_COMPILE_FLAGS_WORK) - string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}") + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") else() set(MPI_COMPILE_FLAGS_WORK ${FLAG}) endif() @@ -323,9 +325,13 @@ function (interrogate_mpi_compiler lang try_libs) # Extract include paths from compile command line string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + set(MPI_INCLUDE_PATH_WORK) + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REPLACE "//" "/" IPATH ${IPATH}) + string(REPLACE "\"" "" IPATH ${IPATH}) + file(TO_CMAKE_PATH "${IPATH}" IPATH) list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) endforeach() @@ -363,8 +369,9 @@ function (interrogate_mpi_compiler lang try_libs) string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}") + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") else() set(MPI_LINK_FLAGS_WORK ${FLAG}) endif() @@ -386,8 +393,7 @@ function (interrogate_mpi_compiler lang try_libs) # in the showme list that can only be found in the implicit # link directories of the compiler. if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) - string(APPEND MPI_LINK_PATH - ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + set(MPI_LINK_PATH "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") endif () # Determine full path names for all of the libraries that one needs @@ -462,11 +468,11 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_path(MPI_HEADER_PATH mpifptr.h HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) + PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) endif() - + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc @@ -624,6 +630,9 @@ foreach (lang C CXX Fortran) try_regular_compiler(${lang} regular_compiler_worked) endif() + # add fortran mpi module path if ENV VAR exists + set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") + set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 804c80f..0a77dae 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -144,6 +144,13 @@ if (TEST_FILTER) file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () +if (TEST_REF_FILTER) + #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +endif (TEST_REF_FILTER) + # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) @@ -151,11 +158,22 @@ if (NOT TEST_SKIP_COMPARE) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index ae88ebc..909cbaf 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${MPI_Fortran_INCLUDE_PATH} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -22,7 +22,7 @@ target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ${MPI_Fortran_LIBRARIES} + ${LINK_Fortran_LIBS} ) if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index e60fe2d..0db7d98 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -263,10 +263,10 @@ IV. Further considerations B. Use source packages from an SVN server by adding the following CMake options: - HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" - SZIP_SVN_URL:STRING="http://some_location/szip/trunk" - where "some_location" is the URL to the SVN repository. Also set + HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" + ZLIB_GIT_URL:STRING="http://some_location/zlib" + SZIP_GIT_URL:STRING="http://some_location/szip" + where "some_location" is the URL to the GIT repository. Also set CMAKE_BUILD_TYPE to the configuration type. C. Use source packages from a compressed file by adding the following @@ -376,10 +376,10 @@ These five steps are described in detail below. * MinGW Makefiles * NMake Makefiles * Unix Makefiles - * Visual Studio 12 2013 - * Visual Studio 12 2013 Win64 * Visual Studio 11 2012 * Visual Studio 11 2012 Win64 + * Visual Studio 12 2013 + * Visual Studio 12 2013 Win64 * Visual Studio 14 2015 * Visual Studio 14 2015 Win64 @@ -418,8 +418,8 @@ These five steps are described in detail below. set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) - set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) @@ -476,15 +476,15 @@ These five steps are described in detail below. Release and build the solution. 3.2.1 The external libraries (zlib and szip) can be configured - to allow building the libraries by downloading from an SVN repository. + to allow building the libraries by downloading from an GIT repository. The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following configuration option: - -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" - The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: - ZLIB_SVN_URL:STRING="http://${svn_url}/zlib/trunk" - SZIP_SVN_URL:STRING="http://${svn_url}/szip/trunk" - ${svn_url} should be changed to your location. Also define CMAKE_BUILD_TYPE + The options to control the GIT URL (config/cmake/cacheinit.cmake file) are: + ZLIB_GIT_URL:STRING="http://${git_url}/zlib" + SZIP_GIT_URL:STRING="http://${git_url}/szip" + ${git_url} should be changed to your location. Also define CMAKE_BUILD_TYPE to be the configuration type. 3.2.2 Or the external libraries (zlib and szip) can be configured @@ -524,8 +524,8 @@ These five steps are described in detail below. NOTE: See note 8 of this document for NSIS information. See note 9 of this document for WiX information. - Also, if you are using a Visual Studio Express version or do not - want to enable the packaging components, set HDF5_NO_PACKAGES + Also, if you are using a Visual Studio Express version or + want to disable the packaging components, set HDF5_NO_PACKAGES to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) 6. The files that support building HDF5 with CMake are all the files in the @@ -562,7 +562,7 @@ The config/cmake/cacheinit.cmake file can override the following values. ---------------- General Build Options --------------------- BUILD_SHARED_LIBS "Build Shared Libraries" ON -BUILD_STATIC_EXECS "Build Static Executabless" OFF +BUILD_STATIC_EXECS "Build Static Executables" OFF BUILD_TESTING "Build HDF5 Unit Testing" ON ---------------- HDF5 Build Options --------------------- @@ -618,7 +618,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -else (WINDOWS) +else () H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" endif () @@ -641,9 +641,9 @@ build and test process. VIII. Options for Platform Configuration Files ======================================================================== -Below is the HDF518config.cmake ctest script with extra comments. +Below is the HDF518config.cmake and HDF5options.cmake ctest scripts. Execute: - ctest -S HDF518config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf518.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=xxx -C Release -VV -O hdf518.log The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. @@ -651,7 +651,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### +### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf518.log ### ############################################################################################# cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) @@ -671,12 +671,12 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_LIBRARIES - Build/use static libraries +# STATIC_ONLY - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.8.16) +set(CTEST_SOURCE_VERSION 1.8.19) set(CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -685,7 +685,7 @@ set(CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.8 -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac if(DEFINED CTEST_SCRIPT_ARG) @@ -723,11 +723,16 @@ else() endif() endif() +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +################################################################### + if(NOT DEFINED INSTALLDIR) if(WIN32) - set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") else() - set(INSTALLDIR "/usr/local/myhdf5") + set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") endif() endif() if(NOT DEFINED CTEST_CONFIGURATION_TYPE) @@ -736,10 +741,10 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") else() - set(STATICLIBRARIES "NO") + set(STATICONLYLIBRARIES "NO") endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") @@ -790,12 +795,28 @@ if(WIN32) ## Set the following to unique id your computer ## set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else() + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") else() set(CTEST_SITE "LINUX.XXXX") endif() + if(APPLE) + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + set(CTEST_USE_LAUNCHERS 1) + set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set(RR_FLAGS_C "${RR_FLAGS_COMMON}") + set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif() endif() ################################################################### @@ -816,38 +837,21 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16") +set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set(REPOSITORY_BRANCH "develop") + #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") ################################################################### ################################################################### -#### Change default configuration of options in config/cmake/cacheinit.cmake file ### -#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") - -################################################################### -if(${STATICLIBRARIES}) +if(${STATICONLYLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") endif() ################################################################### - -### uncomment/comment and change the following lines for other configuration options - -#### ext libraries #### -### ext libs from tgz -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") -### ext libs from svn -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") -### ext libs on system -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") -### disable ext libs building -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### if(${FORTRANLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") @@ -859,61 +863,96 @@ else() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") endif() -### disable test program builds -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") - -### disable packaging -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") - ### change install prefix set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### if(WIN32) + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() endif() endif() endif() +HDF5options.cmake: +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options + +############################################################################################# +#### ext libraries #### + +### ext libs from tgz +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### ext libs from git +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") +### ext libs on system +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") + +### disable ext zlib building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") +### disable ext szip building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") + +############################################################################################# +### disable test program builds + +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") + +############################################################################################# +### disable packaging + +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") +### Create install package with external libraries (szip, zlib, jpeg) +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") + +############################################################################################# ======================================================================== For further assistance, send email to help@hdfgroup.org diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6655eb0..ca292d2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -57,7 +57,8 @@ New Features Configuration ------------- - - None + - CMake minimum is now 3.2.2. (ADB 2016/01/10) + Library @@ -204,14 +205,14 @@ They are built with the configure process unless specified otherwise. Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) (cmake and autotools) Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 w/ Intel Fortran 16 (cmake) - + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) @@ -252,9 +253,10 @@ SunOS 5.11 32-bit n y/y n y y y SunOS 5.11 64-bit n y/y n y y y Windows 7 y y/y n y y y Windows 7 x64 y y/y n y y y -Windows 7 Cygwin n y/y n y y n -Windows 10 n y/y n y y y -Windows 10 x64 n y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y @@ -273,6 +275,7 @@ SunOS 5.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y Windows 10 y y y y Windows 10 x64 y y y y Mac OS X Mountain Lion 10.8.5 64-bit y n y y diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index da61fed..9773e0f 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -22,7 +22,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.8.x product requires a minimum CMake version - of 3.1.0. + of 3.2.2. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -52,7 +52,7 @@ Default installation process: with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATIC_LIBRARIES script option set to "NO". + Shared libraries can be used with the STATIC_ONLY script option set to "NO". Other options can be changed by editing the HDF518_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 80c9668..9098f15 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -37,7 +37,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.8.x product requires a minimum CMake version - of 3.1.0. + of 3.2.2. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -226,125 +226,98 @@ NOTE: this file is available at the HDF web site: ======================================================================== ctest ======================================================================== + cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +############################################################################################################### +# This script will build and run the examples from a folder +# Execute from a command line: +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log +############################################################################################################### + +set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -############################################################################ -# Usage: -# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log -# where valid options for OPTION are: -# BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles -# VS2015 * Visual Studio 14 2015 -# VS201564 * Visual Studio 14 2015 Win64 -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 -# -# INSTALLDIR - root folder where hdf5 is installed -# CTEST_BUILD_CONFIGURATION - Release, Debug, etc -# CTEST_SOURCE_NAME - source folder -# STATIC_LIBRARIES - Build/use static libraries -# FORTRAN_LIBRARIES - Build/use fortran libraries -# NO_MAC_FORTRAN - Yes to be SHARED on a Mac -############################################################################## # handle input parameters to script. -#BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.8 root folder +#INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO +#JAVA_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if(DEFINED CTEST_SCRIPT_ARG) +if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() - -# build generator must be defined -if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else() - if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CMAKE_GENERATOR "Unix Makefiles") - elseif(${BUILD_GENERATOR} STREQUAL "VS2015") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif(${BUILD_GENERATOR} STREQUAL "VS201564") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CMAKE_GENERATOR "Visual Studio 12 2013") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CMAKE_GENERATOR "Visual Studio 11 2012") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() -set(CTEST_CMAKE_GENERATOR "${CMAKE_GENERATOR}") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) - -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif() -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") + endif () + endforeach () +endif () +if (NOT DEFINED INSTALLDIR) + set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif () +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "HDF5Examples") +endif () +if (NOT DEFINED STATIC_ONLY) + set (STATICONLYLIBRARIES "YES") +else () + set (STATICONLYLIBRARIES "NO") endif() -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "YES") +if (NOT DEFINED FORTRAN_LIBRARIES) + set (FORTRANLIBRARIES "NO") +else () + set (FORTRANLIBRARIES "YES") endif() +if (NOT DEFINED JAVA_LIBRARIES) + set (JAVALIBRARIES "NO") +else () + set (JAVALIBRARIES "YES") +endif () #TAR_SOURCE - name of tarfile -#if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif() +#if (NOT DEFINED TAR_SOURCE) +# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif () ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +if (WIN32) + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else (WIN32) + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) -if(${FORTRANLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +if (${FORTRANLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif () +if (${JAVALIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -354,81 +327,90 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HD #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if(APPLE) +if (APPLE) # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + if (NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () #----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- -if(CTEST_USE_TAR_SOURCE) +if (CTEST_USE_TAR_SOURCE) ## Uncompress source if tar or zip file provided ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() - - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif() -endif(CTEST_USE_TAR_SOURCE) + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif () +endif () #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) else () - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") endif () # Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- ## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") +set ($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- -configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ## NORMAL process ## -------------------------- ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") +if (LOCAL_SUBMIT) + ctest_submit (PARTS Configure Notes) +endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) +if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) +endif () ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if(res GREATER 0) - message (FATAL_ERROR "tests FAILED") +if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) endif() +if (res GREATER 0) + message (FATAL_ERROR "tests FAILED") +endif () #----------------------------------------------------------------------------- ############################################################################################################## diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt index 1f38891..41d6a99 100644 --- a/release_docs/USING_HDF5_VS.txt +++ b/release_docs/USING_HDF5_VS.txt @@ -46,7 +46,7 @@ Using Visual Studio with HDF5 Libraries szip.lib zlib.lib hdf5.lib hdf5_cpp.lib ======================================================================== -Helpful Pointers +3. Helpful Pointers ======================================================================== 3.1 FAQ -- cgit v0.12 From 1653bb14324c2edc1a0c0336eb9f327d4f2e76b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Mar 2017 10:54:26 -0600 Subject: Add option TEST_SHARED_PROGRAMS to disable shared testing by default --- CMakeLists.txt | 3 + fortran/test/CMakeTests.cmake | 2 +- hl/fortran/test/CMakeTests.cmake | 2 +- test/CMakeTests.cmake | 428 +++++++++++++++++---------------------- 4 files changed, 192 insertions(+), 243 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d03ea86..3e413e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -683,6 +683,9 @@ if (BUILD_TESTING) option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) + option (TEST_SHARED_PROGRAMS "Enable testing of Shared programs" OFF) + mark_as_advanced (TEST_SHARED_PROGRAMS) + enable_testing () include (CTest) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 7cb1bd0..4838aae 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -27,7 +27,7 @@ add_test (NAME FORTRAN_fflush1 COMMAND $) add_test (NAME FORTRAN_fflush2 COMMAND $) set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 5af9ced..0895942 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -32,7 +32,7 @@ set_tests_properties (HL_FORTRAN_f90_tstimage PROPERTIES DEPENDS HL_FORTRAN_test add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( NAME HL_FORTRAN_test-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5812cd5..5fbde25 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -9,7 +9,7 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files") -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") @@ -29,9 +29,9 @@ if (HDF5_TEST_VFD) endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") - #if (BUILD_SHARED_LIBS) - # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + endif () endforeach () endif () @@ -44,7 +44,7 @@ set (HDF5_TEST_FILES foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") endif () endforeach () @@ -52,7 +52,7 @@ if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") endif () endforeach () @@ -72,7 +72,7 @@ set (HDF5_REFERENCE_FILES foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () @@ -80,7 +80,7 @@ if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () @@ -128,7 +128,7 @@ set (HDF5_REFERENCE_TEST_FILES foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () @@ -136,14 +136,14 @@ if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () endforeach () endif () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) endif() @@ -213,7 +213,7 @@ else () ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_test (NAME H5TEST-shared-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -261,69 +261,73 @@ endif () ############################################################################## ############################################################################## +set (test_CLEANFILES + dt_arith1.h5 + dt_arith2.h5 + dtransform.h5 + dtypes3.h5 + dtypes4.h5 + dtypes5.h5 + efc0.h5 + efc1.h5 + efc2.h5 + efc3.h5 + efc4.h5 + efc5.h5 + extlinks16A00000.h5 + extlinks16A00001.h5 + extlinks16A00002.h5 + extlinks16B-b.h5 + extlinks16B-g.h5 + extlinks16B-l.h5 + extlinks16B-r.h5 + extlinks16B-s.h5 + extlinks19B00000.h5 + extlinks19B00001.h5 + extlinks19B00002.h5 + extlinks19B00003.h5 + extlinks19B00004.h5 + extlinks19B00005.h5 + extlinks19B00006.h5 + extlinks19B00007.h5 + extlinks19B00008.h5 + extlinks19B00009.h5 + extlinks19B00010.h5 + extlinks19B00011.h5 + extlinks19B00012.h5 + extlinks19B00013.h5 + extlinks19B00014.h5 + extlinks19B00015.h5 + extlinks19B00016.h5 + extlinks19B00017.h5 + extlinks19B00018.h5 + extlinks19B00019.h5 + extlinks19B00020.h5 + extlinks19B00021.h5 + extlinks19B00022.h5 + extlinks19B00023.h5 + extlinks19B00024.h5 + extlinks19B00025.h5 + extlinks19B00026.h5 + extlinks19B00027.h5 + extlinks19B00028.h5 + fheap.h5 + log_vfd_out.log + new_multi_file_v16-r.h5 + new_multi_file_v16-s.h5 + objcopy_ext.dat + testmeta.h5 + tstint1.h5 + tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 +) + # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - dt_arith1.h5 - dt_arith2.h5 - dtransform.h5 - dtypes3.h5 - dtypes4.h5 - dtypes5.h5 - efc0.h5 - efc1.h5 - efc2.h5 - efc3.h5 - efc4.h5 - efc5.h5 - extlinks16A00000.h5 - extlinks16A00001.h5 - extlinks16A00002.h5 - extlinks16B-b.h5 - extlinks16B-g.h5 - extlinks16B-l.h5 - extlinks16B-r.h5 - extlinks16B-s.h5 - extlinks19B00000.h5 - extlinks19B00001.h5 - extlinks19B00002.h5 - extlinks19B00003.h5 - extlinks19B00004.h5 - extlinks19B00005.h5 - extlinks19B00006.h5 - extlinks19B00007.h5 - extlinks19B00008.h5 - extlinks19B00009.h5 - extlinks19B00010.h5 - extlinks19B00011.h5 - extlinks19B00012.h5 - extlinks19B00013.h5 - extlinks19B00014.h5 - extlinks19B00015.h5 - extlinks19B00016.h5 - extlinks19B00017.h5 - extlinks19B00018.h5 - extlinks19B00019.h5 - extlinks19B00020.h5 - extlinks19B00021.h5 - extlinks19B00022.h5 - extlinks19B00023.h5 - extlinks19B00024.h5 - extlinks19B00025.h5 - extlinks19B00026.h5 - extlinks19B00027.h5 - extlinks19B00028.h5 - fheap.h5 - log_vfd_out.log - new_multi_file_v16-r.h5 - new_multi_file_v16-s.h5 - objcopy_ext.dat - testmeta.h5 - tstint1.h5 - tstint2.h5 - unregister_filter_1.h5 - unregister_filter_2.h5 + ${test_CLEANFILES} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -349,70 +353,12 @@ set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 2400) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) # Remove any output file left over from previous test run add_test (NAME H5TEST-shared-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - dt_arith1.h5 - dt_arith2.h5 - dtransform.h5 - dtypes3.h5 - dtypes4.h5 - dtypes5.h5 - efc0.h5 - efc1.h5 - efc2.h5 - efc3.h5 - efc4.h5 - efc5.h5 - extlinks16A00000.h5 - extlinks16A00001.h5 - extlinks16A00002.h5 - extlinks16B-b.h5 - extlinks16B-g.h5 - extlinks16B-l.h5 - extlinks16B-r.h5 - extlinks16B-s.h5 - extlinks19B00000.h5 - extlinks19B00001.h5 - extlinks19B00002.h5 - extlinks19B00003.h5 - extlinks19B00004.h5 - extlinks19B00005.h5 - extlinks19B00006.h5 - extlinks19B00007.h5 - extlinks19B00008.h5 - extlinks19B00009.h5 - extlinks19B00010.h5 - extlinks19B00011.h5 - extlinks19B00012.h5 - extlinks19B00013.h5 - extlinks19B00014.h5 - extlinks19B00015.h5 - extlinks19B00016.h5 - extlinks19B00017.h5 - extlinks19B00018.h5 - extlinks19B00019.h5 - extlinks19B00020.h5 - extlinks19B00021.h5 - extlinks19B00022.h5 - extlinks19B00023.h5 - extlinks19B00024.h5 - extlinks19B00025.h5 - extlinks19B00026.h5 - extlinks19B00027.h5 - extlinks19B00028.h5 - fheap.h5 - log_vfd_out.log - new_multi_file_v16-r.h5 - new_multi_file_v16-s.h5 - objcopy_ext.dat - testmeta.h5 - tstint1.h5 - tstint2.h5 - unregister_filter_1.h5 - unregister_filter_2.h5 + ${test_CLEANFILES} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) @@ -594,7 +540,7 @@ add_test (NAME H5TEST-testlibinfo ${HDF5_TEST_BINARY_DIR}/H5TEST ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) #-- Adding test for cache if (NOT CYGWIN) add_test (NAME H5TEST-shared-clear-cache-objects @@ -775,14 +721,16 @@ if (HDF5_TEST_VFD) set (H5_VFD_TESTS testhdf5 - accum +# cache + cache_api lheap ohdr stab gheap -# cache - cache_api pool + accum + btree2 +# fheap hyperslab istore bittests @@ -808,7 +756,7 @@ if (HDF5_TEST_VFD) set_extent ttsafe getname - vfd +# vfd ntypes dangle dtransform @@ -816,13 +764,11 @@ if (HDF5_TEST_VFD) cross_read freespace mf - btree2 - #fheap - error_test - err_compat - tcheck_version - testmeta - #links_env +# error_test +# err_compat + #tcheck_version +# testmeta +# links_env unregister ) if (NOT CYGWIN) @@ -848,31 +794,31 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - #if (BUILD_SHARED_LIBS) - # add_test (NAME VFD-${vfdname}-${test}-shared - # COMMAND "${CMAKE_COMMAND}" - # -D "TEST_PROGRAM=$" - # -D "TEST_ARGS:STRING=" - # -D "TEST_VFD:STRING=${vfdname}" - # -D "TEST_EXPECT=${resultcode}" - # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - # ) - # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) - #if (BUILD_SHARED_LIBS) - # add_test (NAME VFD-${vfdname}-${test}-shared - # COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" + ) + endif () endif() else () add_test (NAME VFD-${vfdname}-${vfdtest} @@ -889,22 +835,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - #if (BUILD_SHARED_LIBS) - # add_test (NAME VFD-${vfdname}-${test}-shared - # COMMAND "${CMAKE_COMMAND}" - # -D "TEST_PROGRAM=$" - # -D "TEST_ARGS:STRING=" - # -D "TEST_VFD:STRING=${vfdname}" - # -D "TEST_EXPECT=${resultcode}" - # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - # ) - # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () endif () else () add_test (NAME VFD-${vfdname}-${vfdtest} @@ -921,22 +867,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - #if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") - # add_test (NAME VFD-${vfdname}-${vfdtest}-shared - # COMMAND "${CMAKE_COMMAND}" - # -D "TEST_PROGRAM=$" - # -D "TEST_ARGS:STRING=" - # -D "TEST_VFD:STRING=${vfdname}" - # -D "TEST_EXPECT=${resultcode}" - # -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - # ) - # set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT ${vfdtest} STREQUAL "cache") + add_test (NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () endif () ENDMACRO () @@ -959,22 +905,22 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - #if (BUILD_SHARED_LIBS) - # add_test (NAME VFD-${vfdname}-${test}-shared - # COMMAND "${CMAKE_COMMAND}" - # -D "TEST_PROGRAM=$" - # -D "TEST_ARGS:STRING=" - # -D "TEST_VFD:STRING=${vfdname}" - # -D "TEST_EXPECT=${resultcode}" - # -D "TEST_OUTPUT=${vfdname}-${test}-shared" - # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - # ) - # set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES - # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${test}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () endif () endforeach () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) @@ -987,18 +933,18 @@ if (HDF5_TEST_VFD) if (NOT CYGWIN) set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) endif () - #if (BUILD_SHARED_LIBS) - # set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) - # set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) - # set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) - # set_tests_properties (VFD-${vfdname}-objcopy-shared PROPERTIES TIMEOUT 1000) - # set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) - # set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) - # set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) - # if (NOT CYGWIN AND NOT WIN32) - # set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - # endif () - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) + set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-objcopy-shared PROPERTIES TIMEOUT 1000) + set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) + set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) + set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -1015,23 +961,23 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - #if (BUILD_SHARED_LIBS) - # add_test (NAME VFD-${vfdname}-fheap-shared - # COMMAND "${CMAKE_COMMAND}" - # -D "TEST_PROGRAM=$" - # -D "TEST_ARGS:STRING=" - # -D "TEST_VFD:STRING=${vfdname}" - # -D "TEST_EXPECT=${resultcode}" - # -D "TEST_OUTPUT=${vfdname}-fheap-shared" - # -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - # -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - # ) - # set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - # TIMEOUT 1800 - # ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - # ) - #endif () + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) + add_test (NAME VFD-${vfdname}-fheap-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () endif () ENDMACRO () -- cgit v0.12 From 1f4602f73b46fc4de4e711d4d743c9b049179ea2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Mar 2017 12:33:32 -0600 Subject: HDFFV-10120 verify nozlib checks and synchronize scripts with develop --- tools/h5copy/CMakeTests.cmake | 74 ++++++++++++++++++++++++++++------- tools/h5copy/testh5copy.sh.in | 19 +++++++-- tools/h5diff/CMakeTests.cmake | 13 ++++-- tools/h5import/CMakeTests.cmake | 18 ++------- tools/h5import/h5importtestutil.sh.in | 5 ++- tools/h5jam/CMakeTests.cmake | 35 +---------------- tools/h5jam/testh5jam.sh.in | 2 +- tools/h5ls/CMakeTests.cmake | 8 +++- tools/h5repack/CMakeTests.cmake | 20 +++------- tools/h5repack/h5repack.sh.in | 4 +- tools/h5stat/CMakeTests.cmake | 8 +--- tools/h5stat/testh5stat.sh.in | 2 +- tools/misc/CMakeTests.cmake | 4 -- tools/misc/testh5mkgrp.sh.in | 2 +- 14 files changed, 115 insertions(+), 99 deletions(-) diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a2131d1..c429377 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -108,6 +108,15 @@ endif () ENDMACRO () + MACRO (ADD_SKIP_H5_TEST testname skipresultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5COPY-${testname}-${skipresultfile}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" + ) + endif () + ENDMACRO () + MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run @@ -168,7 +177,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) endif () @@ -211,8 +220,6 @@ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 - ./testfiles/${testname}.out.out - ./testfiles/${testname}.out.out.err ) add_test ( NAME H5COPY-CMP-${testname} @@ -292,12 +299,31 @@ set (last_test "H5COPY-clearall-objects") endif () +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# filters are defined. + +# detect whether the encoder is present. + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif () + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif () + # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + else () + ADD_H5_TEST (compressed 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + endif () + ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) ADD_H5_TEST (dset_attr 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) @@ -310,25 +336,41 @@ # "Test copying empty, 'full' & 'nested' groups" ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + else () + ADD_H5_TEST (grp_dsets 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + endif () ADD_H5_TEST (grp_attr 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) # "Test copying dataset within group in source file to group in destination" ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + if (USE_FILTER_DEFLATE) + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + else () + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + endif () # "Test copying objects into group hier. that doesn't exist yet in destination file" ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + else () + ADD_H5_TEST (E_F_grp_dsets 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + endif () ############# COPY REFERENCES ############## @@ -374,4 +416,8 @@ # - dataset ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + else () + ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + endif () diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index d8abfd9..449ae1a 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -21,6 +21,10 @@ srcdir=@srcdir@ +# Determine which filters are available +USE_FILTER_SZIP="@USE_FILTER_SZIP@" +USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" + # source dirs SRC_TOOLS="$srcdir/.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" @@ -128,7 +132,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5COPY_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -487,7 +491,9 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed +fi TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl TOOLTEST -i $TESTFILE -o $TESTDIR/dset_attr.out.h5 -v -s /dset_attr -d /dset_attr @@ -499,16 +505,19 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty +fi TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr +if test $USE_FILTER_DEFLATE = "yes" ; then echo "Test copying dataset within group in source file to group in destination" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group - echo "Test copying & renaming group" TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename +fi echo "Test copying 'full' group hierarchy into group in destination file" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets @@ -517,8 +526,10 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2 TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested +fi } # Copy references in various way. @@ -579,8 +590,10 @@ TEST_MISC() TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " - TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp +fi } ############################################################################## diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 91e0cab..a9ec683 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -335,13 +335,18 @@ -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${resultfile}.txt" -# -D "TEST_APPEND=EXIT CODE: [0-9]" -# -D "TEST_REF_FILTER=EXIT CODE: 0" - -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_REF_APPEND=EXIT CODE: [0-9]" + -D "TEST_REF_FILTER=EXIT CODE: 0" + -D "TEST_SORT_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "PH5DIFF-${resultfile}") endif () ENDMACRO () diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index d1f1681..4e6e171 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -93,10 +93,6 @@ COMMAND ${CMAKE_COMMAND} -E remove ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err ) set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -141,12 +137,6 @@ -E remove d${testfile} d${testfile}.bin - d${testfile}.imp - d${testfile}.imp.err - d${testfile}.dmp - d${testfile}.dmp.err - d${testfile}.dff - d${testfile}.dff.err ) set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -434,17 +424,17 @@ ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - else (NOT USE_FILTER_DEFLATE) + else () ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - endif (NOT USE_FILTER_DEFLATE) + endif () # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - else (NOT USE_FILTER_DEFLATE) + else () ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - endif (NOT USE_FILTER_DEFLATE) + endif () # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/h5import/h5importtestutil.sh.in b/tools/h5import/h5importtestutil.sh.in index e50ddac..6e747e7 100644 --- a/tools/h5import/h5importtestutil.sh.in +++ b/tools/h5import/h5importtestutil.sh.in @@ -153,7 +153,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5IMPORT_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -161,6 +161,9 @@ CLEAN_TESTFILES_AND_TESTDIR() fi } +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# TESTING() { SPACES=" " echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 3752e55..f82e0d6 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -49,13 +49,6 @@ endif () else () add_test ( - NAME H5JAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -66,7 +59,6 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) endif () ENDMACRO () @@ -83,13 +75,6 @@ endif () else () add_test ( - NAME H5JAM-UNJAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -100,7 +85,6 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) endif () ENDMACRO () @@ -108,16 +92,6 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5JAM-${testname}-CHECKFILE-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${actual}.new - ${actual}.new.err - ${actual}.out - ${actual}.out.err - ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -129,7 +103,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends}) add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" @@ -174,11 +148,6 @@ else () if (NOT "${ARGN}" STREQUAL "--delete") add_test ( - NAME H5JAM-${testname}-UNJAM_D-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err - ) - set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - add_test ( NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -189,7 +158,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") else () add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index 1664d6b..d8c9274 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -126,7 +126,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5JAM_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index f995c74..ad54cc2 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -431,8 +431,14 @@ ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) endif () +# test for file with datasets that use Fixed Array chunk indices + if (USE_FILTER_DEFLATE) + # data read internal filters + ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5) + endif (USE_FILTER_DEFLATE) + + ############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5) - diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index ebc2055..fa454ce 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -120,12 +120,6 @@ set (last_test "H5REPACK-${testname}") else () add_test ( - NAME H5REPACK-h5repack-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove h5repack-${testname}.out h5repack-${testname}.out.err - ) - set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -136,7 +130,6 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") endif () ENDMACRO () @@ -346,10 +339,6 @@ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} - testfiles/${testname}.${resultfile}.out - testfiles/${testname}.${resultfile}.out.err - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err ) add_test ( NAME H5REPACK_UD-${testname} @@ -961,7 +950,10 @@ ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) # test for datum size > H5TOOLS_MALLOCSIZE - ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () + ADD_H5_TEST (gt_mallocsize ${TESTTYPE} ${FILE1} -f GZIP=1) # Check repacking file with committed datatypes in odd configurations ADD_H5_TEST (committed_dt "TEST" ${FILE15}) @@ -997,12 +989,12 @@ set (TESTRETVAL 255) if (WIN32) set (TESTRETVAL -1) - endif() + endif () ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () endif () diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index de55f20..966aedf 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -39,6 +39,8 @@ H5DUMP=../h5dump/h5dump # The h5dump tool name H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary RM='rm -rf' +CMP='cmp' +DIFF='diff -c' GREP='grep' CP='cp' DIRNAME='dirname' @@ -165,7 +167,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5REPACK_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 00ce250..a3db0fc 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -75,11 +75,6 @@ endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5STAT-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -90,7 +85,6 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") endif () ENDMACRO () @@ -194,7 +188,7 @@ ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) # h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c -# as of release 1.8.0-alpha4 +# as of release 1.8.7-snap0 (on a 64-bit machine) ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) # h5stat_newgrat.h5 is generated by h5stat_gentest.c ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index 4d698da..9ceb943 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -149,7 +149,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5STAT_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index d065b63..ee60bf8 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -76,8 +76,6 @@ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err ) set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") endif () @@ -118,8 +116,6 @@ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err ) set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") add_test ( diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in index 190e824..a0413e1 100644 --- a/tools/misc/testh5mkgrp.sh.in +++ b/tools/misc/testh5mkgrp.sh.in @@ -117,7 +117,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $tstfile` + SDIR=$SRC_H5MKGRP_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then -- cgit v0.12 From db3936746f1175d07a754c345836a01c2c0128ef Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Mar 2017 16:32:32 -0600 Subject: Remove non-applicable test --- tools/h5ls/CMakeTests.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index ad54cc2..2addebf 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -431,13 +431,6 @@ ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) endif () -# test for file with datasets that use Fixed Array chunk indices - if (USE_FILTER_DEFLATE) - # data read internal filters - ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5) - endif (USE_FILTER_DEFLATE) - - ############################################################################## ### P L U G I N T E S T S ############################################################################## -- cgit v0.12 From 0c25a705bab5f2e06bfba0cfa285874d071e2bed Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Mar 2017 13:32:42 -0600 Subject: HDFFV-10128 merge from develop --- tools/h5diff/CMakeTests.cmake | 22 +++-- tools/h5diff/h5diffgentest.c | 161 ++++++++++++++++++++++++++++++++ tools/h5diff/testfiles/diff_strings1.h5 | Bin 0 -> 4464 bytes tools/h5diff/testfiles/diff_strings2.h5 | Bin 0 -> 4464 bytes tools/h5diff/testh5diff.sh.in | 17 ++-- tools/lib/h5diff_array.c | 10 +- 6 files changed, 192 insertions(+), 18 deletions(-) create mode 100644 tools/h5diff/testfiles/diff_strings1.h5 create mode 100644 tools/h5diff/testfiles/diff_strings2.h5 diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index a9ec683..93fdd55 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -286,7 +286,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) @@ -314,9 +314,9 @@ if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_PH5_TEST resultfile resultcode) + macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) @@ -348,9 +348,9 @@ endif () set (last_test "PH5DIFF-${resultfile}") endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -393,7 +393,7 @@ endif () set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## @@ -450,6 +450,9 @@ # attrs with verbose option level set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + # strings + set (STRINGS1 diff_strings1.h5) + set (STRINGS2 diff_strings2.h5) if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run @@ -1089,8 +1092,7 @@ ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1 g1/d2) # with --use-system-epsilon for float value. expect less differences -ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 -g1/fp2) +ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 g1/fp2) # not comparable -c flag ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) @@ -1386,3 +1388,7 @@ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/ ############################################################################## ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) + +# ############################################################################## +# # END +# ############################################################################## diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index cfaffe6..50b32aa 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -93,6 +93,9 @@ hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* non-comparable dataset and attribute */ #define NON_COMPARBLES1 "non_comparables1.h5" #define NON_COMPARBLES2 "non_comparables2.h5" +/* string dataset and attribute */ +#define DIFF_STRINGS1 "diff_strings1.h5" +#define DIFF_STRINGS2 "diff_strings2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 @@ -157,6 +160,7 @@ static void test_comps_array_vlen (const char *fname, const char *dset, const ch static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); static void test_data_nocomparables (const char *fname, int diff); static void test_objs_nocomparables (const char *fname1, const char *fname2); +static void test_objs_strings (const char *fname, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); @@ -257,6 +261,9 @@ int main(void) /* common objects (same name) with different object types. HDFFV-7644 */ test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); + /* string dataset and attribute. HDFFV-10028 */ + test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2); + return 0; } @@ -5214,6 +5221,160 @@ out: } +static hid_t mkstr(int size, H5T_str_t pad) { + hid_t type; + + if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; + if(H5Tset_size(type, (size_t)size) < 0) return -1; + if(H5Tset_strpad(type, pad) < 0) return -1; + + return type; +} + +/*------------------------------------------------------------------------- +* Function: test_objs_strings +* +* Purpose: +* Create test files with common objects (same name) but different string +* types. +* h5diff should show differences output from these common objects. +*-------------------------------------------------------------------------*/ +static void test_objs_strings(const char *fname1, const char *fname2) +{ + herr_t status = SUCCEED; + hid_t fid1=0; + hid_t fid2=0; + hid_t dataset=0; + hid_t space=0; + hid_t f_type=0; + hid_t m_type=0; + hsize_t dims1[] = {3, 4}; + char string1A[12][3] = {"s1","s2","s3","s4","s5","s6","s","s","s9", + "s0","s1","s2"}; + char string1B[12][3] = {"s1","s2","s3","s4","s","s","s7","s8","s9", + "s0","s1","s2"}; + + hsize_t dims2[]={20}; + char string2A[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2", + "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", + "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; + char string2B[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", + "ab cd 3", "ab cd 4", "ab cd 5", "ab cd 6", + "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; + + hsize_t dims3[] = {27}; + char string3A[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abd2", "abc3", "bcd4", "acd5", + "abcd6", "abcd7", "abcd8", "abcd9", + "abcd0", "abcd1", "abcd2", "abcd3", + "abc4", "abc5", "abc6"}; + char string3B[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abcd2", "abcd3", "abcd4", "abcd5", + "abd6", "abc7", "bcd8", "acd9", + "abcd0", "abcd1", "abcd2", "abcd3", + "abd4", "abd5", "abd6"}; + + hsize_t dims4[] = {3}; + char string4A[3][21] = { "s1234567890123456789", "s1234567890123456789", + "s12345678901234567"}; + char string4B[3][21] = { "s1234567890123456789", "s12345678901234567", + "s1234567890123456789"}; + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + /* file1 */ + fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + status = FAIL; + goto out; + } + + /* file2 */ + fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + status = FAIL; + goto out; + } + + /* string 1 : nullterm string */ + space = H5Screate_simple(2, dims1, NULL); + f_type = mkstr(5, H5T_STR_NULLTERM); + m_type = mkstr(3, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 2 : space pad string */ + space = H5Screate_simple(1, dims2, NULL); + f_type = mkstr(11, H5T_STR_SPACEPAD); + m_type = mkstr(10, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 3 : null pad string */ + space = H5Screate_simple(1, dims3, NULL); + f_type = mkstr(8, H5T_STR_NULLPAD); + m_type = mkstr(6, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 4 : space pad long string */ + space = H5Screate_simple(1, dims4, NULL); + f_type = mkstr(168, H5T_STR_SPACEPAD); + m_type = mkstr(21, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + +out: + /*----------------------------------------------------------------------- + * Close IDs + *-----------------------------------------------------------------------*/ + if(fid1) + H5Fclose(fid1); + if(fid2) + H5Fclose(fid2); +} + /*------------------------------------------------------------------------- * Function: write_attr_in * diff --git a/tools/h5diff/testfiles/diff_strings1.h5 b/tools/h5diff/testfiles/diff_strings1.h5 new file mode 100644 index 0000000..8839f5a Binary files /dev/null and b/tools/h5diff/testfiles/diff_strings1.h5 differ diff --git a/tools/h5diff/testfiles/diff_strings2.h5 b/tools/h5diff/testfiles/diff_strings2.h5 new file mode 100644 index 0000000..810278c Binary files /dev/null and b/tools/h5diff/testfiles/diff_strings2.h5 differ diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 5748128..dedeb15 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -120,6 +120,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 +$SRC_H5DIFF_TESTFILES/diff_strings1.h5 +$SRC_H5DIFF_TESTFILES/diff_strings2.h5 " LIST_OTHER_TEST_FILES=" @@ -609,8 +611,6 @@ TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2 TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2 - - # ############################################################################## # # Dataset datatypes # ############################################################################## @@ -646,6 +646,13 @@ TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg # ( HDDFV-7942 ) TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b +# Strings +# ( HDFFV-10128 ) +TOOLTEST h5diff_60.txt -v diff_strings1 diff_strings2 string1 string1 +TOOLTEST h5diff_61.txt -v diff_strings1 diff_strings2 string2 string2 +TOOLTEST h5diff_62.txt -v diff_strings1 diff_strings2 string3 string3 +TOOLTEST h5diff_63.txt -v diff_strings1 diff_strings2 string4 string4 + # ############################################################################## # # Error messages # ############################################################################## @@ -717,8 +724,6 @@ TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.19: number smaller than smallest difference TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 - - # ############################################################################## # # -n # ############################################################################## @@ -771,7 +776,6 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen # ################################################## # attrs with verbose option level # ################################################## - TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 @@ -822,7 +826,6 @@ TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # with --use-system-epsilon for float value TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 - # not comparable -c flag TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 @@ -950,7 +953,6 @@ TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_e # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2 - # ############################################################################## # # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## @@ -1101,6 +1103,7 @@ TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 # ############################################################################## # # Test mutually exclusive options # ############################################################################## +# # Test with -d , -p and --use-system-epsilon. TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index e4b166f..fc19bbc 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -544,7 +544,7 @@ hsize_t diff_array( void *_mem1, * Recursively call this function for each element * H5T_STRING * compare byte by byte in a cycle from 0 to type_size. this type_size is the - * value obtained by the get_size function but it is the string lenght for + * value obtained by the get_size function but it is the string length for * variable sized strings * H5T_OPAQUE * compare byte by byte in a cycle from 0 to type_size @@ -600,7 +600,7 @@ static hsize_t diff_datum(void *_mem1, /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught - * by the confition, but it gives more clarity for code planning + * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && @@ -690,6 +690,10 @@ static hsize_t diff_datum(void *_mem1, * of length of strings. * For now mimic the previous way. */ + if(size1 != size2) + { + nfound++; + } if(size1 < size2) { size = size1; @@ -710,7 +714,7 @@ static hsize_t diff_datum(void *_mem1, pad = H5Tget_strpad(m_type); - for (u=0; u Date: Mon, 6 Mar 2017 13:36:41 -0600 Subject: HDFFV-10128 test reference files --- tools/h5diff/testfiles/h5diff_60.txt | 10 ++++++++++ tools/h5diff/testfiles/h5diff_61.txt | 30 +++++++++++++++++++++++++++++ tools/h5diff/testfiles/h5diff_62.txt | 37 ++++++++++++++++++++++++++++++++++++ tools/h5diff/testfiles/h5diff_63.txt | 10 ++++++++++ 4 files changed, 87 insertions(+) create mode 100644 tools/h5diff/testfiles/h5diff_60.txt create mode 100644 tools/h5diff/testfiles/h5diff_61.txt create mode 100644 tools/h5diff/testfiles/h5diff_62.txt create mode 100644 tools/h5diff/testfiles/h5diff_63.txt diff --git a/tools/h5diff/testfiles/h5diff_60.txt b/tools/h5diff/testfiles/h5diff_60.txt new file mode 100644 index 0000000..938f279 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_60.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3x4] [3x4] +position string1 string1 difference +------------------------------------------------------------ +[ 1 0 ] 5 \000 +[ 1 1 ] 6 \000 +[ 1 2 ] \000 7 +[ 1 3 ] \000 8 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_61.txt b/tools/h5diff/testfiles/h5diff_61.txt new file mode 100644 index 0000000..1f238b1 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_61.txt @@ -0,0 +1,30 @@ +dataset: and +size: [20] [20] +position string2 string2 difference +------------------------------------------------------------ +[ 8 ] 9 e +[ 8 ] f +[ 8 ] 9 +[ 9 ] 0 e +[ 9 ] f +[ 9 ] 0 +[ 10 ] 1 e +[ 10 ] f +[ 10 ] 1 +[ 11 ] 2 e +[ 11 ] f +[ 11 ] 2 +[ 12 ] e 3 +[ 12 ] f +[ 12 ] 3 +[ 13 ] e 4 +[ 13 ] f +[ 13 ] 4 +[ 14 ] e 5 +[ 14 ] f +[ 14 ] 5 +[ 15 ] e 6 +[ 15 ] f +[ 15 ] 6 +24 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_62.txt b/tools/h5diff/testfiles/h5diff_62.txt new file mode 100644 index 0000000..0cc0947 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_62.txt @@ -0,0 +1,37 @@ +dataset: and +size: [27] [27] +position string3 string3 difference +------------------------------------------------------------ +[ 12 ] d c +[ 12 ] 2 d +[ 12 ] \000 2 +[ 13 ] 3 d +[ 13 ] \000 3 +[ 14 ] b a +[ 14 ] c b +[ 14 ] d c +[ 14 ] 4 d +[ 14 ] \000 4 +[ 15 ] c b +[ 15 ] d c +[ 15 ] 5 d +[ 15 ] \000 5 +[ 16 ] c d +[ 16 ] d 6 +[ 16 ] 6 \000 +[ 17 ] d 7 +[ 17 ] 7 \000 +[ 18 ] a b +[ 18 ] b c +[ 18 ] c d +[ 18 ] d 8 +[ 18 ] 8 \000 +[ 19 ] b c +[ 19 ] c d +[ 19 ] d 9 +[ 19 ] 9 \000 +[ 24 ] c d +[ 25 ] c d +[ 26 ] c d +31 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_63.txt b/tools/h5diff/testfiles/h5diff_63.txt new file mode 100644 index 0000000..043da16 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_63.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3] [3] +position string4 string4 difference +------------------------------------------------------------ +[ 1 ] 8 +[ 1 ] 9 +[ 2 ] 8 +[ 2 ] 9 +4 differences found +EXIT CODE: 1 -- cgit v0.12 From 3ed48564bdeec5c8dd043a39a4a5bf2784dfab73 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Mar 2017 13:38:36 -0600 Subject: HDFFV-10128 new files added --- MANIFEST | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MANIFEST b/MANIFEST index 7ef11d3..47ed8d1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1806,6 +1806,10 @@ ./tools/h5diff/testfiles/h5diff_57.txt ./tools/h5diff/testfiles/h5diff_58.txt ./tools/h5diff/testfiles/h5diff_59.txt +./tools/h5diff/testfiles/h5diff_60.txt +./tools/h5diff/testfiles/h5diff_61.txt +./tools/h5diff/testfiles/h5diff_62.txt +./tools/h5diff/testfiles/h5diff_63.txt ./tools/h5diff/testfiles/h5diff_600.txt ./tools/h5diff/testfiles/h5diff_601.txt ./tools/h5diff/testfiles/h5diff_603.txt @@ -2009,6 +2013,8 @@ ./tools/h5diff/testfiles/tudfilter2.h5 ./tools/h5diff/testfiles/h5diff_ud.txt ./tools/h5diff/testfiles/h5diff_udfail.txt +./tools/h5diff/testfiles/diff_strings1.h5 +./tools/h5diff/testfiles/diff_strings2.h5 #test files for h5repack ./tools/h5repack/testfiles/README -- cgit v0.12 From 16621eeb9174ae69be31a619426ff6ad39600150 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Mar 2017 14:26:04 -0600 Subject: HDFFV-10128 fix test scripts with ref files --- tools/h5diff/CMakeTests.cmake | 21 +++++++++++++++++++++ tools/h5diff/testh5diff.sh.in | 12 ++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 93fdd55..3e985f7 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -52,6 +52,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 ) set (LIST_OTHER_TEST_FILES @@ -179,6 +181,10 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_60.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_61.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_62.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt @@ -710,6 +716,14 @@ h5diff_530.out.err h5diff_540.out h5diff_540.out.err + h5diff_60.out + h5diff_60.out.err + h5diff_61.out + h5diff_61.out.err + h5diff_62.out + h5diff_62.out.err + h5diff_63.out + h5diff_63.out.err h5diff_600.out h5diff_600.out.err h5diff_601.out @@ -930,6 +944,13 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) # ( HDDFV-7942 ) ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b) +# Strings +# ( HDFFV-10128 ) +ADD_H5_TEST (h5diff_60 1 -v ${STRINGS1} ${STRINGS2} string1 string1) +ADD_H5_TEST (h5diff_61 1 -v ${STRINGS1} ${STRINGS2} string2 string2) +ADD_H5_TEST (h5diff_62 1 -v ${STRINGS1} ${STRINGS2} string3 string3) +ADD_H5_TEST (h5diff_63 1 -v ${STRINGS1} ${STRINGS2} string4 string4) + # ############################################################################## # # Error messages # ############################################################################## diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index dedeb15..b2b0b8c 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -254,6 +254,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_517.txt $SRC_H5DIFF_TESTFILES/h5diff_518.txt $SRC_H5DIFF_TESTFILES/h5diff_530.txt $SRC_H5DIFF_TESTFILES/h5diff_540.txt +$SRC_H5DIFF_TESTFILES/h5diff_60.txt +$SRC_H5DIFF_TESTFILES/h5diff_61.txt +$SRC_H5DIFF_TESTFILES/h5diff_62.txt +$SRC_H5DIFF_TESTFILES/h5diff_63.txt $SRC_H5DIFF_TESTFILES/h5diff_600.txt $SRC_H5DIFF_TESTFILES/h5diff_601.txt $SRC_H5DIFF_TESTFILES/h5diff_603.txt @@ -648,10 +652,10 @@ TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b # Strings # ( HDFFV-10128 ) -TOOLTEST h5diff_60.txt -v diff_strings1 diff_strings2 string1 string1 -TOOLTEST h5diff_61.txt -v diff_strings1 diff_strings2 string2 string2 -TOOLTEST h5diff_62.txt -v diff_strings1 diff_strings2 string3 string3 -TOOLTEST h5diff_63.txt -v diff_strings1 diff_strings2 string4 string4 +TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1 +TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2 +TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3 +TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4 # ############################################################################## # # Error messages -- cgit v0.12 From d5fea5b80a2ccc21fb4f187d0efeda80b9134156 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 7 Mar 2017 09:59:39 -0600 Subject: Bring fix for HDFFV-9697 from develop branch. Populate the fix for HDFFV-9697: Fix for unknown message from develop branch. Tested on ostrich, platypus, kite, quail, osx1010test, emu, mayll, moohan, kituo. --- src/H5Dint.c | 12 +- src/H5Fpkg.h | 2 +- src/H5Fsuper.c | 2 +- src/H5O.c | 82 +++++----- src/H5Obogus.c | 66 +++++--- src/H5Ocache.c | 11 +- src/H5Opkg.h | 8 +- src/H5Oprivate.h | 70 +++++---- test/gen_bogus.c | 72 +++++++-- test/ohdr.c | 446 +++++++++++++++++++++++++++++++++++-------------------- test/tbogus.h5 | Bin 1944 -> 3792 bytes 11 files changed, 503 insertions(+), 268 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index 16ced02..b5adfc4 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -869,16 +869,22 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") - /* Check whether to add a "bogus" message */ - if(H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME) > 0) { + /* Check whether to add a "bogus" message */ + if( (H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME) > 0) && + (H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_ID_NAME) > 0) ) { + uint8_t bogus_flags = 0; /* Flags for creating "bogus" message */ + unsigned bogus_id; /* "bogus" ID */ + /* Retrieve "bogus" message ID */ + if(H5P_get(dc_plist, H5O_BOGUS_MSG_ID_NAME, &bogus_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") /* Retrieve "bogus" message flags */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus message options") /* Add a "bogus" message (for error testing). */ - if(H5O_bogus_oh(file, dxpl_id, oh, (unsigned)bogus_flags) < 0) + if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create 'bogus' message") } /* end if */ } diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 21034d7..3a343cc 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -310,7 +310,7 @@ H5_DLL herr_t H5F_super_free(H5F_super_t *sblock); /* Superblock extension related routines */ H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); -H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_t may_create); +H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create); H5_DLL herr_t H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, hbool_t was_created); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 3f2b33f..5f71f61 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -712,7 +712,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_t may_create) +H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create) { hbool_t ext_created = FALSE; /* Whether superblock extension was created */ hbool_t ext_opened = FALSE; /* Whether superblock extension was opened */ diff --git a/src/H5O.c b/src/H5O.c index 38d9f6b..8c2d08d 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -98,34 +98,39 @@ static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); */ const H5O_msg_class_t *const H5O_msg_class_g[] = { - H5O_MSG_NULL, /*0x0000 Null */ - H5O_MSG_SDSPACE, /*0x0001 Dataspace */ - H5O_MSG_LINFO, /*0x0002 Link information */ - H5O_MSG_DTYPE, /*0x0003 Datatype */ - H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ - H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ - H5O_MSG_LINK, /*0x0006 Link */ - H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ - H5O_MSG_LAYOUT, /*0x0008 Data Layout */ + H5O_MSG_NULL, /*0x0000 Null */ + H5O_MSG_SDSPACE, /*0x0001 Dataspace */ + H5O_MSG_LINFO, /*0x0002 Link information */ + H5O_MSG_DTYPE, /*0x0003 Datatype */ + H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ + H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ + H5O_MSG_LINK, /*0x0006 Link */ + H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ + H5O_MSG_LAYOUT, /*0x0008 Data Layout */ #ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS, /*0x0009 "Bogus" (for testing) */ + H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ #else /* H5O_ENABLE_BOGUS */ - NULL, /*0x0009 "Bogus" (for testing) */ + NULL, /*0x0009 "Bogus valid" (for testing) */ +#endif /* H5O_ENABLE_BOGUS */ + H5O_MSG_GINFO, /*0x000A Group information */ + H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ + H5O_MSG_ATTR, /*0x000C Attribute */ + H5O_MSG_NAME, /*0x000D Object name */ + H5O_MSG_MTIME, /*0x000E Object modification date and time */ + H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ + H5O_MSG_CONT, /*0x0010 Object header continuation */ + H5O_MSG_STAB, /*0x0011 Symbol table */ + H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ + H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ + H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ + H5O_MSG_AINFO, /*0x0015 Attribute information */ + H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ + H5O_MSG_UNKNOWN, /*0x0017 Placeholder for unknown message */ +#ifdef H5O_ENABLE_BOGUS + H5O_MSG_BOGUS_INVALID /*0x0018 "Bogus invalid" (for testing) */ +#else /* H5O_ENABLE_BOGUS */ + NULL /*0x0018 "Bogus invalid" (for testing) */ #endif /* H5O_ENABLE_BOGUS */ - H5O_MSG_GINFO, /*0x000A Group information */ - H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ - H5O_MSG_ATTR, /*0x000C Attribute */ - H5O_MSG_NAME, /*0x000D Object name */ - H5O_MSG_MTIME, /*0x000E Object modification date and time */ - H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ - H5O_MSG_CONT, /*0x0010 Object header continuation */ - H5O_MSG_STAB, /*0x0011 Symbol table */ - H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ - H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ - H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ - H5O_MSG_AINFO, /*0x0015 Attribute information */ - H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ - H5O_MSG_UNKNOWN /*0x0017 Placeholder for unknown message */ }; /* Declare a free list to manage the H5O_t struct */ @@ -2122,10 +2127,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags) +H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) { - size_t idx; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; /* Local index variable */ + H5O_msg_class_t *type; /* Message class type */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2134,7 +2140,8 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags) /* Look for existing message */ for(idx = 0; idx < oh->nmesgs; idx++) - if(H5O_MSG_BOGUS == oh->mesg[idx].type) + if(H5O_MSG_BOGUS_VALID == oh->mesg[idx].type || + H5O_MSG_BOGUS_INVALID == oh->mesg[idx].type) break; /* Create a new message */ @@ -2142,18 +2149,25 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags) H5O_bogus_t *bogus; /* Pointer to the bogus information */ /* Allocate the native message in memory */ - if(NULL == (bogus = H5MM_malloc(sizeof(H5O_bogus_t)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for 'bogus' message") + if(NULL == (bogus = H5MM_malloc(sizeof(H5O_bogus_t)))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for 'bogus' message") /* Update the native value */ bogus->u = H5O_BOGUS_VALUE; + if(bogus_id == H5O_BOGUS_VALID_ID) + type = H5O_MSG_BOGUS_VALID; + else if(bogus_id == H5O_BOGUS_INVALID_ID) + type = H5O_MSG_BOGUS_INVALID; + else + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message") + /* Allocate space in the object header for bogus message */ - if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_BOGUS, &mesg_flags, bogus, &idx) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") + if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, bogus, &idx) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") /* Point to "bogus" information (take it over) */ - oh->mesg[idx].native = bogus; + oh->mesg[idx].native = bogus; /* Set the appropriate flags for the message */ oh->mesg[idx].flags = mesg_flags; diff --git a/src/H5Obogus.c b/src/H5Obogus.c index b368ab6..3effae3 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -46,27 +46,51 @@ static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * int indent, int fwidth); /* This message derives from H5O message class */ -const H5O_msg_class_t H5O_MSG_BOGUS[1] = {{ - H5O_BOGUS_ID, /*message id number */ - "bogus", /*message name for debugging */ - 0, /*native message size */ - 0, /* messages are sharable? */ - H5O_bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ - NULL, /*copy the native value */ - H5O_bogus_size, /*raw message size */ - NULL, /*free internal memory */ - NULL, /*free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /*set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_bogus_debug /*debug the message */ +const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ + H5O_BOGUS_VALID_ID, /*message id number */ + "bogus valid", /*message name for debugging */ + 0, /*native message size */ + 0, /*messages are sharable? */ + H5O_bogus_decode, /*decode message */ + H5O_bogus_encode, /*encode message */ + NULL, /*copy the native value */ + H5O_bogus_size, /*raw message size */ + NULL, /*free internal memory */ + NULL, /*free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O_bogus_debug /*debug the message */ +}}; + +/* This message derives from H5O message class */ +const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ + H5O_BOGUS_INVALID_ID, /*message id number */ + "bogus invalid", /*message name for debugging */ + 0, /*native message size */ + 0, /*messages are sharable? */ + H5O_bogus_decode, /*decode message */ + H5O_bogus_encode, /*encode message */ + NULL, /*copy the native value */ + H5O_bogus_size, /*raw message size */ + NULL, /*free internal memory */ + NULL, /*free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O_bogus_debug /*debug the message */ }}; diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 2aaf933..0f22acb 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -1116,10 +1116,6 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, else id = *p++; - /* Check for unknown message ID getting encoded in file */ - if(id == H5O_UNKNOWN_ID) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "'unknown' message ID encoded in file?!?") - /* Message size */ UINT16DECODE(p, mesg_size); HDassert(mesg_size == H5O_ALIGN_OH(oh, mesg_size)); @@ -1193,7 +1189,12 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, /* Point unknown messages at 'unknown' message class */ /* (Usually from future versions of the library) */ - if(id >= NELMTS(H5O_msg_class_g) || NULL == H5O_msg_class_g[id]) { + if(id >= H5O_UNKNOWN_ID || +#ifdef H5O_ENABLE_BOGUS + id == H5O_BOGUS_VALID_ID || +#endif + NULL == H5O_msg_class_g[id]) { + H5O_unknown_t *unknown; /* Pointer to "unknown" message info */ /* Allocate "unknown" message info */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 2c8c5a0..c7789fe 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -31,7 +31,7 @@ #define H5O_NMESGS 8 /*initial number of messages */ #define H5O_NCHUNKS 2 /*initial number of chunks */ #define H5O_MIN_SIZE 22 /* Min. obj header data size (must be big enough for a message prefix and a continuation message) */ -#define H5O_MSG_TYPES 24 /* # of types of messages */ +#define H5O_MSG_TYPES 25 /* # of types of messages */ #define H5O_MAX_CRT_ORDER_IDX 65535 /* Max. creation order index value */ /* Versions of object header structure */ @@ -441,11 +441,13 @@ H5_DLLVAR const H5O_msg_class_t H5O_MSG_EFL[1]; H5_DLLVAR const H5O_msg_class_t H5O_MSG_LAYOUT[1]; #ifdef H5O_ENABLE_BOGUS -/* "Bogus" Message. (0x0009) */ +/* "Bogus valid" Message. (0x0009) */ +/* "Bogus invalid" Message. (0x00018) */ /* * Used for debugging - should never be found in valid HDF5 file. */ -H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS[1]; +H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1]; +H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1]; #endif /* H5O_ENABLE_BOGUS */ /* Group Information Message. (0x000a) */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 94ba6a0..e749398 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -83,6 +83,9 @@ typedef struct H5O_t H5O_t; /* Hash value constants */ #define H5O_HASH_SIZE 32 +/* Enable reading/writing "bogus" messages */ +/* #define H5O_ENABLE_BOGUS */ + /* ========= Object Creation properties ============ */ #define H5O_CRT_ATTR_MAX_COMPACT_NAME "max compact attr" /* Max. # of attributes to store compactly */ #define H5O_CRT_ATTR_MIN_DENSE_NAME "min dense attr" /* Min. # of attributes to store densely */ @@ -92,6 +95,11 @@ typedef struct H5O_t H5O_t; #ifdef H5O_ENABLE_BOGUS #define H5O_BOGUS_MSG_FLAGS_NAME "bogus msg flags" /* Flags for 'bogus' message */ #define H5O_BOGUS_MSG_FLAGS_SIZE sizeof(uint8_t) + +/* bogus ID can be either (a) H5O_BOGUS_VALID_ID or (b) H5O_BOGUS_INVALID_ID */ +#define H5O_BOGUS_MSG_ID_NAME "bogus msg id" /* ID for 'bogus' message */ +#define H5O_BOGUS_MSG_ID_SIZE sizeof(unsigned) + #endif /* H5O_ENABLE_BOGUS */ #ifdef H5O_ENABLE_BAD_MESG_COUNT #define H5O_BAD_MESG_COUNT_NAME "bad message count" /* Flag setting bad message count */ @@ -168,32 +176,41 @@ typedef struct H5O_copy_t { } H5O_copy_t; /* Header message IDs */ -#define H5O_NULL_ID 0x0000 /* Null Message. */ -#define H5O_SDSPACE_ID 0x0001 /* Dataspace Message. */ -#define H5O_LINFO_ID 0x0002 /* Link info Message. */ -#define H5O_DTYPE_ID 0x0003 /* Datatype Message. */ -#define H5O_FILL_ID 0x0004 /* Fill Value Message. (Old) */ -#define H5O_FILL_NEW_ID 0x0005 /* Fill Value Message. (New) */ -#define H5O_LINK_ID 0x0006 /* Link Message. */ -#define H5O_EFL_ID 0x0007 /* External File List Message */ -#define H5O_LAYOUT_ID 0x0008 /* Data Layout Message. */ -#define H5O_BOGUS_ID 0x0009 /* "Bogus" Message. */ -#define H5O_GINFO_ID 0x000a /* Group info Message. */ -#define H5O_PLINE_ID 0x000b /* Filter pipeline message. */ -#define H5O_ATTR_ID 0x000c /* Attribute Message. */ -#define H5O_NAME_ID 0x000d /* Object name message. */ -#define H5O_MTIME_ID 0x000e /* Modification time message. (Old) */ -#define H5O_SHMESG_ID 0x000f /* Shared message "SOHM" table. */ -#define H5O_CONT_ID 0x0010 /* Object header continuation message. */ -#define H5O_STAB_ID 0x0011 /* Symbol table message. */ -#define H5O_MTIME_NEW_ID 0x0012 /* Modification time message. (New) */ -#define H5O_BTREEK_ID 0x0013 /* v1 B-tree 'K' values message. */ -#define H5O_DRVINFO_ID 0x0014 /* Driver info message. */ -#define H5O_AINFO_ID 0x0015 /* Attribute info message. */ -#define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */ -#define H5O_UNKNOWN_ID 0x0017 /* Placeholder message ID for unknown message. */ +#define H5O_NULL_ID 0x0000 /* Null Message. */ +#define H5O_SDSPACE_ID 0x0001 /* Dataspace Message. */ +#define H5O_LINFO_ID 0x0002 /* Link info Message. */ +#define H5O_DTYPE_ID 0x0003 /* Datatype Message. */ +#define H5O_FILL_ID 0x0004 /* Fill Value Message. (Old) */ +#define H5O_FILL_NEW_ID 0x0005 /* Fill Value Message. (New) */ +#define H5O_LINK_ID 0x0006 /* Link Message. */ +#define H5O_EFL_ID 0x0007 /* External File List Message */ +#define H5O_LAYOUT_ID 0x0008 /* Data Layout Message. */ +#define H5O_BOGUS_VALID_ID 0x0009 /* "Bogus valid" Message. */ +#define H5O_GINFO_ID 0x000a /* Group info Message. */ +#define H5O_PLINE_ID 0x000b /* Filter pipeline message. */ +#define H5O_ATTR_ID 0x000c /* Attribute Message. */ +#define H5O_NAME_ID 0x000d /* Object name message. */ +#define H5O_MTIME_ID 0x000e /* Modification time message. (Old) */ +#define H5O_SHMESG_ID 0x000f /* Shared message "SOHM" table. */ +#define H5O_CONT_ID 0x0010 /* Object header continuation message. */ +#define H5O_STAB_ID 0x0011 /* Symbol table message. */ +#define H5O_MTIME_NEW_ID 0x0012 /* Modification time message. (New) */ +#define H5O_BTREEK_ID 0x0013 /* v1 B-tree 'K' values message. */ +#define H5O_DRVINFO_ID 0x0014 /* Driver info message. */ +#define H5O_AINFO_ID 0x0015 /* Attribute info message. */ +#define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */ +#define H5O_UNKNOWN_ID 0x0017 /* Placeholder message ID for unknown message. */ /* (this should never exist in a file) */ +/* + * Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g + * in H5O.c when creating a new message type. Also bump the value of + * H5O_BOGUS_INVALID_ID, below, to be one greater than the value of + * H5O_UNKNOWN_ID. + * + * (this should never exist in a file) + */ +#define H5O_BOGUS_INVALID_ID 0x0018 /* "Bogus invalid" Message. */ /* Shared object message types. * Shared objects can be committed, in which case the shared message contains @@ -425,9 +442,6 @@ typedef struct H5O_layout_t { H5O_storage_t storage; /* Information for storing dataset elements */ } H5O_layout_t; -/* Enable reading/writing "bogus" messages */ -/* #define H5O_ENABLE_BOGUS */ - #ifdef H5O_ENABLE_BOGUS /* * "Bogus" Message. @@ -641,7 +655,7 @@ H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force); #ifdef H5O_ENABLE_BOGUS -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags); +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); #endif /* H5O_ENABLE_BOGUS */ H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, hid_t dxpl_id, H5O_hdr_info_t *hdr); diff --git a/test/gen_bogus.c b/test/gen_bogus.c index df1e81f..290ec08 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -36,18 +36,21 @@ #define FALSE 0 #endif /* FALSE */ -int main(void) -{ #ifdef H5O_ENABLE_BOGUS - hid_t fid = -1; /* File ID */ + +/* + * Create datasets in the location (in "/" or "/group") with + * message id: (a) H5O_BOGUS_VALID_ID or (b)H5O_BOGUS_INVALID_ID + * and various unknown message flags + */ +static int +generate_datasets(hid_t loc_id, unsigned bogus_id) +{ hid_t sid = -1; /* Dataspace ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t did = -1; /* Dataset ID */ uint8_t bogus_flags = 0; /* Flags for bogus message */ - /* Create file for test datasets */ - if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - /* Create dataspace for datasets */ if((sid = H5Screate(H5S_SCALAR)) < 0) goto error; @@ -57,24 +60,30 @@ int main(void) /* Add property for bogus message flags */ if(H5Pinsert2(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, H5O_BOGUS_MSG_FLAGS_SIZE, &bogus_flags, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error; + /* Add property for bogus message ID */ + if(H5Pinsert2(dcpl, H5O_BOGUS_MSG_ID_NAME, H5O_BOGUS_MSG_ID_SIZE, &bogus_id, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error; + /* Create dataset with "bogus" message, but no message flags */ - if((did = H5Dcreate2(fid, "/Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(loc_id, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; - /* Set "fail if unknown" message flag for bogus message */ + /* Set "fail if unknown and open for write" message flag for bogus message */ bogus_flags = H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE; if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; /* Create second dataset, with "fail if unknown" message flag */ - if((did = H5Dcreate2(fid, "/Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(loc_id, "Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; + /* Set "fail if unknown always" message flag for bogus message */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS, skip creating "Dataset3" */ + /* Set "mark if unknown" message flag for bogus message */ bogus_flags = H5O_MSG_FLAG_MARK_IF_UNKNOWN; if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; - /* Create second dataset, with "mark if unknown" message flag */ - if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + /* Create fourth dataset, with "mark if unknown" message flag */ + if((did = H5Dcreate2(loc_id, "Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; /* Close dataset creation property list */ @@ -83,9 +92,6 @@ int main(void) /* Close dataspace */ if(H5Sclose(sid) < 0) goto error; - /* Close file */ - if(H5Fclose(fid) < 0) goto error; - return 0; error: @@ -93,6 +99,43 @@ error: H5Dclose(did); H5Sclose(sid); H5Pclose(dcpl); + } H5E_END_TRY; + + return -1; +} /* generate_datasets() */ +#endif + +int main(void) +{ +#ifdef H5O_ENABLE_BOGUS + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + + /* Create file for test datasets */ + if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + + /* Create datasets in "/" group with bogus message H5O_BOGUS_VALID_ID */ + if(generate_datasets(fid, H5O_BOGUS_VALID_ID) < 0) + goto error; + + if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create datasets in "/group" with bogus message H5O_BOGUS_INVALID_ID */ + if(generate_datasets(gid, H5O_BOGUS_INVALID_ID) < 0) + goto error; + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Close file */ + if(H5Fclose(fid) < 0) goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; #else /* H5O_ENABLE_BOGUS */ @@ -100,4 +143,3 @@ error: #endif /* H5O_ENABLE_BOGUS */ return 1; } - diff --git a/test/ohdr.c b/test/ohdr.c index 1b324a9..6e6faa4 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -288,6 +288,280 @@ error: return -1; } /* test_ohdr_cache() */ +/* + * To test objects with unknown messages in a file with: + * a) H5O_BOGUS_VALID_ID: + * --the bogus_id is within the range of H5O_msg_class_g[] + * b) H5O_BOGUS_INVALID_ID: + * --the bogus_id is outside the range of H5O_msg_class_g[] + * + * The test file is FILE_BOGUS: "tbogus.h5" generated with gen_bogus.c + * --objects that have unknown header messages with H5O_BOGUS_VALID_ID in "/" + * --objects that have unknown header messages with H5O_BOGUS_INVALID_ID in "/group" + * + * The test also uses the test file FILENAME[0] (ohdr.h5): the parameter "filename" + */ +static herr_t +test_unknown(unsigned bogus_id, char *filename, hid_t fapl) +{ + hid_t fid = -1; /* file ID */ + hid_t gid = -1; /* group ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t loc = -1; /* location: file or group ID */ + hid_t fid_bogus = -1; /* bogus file ID */ + hid_t gid_bogus = -1; /* bogus group ID */ + hid_t loc_bogus = -1; /* location: bogus file or group ID */ + char testfile[256]; + + /* create a different name for a local copy of the data file to be + opened with rd/wr file permissions in case build and test are + done in the source directory. */ + HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS)); + testfile[strlen(FILE_BOGUS)]='\0'; + HDstrncat(testfile, ".copy", 5); + + /* Make a copy of the data file from svn. */ + if(h5_make_local_copy(FILE_BOGUS, testfile) < 0) + FAIL_STACK_ERROR + + TESTING("object with unknown header message and no flags set"); + + /* Open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + + /* Open FILE_BOGUS */ + if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in FILE_BOGUS */ + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc_bogus = gid_bogus; + + /* Create "group" in filename */ + if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + + } else { /* H5O_BOGUS_VALID_ID */ + loc_bogus = fid_bogus; + loc = fid; + } /* end else */ + + /* Open the dataset with the unknown header message, but no extra flags */ + if((did = H5Dopen2(loc_bogus, "Dataset1", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + + TESTING("object in r/o file with unknown header message & 'fail if unknown and open for write' flag set"); + + /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ + if((did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + + /* TESTING("object in r/o file with unknown header message & 'fail if unknown always' flag set"); */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS */ + + TESTING("object with unknown header message & 'mark if unknown' flag set"); + + /* Copy object with "mark if unknown" flag on message into file (FILENAME[0]) that can be modified */ + if(H5Ocopy(loc_bogus, "Dataset4", loc, "Dataset4", H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + + /* Closing: filename */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename, with read-only permissions */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Check that the "unknown" message was _NOT_ marked */ + if(H5O_check_msg_marked_test(did, FALSE) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close "group" in filename depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + + /* Close filename (to flush change to object header) */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(did, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close "group" in filename depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + + /* Close filename (to flush change to object header) */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + /* Re-open filename */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID depending on bogus_id */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in filename */ + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc = gid; + } else + loc = fid; + + /* Re-open the dataset with the "mark if unknown" message */ + if((did = H5Dopen2(loc, "Dataset4", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Check that the "unknown" message was marked */ + if(H5O_check_msg_marked_test(did, TRUE) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Closing: filename */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + PASSED(); + + /* Closing: FILE_BOGUS */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid_bogus) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid_bogus) < 0) + FAIL_STACK_ERROR + + TESTING("object in r/w file with unknown header message & 'fail if unknown and open for write' flag set"); + + /* Open FILE_BOGUS with RW intent this time */ + if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Set up location ID */ + if(bogus_id == H5O_BOGUS_INVALID_ID) { + /* Open "group" in FILE_BOGUS */ + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + loc_bogus = gid_bogus; + } else + loc_bogus = fid_bogus; + + /* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ + H5E_BEGIN_TRY { + did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT); + } H5E_END_TRY; + if(did >= 0) { + H5Dclose(did); + TEST_ERROR + } /* end if */ + + PASSED(); + + /* TESTING("object in r/w file with unknown header message & 'fail if unknown always' flag set"); */ + /* There is no H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS */ + + /* Closing: FILE_BOGUS */ + if(bogus_id == H5O_BOGUS_INVALID_ID) + if(H5Gclose(gid_bogus) < 0) + FAIL_STACK_ERROR + if(H5Fclose(fid_bogus) < 0) + FAIL_STACK_ERROR + + PASSED(); + + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Gclose(gid); + H5Fclose(fid_bogus); + H5Gclose(gid_bogus); + H5Dclose(did); + H5Sclose(sid); + H5Aclose(aid); + } H5E_END_TRY; + + return FAIL; +} /* test_unknown() */ + /*------------------------------------------------------------------------- * Function: main @@ -334,8 +608,8 @@ main(void) if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0) FAIL_STACK_ERROR - /* test on object continuation block */ - if(test_cont(filename, fapl) < 0) + /* test on object continuation block */ + if(test_cont(filename, fapl) < 0) FAIL_STACK_ERROR /* Create the file to operate on */ @@ -650,164 +924,22 @@ main(void) PASSED(); - - /* Test reading datasets with undefined object header messages */ - HDputs("Accessing objects with unknown header messages:"); - { - hid_t file2; /* File ID for 'bogus' object file */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - char testpath[512] = ""; - char testfile[512] = ""; - char *srcdir = HDgetenv("srcdir"); - - /* Build path to all test files */ - if(srcdir && ((HDstrlen(srcdir) + 2) < sizeof(testpath))) { - HDstrcpy(testpath, srcdir); - HDstrcat(testpath, "/"); - } /* end if */ - - /* Build path to test file */ - if(srcdir && ((HDstrlen(testpath) + HDstrlen(FILE_BOGUS) + 1) < sizeof(testfile))) - HDstrcpy(testfile, testpath); - HDstrcat(testfile, FILE_BOGUS); - - TESTING("object with unknown header message and no flags set"); - - /* Open the file with objects that have unknown header messages (generated with gen_bogus.c) */ - if((file2 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Open the dataset with the unknown header message, but no extra flags */ - if((dset = H5Dopen2(file2, "/Dataset1", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Dclose(dset) < 0) - TEST_ERROR - - PASSED(); - - TESTING("object with unknown header message & 'fail if unknown and open for write' flag set"); - - /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ - if((dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Dclose(dset) < 0) - TEST_ERROR - - PASSED(); - - TESTING("object with unknown header message & 'mark if unknown' flag set"); - - /* Copy object with "mark if unknown" flag on message into file that can be modified */ - if(H5Ocopy(file2, "/Dataset3", file, "/Dataset3", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR - - /* Close the file we created (to flush changes to file) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created, with read-only permissions */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - - /* Open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Check that the "unknown" message was _NOT_ marked */ - if(H5O_check_msg_marked_test(dset, FALSE) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file we created (to flush change to object header) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created */ - if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - - /* Open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create data space */ - if((sid = H5Screate(H5S_SCALAR)) < 0) - FAIL_STACK_ERROR - - /* Create an attribute, to get the object header into write access */ - if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - - /* Close dataspace */ - if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR - - /* Close attribute */ - if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file we created (to flush change to object header) */ - if(H5Fclose(file) < 0) - TEST_ERROR - - /* Re-open the file created */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - - /* Re-open the dataset with the "mark if unknown" message */ - if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Check that the "unknown" message was marked */ - if(H5O_check_msg_marked_test(dset, TRUE) < 0) - FAIL_STACK_ERROR - - /* Close the dataset */ - if(H5Dclose(dset) < 0) - TEST_ERROR - - /* Close the file with the bogus objects */ - if(H5Fclose(file2) < 0) - TEST_ERROR - - PASSED(); - - /* Open the file with objects that have unknown header messages (generated with gen_bogus.c) with RW intent this time */ - if((file2 = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - TEST_ERROR - - TESTING("object with unknown header message & 'fail if unknown and open for write' flag set"); - - /* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ - H5E_BEGIN_TRY { - dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT); - } H5E_END_TRY; - if(dset >= 0) { - H5Dclose(dset); - TEST_ERROR - } /* end if */ - - /* Close the file with the bogus objects */ - if(H5Fclose(file2) < 0) - TEST_ERROR - - PASSED(); - } - - /* Close the file we created */ + /* Close the file we created */ if(H5Fclose(file) < 0) TEST_ERROR - /* Test object header creation metadata cache issues */ - if(test_ohdr_cache(filename, fapl) < 0) + /* Test reading datasets with undefined object header messages + * and the various "fail/mark if unknown" object header message flags + */ + HDputs("Accessing objects with unknown header messages: H5O_BOGUS_VALID_ID"); + if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0) + TEST_ERROR + HDputs("Accessing objects with unknown header messages: H5O_BOGUS_INVALID_ID"); + if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0) + TEST_ERROR + + /* Test object header creation metadata cache issues */ + if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR } /* end for */ diff --git a/test/tbogus.h5 b/test/tbogus.h5 index 5b1d85e..87b183b 100644 Binary files a/test/tbogus.h5 and b/test/tbogus.h5 differ -- cgit v0.12 From e00234fc8d6be9b314b920b1113b5bcc7653317f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Mar 2017 13:03:20 -0500 Subject: HDFFV-10138 merge app framework to examples --- CMakeInstallation.cmake | 26 ++- MANIFEST | 3 + config/cmake/CTestScript.cmake | 152 ++++++++++++++ config/cmake/HDF518_Examples.cmake.in | 244 ++++++---------------- config/cmake/HDF5_Examples_options.cmake | 45 ++++ config/cmake/scripts/CTestScript.cmake | 342 +++++++++++++++---------------- config/cmake/scripts/HDF5options.cmake | 37 ++++ 7 files changed, 495 insertions(+), 354 deletions(-) create mode 100644 config/cmake/CTestScript.cmake create mode 100644 config/cmake/HDF5_Examples_options.cmake create mode 100644 config/cmake/scripts/HDF5options.cmake diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 2e3083b..ea2b667 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -8,7 +8,7 @@ if (WIN32) find_program (NSIS_EXECUTABLE NSIS.exe PATHS "$ENV{ProgramFiles}\\NSIS" "$ENV{ProgramFiles${PF_ENV_EXT}}\\NSIS") if(NOT CPACK_WIX_ROOT) file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT) - endif() + endif () find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") endif () @@ -156,13 +156,25 @@ if (HDF5_PACK_EXAMPLES) USE_SOURCE_PERMISSIONS COMPONENT hdfdocuments ) - install ( - FILES - ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt - DESTINATION ${HDF5_INSTALL_DATA_DIR} - COMPONENT hdfdocuments - ) endif () + install ( + FILES + ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) + install ( + FILES + ${HDF_RESOURCES_DIR}/CTestScript.cmake + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) + install ( + FILES + ${HDF_RESOURCES_DIR}/HDF5_Examples_options.cmake + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) endif () #----------------------------------------------------------------------------- diff --git a/MANIFEST b/MANIFEST index 47ed8d1..bf8fcbd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2405,5 +2405,8 @@ ./tools/perform/CMakeTests.cmake # CMake-specific User Scripts +./config/cmake/CTestScript.cmake +./config/cmake/HDF5_Examples_options.cmake ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF518config.cmake +./config/cmake/scripts/HDF5options.cmake diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake new file mode 100644 index 0000000..d53d7a4 --- /dev/null +++ b/config/cmake/CTestScript.cmake @@ -0,0 +1,152 @@ +cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +######################################################## +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if (NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () + + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else () + ## machine name provided + ## -------------------------- + if (CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else () + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif () + if (SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif () + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if (APPLE) + # Compiler choice + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + + if (NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif () + + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () + +#----------------------------------------------------------------------------- +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar or zip file provided + ## -------------------------- + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () +endif () + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +else () + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () + +# Use multiple CPU cores to build +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" +) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +## -- set output to english +set ($ENV{LC_MESSAGES} "en_EN") + +#----------------------------------------------------------------------------- + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_SUBMIT reports to CDash server + ## -------------------------- + ctest_start (Experimental) + ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Configure Notes) + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () + + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () + + ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif() + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + message (FATAL_ERROR "tests FAILED") + endif () +#----------------------------------------------------------------------------- diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 4d86cf9..5732786 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -5,196 +5,88 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log ############################################################################################################### -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if(DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif() -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif() -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "NO") -endif() -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "YES") -endif() -if(NOT DEFINED HDF_LOCAL) - set(CDASH_LOCAL "NO") -else(NOT HDF_LOCAL) - set(CDASH_LOCAL "YES") -endif() +#CTEST_SOURCE_NAME - name of source folder; HDF5Examples +if (DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif () + endforeach () +endif () + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") +################################################################## + +if (NOT DEFINED INSTALLDIR) + set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif () + +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "HDF5Examples") +endif () + +if (NOT DEFINED HDF_LOCAL) + set (CDASH_LOCAL "NO") +else () + set (CDASH_LOCAL "YES") +endif () if(NOT DEFINED CTEST_SITE) - set(CTEST_SITE "local") -endif() -if(NOT DEFINED CTEST_BUILD_NAME) - set(CTEST_BUILD_NAME "examples") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") + set (CTEST_SITE "local") +endif () +if (NOT DEFINED CTEST_BUILD_NAME) + set (CTEST_BUILD_NAME "examples") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile -#if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif() +#if (NOT DEFINED TAR_SOURCE) +# set (CTEST_USE_TAR_SOURCE "HDF5Examples-0.2.4-Source") +#endif () ############################################################################################################### -# Adjust the following SET Commands as needed -############################################################################################################### -if(WIN32) - if(${STATICONLYLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(${STATICONLYLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif(WIN32) -if(${FORTRANLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif() -if(${CDASH_LOCAL}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +if (WIN32) + set (SITE_OS_NAME "Windows") + set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else () + set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif () +if (${CDASH_LOCAL}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if(APPLE) - # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() - -#----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## -------------------------- -if(CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided - ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() - - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif() -endif(CTEST_USE_TAR_SOURCE) - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) +if (WIN32) + include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else () - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + include (${CTEST_SCRIPT_DIRECTORY}/HDF_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif () - -# Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- -configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) -ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") -## NORMAL process -## -------------------------- -ctest_start (Experimental) -ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif() -if(LOCAL_SUBMIT) - ctest_submit (PARTS Configure Notes) -endif() -ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif() -if(LOCAL_SUBMIT) - ctest_submit (PARTS Build) -endif() -ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif() -if(LOCAL_SUBMIT) - ctest_submit (PARTS Test) -endif() -if(${res} LESS 0 OR ${res} GREATER 0) - message (FATAL_ERROR "tests FAILED") -endif() -#----------------------------------------------------------------------------- -############################################################################################################## -message(STATUS "DONE") \ No newline at end of file diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake new file mode 100644 index 0000000..2708f80 --- /dev/null +++ b/config/cmake/HDF5_Examples_options.cmake @@ -0,0 +1,45 @@ +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +#### DEFAULT: ### +#### BUILD_SHARED_LIBS:BOOL=OFF ### +#### HDF_BUILD_C:BOOL=ON ### +#### HDF_BUILD_CXX:BOOL=OFF ### +#### HDF_BUILD_FORTRAN:BOOL=OFF ### +#### BUILD_TESTING:BOOL=OFF ### +#### HDF_ENABLE_PARALLEL:BOOL=OFF ### +#### HDF_ENABLE_THREADSAFE:BOOL=OFF ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options +### build with shared libraries +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + +############################################################################################# +#### languages #### +### disable C builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF") + +### enable C++ builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON") + +### enable Fortran builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + + +############################################################################################# +### enable parallel program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") + + +############################################################################################# +### enable threadsafe program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON") + + +############################################################################################# +### enable test program builds, requires reference files in testfiles subdirectory +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") + +############################################################################################# diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index e525078..d24eb44 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -7,163 +7,163 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # ----------------------------------------------------------- # -- Get environment # ----------------------------------------------------------- -if(NOT SITE_OS_NAME) +if (NOT SITE_OS_NAME) ## machine name not provided - attempt to discover with uname ## -- set hostname ## -------------------------- - find_program(HOSTNAME_CMD NAMES hostname) - exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) - set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") - find_program(UNAME NAMES uname) - macro(getuname name flag) - exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") - endmacro(getuname) + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () - getuname(osname -s) - getuname(osrel -r) - getuname(cpu -m) - message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") - set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") - endif() - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else() + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else () ## machine name provided ## -------------------------- - if(CMAKE_HOST_UNIX) - set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") - else() - set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") - endif() - if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif() - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif() + if (CMAKE_HOST_UNIX) + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else () + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif () + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif () #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if(APPLE) +if (APPLE) # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif() + if (NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif () - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () #----------------------------------------------------------------------------- -set(NEED_REPOSITORY_CHECKOUT 0) -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if(CTEST_USE_TAR_SOURCE) +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") - endif() + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () - file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) - set(LOCAL_SKIP_UPDATE "TRUE") -else() - if(LOCAL_UPDATE) - if(CTEST_USE_GIT_SOURCE) - find_program(CTEST_GIT_COMMAND NAMES git git.cmd) - set(CTEST_GIT_UPDATE_OPTIONS) + file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set (LOCAL_SKIP_UPDATE "TRUE") +else () + if (LOCAL_UPDATE) + if (CTEST_USE_GIT_SOURCE) + find_program (CTEST_GIT_COMMAND NAMES git git.cmd) + set (CTEST_GIT_UPDATE_OPTIONS) - if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set(NEED_REPOSITORY_CHECKOUT 1) - endif() + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () - if(${NEED_REPOSITORY_CHECKOUT}) - if(REPOSITORY_BRANCH) - set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - else() - set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - endif() - set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") - else() - set(CTEST_GIT_options "pull") - endif() - set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else() + if (${NEED_REPOSITORY_CHECKOUT}) + if (REPOSITORY_BRANCH) + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + else () + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + endif () + set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") + else () + set (CTEST_GIT_options "pull") + endif () + set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") + else () ## -------------------------- ## use subversion to get source #----------------------------------------------------------------------------- ## cygwin does not handle the find_package() call ## -------------------------- - set(CTEST_UPDATE_COMMAND "SVNCommand") - if(NOT SITE_CYGWIN}) + set (CTEST_UPDATE_COMMAND "SVNCommand") + if (NOT SITE_CYGWIN}) find_package (Subversion) - set(CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") - set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") - else() - set(CTEST_SVN_COMMAND "/usr/bin/svn") - set(CTEST_UPDATE_COMMAND "/usr/bin/svn") - endif() + set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") + set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") + else () + set (CTEST_SVN_COMMAND "/usr/bin/svn") + set (CTEST_UPDATE_COMMAND "/usr/bin/svn") + endif () - if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set(NEED_REPOSITORY_CHECKOUT 1) - endif() + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () - if(NOT CTEST_REPO_VERSION) - set(CTEST_REPO_VERSION "HEAD") - endif() - if(${NEED_REPOSITORY_CHECKOUT}) - set(CTEST_CHECKOUT_COMMAND + if (NOT CTEST_REPO_VERSION) + set (CTEST_REPO_VERSION "HEAD") + endif () + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else() - if(CTEST_REPO_VERSION) - set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") - endif() - endif() - endif() - endif() -endif() + else () + if (CTEST_REPO_VERSION) + set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") + endif () + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}") - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -else() - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -endif() +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +endif () # Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () #----------------------------------------------------------------------------- # Send the main script as a note. -list(APPEND CTEST_NOTES_FILES +list (APPEND CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" "${CMAKE_CURRENT_LIST_FILE}" "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" @@ -172,39 +172,39 @@ list(APPEND CTEST_NOTES_FILES #----------------------------------------------------------------------------- # Check for required variables. # -------------------------- -foreach(req +foreach (req CTEST_CMAKE_GENERATOR CTEST_SITE CTEST_BUILD_NAME ) - if(NOT DEFINED ${req}) - message(FATAL_ERROR "The containing script must set ${req}") - endif() -endforeach() + if (NOT DEFINED ${req}) + message (FATAL_ERROR "The containing script must set ${req}") + endif () +endforeach () #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -if(LOCAL_MEMCHECK_TEST) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) +if (LOCAL_MEMCHECK_TEST) + find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) -else() - if(LOCAL_COVERAGE_TEST) - find_program(CTEST_COVERAGE_COMMAND NAMES gcov) - endif() +else () + if (LOCAL_COVERAGE_TEST) + find_program (CTEST_COVERAGE_COMMAND NAMES gcov) + endif () set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) -endif() +endif () #----------------------------------------------------------------------------- ## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") +set ($ENV{LC_MESSAGES} "en_EN") # Print summary information. -foreach(v +foreach (v CTEST_SITE CTEST_BUILD_NAME CTEST_SOURCE_DIRECTORY @@ -217,9 +217,9 @@ foreach(v CTEST_SCRIPT_DIRECTORY CTEST_USE_LAUNCHERS ) - set(vars "${vars} ${v}=[${${v}}]\n") -endforeach(v) -message(STATUS "Dashboard script configuration:\n${vars}\n") + set (vars "${vars} ${v}=[${${v}}]\n") +endforeach () +message (STATUS "Dashboard script configuration:\n${vars}\n") #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -231,63 +231,63 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") ## -- LOCAL_COVERAGE_TEST executes code coverage process ## -------------------------- ctest_start (${MODEL} TRACK ${MODEL}) - if(LOCAL_UPDATE) + if (LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif() - configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + endif () + configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) - endif() - if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") - endif() + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Build) - endif() - if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") - endif() + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () - if(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) + if (NOT LOCAL_SKIP_TEST) + if (NOT LOCAL_MEMCHECK_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Test) - endif() - if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") - endif() - else() + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + else () ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS MemCheck) - endif() - endif() - if(LOCAL_COVERAGE_TEST) + endif () + endif () + if (LOCAL_COVERAGE_TEST) ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Coverage) - endif() - endif() - endif(NOT LOCAL_SKIP_TEST) + endif () + endif () + endif () - if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) + if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) ##----------------------------------------------- ## Package the product ##----------------------------------------------- - execute_process(COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V + execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} RESULT_VARIABLE cpackResult OUTPUT_VARIABLE cpackLog ERROR_VARIABLE cpackLog.err ) - file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - if(cpackResult GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") - endif() - endif() + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if (cpackResult GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") + endif () + endif () #----------------------------------------------------------------------------- diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake new file mode 100644 index 0000000..6239f1f --- /dev/null +++ b/config/cmake/scripts/HDF5options.cmake @@ -0,0 +1,37 @@ +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options + +############################################################################################# +#### ext libraries #### + +### ext libs from tgz +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### ext libs from git +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") +### ext libs on system +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") + +### disable ext zlib building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") +### disable ext szip building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") + +############################################################################################# +### disable test program builds + +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") + +############################################################################################# +### disable packaging + +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") +### Create install package with external libraries (szip, zlib) +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") + +############################################################################################# -- cgit v0.12 From 096aac122ed6b6e8d07a30330bd95992887cd2be Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Mar 2017 12:53:01 -0500 Subject: Update cmake commands to match master --- UserMacros.cmake | 4 ++-- config/cmake/ConfigureChecks.cmake | 16 ++++++------- config/cmake/H5pubconf.h.in | 37 ++++++++++++++++++++++++++---- config/cmake/UserMacros/Windows_MT.cmake | 4 ++-- config/cmake/cacheinit.cmake | 2 ++ config/cmake/hdf5-config-version.cmake.in | 8 +++---- config/cmake/scripts/CTestScript.cmake | 9 ++++++-- config/cmake/scripts/HDF5options.cmake | 4 ++++ config/cmake/userblockTest.cmake | 2 +- config/cmake/vfdTest.cmake | 4 ++-- config/cmake_ext_mod/CheckTypeSize.cmake | 4 ++-- config/cmake_ext_mod/ConfigureChecks.cmake | 36 ++++++++++++++++------------- config/cmake_ext_mod/FindMPI.cmake | 6 ++--- config/cmake_ext_mod/FindSZIP.cmake | 4 ++-- config/cmake_ext_mod/HDFMacros.cmake | 12 ++++++---- config/cmake_ext_mod/HDFUseFortran.cmake | 4 ++-- config/cmake_ext_mod/runTest.cmake | 18 +++++++++++---- 17 files changed, 114 insertions(+), 60 deletions(-) diff --git a/UserMacros.cmake b/UserMacros.cmake index 4593753..01e76ed 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -7,9 +7,9 @@ #----------------------------------------------------------------------------- # Option to Build with User Defined Values #----------------------------------------------------------------------------- -MACRO (MACRO_USER_DEFINED_LIBS) +macro (MACRO_USER_DEFINED_LIBS) set (USER_DEFINED_VALUE "FALSE") -ENDMACRO () +endmacro () #------------------------------------------------------------------------------- option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7a1a4b0..75fe099 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -106,9 +106,9 @@ CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) # Find the library containing clock_gettime() if (NOT WINDOWS) - CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) - CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) - CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) + CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC) + CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) + CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) if (CLOCK_GETTIME_IN_LIBC) set (H5_HAVE_CLOCK_GETTIME 1) elseif (CLOCK_GETTIME_IN_LIBRT) @@ -147,7 +147,7 @@ if (NOT WINDOWS) "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () - else ( ) + else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log @@ -161,7 +161,7 @@ endif () #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- -MACRO (H5ConversionTests TEST msg) +macro (H5ConversionTests TEST msg) if ("${TEST}" MATCHES "^${TEST}$") # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE @@ -190,12 +190,12 @@ MACRO (H5ConversionTests TEST msg) endif () endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- -MACRO (H5MiscConversionTest VAR TEST msg) +macro (H5MiscConversionTest VAR TEST msg) if ("${TEST}" MATCHES "^${TEST}$") if (${VAR}) set (${TEST} 1 CACHE INTERNAL ${msg}) @@ -205,7 +205,7 @@ MACRO (H5MiscConversionTest VAR TEST msg) message (STATUS "${msg}... no") endif () endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Check various conversion capabilities diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 13740ea..44cbead 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -73,7 +73,7 @@ /* Define to 1 if you have the `difftime' function. */ #cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@ -/* Define if the direct I/O virtual file driver should be compiled */ +/* Define if the direct I/O virtual file driver (VFD) should be compiled */ #cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ /* Define to 1 if you have the header file. */ @@ -148,7 +148,7 @@ /* Define if the compiler understands inline */ #cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@ -/* Define if library will contain instrumentation to detect correct +/* Define if parallel library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -185,9 +185,21 @@ /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ +/* Define to 1 if you have the `llround' function. */ +#cmakedefine H5_HAVE_LLROUND @H5_HAVE_LLROUND@ + +/* Define to 1 if you have the `llroundf' function. */ +#cmakedefine H5_HAVE_LLROUNDF @H5_HAVE_LLROUNDF@ + /* Define to 1 if you have the `longjmp' function. */ #cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@ +/* Define to 1 if you have the `lround' function. */ +#cmakedefine H5_HAVE_LROUND @H5_HAVE_LROUND@ + +/* Define to 1 if you have the `lroundf' function. */ +#cmakedefine H5_HAVE_LROUNDF @H5_HAVE_LROUNDF@ + /* Define to 1 if you have the `lseek64' function. */ #cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ @@ -227,6 +239,12 @@ /* Define to 1 if you have the `rand_r' function. */ #cmakedefine H5_HAVE_RAND_R @H5_HAVE_RAND_R@ +/* Define to 1 if you have the `round' function. */ +#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@ + +/* Define to 1 if you have the `roundf' function. */ +#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@ + /* Define to 1 if you have the `setjmp' function. */ #cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@ @@ -275,6 +293,12 @@ /* Define to 1 if you have the `strdup' function. */ #cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@ +/* Define to 1 if you have the `strtoll' function. */ +#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@ + +/* Define to 1 if you have the `strtoull' function. */ +#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_STRINGS_H @H5_HAVE_STRINGS_H@ @@ -293,6 +317,9 @@ /* Define to 1 if you have the `system' function. */ #cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_IOCTL_H @H5_HAVE_SYS_IOCTL_H@ @@ -347,6 +374,9 @@ /* Define to 1 if you have the `waitpid' function. */ #cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@ +/* Define to 1 if you have the 'InitOnceExecuteOnce' function. */ +#cmakedefine H5_HAVE_WIN_THREADS @H5_HAVE_WIN_THREADS@ + /* Define if your system has window style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ @@ -387,8 +417,7 @@ with special algorithm. */ #cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@ -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ /* Define if the metadata trace file code is to be compiled in */ diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index d30d4d5..216a014 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -10,7 +10,7 @@ #----------------------------------------------------------------------------- # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- -MACRO (TARGET_STATIC_CRT_FLAGS) +macro (TARGET_STATIC_CRT_FLAGS) if (MSVC AND NOT BUILD_SHARED_LIBS) foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE @@ -31,7 +31,7 @@ MACRO (TARGET_STATIC_CRT_FLAGS) set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 5fbee62..f16111e 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -38,6 +38,8 @@ set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) +set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) + set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 45a832e..ad1b96d 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -12,7 +12,7 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() +else () if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ @@ -32,16 +32,16 @@ else() set (PACKAGE_VERSION_COMPATIBLE FALSE) endif () endif () -endif() +endif () # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif() +endif () # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() +endif () diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index d24eb44..cb92933 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -185,17 +185,22 @@ endforeach () #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ +if(CMAKE_GENERATOR_TOOLSET) + set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") +else () + set(CTEST_CONFIGURE_TOOLSET "") +endif() if (LOCAL_MEMCHECK_TEST) find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) else () if (LOCAL_COVERAGE_TEST) find_program (CTEST_COVERAGE_COMMAND NAMES gcov) endif () set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) endif () diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 6239f1f..bbbb8dc 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -6,6 +6,10 @@ ### uncomment/comment and change the following lines for other configuration options ############################################################################################# +#### alternate toolsets #### +#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") + +############################################################################################# #### ext libraries #### ### ext libs from tgz diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 43db733..5095b33 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -57,7 +57,7 @@ if (TEST_CHECKUB STREQUAL "YES") file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) endif () - MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) + math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 9c93fb7..c9b4ecc 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -54,8 +54,8 @@ if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") - endif() - endif() + endif () + endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index 85b1c6c..d217ac5 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -7,7 +7,7 @@ # HAVE_${VARIABLE} - does the variable exists or not # -MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) +macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") set (MACRO_CHECK_TYPE_SIZE_FLAGS @@ -47,4 +47,4 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) endif () endif () set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -ENDMACRO () +endmacro () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 1872cd5..a0ec8e3 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -45,12 +45,12 @@ endif () # does, it appends library to the list. #----------------------------------------------------------------------------- set (LINK_LIBS "") -MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) +macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) if (${VARIABLE}) set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) endif () -ENDMACRO () +endmacro () # ---------------------------------------------------------------------- # WINDOWS Hard code Values @@ -133,7 +133,7 @@ if (NOT WINDOWS) endif () # For other specific tests, use this MACRO. -MACRO (HDF_FUNCTION_TEST OTHER_TEST) +macro (HDF_FUNCTION_TEST OTHER_TEST) if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) @@ -178,7 +178,7 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) ) endif () endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Check for these functions before the time headers are checked @@ -188,28 +188,29 @@ HDF_FUNCTION_TEST (STDC_HEADERS) #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- -MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) +macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) if (${VARIABLE}) set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Check for the existence of certain header files #----------------------------------------------------------------------------- -CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H) CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) -CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler @@ -346,7 +347,7 @@ endif () #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- -MACRO (HDF_CHECK_TYPE_SIZE type var) +macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) # message (STATUS "Checking size of ${aType} and storing into ${aVar}") @@ -355,7 +356,7 @@ MACRO (HDF_CHECK_TYPE_SIZE type var) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") # message (STATUS "Size of ${aType} was NOT Found") endif () -ENDMACRO () +endmacro () HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR) HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT) @@ -527,6 +528,8 @@ CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK) CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF) CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM) CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL) +CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL) CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK) CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM) @@ -572,7 +575,7 @@ if (NOT WINDOWS) endif () # For other CXX specific tests, use this MACRO. -MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) +macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) @@ -585,6 +588,7 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H + HAVE_SYS_FILE_H ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") @@ -617,7 +621,7 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) endif () endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Check a bunch of cxx functions diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 1fb07d4..ff1ead2 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -471,7 +471,7 @@ function (interrogate_mpi_compiler lang try_libs) PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif() + endif () set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB @@ -480,8 +480,8 @@ function (interrogate_mpi_compiler lang try_libs) PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) if (MPI_LIBRARIES_WORK AND MPI_LIB) list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - endif() - endif() + endif () + endif () if (NOT MPI_LIBRARIES_WORK) set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 1709c2b..bb5f8d6 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -24,7 +24,7 @@ # made to remove references to Qt and make this file more generally applicable ######################################################################### -MACRO (SZIP_ADJUST_LIB_VARS basename) +macro (SZIP_ADJUST_LIB_VARS basename) if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version @@ -62,7 +62,7 @@ MACRO (SZIP_ADJUST_LIB_VARS basename) # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) -ENDMACRO () +endmacro () # Look for the header file. diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index ecf3be0..3039cfd 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -237,16 +237,18 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") endif () set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "^16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^15.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "18.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^20.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 6a81e3a..bf254a1 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -26,7 +26,7 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- -MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) +macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) message (STATUS "Testing Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES @@ -63,7 +63,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif () -ENDMACRO () +endmacro () #----------------------------------------------------------------------------- # Configure Checks which require Fortran compilation must go in here diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 0a77dae..9a2236e 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -34,6 +34,14 @@ endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +if (TEST_LIBRARY_DIRECTORY) + if (WIN32 AND NOT MINGW) + set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") + else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") + endif () +endif () + if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") endif () @@ -92,8 +100,8 @@ if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) message (STATUS "Output :\n${TEST_STREAM}") - endif() - endif() + endif () + endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () @@ -140,7 +148,7 @@ endif () # remove text from the output file if (TEST_FILTER) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () @@ -149,7 +157,7 @@ if (TEST_REF_FILTER) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") -endif (TEST_REF_FILTER) +endif () # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) @@ -250,7 +258,7 @@ if (NOT TEST_SKIP_COMPARE) if (${len_ref} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () - endif() + endif () if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () -- cgit v0.12 From ba2cfde1fda880bf9d4b18dd439100ee5c4680bb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Mar 2017 16:44:23 -0500 Subject: Merge/port changes from develop back to 1.8 for tools and cmake --- CMakeLists.txt | 14 +- c++/test/CMakeTests.cmake | 4 +- c++/test/tlinks.cpp | 2 +- config/cmake/CTestCustom.cmake | 15 +- configure.ac | 1 + fortran/examples/CMakeTests.cmake | 2 +- hl/test/CMakeTests.cmake | 6 +- release_docs/INSTALL_CMake.txt | 374 ++++++------ release_docs/USING_HDF5_CMake.txt | 12 +- src/H5PL.c | 359 +++++++++++- src/H5PLpublic.h | 9 +- src/H5private.h | 8 +- src/H5system.c | 3 +- src/H5win32defs.h | 16 +- test/CMakeTests.cmake | 16 +- test/app_ref.c | 4 + test/big.c | 16 +- test/cache.c | 4 - test/cache_api.c | 207 ++++--- test/cache_common.c | 12 +- test/dt_arith.c | 67 ++- test/dtypes.c | 95 +++- test/efc.c | 2 +- test/err_compat.c | 3 +- test/error_test.c | 2 +- test/file_image.c | 19 +- test/freespace.c | 2 + test/h5test.c | 419 ++++++++++---- test/h5test.h | 47 +- test/mf.c | 2 + test/plugin.c | 632 ++++++++++++++------- test/set_extent.c | 3 - test/vfd.c | 149 +++-- testpar/CMakeLists.txt | 2 +- testpar/CMakeTests.cmake | 4 +- testpar/t_mpi.c | 2 +- testpar/t_pflush2.c | 4 +- testpar/t_shapesame.c | 2 +- testpar/testphdf5.c | 2 +- tools/h5copy/CMakeTests.cmake | 24 +- tools/h5copy/h5copy.c | 142 +++-- tools/h5diff/h5diff_common.c | 5 +- tools/h5diff/h5diff_main.c | 3 +- tools/h5dump/CMakeTests.cmake | 48 +- tools/h5dump/CMakeTestsPBITS.cmake | 4 +- tools/h5dump/CMakeTestsXML.cmake | 8 +- tools/h5dump/h5dump_extern.h | 7 +- tools/h5dump/h5dump_xml.c | 138 ++--- tools/h5import/CMakeTests.cmake | 12 +- tools/h5import/h5import.c | 28 +- tools/h5jam/CMakeTests.cmake | 24 +- tools/h5jam/getub.c | 213 ++++--- tools/h5jam/h5jam.c | 192 +++---- tools/h5ls/CMakeTests.cmake | 8 +- tools/h5ls/h5ls.c | 122 ++-- tools/h5repack/CMakeTests.cmake | 38 +- tools/h5repack/dynlib_rpk.c | 4 +- tools/h5repack/dynlib_vrpk.c | 8 +- tools/h5repack/h5repack.c | 28 +- tools/h5repack/h5repack_copy.c | 108 ++-- tools/h5repack/h5repack_main.c | 569 +++++++++---------- tools/h5repack/h5repack_parse.c | 7 +- tools/h5repack/h5repack_plugin.sh.in | 25 +- tools/h5repack/h5repack_verify.c | 7 +- tools/h5repack/h5repacktst.c | 2 +- .../h5repack_layout.h5-plugin_version_test.ddl | 14 +- tools/h5stat/CMakeTests.cmake | 4 +- tools/h5stat/h5stat.c | 2 +- tools/lib/h5diff.c | 10 +- tools/lib/h5diff_attr.c | 6 +- tools/lib/io_timer.c | 5 +- tools/misc/CMakeTests.cmake | 8 +- tools/misc/h5debug.c | 24 +- tools/misc/h5mkgrp.c | 3 - tools/misc/h5repart.c | 89 +-- tools/perform/chunk.c | 477 ++++++++-------- tools/perform/perf_meta.c | 2 +- tools/testfiles/textlinksrc-nodangle-1.ls | 4 +- tools/testfiles/tgroup-1.ls | 4 +- 79 files changed, 2916 insertions(+), 2052 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e413e3..08a65c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,7 +245,7 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) +math (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -253,7 +253,7 @@ string (REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) + math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -261,7 +261,7 @@ string (REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) + math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -269,7 +269,7 @@ string (REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) + math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -277,7 +277,7 @@ string (REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) + math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -285,7 +285,7 @@ string (REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) + math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -293,7 +293,7 @@ string (REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) + math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index cf07ab3..7ffabb2 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -50,7 +50,7 @@ if (HDF5_TEST_VFD) set (VFD_LIST ${VFD_LIST} direct) endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") add_test ( @@ -78,7 +78,7 @@ if (HDF5_TEST_VFD) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) endif () - ENDMACRO () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 2b05764..03fe02e 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -615,7 +615,7 @@ void test_links() /* Close 2nd FAPL */ H5Pclose(fapl2_id); - h5_cleanup(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); /* Test that external links can be used after a library reset. MUST be * called last so the reset doesn't interfere with the property lists. This diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 8d80f19..9a51878 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,5 +1,10 @@ set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) - +# Allow full output to go to CDash set to 0 +SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000) +SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000) +# WARNING! This could be a lot of output and could overwhelm CDash and the +# MySQL DB so this might not be a good idea! + set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" @@ -16,7 +21,7 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION "note: expanded from macro" # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) - + set (CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} H5TEST-flush1 #designed to fail @@ -47,6 +52,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5DUMP_PACKED_BITS-clearall-objects H5DUMP-XML-clearall-objects ######### tools/h5import ######### + H5IMPORT-h5importtest-clear-objects H5IMPORT-clear-objects ######### tools/h5jam ######### H5JAM-SETUP-N_twithub_u10_c-clear-objects @@ -204,6 +210,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_long_switches #uses grepTest.cmake H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin + H5REPACK_CMP-plugin_zero ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### @@ -212,4 +219,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE ######### examples ######### EXAMPLES-clear-objects CPP_ex-clear-objects + CPP_ex_tutr-clear-objects + HL_ex-clear-objects + f90_ex-clear-objects + HL_FORTRAN_f90_ex-clear-objects ) diff --git a/configure.ac b/configure.ac index f0eb713..f0a1bb3 100644 --- a/configure.ac +++ b/configure.ac @@ -1581,6 +1581,7 @@ AC_CHECK_FUNCS([gethostname getrusage gettimeofday]) AC_CHECK_FUNCS([lstat rand_r random setsysinfo]) AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([snprintf srandom strdup symlink system]) +AC_CHECK_FUNCS([strtoll strtoull]) AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid]) ## ---------------------------------------------------------------------- diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index e616979..87822f3 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -134,7 +134,7 @@ if (HDF5_ENABLE_F2003) endif () set (last_test "f03_ex-shared_${example}") endif () - endforeach (example ${F2003_examples}) + endforeach () endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index e8b7079..c451ab1 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -28,13 +28,13 @@ set (HL_REFERENCE_TEST_FILES # -------------------------------------------------------------------- foreach (h5_file ${HL_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_HL_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}" "hl_test_files") -endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) +endforeach () add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list}) # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- -MACRO (HL_ADD_TEST hl_name) +macro (HL_ADD_TEST hl_name) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_${hl_name} COMMAND $) else () @@ -55,7 +55,7 @@ MACRO (HL_ADD_TEST hl_name) WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} ) endif () -ENDMACRO () +endmacro () # Remove any output file left over from previous test run add_test ( diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 0db7d98..bfec833 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -30,7 +30,7 @@ Obtaining HDF5 source code CMake version 1. We suggest you obtain the latest CMake from the Kitware web site. - The HDF5 1.8."X" product requires a minimum CMake version 3.1.0, + The HDF5 1.8."X" product requires a minimum CMake version 3.2.2, where "X" is the current HDF5 release version. Note: @@ -51,7 +51,7 @@ The following files referenced below are available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html Single compressed file with all the files needed, including source: - hdf5-1.8.16-CMake.zip or hdf5-1.8.16-CMake.tar.gz + hdf5-1.8.19-CMake.zip or hdf5-1.8.19-CMake.tar.gz Individual files ----------------------------------------------- @@ -688,232 +688,232 @@ set(CTEST_SOURCE_VERSEXT "") #STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac -if(DEFINED CTEST_SCRIPT_ARG) +if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() + set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif () + endforeach () +endif () # build generator must be defined -if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else() - if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif(${BUILD_GENERATOR} STREQUAL "VS2015") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif(${BUILD_GENERATOR} STREQUAL "VS201564") - set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() +if (NOT DEFINED BUILD_GENERATOR) + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") +else () + if (${BUILD_GENERATOR} STREQUAL "Unix") + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") + endif () +endif () ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") ################################################################### -if(NOT DEFINED INSTALLDIR) - if(WIN32) - set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - else() - set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - endif() -endif() -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif() -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else() - set(STATICONLYLIBRARIES "NO") -endif() -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else() - set(FORTRANLIBRARIES "YES") -endif() - -set(CTEST_BINARY_NAME "build") -set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") -if(WIN32) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else() - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif() +if (NOT DEFINED INSTALLDIR) + if (WIN32) + set (INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") + else () + set (INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") + endif () +endif () +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +endif () +if (NOT DEFINED STATIC_ONLY) + set (STATICONLYLIBRARIES "YES") +else () + set (STATICONLYLIBRARIES "NO") +endif () +if (NOT DEFINED FORTRAN_LIBRARIES) + set (FORTRANLIBRARIES "NO") +else () + set(FORTRANLIBRARIES "YES") +endif () + +set (CTEST_BINARY_NAME "build") +set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") +if (WIN32) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else () + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif () ################################################################### ######### Following describes compiler ############ -if(WIN32) - set(SITE_OS_NAME "Windows") - set(SITE_OS_VERSION "WIN7") - if(${BUILD_GENERATOR} STREQUAL "VS201564") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2015") - set(SITE_COMPILER_VERSION "14") - elseif(${BUILD_GENERATOR} STREQUAL "VS2015") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2015") - set(SITE_COMPILER_VERSION "14") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") - endif() +if (WIN32) + set (SITE_OS_NAME "Windows") + set (SITE_OS_VERSION "WIN7") + if (${BUILD_GENERATOR} STREQUAL "VS201564") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + endif () ## Set the following to unique id your computer ## - set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else() - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") +else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## - if(APPLE) - set(CTEST_SITE "MAC.XXXX") - else() - set(CTEST_SITE "LINUX.XXXX") - endif() - if(APPLE) - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - set(CTEST_USE_LAUNCHERS 1) - set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set(RR_FLAGS_C "${RR_FLAGS_COMMON}") - set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif() -endif() + if (APPLE) + set (CTEST_SITE "MAC.XXXX") + else () + set (CTEST_SITE "LINUX.XXXX") + endif () + if (APPLE) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + set (CTEST_USE_LAUNCHERS 1) + set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set (RR_FLAGS_C "${RR_FLAGS_COMMON}") + set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () +endif () ################################################################### ################################################################### ######### Following is for submission to CDash ############ ################################################################### -set(MODEL "Experimental") +set (MODEL "Experimental") ################################################################### ################################################################### ##### Following controls CDash submission ##### -#set(LOCAL_SUBMIT "TRUE") +#set (LOCAL_SUBMIT "TRUE") ##### Following controls test process ##### -#set(LOCAL_SKIP_TEST "TRUE") -#set(LOCAL_MEMCHECK_TEST "TRUE") -#set(LOCAL_COVERAGE_TEST "TRUE") +#set (LOCAL_SKIP_TEST "TRUE") +#set (LOCAL_MEMCHECK_TEST "TRUE") +#set (LOCAL_COVERAGE_TEST "TRUE") ##### Following controls cpack command ##### -#set(LOCAL_NO_PACKAGE "TRUE") +#set (LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### -#set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set(REPOSITORY_BRANCH "develop") +#set (LOCAL_UPDATE "TRUE") +set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set (REPOSITORY_BRANCH "hdf5_1_8") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +#set (CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") ################################################################### ################################################################### -if(${STATICONLYLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +if (${STATICONLYLIBRARIES}) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## - set(SITE_BUILDNAME_SUFFIX "STATIC") -endif() + set (SITE_BUILDNAME_SUFFIX "STATIC") +endif () ################################################################### #### fortran #### -if(${FORTRANLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") +if (${FORTRANLIBRARIES}) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -else() - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +else () + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") -endif() + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") +endif () ### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### -if(WIN32) - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") - include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() -else() - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") - include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - endif() - endif() -endif() +if (WIN32) + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () +else () + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if (APPLE) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if (CYGWIN) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + endif () + endif () +endif () HDF5options.cmake: ############################################################################################# @@ -924,6 +924,10 @@ HDF5options.cmake: ### uncomment/comment and change the following lines for other configuration options ############################################################################################# +#### alternate toolsets #### +#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") + +############################################################################################# #### ext libraries #### ### ext libs from tgz @@ -949,7 +953,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING ### disable packaging #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) +### Create install package with external libraries (szip, zlib) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ############################################################################################# diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 9098f15..589ef03 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -221,7 +221,9 @@ NOTE: this file is available at the HDF web site: HDF518_Examples.cmake - +Also available at the HDF web site is a CMake application framework template. +You can quickly add files to the framework and execute the script to compile +your application with an installed HDF5 binary. ======================================================================== ctest @@ -269,12 +271,12 @@ if (NOT DEFINED STATIC_ONLY) set (STATICONLYLIBRARIES "YES") else () set (STATICONLYLIBRARIES "NO") -endif() +endif () if (NOT DEFINED FORTRAN_LIBRARIES) set (FORTRANLIBRARIES "NO") else () set (FORTRANLIBRARIES "YES") -endif() +endif () if (NOT DEFINED JAVA_LIBRARIES) set (JAVALIBRARIES "NO") else () @@ -314,7 +316,7 @@ else () endif () if (${JAVALIBRARIES}) set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else() +else () set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") endif () set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") @@ -407,7 +409,7 @@ endif () ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if (LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif() +endif () if (res GREATER 0) message (FATAL_ERROR "tests FAILED") endif () diff --git a/src/H5PL.c b/src/H5PL.c index 82075f4..0e136a4 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -73,7 +73,7 @@ #define H5PL_CLR_ERROR /* maximum size for expanding env vars */ -#define EXPAND_BUFFER_SIZE 32767 +#define H5PL_EXPAND_BUFFER_SIZE 32767 typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); @@ -86,7 +86,7 @@ typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); #define H5PL_HANDLE void * /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW) +#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) /* Get the address of a symbol in dynamic library */ #define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) @@ -95,7 +95,7 @@ typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); #define H5PL_CLOSE_LIB(H) dlclose(H) /* Clear error */ -#define H5PL_CLR_ERROR dlerror() +#define H5PL_CLR_ERROR HERROR(H5E_PLUGIN, H5E_CANTGET, "can't dlopen:%s", dlerror()) typedef const void *(*H5PL_get_plugin_info_t)(void); #endif /* H5_HAVE_WIN32_API */ @@ -212,10 +212,13 @@ H5PLset_loading_state(unsigned int plugin_type) { char *preload_path; herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_API(FAIL) H5TRACE1("e", "Iu", plugin_type); + /* change the bit value of the requested plugin type(s) */ H5PL_plugin_g = plugin_type; + /* check if special ENV variable is set and disable all plugin types */ if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) { /* Special symbol "::" means no plugin during data reading. */ @@ -243,12 +246,14 @@ herr_t H5PLget_loading_state(unsigned int *plugin_type) { herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*Iu", plugin_type); if(plugin_type) *plugin_type = H5PL_plugin_g; - done: + +done: FUNC_LEAVE_API(ret_value) } /* end H5PLget_loading_state() */ @@ -375,6 +380,304 @@ done: /*------------------------------------------------------------------------- + * Function: H5PLappend + * + * Purpose: Insert a plugin path at the end of the list. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +herr_t +H5PLappend(char* plugin_path) +{ + herr_t ret_value = SUCCEED; /* Return value */ + char *dl_path = NULL; + + FUNC_ENTER_API(FAIL) + if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") + if(NULL == plugin_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + dl_path = H5MM_strdup(plugin_path); + if(NULL == dl_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") +#ifdef H5_HAVE_WIN32_API + else { /* Expand windows env var*/ + long bufCharCount; + char *tempbuf; + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") + } + if(bufCharCount == 0) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } + dl_path = (char *)H5MM_xfree(dl_path); + dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); + } +#endif /* H5_HAVE_WIN32_API */ + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dl_path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_num_paths_g++; + +done: + if(dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_API(ret_value) +} /* end H5PLappend() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLprepend + * + * Purpose: Insert a plugin path at the beginning of the list. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +herr_t +H5PLprepend(char* plugin_path) +{ + herr_t ret_value = SUCCEED; /* Return value */ + char *dl_path = NULL; + unsigned int plindex; + + FUNC_ENTER_API(FAIL) + if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") + if(NULL == plugin_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + dl_path = H5MM_strdup(plugin_path); + if(NULL == dl_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") +#ifdef H5_HAVE_WIN32_API + else { /* Expand windows env var*/ + long bufCharCount; + char *tempbuf; + if (NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + if ((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") + } + if (bufCharCount == 0) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } + dl_path = (char *)H5MM_xfree(dl_path); + dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); + } +#endif /* H5_HAVE_WIN32_API */ + for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) + H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; + if (NULL == (H5PL_path_table_g[0] = H5MM_strdup(dl_path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_num_paths_g++; + +done: + if (dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_API(ret_value) +} /* end H5PLprepend() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLput + * + * Purpose: Replace the path at the specified index. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +herr_t +H5PLput(char* plugin_path, unsigned int index) +{ + herr_t ret_value = SUCCEED; /* Return value */ + char *dl_path = NULL; + + FUNC_ENTER_API(FAIL) + if(NULL == plugin_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + dl_path = H5MM_strdup(plugin_path); + if(NULL == dl_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") +#ifdef H5_HAVE_WIN32_API + else { /* Expand windows env var*/ + long bufCharCount; + char *tempbuf; + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") + } + if(bufCharCount == 0) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } + dl_path = (char *)H5MM_xfree(dl_path); + dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); + } +#endif /* H5_HAVE_WIN32_API */ + if(H5PL_path_table_g[index]) + H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); + if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + +done: + if(dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_API(ret_value) +} /* end H5PLput() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLinsert + * + * Purpose: Insert a plugin path at the specified index, moving other paths after the index. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +herr_t +H5PLinsert(char* plugin_path, unsigned int index) +{ + herr_t ret_value = SUCCEED; /* Return value */ + char *dl_path = NULL; + unsigned int plindex; + + FUNC_ENTER_API(FAIL) + if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") + if(NULL == plugin_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + dl_path = H5MM_strdup(plugin_path); + if(NULL == dl_path) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") +#ifdef H5_HAVE_WIN32_API + else { /* Expand windows env var*/ + long bufCharCount; + char *tempbuf; + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") + } + if(bufCharCount == 0) { + tempbuf = (char *)H5MM_xfree(tempbuf); + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } + dl_path = (char *)H5MM_xfree(dl_path); + dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); + } +#endif /* H5_HAVE_WIN32_API */ + for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) + H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; + if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_num_paths_g++; + +done: + if(dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_API(ret_value) +} /* end H5PLinsert() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLremove + * + * Purpose: Remove the plugin path at the specifed index and compacting the list. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +herr_t +H5PLremove(unsigned int index) +{ + herr_t ret_value = SUCCEED; /* Return value */ + char *dl_path = NULL; + unsigned int plindex; + + FUNC_ENTER_API(FAIL) + if(H5PL_num_paths_g == 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(NULL == (dl_path = H5PL_path_table_g[index])) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) + H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; + if(H5PL_path_table_g[plindex]) + dl_path = (char *)H5MM_xfree(dl_path); + H5PL_num_paths_g--; + H5PL_path_table_g[H5PL_num_paths_g] = NULL; + +done: + if(dl_path) + dl_path = (char *)H5MM_xfree(dl_path); + + FUNC_LEAVE_API(ret_value) +} /* end H5PLremove() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLget + * + * Purpose: Query the plugin path at the specified index. + * + * Return: Non-NULL on success/NULL on failure + * + *------------------------------------------------------------------------- + */ +const char* +H5PLget(unsigned int index) +{ + char* ret_value = NULL; /* Return value */ + + FUNC_ENTER_API(NULL) + if(H5PL_num_paths_g == 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(NULL == (ret_value = H5PL_path_table_g[index])) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5PLget() */ + + +/*------------------------------------------------------------------------- + * Function: H5PLsize + * + * Purpose: Query the size of the current list of plugin paths. + * + * Return: Non-negative or success. + * + *------------------------------------------------------------------------- + */ +unsigned int +H5PLsize(void) +{ + return (unsigned int)H5PL_num_paths_g; +} /* end H5PLsize() */ + + +/*------------------------------------------------------------------------- * Function: H5PL__init_path_table * * Purpose: Initialize the path table. @@ -401,24 +704,31 @@ H5PL__init_path_table(void) */ origin_dl_path = HDgetenv("HDF5_PLUGIN_PATH"); if(NULL == origin_dl_path) - dl_path = HDstrdup(H5PL_DEFAULT_PATH); + dl_path = H5MM_strdup(H5PL_DEFAULT_PATH); else - dl_path = HDstrdup(origin_dl_path); + dl_path = H5MM_strdup(origin_dl_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") #ifdef H5_HAVE_WIN32_API else { /* Expand windows env var*/ long bufCharCount; - char tempbuf[EXPAND_BUFFER_SIZE]; - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, EXPAND_BUFFER_SIZE)) > EXPAND_BUFFER_SIZE) + char *tempbuf; + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { + tempbuf = (char *)H5MM_xfree(tempbuf); HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - if(bufCharCount == 0) + } + if(bufCharCount == 0) { + tempbuf = (char *)H5MM_xfree(tempbuf); HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } dl_path = (char *)H5MM_xfree(dl_path); dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); } -#endif H5_HAVE_WIN32_API +#endif /* H5_HAVE_WIN32_API */ /* Put paths in the path table. They are separated by ":" */ dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); @@ -426,7 +736,7 @@ H5PL__init_path_table(void) /* Check for too many directories in path */ if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = HDstrdup(dir))) + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dir))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_num_paths_g++; dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR); @@ -508,14 +818,9 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) /* Attempt to open the dynamic library as a filter library */ if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - if(found_in_dir) { - /* Indicate success */ - HGOTO_DONE(TRUE) - } /* end if */ - else { - HDassert(pathname); - pathname = (char *)H5MM_xfree(pathname); - } + if(found_in_dir) + HGOTO_DONE(TRUE) /* Indicate success */ + pathname = (char *)H5MM_xfree(pathname); } /* end if */ } /* end while */ @@ -523,8 +828,7 @@ done: if(dirp) if(HDclosedir(dirp) < 0) HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno)) - if(pathname) - pathname = (char *)H5MM_xfree(pathname); + pathname = (char *)H5MM_xfree(pathname); FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find() */ @@ -565,14 +869,9 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - if(found_in_dir) { - /* Indicate success */ - HGOTO_DONE(TRUE) - } /* end if */ - else { - HDassert(pathname); - pathname = (char *)H5MM_xfree(pathname); - } + if(found_in_dir) + HGOTO_DONE(TRUE) /* Indicate success */ + pathname = (char *)H5MM_xfree(pathname); } /* end if */ } while(FindNextFileA(hFind, &fdFile)); /* Find the next file. */ @@ -707,7 +1006,7 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info) const H5Z_class2_t *plugin_info; if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 0296819..f3fe497 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -43,7 +43,14 @@ extern "C" { /* plugin state */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); -H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_type/*out*/); +H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/); +H5_DLL herr_t H5PLappend(char* plugin_path); +H5_DLL herr_t H5PLprepend(char* plugin_path); +H5_DLL herr_t H5PLput(char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLinsert(char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLremove(unsigned int index); +H5_DLL const char* H5PLget(unsigned int index); +H5_DLL unsigned int H5PLsize(void); #ifdef __cplusplus } diff --git a/src/H5private.h b/src/H5private.h index 2e2516a..3c0cb75 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1273,7 +1273,13 @@ typedef off_t h5_stat_size_t; #ifndef HDstrtol #define HDstrtol(S,R,N) strtol(S,R,N) #endif /* HDstrtol */ -H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); +#ifndef HDstrtoll + #ifdef H5_HAVE_STRTOLL + #define HDstrtoll(S,R,N) strtoll(S,R,N) + #else + H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); + #endif /* H5_HAVE_STRTOLL */ +#endif /* HDstrtoll */ #ifndef HDstrtoul #define HDstrtoul(S,R,N) strtoul(S,R,N) #endif /* HDstrtoul */ diff --git a/src/H5system.c b/src/H5system.c index 3d43a7d..2503161 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -473,6 +473,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) * *------------------------------------------------------------------------- */ +#ifndef HDstrtoll int64_t HDstrtoll(const char *s, const char **rest, int base) { @@ -548,7 +549,7 @@ HDstrtoll(const char *s, const char **rest, int base) *rest = s; return acc; } /* end HDstrtoll() */ - +#endif /*------------------------------------------------------------------------- * Function: HDrand/HDsrand diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 3dab8de..63084d2 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -23,6 +23,11 @@ * */ +/* + * _MSC_VER = 1900 VS2015 + * _MSC_VER = 1800 VS2013 + * _MSC_VER = 1700 VS2012 + */ #ifdef H5_HAVE_WIN32_API typedef struct _stati64 h5_stat_t; @@ -53,13 +58,22 @@ typedef __int64 h5_stat_size_t; #define HDsleep(S) Sleep(S*1000) #define HDstat(S,B) _stati64(S,B) #define HDstrcasecmp(A,B) _stricmp(A,B) -#define HDstrtoull(S,R,N) _strtoui64(S,R,N) #define HDstrdup(S) _strdup(S) #define HDtzset() _tzset() #define HDunlink(S) _unlink(S) #define HDwrite(F,M,Z) _write(F,M,Z) #ifdef H5_HAVE_VISUAL_STUDIO + +#if (_MSC_VER < 1800) + #ifndef H5_HAVE_STRTOLL + #define HDstrtoll(S,R,N) _strtoi64(S,R,N) + #endif /* H5_HAVE_STRTOLL */ + #ifndef H5_HAVE_STRTOULL + #define HDstrtoull(S,R,N) _strtoui64(S,R,N) + #endif /* H5_HAVE_STRTOULL */ +#endif /* MSC_VER < 1800 */ + /* * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO */ diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5fbde25..e8b4bec 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -145,7 +145,7 @@ endif () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) -endif() +endif () # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-testhdf5-objects @@ -776,7 +776,7 @@ if (HDF5_TEST_VFD) endif () # Windows only macro - MACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) @@ -819,7 +819,7 @@ if (HDF5_TEST_VFD) COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" ) endif () - endif() + endif () else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" @@ -884,9 +884,9 @@ if (HDF5_TEST_VFD) ) endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) @@ -979,7 +979,7 @@ if (HDF5_TEST_VFD) ) endif () endif () - ENDMACRO () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) @@ -995,13 +995,13 @@ endif () ############################################################################## if (HDF5_BUILD_GENERATORS) - MACRO (ADD_H5_GENERATOR genfile) + macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) - ENDMACRO () + endmacro () # generator executables set (H5_GENERATORS diff --git a/test/app_ref.c b/test/app_ref.c index 3052df7..4b72bcb 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -185,6 +185,10 @@ main (void) PASSED(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + /* Clean up any file(s) created */ h5_reset(); fapl = H5Pcreate (H5P_FILE_ACCESS); h5_cleanup (FILENAME, fapl); diff --git a/test/big.c b/test/big.c index db03c99..9ac4316 100644 --- a/test/big.c +++ b/test/big.c @@ -120,7 +120,7 @@ static hsize_t values_used[WRT_N]; static hsize_t randll(hsize_t limit, int current_index) { - hsize_t acc; + hsize_t acc = 0; int overlap = 1; int i; int tries = 0; @@ -508,7 +508,7 @@ reader(char *filename, hid_t fapl) if('#' != ln[0]) break; i = (int)HDstrtol(ln + 1, &s, 10); - hs_offset[0] = HDstrtoll(s, NULL, 0); + hs_offset[0] = HDstrtoull(s, NULL, 0); HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], ""); HDfflush(stdout); @@ -618,8 +618,8 @@ test_sec2(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: @@ -655,8 +655,8 @@ test_stdio(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); HDfflush(stdout); return 0; @@ -716,8 +716,8 @@ test_family(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: diff --git a/test/cache.c b/test/cache.c index df6d805..c0bfbe2 100644 --- a/test/cache.c +++ b/test/cache.c @@ -19,10 +19,6 @@ * This file contains tests for the cache implemented in * H5C.c */ -#include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" diff --git a/test/cache_api.c b/test/cache_api.c index 8f556be..1a826db 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -20,11 +20,9 @@ * with the cache implemented in H5C.c */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" +/* extern declarations */ /* global variable declarations: */ @@ -50,19 +48,19 @@ static void check_file_mdc_api_errs(void); /**************************************************************************/ /*------------------------------------------------------------------------- - * Function: check_fapl_mdc_api_calls() + * Function: check_fapl_mdc_api_calls() * - * Purpose: Verify that the file access property list related - * metadata cache related API calls are functioning - * correctly. + * Purpose: Verify that the file access property list related + * metadata cache related API calls are functioning + * correctly. * - * Since we have tested the H5C code elsewhere, it should - * be sufficient to verify that the desired configuration - * data is getting to the cache. + * Since we have tested the H5C code elsewhere, it should + * be sufficient to verify that the desired configuration + * data is getting to the cache. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/12/04 * *------------------------------------------------------------------------- @@ -131,13 +129,13 @@ check_fapl_mdc_api_calls(void) if ( pass ) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); + fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if ( fapl_id < 0 ) { + if ( fapl_id < 0 ) { - pass = FALSE; + pass = FALSE; failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; - } + } } if ( pass ) { @@ -149,7 +147,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) { @@ -170,7 +168,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pset_mdc_config() failed.\n"; + failure_mssg = "H5Pset_mdc_config() failed.\n"; } } @@ -183,7 +181,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) { @@ -197,7 +195,7 @@ check_fapl_mdc_api_calls(void) if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } @@ -239,11 +237,11 @@ check_fapl_mdc_api_calls(void) if ( file_ptr == NULL ) { pass = FALSE; - failure_mssg = "Can't get file_ptr.\n"; + failure_mssg = "Can't get file_ptr.\n"; - } else { + } else { - cache_ptr = file_ptr->shared->cache; + cache_ptr = file_ptr->shared->cache; } } @@ -262,10 +260,9 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! resize_configs_are_equal(&default_auto_size_ctl, \ + if ( ! resize_configs_are_equal(&default_auto_size_ctl, \ &cache_ptr->resize_ctl, TRUE) ) { - pass = FALSE; failure_mssg = "Unexpected value(s) in cache resize_ctl 1.\n"; } @@ -295,7 +292,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) { @@ -305,22 +302,22 @@ check_fapl_mdc_api_calls(void) } else if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -335,13 +332,13 @@ check_fapl_mdc_api_calls(void) /* Create a FAPL */ if ( pass ) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); + fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if ( fapl_id < 0 ) { + if ( fapl_id < 0 ) { - pass = FALSE; + pass = FALSE; failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; - } + } } /* Modify the initial mdc configuration in the FAPL. */ @@ -353,7 +350,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pset_mdc_config() failed.\n"; + failure_mssg = "H5Pset_mdc_config() failed.\n"; } } @@ -388,7 +385,7 @@ check_fapl_mdc_api_calls(void) if ( file_ptr == NULL ) { pass = FALSE; - failure_mssg = "Can't get file_ptr.\n"; + failure_mssg = "Can't get file_ptr.\n"; } else { @@ -411,10 +408,9 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \ + if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \ &cache_ptr->resize_ctl, TRUE) ) { - pass = FALSE; failure_mssg = "Unexpected value(s) in cache resize_ctl 2.\n"; } @@ -444,7 +440,7 @@ check_fapl_mdc_api_calls(void) if ( result < 0 ) { pass = FALSE; - failure_mssg = "H5Pget_mdc_config() failed.\n"; + failure_mssg = "H5Pget_mdc_config() failed.\n"; } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) { @@ -454,7 +450,7 @@ check_fapl_mdc_api_calls(void) } else if ( H5Pclose(test_fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } @@ -464,22 +460,22 @@ check_fapl_mdc_api_calls(void) if ( H5Pclose(fapl_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Pclose() failed.\n"; + failure_mssg = "H5Pclose() failed.\n"; } } /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -493,26 +489,24 @@ check_fapl_mdc_api_calls(void) /*------------------------------------------------------------------------- - * Function: check_file_mdc_api_calls() + * Function: check_file_mdc_api_calls() * - * Purpose: Verify that the file related metadata cache API calls are - * functioning correctly. + * Purpose: Verify that the file related metadata cache API calls are + * functioning correctly. * - * Since we have tested the H5C code elsewhere, it should - * be sufficient to verify that the desired configuration - * data is getting in and out of the cache. Similarly, - * we need only verify that the cache monitoring calls - * return the data that the cache thinks they should return. - * We shouldn't need to verify data correctness beyond that - * point. + * Since we have tested the H5C code elsewhere, it should + * be sufficient to verify that the desired configuration + * data is getting in and out of the cache. Similarly, + * we need only verify that the cache monitoring calls + * return the data that the cache thinks they should return. + * We shouldn't need to verify data correctness beyond that + * point. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/14/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -821,15 +815,15 @@ check_file_mdc_api_calls(void) /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -845,17 +839,16 @@ check_file_mdc_api_calls(void) /*------------------------------------------------------------------------- * Function: mdc_api_call_smoke_check() * - * Purpose: - * - * Return: void + * Purpose: Initial basic functional test to see if there are problems + * with the cache API calls. * - * Programmer: John Mainzer - * 4/14/04 + * NOTE: This test takes some time to run and checks the + * HDF5TestExpress environment variable. * - * Modifications: + * Return: void * - * JRM -- 7/12/06 - * Added progress reporting code. + * Programmer: John Mainzer + * 4/14/04 * *------------------------------------------------------------------------- */ @@ -880,7 +873,7 @@ mdc_api_call_smoke_check(int express_test) hid_t filespace_ids[NUM_DSETS]; hid_t memspace_id = -1; hid_t dataset_ids[NUM_DSETS]; - hid_t properties; + hid_t properties = -1; char dset_name[64]; int i, j, k, l, m, n; herr_t status; @@ -1105,7 +1098,7 @@ mdc_api_call_smoke_check(int express_test) sprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1329,9 +1322,9 @@ mdc_api_call_smoke_check(int express_test) } n++; - } + /* close the file spaces we are done with */ i = 1; while ( ( pass ) && ( i < NUM_DSETS ) ) @@ -1450,7 +1443,6 @@ mdc_api_call_smoke_check(int express_test) } n++; - } /* close file space 0 */ @@ -1496,16 +1488,16 @@ mdc_api_call_smoke_check(int express_test) /* close the file and delete it */ if ( pass ) { - if ( H5Fclose(file_id) < 0 ) { + if ( H5Fclose(file_id) < 0 ) { pass = FALSE; - failure_mssg = "H5Fclose() failed.\n"; + failure_mssg = "H5Fclose() failed.\n"; } else if ( HDremove(filename) < 0 ) { pass = FALSE; - failure_mssg = "HDremove() failed.\n"; + failure_mssg = "HDremove() failed.\n"; } } @@ -3000,18 +2992,16 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /*------------------------------------------------------------------------- - * Function: check_fapl_mdc_api_errs() + * Function: check_fapl_mdc_api_errs() * - * Purpose: Verify that the FAPL related MDC API calls reject input - * errors gracefully. + * Purpose: Verify that the FAPL related MDC API calls reject input + * errors gracefully. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/19/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3030,7 +3020,6 @@ check_fapl_mdc_api_errs(void) pass = TRUE; - /* first test H5Pget_mdc_config(). */ @@ -3038,8 +3027,8 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config((hid_t)-1, &scratch); - } H5E_END_TRY; + result = H5Pget_mdc_config((hid_t)-1, &scratch); + } H5E_END_TRY; if ( result >= 0 ) { @@ -3065,7 +3054,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3171,18 +3160,16 @@ check_fapl_mdc_api_errs(void) /*------------------------------------------------------------------------- - * Function: check_file_mdc_api_errs() + * Function: check_file_mdc_api_errs() * - * Purpose: Verify that the file related MDC API calls reject input - * errors gracefully. + * Purpose: Verify that the file related MDC API calls reject input + * errors gracefully. * * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/19/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3215,7 +3202,7 @@ check_file_mdc_api_errs(void) /* setup the file name */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name); } @@ -3230,7 +3217,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name); } @@ -3252,7 +3239,7 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name); } @@ -3270,7 +3257,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name); } @@ -3289,7 +3276,7 @@ check_file_mdc_api_errs(void) scratch.version = -1; /* a convenient, invalid value */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name); } @@ -3311,7 +3298,7 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name); } @@ -3329,7 +3316,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name); } @@ -3348,7 +3335,7 @@ check_file_mdc_api_errs(void) i = 0; while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", @@ -3378,7 +3365,7 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_hit_rate() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", fcn_name); @@ -3397,7 +3384,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", fcn_name); @@ -3418,7 +3405,7 @@ check_file_mdc_api_errs(void) /* test H5Freset_mdc_hit_rate_stats() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", fcn_name); @@ -3440,7 +3427,7 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_size() */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name); } @@ -3459,7 +3446,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name); } @@ -3481,7 +3468,7 @@ check_file_mdc_api_errs(void) /* close the file and delete it */ if ( pass ) { - if ( show_progress ) { + if ( show_progress ) { HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name); } @@ -3508,22 +3495,17 @@ check_file_mdc_api_errs(void) /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Run tests on the cache code contained in H5C.c + * Purpose: Run tests on the cache code contained in H5C.c * * Return: Success: * - * Failure: - * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * *------------------------------------------------------------------------- */ - int main(void) { @@ -3552,3 +3534,4 @@ main(void) return(0); } /* main() */ + diff --git a/test/cache_common.c b/test/cache_common.c index 5fe68db..6ca3d9f 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -20,9 +20,6 @@ * implemented in H5C.c */ #include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ -#include "h5test.h" -#include "H5Cprivate.h" -#include "H5Iprivate.h" #include "H5MFprivate.h" #include "cache_common.h" @@ -338,8 +335,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, - -/* address translation funtions: */ +/* address translation functions: */ /*------------------------------------------------------------------------- @@ -357,8 +353,8 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, */ void addr_to_type_and_index(haddr_t addr, - int32_t * type_ptr, - int32_t * index_ptr) + int32_t *type_ptr, + int32_t *index_ptr) { int i; int32_t type; @@ -1577,7 +1573,7 @@ entry_in_cache(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: reset_entries * - * Purpose: reset the contents of the entries arrays to know values. + * Purpose: reset the contents of the entries arrays to known values. * * Return: void * diff --git a/test/dt_arith.c b/test/dt_arith.c index 4337690..8396d38 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -20,8 +20,6 @@ * Purpose: Tests the data type interface (H5T) */ -#include -#include #include "h5test.h" /* Number of elements in each random test */ @@ -645,11 +643,18 @@ test_hard_query(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 1; } /* end test_hard_query() */ @@ -871,7 +876,11 @@ error: if(saved_buf2) HDfree(saved_buf2); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1290,6 +1299,10 @@ test_derived_flt(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1305,7 +1318,12 @@ test_derived_flt(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1592,6 +1610,10 @@ test_derived_integer(void) HDfree(saved_buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1606,7 +1628,12 @@ test_derived_integer(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -2601,7 +2628,12 @@ done: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return (int)fails_all_tests; error: @@ -2609,7 +2641,12 @@ error: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_all_tests, 1); } @@ -3307,6 +3344,9 @@ done: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* If the source is normalized values, treat the failures as error; @@ -3330,7 +3370,11 @@ error: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + if(run_test==TEST_NOOP || run_test==TEST_NORMAL) return MAX((int)fails_all_tests, 1); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) @@ -4506,6 +4550,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ /* If the source is normalized floating values, treat the failures as error; @@ -4520,6 +4567,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ if(run_test==TEST_NORMAL) @@ -5168,6 +5219,10 @@ main(void) *---------------------------------------------------------------------- */ without_hardware_g = TRUE; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* Test software floating-point conversion functions */ @@ -5183,8 +5238,14 @@ main(void) /* Test software integer-float conversion functions */ nerrors += run_int_fp_conv("soft"); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + if (nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); diff --git a/test/dtypes.c b/test/dtypes.c index 7c2ad7b..e06c81f 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -20,8 +20,6 @@ * Purpose: Tests the datatype interface (H5T) */ -#include -#include #include "h5test.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ @@ -769,11 +767,20 @@ test_compound_2(void) CHECK_NMEMBS(nmembs , st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -888,11 +895,19 @@ test_compound_3(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1015,11 +1030,19 @@ test_compound_4(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1226,11 +1249,19 @@ test_compound_6(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1365,11 +1396,19 @@ test_compound_7(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4229,6 +4268,10 @@ test_conv_str_1(void) HDfree(buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; @@ -4241,7 +4284,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4304,7 +4351,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4418,7 +4469,11 @@ error: if(tag) H5free_memory(tag); /* Technically allocated by API call */ + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; /* Number of errors */ } @@ -4490,7 +4545,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4657,13 +4716,22 @@ test_conv_bitfield(void) H5Tclose(st); H5Tclose(dt); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: H5Tclose(st); H5Tclose(dt); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4781,14 +4849,18 @@ test_bitfield_funcs(void) retval = 0; - error: - +error: if (retval == -1) retval = 1; H5free_memory(tag); H5Tclose(ntype); H5Tclose(type); if (retval == 0) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return retval; } @@ -7423,8 +7495,10 @@ main(void) #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_deprec(fapl); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + h5_cleanup(FILENAME, fapl); /*must happen before first reset*/ reset_hdf5(); + nerrors += test_conv_str_1(); nerrors += test_conv_str_2(); nerrors += test_conv_str_3(); @@ -7452,6 +7526,7 @@ main(void) nerrors += test_opaque(); nerrors += test_set_order(); nerrors += test_utf_ascii_conv(); + if(nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); diff --git a/test/efc.c b/test/efc.c index ff4f738..167308f 100644 --- a/test/efc.c +++ b/test/efc.c @@ -3200,7 +3200,7 @@ main(void) puts("All external file cache tests passed."); - h5_cleanup(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); return 0; diff --git a/test/err_compat.c b/test/err_compat.c index 576433e..7779ddc 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -500,7 +500,7 @@ main(void) } if(H5Fclose(file) < 0) TEST_ERROR ; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); printf("All error API tests passed.\n"); return 0; @@ -510,3 +510,4 @@ main(void) return 1; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ + diff --git a/test/error_test.c b/test/error_test.c index 64f301d..ee181b1 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -756,7 +756,7 @@ main(void) if(test_filter_error(filename) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfprintf(stderr, "\nAll error API tests passed.\n"); return 0; diff --git a/test/file_image.c b/test/file_image.c index b1b9d47..d9c782a 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -643,7 +643,7 @@ test_core(void) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfree(udata); HDfree(file_image); HDremove(copied_filename); @@ -890,8 +890,7 @@ test_get_file_image(const char * test_banner, VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl); - VERIFY(result != 0, "h5_cleanup() failed."); + h5_clean_files(FILENAME2, fapl); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1039,8 +1038,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(1) failed."); + h5_clean_files(FILENAME2, fapl_id); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1145,8 +1143,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #3 **********************************/ /* set up a split file driver test file, and try to get its image @@ -1208,8 +1205,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image @@ -1269,8 +1265,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + h5_clean_files(FILENAME2, fapl_id); PASSED(); @@ -1340,6 +1335,8 @@ main(void) errors += test_get_file_image_error_rejection(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); if(errors) { printf("***** %d File Image TEST%s FAILED! *****\n", diff --git a/test/freespace.c b/test/freespace.c index 1338ae7..f82c1f6 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -2841,6 +2841,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* make sure alignment is not set for tests to succeed */ diff --git a/test/h5test.c b/test/h5test.c index 4d841f1..188c12f 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -22,8 +22,7 @@ */ #undef NDEBUG /*override -DNDEBUG */ -#include -#include + #include "h5test.h" #include "H5srcdir.h" @@ -75,7 +74,7 @@ char *paraprefix = NULL; /* for command line option para-prefix */ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ #endif -#define READ_BUF_SIZE 4096 +#define READ_BUF_SIZE 65536 /* * These are the letters that are appended to the file name when generating @@ -91,6 +90,12 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ */ static const char *multi_letters = "msbrglo"; +/* Length of multi-file VFD filename buffers */ +#define H5TEST_MULTI_FILENAME_LEN 1024 + +/* Previous error reporting function */ +static H5E_auto2_t err_func = NULL; + static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size); @@ -120,77 +125,228 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) return 0; } - + /*------------------------------------------------------------------------- - * Function: h5_cleanup + * Function: h5_clean_files * - * Purpose: Cleanup temporary test files. + * Purpose: Cleanup temporary test files (always). * base_name contains the list of test file names. - * The file access property list is also closed. * - * Return: Non-zero if cleanup actions were performed; zero otherwise. + * Return: void * - * Programmer: Albert Cheng - * May 28, 1998 + * Programmer: Neil Fortner + * June 1, 2015 * *------------------------------------------------------------------------- */ -int -h5_cleanup(const char *base_name[], hid_t fapl) +void +h5_clean_files(const char *base_name[], hid_t fapl) { - int retval = 0; + int i; - if(GetTestCleanup()) { - int i; + for(i = 0; base_name[i]; i++) { + char filename[1024]; + char temp[2048]; + hid_t driver; + + if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) + continue; - for(i = 0; base_name[i]; i++) { - char filename[1024]; - char temp[2048]; - hid_t driver; + driver = H5Pget_driver(fapl); - if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) - continue; + if(driver == H5FD_FAMILY) { + int j; - driver = H5Pget_driver(fapl); + for(j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); - if(driver == H5FD_FAMILY) { - int j; + if(HDaccess(temp, F_OK) < 0) + break; - for(j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); + HDremove(temp); + } /* end for */ + } else if(driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ - if(HDaccess(temp, F_OK) < 0) - break; + H5Pget_fapl_core(fapl, NULL, &backing); - HDremove(temp); - } /* end for */ - } else if(driver == H5FD_CORE) { - hbool_t backing; /* Whether the core file has backing store */ + /* If the file was stored to disk with bacing store, remove it */ + if(backing) + HDremove(filename); + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; - H5Pget_fapl_core(fapl, NULL, &backing); + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - /* If the file was stored to disk with bacing store, remove it */ - if(backing) - HDremove(filename); - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } /* end for */ + } else { + HDremove(filename); + } + } /* end for */ - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + /* Close the FAPL used to access the file */ + H5Pclose(fapl); - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } /* end for */ - } else { - HDremove(filename); - } + return; +} /* end h5_clean_files() */ + + +/*------------------------------------------------------------------------- + * Function: h5_delete_test_file + * + * Purpose Clean up temporary test files. + * + * When a test calls h5_fixname() to get a VFD-dependent + * test file name, this function can be used to clean it up. + * + * Return: void + * + * Since this is a cleanup file, we don't care if it fails. + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_delete_test_file(const char *base_name, hid_t fapl) +{ + char filename[1024]; /* VFD-dependent filename to delete */ + char sub_filename[2048]; /* sub-files in multi & family VFDs */ + hid_t driver = -1; /* VFD ID */ + + /* Get the VFD-dependent filename */ + if(NULL == h5_fixname(base_name, fapl, filename, sizeof(filename))) + return; + + driver = H5Pget_driver(fapl); + + if(driver == H5FD_FAMILY) { + int j; + for(j = 0; /*void*/; j++) { + HDsnprintf(sub_filename, sizeof(sub_filename), filename, j); + + /* If we can't access the file, it probably doesn't exist + * and we are done deleting the sub-files. + */ + if(HDaccess(sub_filename, F_OK) < 0) + break; + + HDremove(sub_filename); + } /* end for */ + } else if(driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ + + H5Pget_fapl_core(fapl, NULL, &backing); + + /* If the file was stored to disk with bacing store, remove it */ + if(backing) + HDremove(filename); + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; + + HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]); + HDremove(sub_filename); } /* end for */ + } else { + HDremove(filename); + } /* end if */ + + return; +} /* end h5_delete_test_file() */ + + +/*------------------------------------------------------------------------- + * Function: h5_delete_all_test_files + * + * Purpose Clean up temporary test files. + * + * When a test calls h5_fixname() get a VFD-dependent + * test file name, this function can be used to clean it up. + * + * This function takes an array of filenames that ends with + * a NULL string and cleans them all. + * + * Return: void + * + * Since this is a cleanup file, we don't care if it fails. + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_delete_all_test_files(const char *base_name[], hid_t fapl) +{ + int i; /* iterator */ + + for(i = 0; base_name[i]; i++) { + h5_delete_test_file(base_name[i], fapl); + } /* end for */ + + return; +} /* end h5_delete_all_test_files() */ + + +/*------------------------------------------------------------------------- + * Function: h5_cleanup + * + * Purpose: Cleanup temporary test files. + * base_name contains the list of test file names. + * The file access property list is also closed. + * + * Return: Non-zero if cleanup actions were performed; zero otherwise. + * + * Programmer: Albert Cheng + * May 28, 1998 + * + *------------------------------------------------------------------------- + */ +int +h5_cleanup(const char *base_name[], hid_t fapl) +{ + int retval = 0; + + if(GetTestCleanup()) { + /* Clean up files in base_name, and the FAPL */ + h5_clean_files(base_name, fapl); retval = 1; } /* end if */ - H5Pclose(fapl); + /* Restore the original error reporting routine */ + h5_restore_err(); + return retval; +} /* end h5_cleanup() */ + + +/*------------------------------------------------------------------------- + * Function: h5_restore_err + * + * Purpose: Restore the default error handler. + * + * Return: N/A + * + * Programmer: Quincey Koziol + * Sept 10, 2015 + * + *------------------------------------------------------------------------- + */ +void +h5_restore_err(void) +{ + /* Restore the original error reporting routine */ + HDassert(err_func != NULL); + H5Eset_auto2(H5E_DEFAULT, err_func, NULL); + err_func = NULL; } @@ -212,6 +368,10 @@ h5_reset(void) HDfflush(stdout); HDfflush(stderr); H5close(); + + /* Save current error stack reporting routine and redirect to our local one */ + HDassert(err_func == NULL); + H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); /* @@ -233,12 +393,12 @@ h5_reset(void) */ sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); H5E_BEGIN_TRY { - hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(grp); - H5Fclose(file); - HDunlink(filename); + hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(grp); + H5Fclose(file); + HDunlink(filename); } H5E_END_TRY; } #endif /* OLD_WAY */ @@ -528,30 +688,27 @@ h5_rmprefix(const char *filename) const char *ret_ptr; if ((ret_ptr = HDstrstr(filename, ":")) == NULL) - ret_ptr = filename; + ret_ptr = filename; else - ret_ptr++; + ret_ptr++; return(ret_ptr); } /*------------------------------------------------------------------------- - * Function: h5_fileaccess - * - * Purpose: Returns a file access template which is the default template - * but with a file driver set according to the constant or - * environment variable HDF5_DRIVER + * Function: h5_fileaccess * - * Return: Success: A file access property list + * Purpose: Returns a file access template which is the default template + * but with a file driver set according to the constant or + * environment variable HDF5_DRIVER * - * Failure: -1 + * Return: Success: A file access property list + * Failure: -1 * * Programmer: Robb Matzke * Thursday, November 19, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -559,50 +716,61 @@ h5_fileaccess(void) { const char *val = NULL; const char *name; - char s[1024]; - hid_t fapl = -1; + char s[1024]; + hid_t fapl = -1; /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER - if (!val) + if(!val) val = HDF5_DRIVER; #endif - if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) return -1; - if (!val || !*val) - return fapl; /*use default*/ + if(!val || !*val) + return fapl; /* use default */ HDstrncpy(s, val, sizeof s); s[sizeof(s)-1] = '\0'; - if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl; + if(NULL == (name = HDstrtok(s, " \t\n\r"))) + return fapl; - if (!HDstrcmp(name, "sec2")) { + if(!HDstrcmp(name, "sec2")) { /* Unix read() and write() system calls */ - if (H5Pset_fapl_sec2(fapl)<0) return -1; - } else if (!HDstrcmp(name, "stdio")) { + if (H5Pset_fapl_sec2(fapl) < 0) + return -1; + } + else if(!HDstrcmp(name, "stdio")) { /* Standard C fread() and fwrite() system calls */ - if (H5Pset_fapl_stdio(fapl)<0) return -1; - } else if (!HDstrcmp(name, "core")) { + if (H5Pset_fapl_stdio(fapl) < 0) + return -1; + } + else if(!HDstrcmp(name, "core")) { /* In-memory driver settings (backing store on, 1 MB increment) */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; - } else if (!HDstrcmp(name, "core_paged")) { + if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) + return -1; + } + else if(!HDstrcmp(name, "core_paged")) { /* In-memory driver with write tracking and paging on */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; - if (H5Pset_core_write_tracking(fapl, TRUE, (size_t)524288)<0) return -1; - } else if (!HDstrcmp(name, "split")) { + if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) + return -1; + if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0) + return -1; + } + else if(!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ - if (H5Pset_fapl_split(fapl, + if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, - "-r.h5", H5P_DEFAULT)<0) + "-r.h5", H5P_DEFAULT) < 0) return -1; - } else if (!HDstrcmp(name, "multi")) { + } + else if(!HDstrcmp(name, "multi")) { /* Multi-file driver, general case of the split driver */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][1024]; + char *sv[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; H5FD_mem_t mt; @@ -613,45 +781,52 @@ h5_fileaccess(void) HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { - memb_fapl[mt] = H5P_DEFAULT; - sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + memb_fapl[mt] = H5P_DEFAULT; + if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN))) + return -1; + HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } /* end for */ - if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, - memb_addr, FALSE)<0) { + if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) return -1; - } - } else if (!HDstrcmp(name, "family")) { + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + HDfree(sv[mt]); + } + else if(!HDstrcmp(name, "family")) { hsize_t fam_size = 100*1024*1024; /*100 MB*/ /* Family of files, each 1MB and using the default driver */ - if ((val=HDstrtok(NULL, " \t\n\r"))) + if((val = HDstrtok(NULL, " \t\n\r"))) fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); - if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) + if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1; - } else if (!HDstrcmp(name, "log")) { + } + else if(!HDstrcmp(name, "log")) { unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; /* Log file access */ - if ((val = HDstrtok(NULL, " \t\n\r"))) + if((val = HDstrtok(NULL, " \t\n\r"))) log_flags = (unsigned)HDstrtol(val, NULL, 0); - - if (H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) + if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) return -1; - } else if (!HDstrcmp(name, "direct")) { + } + else if(!HDstrcmp(name, "direct")) { #ifdef H5_HAVE_DIRECT /* Linux direct read() and write() system calls. Set memory boundary, file block size, * and copy buffer size to the default values. */ - if (H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0) + if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0) return -1; #endif - } else if(!HDstrcmp(name, "latest")) { + } + else if(!HDstrcmp(name, "latest")) { /* use the latest format */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; - } else { + } + else { /* Unknown driver */ return -1; } @@ -1180,8 +1355,6 @@ getenv_all(MPI_Comm comm, int root, const char* name) * Programmer: Larry Knox * Monday, October 13, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1189,24 +1362,44 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - char buf[READ_BUF_SIZE]; /* Buffer for copying data */ - const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ + void *buf = NULL; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */ + + /* Allocate copy buffer */ + if(NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE))) + goto error; /* Copy old file into temporary file */ - if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1; - if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) - < 0) return -1; + if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) + goto error; + if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) + goto error; /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) - HDwrite(fd_new, buf, (size_t)nread); - + if(HDwrite(fd_new, buf, (size_t)nread) < 0) + goto error; + /* Close files */ - if(HDclose(fd_old) < 0) return -1; - if(HDclose(fd_new) < 0) return -1; + if(HDclose(fd_old) < 0) + goto error; + if(HDclose(fd_new) < 0) + goto error; + + /* Release memory */ + HDfree(buf); return 0; -} + +error: + /* ignore return values since we're already noted the problem */ + if(fd_old > 0) + HDclose(fd_old); + if(fd_new > 0) + HDclose(fd_new); + HDfree(buf); + return -1; +} /* end h5_make_local_copy() */ /*------------------------------------------------------------------------- diff --git a/test/h5test.h b/test/h5test.h index 19524a9..065c089 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -61,18 +61,18 @@ /* Should be used internally by the libtest.a only. */ #define HDGetTestVerbosity() (TestVerbosity) -#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) -#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) -#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) -#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) -#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) +#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) +#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) +#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) +#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) +#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) /* * Test controls definitions. */ -#define SKIPTEST 1 /* Skip this test */ -#define ONLYTEST 2 /* Do only this test */ -#define BEGINTEST 3 /* Skip all tests before this test */ +#define SKIPTEST 1 /* Skip this test */ +#define ONLYTEST 2 /* Do only this test */ +#define BEGINTEST 3 /* Skip all tests before this test */ /* * This contains the filename prefix specificied as command line option for @@ -86,8 +86,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Print the current location on the standard output stream. */ -#define AT() printf (" at %s:%d in %s()...\n", \ - __FILE__, __LINE__, FUNC); +#define AT() printf (" at %s:%d in %s()...\n", \ + __FILE__, __LINE__, FUNC); /* * The name of the test is printed by saying TESTING("something") which will @@ -98,12 +98,13 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * spaces. If the h5_errors() is used for automatic error handling then * the H5_FAILED() macro is invoked automatically when an API function fails. */ -#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} -#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} -#define PASSED() {puts(" PASSED");fflush(stdout);} -#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} -#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} -#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} +#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} +#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} +#define PASSED() {puts(" PASSED");fflush(stdout);} +#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} +#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} +#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} +#define PUTS_ERROR(s) {puts(s); AT(); goto error;} #define TEST_ERROR {H5_FAILED(); AT(); goto error;} #define STACK_ERROR {H5Eprint2(H5E_DEFAULT, stdout); goto error;} #define FAIL_STACK_ERROR {H5_FAILED(); AT(); H5Eprint2(H5E_DEFAULT, stdout); \ @@ -113,9 +114,9 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Alarm definitions to wait up (terminate) a test that runs too long. */ -#define H5_ALARM_SEC 1200 /* default is 20 minutes */ -#define ALARM_ON TestAlarmOn() -#define ALARM_OFF HDalarm(0) +#define H5_ALARM_SEC 1200 /* default is 20 minutes */ +#define ALARM_ON TestAlarmOn() +#define ALARM_OFF HDalarm(0) /* * The methods to compare the equality of floating-point values: @@ -140,13 +141,16 @@ extern "C" { #endif /* Generally useful testing routines */ +H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl); H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); +H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); +H5TEST_DLL void h5_restore_err(void); H5TEST_DLL void h5_show_hostname(void); H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); @@ -156,13 +160,14 @@ H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), - void (*Cleanup) (void), const char *TheDescr, - const void *Parameters); + void (*Cleanup) (void), const char *TheDescr, + const void *Parameters); H5TEST_DLL void TestInfo(const char *ProgName); H5TEST_DLL void TestParseCmdLine(int argc, char *argv[]); H5TEST_DLL void PerformTests(void); H5TEST_DLL void TestSummary(void); H5TEST_DLL void TestCleanup(void); +H5TEST_DLL void TestShutdown(void); H5TEST_DLL void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[])); H5TEST_DLL int GetTestVerbosity(void); H5TEST_DLL int SetTestVerbosity(int newval); diff --git a/test/mf.c b/test/mf.c index a252c2d..eb58beb 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6246,6 +6246,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* Make a copy of the FAPL before adjusting the alignment */ diff --git a/test/plugin.c b/test/plugin.c index 28c7c30..f0c0dd0 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -12,13 +12,11 @@ * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 + * Programmer: Raymond Lu + * 13 February 2013 * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) */ -#include -#include #include "h5test.h" #include "H5srcdir.h" @@ -31,7 +29,7 @@ /* Filters for HDF5 internal test */ #define H5Z_FILTER_DYNLIB1 257 -#define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIB2 258 #define H5Z_FILTER_DYNLIB3 259 #define H5Z_FILTER_DYNLIB4 260 @@ -42,8 +40,8 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 /* Dataset names for testing filters */ -#define DSET_DEFLATE_NAME "deflate" -#define DSET_DYNLIB1_NAME "dynlib1" +#define DSET_DEFLATE_NAME "deflate" +#define DSET_DYNLIB1_NAME "dynlib1" #define DSET_DYNLIB2_NAME "dynlib2" #define DSET_DYNLIB4_NAME "dynlib4" @@ -64,7 +62,7 @@ const char *FILENAME[] = { #define GROUP_ITERATION 1000 -int points_deflate[DSET_DIM1][DSET_DIM2], +int points_deflate[DSET_DIM1][DSET_DIM2], points_dynlib1[DSET_DIM1][DSET_DIM2], points_dynlib2[DSET_DIM1][DSET_DIM2], points_dynlib4[DSET_DIM1][DSET_DIM2], @@ -72,14 +70,14 @@ int points_deflate[DSET_DIM1][DSET_DIM2], /*------------------------------------------------------------------------- - * Function: test_filter_internal + * Function: test_filter_internal * - * Purpose: Tests writing entire data and partial data with filters + * Purpose: Tests writing entire data and partial data with filters * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 27 February 2013 * *------------------------------------------------------------------------- @@ -87,28 +85,28 @@ int points_deflate[DSET_DIM1][DSET_DIM2], static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl) { - hid_t dataset; /* Dataset ID */ - hid_t dxpl; /* Dataset xfer property list ID */ - hid_t write_dxpl; /* Dataset xfer property list ID for writing */ - hid_t sid; /* Dataspace ID */ - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ - const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ - const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ - void *tconv_buf = NULL; /* Temporary conversion buffer */ - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - size_t i, j; /* Local index variables */ + hid_t dataset; /* Dataset ID */ + hid_t dxpl; /* Dataset xfer property list ID */ + hid_t write_dxpl; /* Dataset xfer property list ID for writing */ + hid_t sid; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ int n = 0; /* Create the data space */ - if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; + if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR /* * Create a small conversion buffer to test strip mining. We * might as well test all we can! */ - if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR tconv_buf = HDmalloc((size_t)1000); - if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; TESTING(" filters (setup)"); @@ -117,12 +115,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); printf(" Line %d: Incorrect filter availability\n",__LINE__); - goto error; + TEST_ERROR } /* end if */ /* Create the dataset */ if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, - dcpl, H5P_DEFAULT)) < 0) goto error; + dcpl, H5P_DEFAULT)) < 0) TEST_ERROR PASSED(); @@ -133,18 +131,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (uninitialized read)"); if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + TEST_ERROR; for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(0!=check[i][j]) { - H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } - } + for(j=0; j<(size_t)size[1]; j++) { + if(0!=check[i][j]) { + H5_FAILED(); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + TEST_ERROR + } + } } PASSED(); @@ -157,13 +155,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) n = 0; for(i=0; i 0; i--) { + if (H5PLremove(i-1) < 0) { + fprintf(stderr," at %d: %s\n", i, pathname); + TEST_ERROR + } + } + /* Verify the table is empty */ + if (H5PLsize() > 0) TEST_ERROR + PASSED(); + + TESTING(" remove (exceed)"); + /* Exceed the min path removal */ + H5E_BEGIN_TRY { + ret = H5PLremove(0); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR + PASSED(); + + TESTING(" append"); + /* Create multiple paths to fill table */ + for (i=0; i < 16; i++) { + sprintf(pathname, "a_path_%d", i); + if (H5PLappend(pathname) < 0) { + fprintf(stderr," at %d: %s\n", i, pathname); + TEST_ERROR + } + } + /* Verify the table is full */ + if (H5PLsize() != 16) TEST_ERROR + PASSED(); + TESTING(" append (exceed)"); + /* Exceed the max path append */ + H5E_BEGIN_TRY { + sprintf(pathname, "a_path_%d", 16); + ret = H5PLappend(pathname); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR PASSED(); + TESTING(" remove (verify for prepend)"); + /* Remove one path*/ + if (H5PLremove(8) < 0) TEST_ERROR + + /* Verify that the entries were moved */ + sprintf(pathname, "%s", H5PLget(8)); + if (strcmp(pathname, "a_path_9") != 0) { + fprintf(stderr," get 8: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is not full */ + if (H5PLsize() != 15) TEST_ERROR + + TESTING(" prepend"); + /* Prepend one path*/ + sprintf(pathname, "a_path_%d", 17); + if (H5PLprepend(pathname) < 0) { + fprintf(stderr," prepend 17: %s\n", pathname); + TEST_ERROR + } + + /* Verify the table is full */ + if (H5PLsize() != 16) TEST_ERROR + + /* Verify that the entries were moved */ + sprintf(pathname, "%s", H5PLget(8)); + if (strcmp(pathname, "a_path_7") != 0) { + fprintf(stderr," get 8: %s\n", pathname); + TEST_ERROR + } + sprintf(pathname, "%s", H5PLget(0)); + if (strcmp(pathname, "a_path_17") != 0) { + fprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" prepend (exceed)"); + /* Exceed the max path prepend */ + H5E_BEGIN_TRY { + sprintf(pathname, "a_path_%d", 18); + ret = H5PLprepend(pathname); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR + PASSED(); + + TESTING(" replace"); + /* Replace one path*/ + sprintf(pathname, "a_path_%d", 20); + if (H5PLput(pathname, 1) < 0) { + fprintf(stderr," replace 1: %s\n", pathname); + TEST_ERROR + } + + /* Verify the table is full */ + if (H5PLsize() != 16) TEST_ERROR + + /* Verify that the entries were not moved */ + sprintf(pathname, "%s", H5PLget(0)); + if (strcmp(pathname, "a_path_17") != 0) { + fprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + sprintf(pathname, "%s", H5PLget(2)); + if (strcmp(pathname, "a_path_1") != 0) { + fprintf(stderr," get 2: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" remove (verify for insert)"); + /* Remove one path*/ + if (H5PLremove(4) < 0) TEST_ERROR + + /* Verify that the entries were moved */ + sprintf(pathname, "%s", H5PLget(4)); + if (strcmp(pathname, "a_path_4") != 0) { + fprintf(stderr," get 4: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is not full */ + if (H5PLsize() != 15) TEST_ERROR + + TESTING(" insert"); + /* Insert one path*/ + sprintf(pathname, "a_path_%d", 21); + if (H5PLinsert(pathname, 3) < 0){ + fprintf(stderr," insert 3: %s\n", pathname); + TEST_ERROR + } + + /* Verify that the entries were moved */ + sprintf(pathname, "%s", H5PLget(4)); + if (strcmp(pathname, "a_path_2") != 0){ + fprintf(stderr," get 4: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + /* Verify the table is full */ + if (H5PLsize() != 16) TEST_ERROR + + TESTING(" insert (exceed)"); + /* Exceed the max path insert */ + H5E_BEGIN_TRY { + sprintf(pathname, "a_path_%d", 22); + ret = H5PLinsert(pathname, 12); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR + + PASSED (); + return 0; error: @@ -731,30 +918,30 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests the plugin module (H5PL) + * Purpose: Tests the plugin module (H5PL) * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(1) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Raymond Lu - * 14 March 2013 + * Programmer: Raymond Lu + * 14 March 2013 * *------------------------------------------------------------------------- */ int main(void) { - char filename[FILENAME_BUF_SIZE]; - hid_t file, fapl, fapl2; - hbool_t new_format; + char filename[FILENAME_BUF_SIZE]; + hid_t file, fapl, fapl2; + unsigned new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; double rdcc_w0; - int nerrors = 0; + int nerrors = 0; /* Testing setup */ h5_reset(); @@ -762,10 +949,10 @@ main(void) /* Turn off the chunk cache, so all the chunks are immediately written to disk */ if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) - TEST_ERROR + TEST_ERROR rdcc_nbytes = 0; if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) - TEST_ERROR + TEST_ERROR /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -791,22 +978,25 @@ main(void) /* Create the file for this test */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ - nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); + nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); /* Test dynamically loaded filters for groups */ nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); if(H5Fclose(file) < 0) - TEST_ERROR + TEST_ERROR } /* end for */ /* Close FAPL */ if(H5Pclose(fapl2) < 0) TEST_ERROR if(H5Pclose(fapl) < 0) TEST_ERROR - + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + puts("\nTesting reading data with with dynamic plugin filters:"); /* Close the library so that all loaded plugin libraries are unloaded */ @@ -815,13 +1005,16 @@ main(void) /* Reopen the file for testing data reading */ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + TEST_ERROR /* Read the data with filters */ - nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); /* Open the groups with filters */ - nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); @@ -835,10 +1028,13 @@ main(void) nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); if(H5Fclose(file) < 0) - TEST_ERROR + TEST_ERROR + + /* Test the APIs for access to the filter plugin path table */ + nerrors += (test_filter_path_apis() < 0 ? 1 : 0); if(nerrors) - TEST_ERROR + TEST_ERROR printf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); diff --git a/test/set_extent.c b/test/set_extent.c index f6c3766..5df649c 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -20,9 +20,6 @@ * Purpose: Tests the H5Dset_extent call */ -#include -#include -#include "hdf5.h" #include "h5test.h" /*------------------------------------------------------------------------- diff --git a/test/vfd.c b/test/vfd.c index 4ece2ba..94c0a5c 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -80,9 +80,9 @@ const char *FILENAME[] = { static herr_t test_sec2(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; + hid_t file = -1; /* file ID */ + hid_t fapl = -1; /* file access property list ID */ + hid_t access_fapl = -1; char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -90,7 +90,8 @@ test_sec2(void) TESTING("SEC2 file driver"); /* Set property list and file name for SEC2 driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_sec2(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -125,11 +126,12 @@ test_sec2(void) */ if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + h5_delete_test_file(FILENAME[0], fapl); - if(H5Fclose(file) < 0) + /* Close the fapl */ + if(H5Pclose(fapl) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -184,7 +186,8 @@ test_direct(void) /* Set property list and file name for Direct driver. Set memory alignment boundary * and file block size to 512 which is the minimum for Linux 2.6. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0) TEST_ERROR; h5_fixname(FILENAME[5], fapl, filename, sizeof filename); @@ -333,7 +336,12 @@ test_direct(void) HDassert(check); HDfree(check); - h5_cleanup(FILENAME, fapl); + h5_delete_test_file(FILENAME[1], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; + PASSED(); return 0; @@ -387,7 +395,8 @@ test_core(void) TESTING("CORE file driver"); /* Set property list and file name for CORE driver */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR; if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0) @@ -558,14 +567,19 @@ test_core(void) TEST_ERROR; if(H5Dclose(dset1) < 0) TEST_ERROR; - if(H5Fclose(file) < 0) - TEST_ERROR; HDassert(points); HDfree(points); HDassert(check); HDfree(check); - h5_cleanup(FILENAME, fapl); + /* Close and delete the file */ + if(H5Fclose(file) < 0) + TEST_ERROR; + h5_delete_test_file(FILENAME[5], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; PASSED(); return 0; @@ -602,7 +616,7 @@ error: static herr_t test_family_opens(char *fname, hid_t fa_pl) { - hid_t file; + hid_t file=-1; char first_name[1024]; char wrong_name[1024]; int i; @@ -673,7 +687,7 @@ error: static herr_t test_family(void) { - hid_t file=(-1), fapl, fapl2=(-1), space=(-1), dset=(-1); + hid_t file=-1, fapl=-1, fapl2=-1, space=-1, dset=-1; hid_t access_fapl = -1; char filename[1024]; char dname[]="dataset"; @@ -686,11 +700,11 @@ test_family(void) TESTING("FAMILY file driver"); /* Set property list and file name for FAMILY driver */ - fapl = h5_fileaccess(); - + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; - h5_fixname(FILENAME[2], fapl, filename, sizeof filename); + h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -797,10 +811,15 @@ test_family(void) if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[2], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -808,7 +827,8 @@ error: H5E_BEGIN_TRY { H5Sclose(space); H5Dclose(dset); - H5Pclose (fapl2); + H5Pclose(fapl); + H5Pclose(fapl2); H5Fclose(file); } H5E_END_TRY; return -1; @@ -836,8 +856,8 @@ error: static herr_t test_family_compat(void) { - hid_t file = (-1), fapl; - hid_t dset; + hid_t file = -1, fapl = -1; + hid_t dset = -1; char dname[]="dataset"; char filename[1024]; char pathname[1024], pathname_individual[1024]; @@ -847,13 +867,13 @@ test_family_compat(void) TESTING("FAMILY file driver backward compatibility"); /* Set property list and file name for FAMILY driver */ - fapl = h5_fileaccess(); - + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT) < 0) TEST_ERROR; - h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename); - h5_fixname(FILENAME[3], fapl, newname, sizeof newname); + h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof(filename)); + h5_fixname(FILENAME[3], fapl, newname, sizeof(newname)); pathname[0] = '\0'; HDstrcat(pathname, filename); @@ -869,7 +889,7 @@ test_family_compat(void) counter++; HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); - } + } /* end while */ /* Make sure we can open the file. Use the read and write mode to flush the * superblock. */ @@ -895,10 +915,14 @@ test_family_compat(void) if(H5Dclose(dset) < 0) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[3], fapl); - h5_cleanup(FILENAME, fapl); + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; PASSED(); @@ -931,7 +955,7 @@ error: static herr_t test_multi_opens(char *fname) { - hid_t file; + hid_t file=-1; char super_name[1024]; /*name string "%%s-s.h5"*/ char sf_name[1024]; /*name string "multi_file-s.h5"*/ @@ -963,8 +987,8 @@ test_multi_opens(char *fname) static herr_t test_multi(void) { - hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); - hid_t root, attr, aspace, atype; + hid_t file=-1, fapl=-1, fapl2=-1, dset=-1, space=-1; + hid_t root=-1, attr=-1, aspace=-1, atype=-1; hid_t access_fapl = -1; char filename[1024]; int *fhandle2=NULL, *fhandle=NULL; @@ -982,14 +1006,16 @@ test_multi(void) int buf[MULTI_SIZE][MULTI_SIZE]; TESTING("MULTI file driver"); + /* Set file access property list for MULTI driver */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); - HDmemset(sv, 0, sizeof sv); + HDmemset(memb_map, 0, sizeof(memb_map)); + HDmemset(memb_fapl, 0, sizeof(memb_fapl)); + HDmemset(memb_name, 0, sizeof(memb_name)); + HDmemset(memb_addr, 0, sizeof(memb_addr)); + HDmemset(sv, 0, sizeof(sv)); for(mt=H5FD_MEM_DEFAULT; mt 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[6], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1429,7 +1472,8 @@ test_stdio(void) TESTING("STDIO file driver"); /* Set property list and file name for STDIO driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_stdio(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[7], fapl, filename, sizeof filename); @@ -1465,10 +1509,15 @@ test_stdio(void) if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[7], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -1519,7 +1568,8 @@ test_windows(void) #else /* H5_HAVE_WINDOWS */ /* Set property list and file name for WINDOWS driver. */ - fapl = h5_fileaccess(); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; if(H5Pset_fapl_windows(fapl) < 0) TEST_ERROR; h5_fixname(FILENAME[8], fapl, filename, sizeof filename); @@ -1555,10 +1605,15 @@ test_windows(void) if(file_size < 1 * KB || file_size > 4 * KB) TEST_ERROR; + /* Close and delete the file */ if(H5Fclose(file) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[8], fapl); + + /* Close the fapl */ + if(H5Pclose(fapl) < 0) + TEST_ERROR; - h5_cleanup(FILENAME, fapl); PASSED(); return 0; diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index c88e3e8..5655bb0 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -53,6 +53,6 @@ set (H5P_TESTS foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -endforeach (testp ${H5P_TESTS}) +endforeach () include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 86eaa03..7dce6d6 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -36,7 +36,7 @@ if (HDF5_TEST_VFD) set (VFD_LIST ${VFD_LIST} direct) endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) foreach (test ${H5P_VFD_TESTS}) add_test ( @@ -52,7 +52,7 @@ if (HDF5_TEST_VFD) ) endforeach () endif () - ENDMACRO () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 7bd2f58..814fd22 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -1236,7 +1236,7 @@ finish: /* turn off alarm */ ALARM_OFF; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index 3b46afd..42cb6c4 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -201,8 +201,8 @@ main(int argc, char* argv[]) H5Eset_auto2(H5E_DEFAULT, func, NULL); - h5_cleanup(&FILENAME[0], fapl1); - h5_cleanup(&FILENAME[1], fapl2); + h5_clean_files(&FILENAME[0], fapl1); + h5_clean_files(&FILENAME[1], fapl2); } else { diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 9088470..48b0569 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -5123,7 +5123,7 @@ int main(int argc, char **argv) TestSummary(); /* Clean up test files */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); nerrors += GetTestNumErrs(); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index eaa9eb1..8ee8f3e 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -565,7 +565,7 @@ int main(int argc, char **argv) TestSummary(); /* Clean up test files */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); nerrors += GetTestNumErrs(); diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index c429377..6e230e4 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -36,7 +36,7 @@ # # Perform h5copy according to passing parmeters # - MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -70,9 +70,9 @@ set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -106,18 +106,18 @@ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_SKIP_H5_TEST testname skipresultfile) + macro (ADD_SKIP_H5_TEST testname skipresultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY-${testname}-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -156,9 +156,9 @@ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -197,13 +197,13 @@ set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () - ENDMACRO () + endmacro () # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) + macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) @@ -235,7 +235,7 @@ ) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index b5965ba..5371a21 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -23,7 +23,7 @@ #define PROGRAMNAME "h5copy" /* command-line options: short and long-named parameters */ -static const char *s_opts = "d:f:hi:o:ps:vV"; +static const char *s_opts = "d:f:hi:o:ps:vVE"; static struct long_options l_opts[] = { { "destination", require_arg, 'd' }, { "flag", require_arg, 'f' }, @@ -34,6 +34,7 @@ static struct long_options l_opts[] = { { "source", require_arg, 's' }, { "verbose", no_arg, 'v' }, { "version", no_arg, 'V' }, + { "enable-error-stack", no_arg, 'E' }, { NULL, 0, '\0' } }; char *fname_src = NULL; @@ -91,43 +92,44 @@ leave(int ret) static void usage (void) { - HDfprintf(stdout, "\ -usage: h5copy [OPTIONS] [OBJECTS...]\n\ - OBJECTS\n\ - -i, --input input file name\n\ - -o, --output output file name\n\ - -s, --source source object name\n\ - -d, --destination destination object name\n\ - OPTIONS\n\ - -h, --help Print a usage message and exit\n\ - -p, --parents No error if existing, make parent groups as needed\n\ - -v, --verbose Print information about OBJECTS and OPTIONS\n\ - -V, --version Print version number and exit\n\ - -f, --flag Flag type\n\n\ - Flag type is one of the following strings:\n\n\ - shallow Copy only immediate members for groups\n\n\ - soft Expand soft links into new objects\n\n\ - ext Expand external links into new objects\n\n\ - ref Copy references and any referenced objects, i.e., objects\n\ - that the references point to.\n\ - Referenced objects are copied in addition to the objects\n\ - specified on the command line and reference datasets are\n\ - populated with correct reference values. Copies of referenced\n\ - datasets outside the copy range specified on the command line\n\ - will normally have a different name from the original.\n\ - (Default:Without this option, reference value(s) in any\n\ - reference datasets are set to NULL and referenced objects are\n\ - not copied unless they are otherwise within the copy range\n\ - specified on the command line.)\n\n\ - noattr Copy object without copying attributes\n\n\ - allflags Switches all flags from the default to the non-default setting\n\n\ - These flag types correspond to the following API symbols\n\n\ - H5O_COPY_SHALLOW_HIERARCHY_FLAG\n\ - H5O_COPY_EXPAND_SOFT_LINK_FLAG\n\ - H5O_COPY_EXPAND_EXT_LINK_FLAG\n\ - H5O_COPY_EXPAND_REFERENCE_FLAG\n\ - H5O_COPY_WITHOUT_ATTR_FLAG\n\ - H5O_COPY_ALL\n"); + FLUSHSTREAM(rawoutstream); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, "usage: h5copy [OPTIONS] [OBJECTS...]\n"); + PRINTVALSTREAM(rawoutstream, " OBJECTS\n"); + PRINTVALSTREAM(rawoutstream, " -i, --input input file name\n"); + PRINTVALSTREAM(rawoutstream, " -o, --output output file name\n"); + PRINTVALSTREAM(rawoutstream, " -s, --source source object name\n"); + PRINTVALSTREAM(rawoutstream, " -d, --destination destination object name\n"); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); + PRINTVALSTREAM(rawoutstream, " -p, --parents No error if existing, make parent groups as needed\n"); + PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " -f, --flag Flag type\n\n"); + PRINTVALSTREAM(rawoutstream, " Flag type is one of the following strings:\n\n"); + PRINTVALSTREAM(rawoutstream, " shallow Copy only immediate members for groups\n\n"); + PRINTVALSTREAM(rawoutstream, " soft Expand soft links into new objects\n\n"); + PRINTVALSTREAM(rawoutstream, " ext Expand external links into new objects\n\n"); + PRINTVALSTREAM(rawoutstream, " ref Copy references and any referenced objects, i.e., objects\n"); + PRINTVALSTREAM(rawoutstream, " that the references point to.\n"); + PRINTVALSTREAM(rawoutstream, " Referenced objects are copied in addition to the objects\n"); + PRINTVALSTREAM(rawoutstream, " specified on the command line and reference datasets are\n"); + PRINTVALSTREAM(rawoutstream, " populated with correct reference values. Copies of referenced\n"); + PRINTVALSTREAM(rawoutstream, " datasets outside the copy range specified on the command line\n"); + PRINTVALSTREAM(rawoutstream, " will normally have a different name from the original.\n"); + PRINTVALSTREAM(rawoutstream, " (Default:Without this option, reference value(s) in any\n"); + PRINTVALSTREAM(rawoutstream, " reference datasets are set to NULL and referenced objects are\n"); + PRINTVALSTREAM(rawoutstream, " not copied unless they are otherwise within the copy range\n"); + PRINTVALSTREAM(rawoutstream, " specified on the command line.)\n\n"); + PRINTVALSTREAM(rawoutstream, " noattr Copy object without copying attributes\n\n"); + PRINTVALSTREAM(rawoutstream, " allflags Switches all flags from the default to the non-default setting\n\n"); + PRINTVALSTREAM(rawoutstream, " These flag types correspond to the following API symbols\n\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_SHALLOW_HIERARCHY_FLAG\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_EXPAND_SOFT_LINK_FLAG\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_EXPAND_EXT_LINK_FLAG\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_EXPAND_REFERENCE_FLAG\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_WITHOUT_ATTR_FLAG\n"); + PRINTVALSTREAM(rawoutstream, " H5O_COPY_ALL\n"); } @@ -215,6 +217,11 @@ static int parse_flag(const char* s_flag, unsigned *flag) int main (int argc, const char *argv[]) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + H5E_auto2_t func; + H5E_auto2_t tools_func; + void *edata; + void *tools_edata; hid_t fid_src = -1; hid_t fid_dst = -1; unsigned flag = 0; @@ -229,14 +236,22 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* initialize h5tools lib */ + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + + /* Initialize h5tools lib */ h5tools_init(); + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + /* init linkinfo struct */ HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); /* Check for no command line parameters */ - if(argc == 1) + if(argc == 1) { usage(); leave(EXIT_FAILURE); @@ -291,6 +306,10 @@ main (int argc, const char *argv[]) verbose = 1; break; + case 'E': + enable_error_stack = TRUE; + break; + default: usage(); leave(EXIT_FAILURE); @@ -329,6 +348,11 @@ main (int argc, const char *argv[]) leave(EXIT_FAILURE); } + if (enable_error_stack) { + H5Eset_auto2(H5E_DEFAULT, func, edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } + /*------------------------------------------------------------------------- * open output file *-------------------------------------------------------------------------*/ @@ -393,19 +417,19 @@ main (int argc, const char *argv[]) /* create property to pass copy options */ if ( (ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); /* set options for object copy */ if (flag) { if ( H5Pset_copy_object(ocpl_id, flag) < 0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_copy_object failed"); } /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { error_msg("Could not create link creation property list\n"); - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); } /* end if */ /* Check for creating intermediate groups */ @@ -413,7 +437,7 @@ main (int argc, const char *argv[]) /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, 1) < 0) { error_msg("Could not set property for creating parent groups\n"); - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_create_intermediate_group failed"); } /* end if */ /* Display some output if requested */ @@ -424,7 +448,7 @@ main (int argc, const char *argv[]) { size_t i, len; - len = HDstrlen(oname_dst); + len = HDstrlen(oname_dst); /* check if all the parents groups exist. skip root group */ for (i = 1; i < len; i++) @@ -440,7 +464,7 @@ main (int argc, const char *argv[]) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); HDfree(str_ptr); - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lexists failed"); } HDfree(str_ptr); } @@ -450,17 +474,17 @@ main (int argc, const char *argv[]) /*------------------------------------------------------------------------- * do the copy *-------------------------------------------------------------------------*/ - + if(verbose) linkinfo.opt.msg_mode = 1; - + li_ret = H5tools_get_symlink_info(fid_src, oname_src, &linkinfo, 1); if (li_ret == 0) /* dangling link */ { - if(H5Lcopy(fid_src, oname_src, + if(H5Lcopy(fid_src, oname_src, fid_dst, oname_dst, H5P_DEFAULT, H5P_DEFAULT) < 0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lcopy failed"); } else /* valid link */ { @@ -470,33 +494,33 @@ main (int argc, const char *argv[]) oname_dst, /* Name of the destination object */ ocpl_id, /* Object copy property list */ lcpl_id)<0) /* Link creation property list */ - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Ocopy failed"); } /* free link info path */ if (linkinfo.trg_path) - HDfree((char*)linkinfo.trg_path); + HDfree(linkinfo.trg_path); /* close propertis */ if(H5Pclose(ocpl_id)<0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pclose failed"); if(H5Pclose(lcpl_id)<0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pclose failed"); /* close files */ if (H5Fclose(fid_src)<0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Fclose failed"); if (H5Fclose(fid_dst)<0) - goto error; + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Fclose failed"); leave(EXIT_SUCCESS); -error: +done: printf("Error in copy...Exiting\n"); /* free link info path */ if (linkinfo.trg_path) - HDfree((char*)linkinfo.trg_path); + HDfree(linkinfo.trg_path); H5E_BEGIN_TRY { H5Pclose(ocpl_id); @@ -505,6 +529,6 @@ error: H5Fclose(fid_dst); } H5E_END_TRY; - leave(EXIT_FAILURE); + leave(ret_value); } diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index a371cc0..98335b8 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -249,16 +249,17 @@ void parse_command_line(int argc, usage(); h5diff_exit(EXIT_FAILURE); } - options->count = atol( opt_arg ); - + options->count = HDstrtoull(opt_arg, NULL, 0); break; case 'N': options->do_nans = 0; break; + case 'c': options->m_list_not_cmp = 1; break; + case 'e': options->use_system_epsilon = 1; break; diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index a916ec5..2b971f4 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -16,6 +16,7 @@ #include #include #include +#include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" #include "h5tools.h" @@ -138,6 +139,6 @@ int main(int argc, const char *argv[]) */ void h5diff_exit(int status) { - exit(status); + HDexit(status); } diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index fb3c253..422fc83 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -381,7 +381,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_HELP_TEST testname resultcode) + macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) @@ -403,9 +403,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -416,9 +416,9 @@ else () ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -449,9 +449,9 @@ ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_N resultfile resultcode) + macro (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) @@ -482,9 +482,9 @@ ) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) + macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) @@ -522,9 +522,9 @@ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) @@ -569,9 +569,9 @@ set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) + macro (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-output-${resultfile}-clear-objects @@ -593,9 +593,9 @@ set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_MASK_TEST resultfile resultcode) + macro (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -610,9 +610,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) + macro (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -628,9 +628,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -648,9 +648,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) + macro (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -678,9 +678,9 @@ set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -705,7 +705,7 @@ ) set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index c6bd78c..a36afc1 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -108,7 +108,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_PBITS_TEST resultfile resultcode) + macro (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -132,7 +132,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 6cdc81c..7fb9a3b 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -144,7 +144,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) + macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -155,9 +155,9 @@ else () ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_XML_H5_TEST resultfile resultcode) + macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") @@ -180,7 +180,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h index 08f9e36..2a8c9f6 100644 --- a/tools/h5dump/h5dump_extern.h +++ b/tools/h5dump/h5dump_extern.h @@ -52,7 +52,7 @@ typedef struct h5dump_table_list_t { extern h5dump_table_list_t table_list; extern table_t *group_table, *dset_table, *type_table; -extern int dump_indent; /*how far in to indent the line */ +extern unsigned dump_indent; /*how far in to indent the line */ extern int unamedtype; /* shared datatype with no name */ extern hbool_t hit_elink; /* whether we have traversed an external link */ @@ -73,7 +73,6 @@ extern int display_fi; /*file index */ extern int display_ai; /*array index */ extern int display_escape; /*escape non printable characters */ extern int display_region; /*print region reference data */ -extern int enable_error_stack; /* re-enable error stack */ extern int disable_compact_subset; /* disable compact form of subset notation */ extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ extern int include_attrs; /* Display attributes */ @@ -88,8 +87,8 @@ extern H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ extern unsigned long long packed_mask[PACKED_BITS_MAX]; /* packed bits are restricted to 8*sizeof(llong) bytes */ /* packed bits display parameters */ -extern int packed_offset[PACKED_BITS_MAX]; -extern int packed_length[PACKED_BITS_MAX]; +extern unsigned packed_offset[PACKED_BITS_MAX]; +extern unsigned packed_length[PACKED_BITS_MAX]; /* * The global table is set to either ddl_function_table or diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 8ad76e6..0b9f10f 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -156,7 +156,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -332,9 +332,8 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ H5Dclose(obj); goto done; } - else { + else found_obj->displayed = TRUE; - } } /* end if */ dump_function_table->dump_dataset_function(obj, name, NULL); @@ -755,7 +754,7 @@ xml_escape_the_string(const char *str, int slen) if (slen < 0) len = HDstrlen(str); else - len = slen; + len = (size_t)slen; extra = 0; @@ -877,7 +876,7 @@ xml_print_datatype(hid_t type, unsigned in_group) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -953,7 +952,6 @@ xml_print_datatype(hid_t type, unsigned in_group) } } else { - switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; @@ -1582,7 +1580,7 @@ xml_dump_datatype(hid_t type) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -1592,7 +1590,7 @@ xml_dump_datatype(hid_t type) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -1721,7 +1719,7 @@ xml_dump_dataspace(hid_t space) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -1731,7 +1729,7 @@ xml_dump_dataspace(hid_t space) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -1897,7 +1895,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, h5tool_format_t string_dataformat; HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; /* Print all the values. */ @@ -1911,7 +1909,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -1950,12 +1948,10 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, if (obj_data == DATASET_DATA) { type = H5Dget_type(obj_id); - if (H5Tget_class(type) == H5T_REFERENCE) { + if (H5Tget_class(type) == H5T_REFERENCE) status = xml_print_refs(obj_id, DATASET_DATA); - } - else if (H5Tget_class(type) == H5T_STRING) { + else if (H5Tget_class(type) == H5T_STRING) status = xml_print_strs(obj_id, DATASET_DATA); - } else { h5tools_context_t datactx; HDmemset(&datactx, 0, sizeof(datactx)); @@ -2095,7 +2091,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -2105,7 +2101,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -2425,7 +2421,7 @@ xml_dump_named_datatype(hid_t type, const char *name) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -2435,7 +2431,7 @@ xml_dump_named_datatype(hid_t type, const char *name) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -2650,7 +2646,7 @@ xml_dump_group(hid_t gid, const char *name) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -2660,7 +2656,7 @@ xml_dump_group(hid_t gid, const char *name) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -3011,9 +3007,8 @@ xml_print_refs(hid_t did, int source) goto error; e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); /* need to check result here */ - if (e < 0) { + if (e < 0) goto error; - } } else if (source == ATTRIBUTE_DATA) { space = H5Aget_space(did); @@ -3028,9 +3023,8 @@ xml_print_refs(hid_t did, int source) } e = H5Aread(did, H5T_STD_REF_OBJ, buf); /* need to check the result here */ - if (e < 0) { + if (e < 0) goto error; - } } refbuf = (hobj_ref_t *) buf; @@ -3039,7 +3033,7 @@ xml_print_refs(hid_t did, int source) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -3049,7 +3043,7 @@ xml_print_refs(hid_t did, int source) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -3140,20 +3134,16 @@ xml_print_strs(hid_t did, int source) h5tool_format_t string_dataformat; hsize_t curr_pos = 0; /* total data element position */ - if (source == DATASET_DATA) { + if (source == DATASET_DATA) type = H5Dget_type(did); - } - else if (source == ATTRIBUTE_DATA) { + else if (source == ATTRIBUTE_DATA) type = H5Aget_type(did); - } - else { + else /* return an error */ return FAIL; - } - if (H5Tget_class(type) != H5T_STRING) { + if (H5Tget_class(type) != H5T_STRING) /* return an error */ goto error; - } /* Check if we have VL data in the dataset's datatype */ is_vlstr = H5Tis_variable_str(type); @@ -3169,9 +3159,8 @@ xml_print_strs(hid_t did, int source) goto error; e = H5Dread(did, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - if (e < 0) { + if (e < 0) goto error; - } } else if (source == ATTRIBUTE_DATA) { space = H5Aget_space(did); @@ -3185,9 +3174,8 @@ xml_print_strs(hid_t did, int source) goto error; e = H5Aread(did, type, buf); - if (e < 0) { + if (e < 0) goto error; - } } bp = (char*) buf; @@ -3198,7 +3186,7 @@ xml_print_strs(hid_t did, int source) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -3208,7 +3196,7 @@ xml_print_strs(hid_t did, int source) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -3314,7 +3302,7 @@ check_filters(hid_t dcpl) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -3324,7 +3312,7 @@ check_filters(hid_t dcpl) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -3454,7 +3442,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -3464,7 +3452,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -3824,7 +3812,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; t_name = xml_escape_the_name(name); @@ -3838,7 +3826,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } @@ -4039,42 +4027,42 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s H5Pget_fill_time(dcpl, &ft); h5tools_str_append(&buffer, "FillTime=\""); switch (ft) { - case H5D_FILL_TIME_ALLOC: - h5tools_str_append(&buffer, "FillOnAlloc"); - break; - case H5D_FILL_TIME_NEVER: - h5tools_str_append(&buffer, "FillNever"); - break; - case H5D_FILL_TIME_IFSET: - h5tools_str_append(&buffer, "FillIfSet"); - break; + case H5D_FILL_TIME_ALLOC: + h5tools_str_append(&buffer, "FillOnAlloc"); + break; + case H5D_FILL_TIME_NEVER: + h5tools_str_append(&buffer, "FillNever"); + break; + case H5D_FILL_TIME_IFSET: + h5tools_str_append(&buffer, "FillIfSet"); + break; case H5D_FILL_TIME_ERROR: HDassert(0); /* fall through */ - default: - h5tools_str_append(&buffer, "?"); - break; + default: + h5tools_str_append(&buffer, "?"); + break; } /* end switch */ h5tools_str_append(&buffer, "\" "); H5Pget_alloc_time(dcpl, &at); h5tools_str_append(&buffer, "AllocationTime=\""); switch (at) { - case H5D_ALLOC_TIME_EARLY: - h5tools_str_append(&buffer, "Early"); - break; - case H5D_ALLOC_TIME_INCR: - h5tools_str_append(&buffer, "Incremental"); - break; - case H5D_ALLOC_TIME_LATE: - h5tools_str_append(&buffer, "Late"); - break; - case H5D_ALLOC_TIME_DEFAULT: + case H5D_ALLOC_TIME_EARLY: + h5tools_str_append(&buffer, "Early"); + break; + case H5D_ALLOC_TIME_INCR: + h5tools_str_append(&buffer, "Incremental"); + break; + case H5D_ALLOC_TIME_LATE: + h5tools_str_append(&buffer, "Late"); + break; + case H5D_ALLOC_TIME_DEFAULT: case H5D_ALLOC_TIME_ERROR: HDassert(0); /* fall through */ - default: - h5tools_str_append(&buffer, "?"); - break; + default: + h5tools_str_append(&buffer, "?"); + break; } /* end switch */ h5tools_str_append(&buffer, "\""); h5tools_str_append(&buffer, ">"); @@ -4418,7 +4406,7 @@ xml_print_enum(hid_t type) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); HDmemset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = dump_indent/COL; + ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; string_dataformat = *outputformat; @@ -4428,7 +4416,7 @@ xml_print_enum(hid_t type) string_dataformat.fmt_float = fp_format; } - if (h5tools_nCols==0) { + if (h5tools_nCols == 0) { string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 4e6e171..bfc5ef8 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -80,7 +80,7 @@ ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST testname importfile conffile testfile) + macro (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) @@ -126,9 +126,9 @@ ) set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_DUMPTEST testname datasetname testfile) + macro (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -194,16 +194,16 @@ ) set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) endif () - ENDMACRO () + endmacro () # -------------------------------------------------------------------- # Determine if filter is available for h5diff diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 9617df3..d1aab0c 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -1439,7 +1439,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #endif if (HDstrcmp("H5T_VARIABLE;", temp)) { char *more = temp; - ival = HDstrtol(more, &more, 10); + ival = (int)HDstrtol(more, &more, 10); if (getInputSize(in, ival) == -1) { (void) HDfprintf(stderr, err5b, infile); goto error; @@ -2279,13 +2279,13 @@ static int parseDimensions(struct Input *in, char *strm) HDstrncpy(temp, strm, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; in->sizeOfDimension[i++] - = HDstrtol(HDstrtok (temp, delimiter), NULL, BASE_10); + = HDstrtoull(HDstrtok (temp, delimiter), NULL, BASE_10); while (1) { token = HDstrtok (NULL, delimiter); if (token == NULL) break; - in->sizeOfDimension[i++] = HDstrtol(token, NULL, BASE_10); + in->sizeOfDimension[i++] = HDstrtoull(token, NULL, BASE_10); } return (0); } @@ -3121,7 +3121,7 @@ static int getRank(struct Input *in, FILE *strm) /* same as getChunkedDimensionSizes. But defined separately for extensibility */ static int getDimensionSizes(struct Input *in, FILE *strm) { - int ival; + unsigned long long ullval; int i = 0; const char *err1 = "Unable to allocate dynamic memory.\n"; @@ -3132,8 +3132,8 @@ static int getDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%d", (&ival)) == 1) - in->sizeOfDimension[i++] = ival; + while (fscanf(strm, "%llu", (&ullval)) == 1) + in->sizeOfDimension[i++] = ullval; if (in->rank != i) { (void) HDfprintf(stderr, "%s", err2); @@ -3144,7 +3144,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm) /* same as getDimensionSizes. But defined separately for extensibility */ static int getChunkedDimensionSizes(struct Input *in, FILE *strm) { - int ival; + unsigned long long ullval; int i = 0; const char *err1 = "Unable to allocate dynamic memory.\n"; @@ -3156,8 +3156,8 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%d", (&ival)) == 1) - in->sizeOfChunk[i++] = ival; + while (fscanf(strm, "%llu", (&ullval)) == 1) + in->sizeOfChunk[i++] = ullval; if (in->rank != i) { (void) HDfprintf(stderr, "%s", err2); @@ -3174,7 +3174,7 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm) static int getMaximumDimensionSizes(struct Input *in, FILE *strm) { - int ival; + long long llval; int i = 0; const char *err1 = "Unable to allocate dynamic memory.\n"; @@ -3186,11 +3186,11 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%d", (&ival)) == 1) { - if (ival == -1) + while (fscanf(strm, "%lld", (&llval)) == 1) { + if (llval == -1) in->maxsizeOfDimension[i++] = H5S_UNLIMITED; else - in->maxsizeOfDimension[i++] = ival; + in->maxsizeOfDimension[i++] = (hsize_t)llval; } if (in->rank != i) { @@ -3927,7 +3927,7 @@ static int process(struct Options *opt) return (-1); } HDfclose(extfile); - H5Pset_external(proplist, in->externFilename, (off_t) 0, numOfElements * in->inputSize / 8); + H5Pset_external(proplist, in->externFilename, (off_t)0, numOfElements * (hsize_t)in->inputSize / 8); } /* create dataspace */ diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index f82e0d6..c9ec521 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -40,7 +40,7 @@ # TEST_H5JAM_OUTPUT # For the purpose to verify only output & exitcode from h5jam # - MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) + macro (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) @@ -60,13 +60,13 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () # ============================================================ # TEST_H5UNJAM_OUTPUT # For the purpose to verify only output & exitcode from h5unjam # - MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) + macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) @@ -86,9 +86,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (CHECKFILE testname testdepends expected actual) + macro (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -118,9 +118,9 @@ ) set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) endif () - ENDMACRO() + endmacro() - MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) + macro (UNJAMTEST testname setfile infile ufile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects @@ -213,9 +213,9 @@ CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) endif () - ENDMACRO() + endmacro() - MACRO (JAMTEST testname jamfile infile chkfile outfile) + macro (JAMTEST testname jamfile infile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-clear-objects @@ -256,9 +256,9 @@ set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) endif () - ENDMACRO () + endmacro () - MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + macro (JAMTEST_NONE testname jamfile infile setfile chkfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}_NONE-clear-objects @@ -311,7 +311,7 @@ set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 776eaeb..4e02e6b 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -13,21 +13,14 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - -#ifdef H5_HAVE_UNISTD_H -#include -#endif - #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" -void parse_command_line (int argc, const char *argv[]); +void parse_command_line(int argc, const char *argv[]); /* Name of tool */ -#define PROGRAMNAME "getub" +#define PROGRAM_NAME "getub" char *nbytes = NULL; static const char *s_opts = "c:"; /* add more later ? */ @@ -42,19 +35,14 @@ static struct long_options l_opts[] = { * Purpose: Print the usage message * * Return: void - * - * Programmer: - * - * Modifications: - * *------------------------------------------------------------------------- */ static void usage (const char *prog) { - fflush (stdout); - fprintf (stdout, "usage: %s -c nb file] \n", prog); - fprintf (stdout, " print first 'nb' byts of file to stdoug.\n"); + HDfflush(stdout); + HDfprintf(stdout, "usage: %s -c nb file] \n", prog); + HDfprintf(stdout, " print first 'nb' byts of file to stdoug.\n"); } /*------------------------------------------------------------------------- @@ -65,112 +53,105 @@ usage (const char *prog) * Return: Success: * * Failure: Exits program with EXIT_FAILURE value. - * - * Programmer: - * - * Modifications: - * *------------------------------------------------------------------------- */ - void -parse_command_line (int argc, const char *argv[]) +parse_command_line(int argc, const char *argv[]) { - int opt; - - /* parse command line options */ - while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } - } - - if (argc <= opt_ind) - { + int opt; + + /* parse command line options */ + while((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { + switch((char) opt) { + case 'c': + nbytes = HDstrdup(opt_arg); + break; + case '?': + default: + usage(h5tools_getprogname()); + HDexit(EXIT_FAILURE); + } /* end switch */ + } /* end while */ + + if(argc <= opt_ind) { error_msg("missing file name\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } -} + usage(h5tools_getprogname()); + HDexit(EXIT_FAILURE); + } /* end if */ +} /* end parse_command_line() */ int -main (int argc, const char *argv[]) +main(int argc, const char *argv[]) { - int fd; - unsigned int size; - char *filename; - long res; - char *buf; - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* Initialize h5tools lib */ - h5tools_init(); - - parse_command_line (argc, argv); - - if (nbytes == NULL) - { - /* missing arg */ - error_msg("missing size\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } - if (argc <= (opt_ind)) - { - error_msg("missing file name\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } - filename = HDstrdup (argv[opt_ind]); - - size = 0; - res = sscanf (nbytes, "%u", &size); - if (res == EOF) - { + int fd = -1; + unsigned size; + char *filename = NULL; + long res; + char *buf = NULL; + + h5tools_setprogname(PROGRAM_NAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); + + parse_command_line(argc, argv); + + if(NULL == nbytes) { + /* missing arg */ + error_msg("missing size\n"); + usage(h5tools_getprogname()); + goto error; + } /* end if */ + + if(argc <= (opt_ind)) { + error_msg("missing file name\n"); + usage(h5tools_getprogname()); + goto error; + } /* end if */ + + filename = HDstrdup(argv[opt_ind]); + + size = 0; + if(EOF == (res = sscanf(nbytes, "%u", &size))) { /* fail */ error_msg("missing file name\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } - - fd = HDopen (filename, O_RDONLY, 0); - if (fd < 0) - { - error_msg("can't open file %s\n", filename); - exit (EXIT_FAILURE); - } - - buf = (char *)HDmalloc ((unsigned)(size + 1)); - if (buf == NULL) - { - HDclose (fd); - exit (EXIT_FAILURE); - } - - res = HDread (fd, buf, (unsigned)size); - - if (res < (long)size) - { - if (buf) - HDfree (buf); - HDclose (fd); - exit (EXIT_FAILURE); - } - - HDwrite (1, buf, (unsigned)size); - - if (buf) - HDfree (buf); - HDclose (fd); - return (EXIT_SUCCESS); -} + usage(h5tools_getprogname()); + goto error; + } /* end if */ + + if((fd = HDopen(filename, O_RDONLY, 0)) < 0) { + error_msg("can't open file %s\n", filename); + goto error; + } /* end if */ + + if(NULL == (buf = (char *)HDmalloc((unsigned)(size + 1)))) { + error_msg("can't allocate buffer \n"); + goto error; + } /* end if */ + + res = HDread(fd, buf, (unsigned)size); + if(res < (long)size) { + error_msg("Bad read \n"); + goto error; + } /* end if */ + + if(HDwrite(1, buf, (unsigned)size) < 0) { + error_msg("Bad write \n"); + goto error; + } /* end if */ + + /* close things and exit */ + HDfree(buf); + HDclose(fd); + + return EXIT_SUCCESS; + +error: + if(buf) + HDfree(buf); + if(fd > -1) + HDclose(fd); + return EXIT_FAILURE; +} /* end main() */ + diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index ab38f65..ad52553 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -421,109 +421,88 @@ main (int argc, const char *argv[]) * Return: Success: last byte written in the output. * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: - * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t -copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, +copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssize_t limit) { - char buf[1024]; - h5_stat_t sbuf; - int res; - ssize_t tot = 0; - ssize_t howmuch = 0; - ssize_t nchars = -1; -/* used in assertion check - ssize_t ncw = -1; -*/ - ssize_t to; - ssize_t from; - ssize_t toend; - ssize_t fromend; - - if(startin > startout) { - /* this case is prohibited */ - error_msg("copy_some_to_file: panic: startin > startout?\n"); - exit (EXIT_FAILURE); - } - - if(limit < 0) { - res = HDfstat(infid, &sbuf); - if(res < 0) { - error_msg("Can't stat file \n"); - exit (EXIT_FAILURE); - } - - howmuch = (ssize_t)sbuf.st_size; - } - else - howmuch = limit; - - if(howmuch == 0) - return 0; - - /* assert (howmuch > 0) */ - - toend = (ssize_t) startout + howmuch; - fromend = (ssize_t) startin + howmuch; - - if (howmuch > 512) - { - to = toend - 512; - from = fromend - 512; - } - else - { - to = toend - howmuch; - from = fromend - howmuch; - } - - while (howmuch > 0) - { - HDlseek (outfid, (off_t) to, SEEK_SET); - HDlseek (infid, (off_t) from, SEEK_SET); - - if (howmuch > 512) - { - nchars = HDread (infid, buf, (unsigned) 512); - } - else - { - nchars = HDread (infid, buf, (unsigned)howmuch); - } - - if (nchars <= 0) - { - printf ("huh? \n"); - exit (EXIT_FAILURE); - } - /*ncw = */ HDwrite (outfid, buf, (unsigned) nchars); - - /* assert (ncw == nchars) */ - - tot += nchars; - howmuch -= nchars; - if (howmuch > 512) - { - to -= nchars; - from -= nchars; - } - else - { - to -= howmuch; - from -= howmuch; - } - } + char buf[1024]; + h5_stat_t sbuf; + int res; + ssize_t tot = 0; + ssize_t howmuch = 0; + ssize_t nchars = -1; + ssize_t to; + ssize_t from; + ssize_t toend; + ssize_t fromend; + + if(startin > startout) { + /* this case is prohibited */ + error_msg("copy_some_to_file: panic: startin > startout?\n"); + exit (EXIT_FAILURE); + } /* end if */ + + if(limit < 0) { + res = HDfstat(infid, &sbuf); + if(res < 0) { + error_msg("Can't stat file \n"); + HDexit(EXIT_FAILURE); + } /* end if */ + + howmuch = (ssize_t)sbuf.st_size; + } else { + howmuch = limit; + } /* end if */ + + if(0 == howmuch) + return 0; + + toend = (ssize_t) startout + howmuch; + fromend = (ssize_t) startin + howmuch; + + if (howmuch > 512) { + to = toend - 512; + from = fromend - 512; + } else { + to = toend - howmuch; + from = fromend - howmuch; + } /* end if */ + + while (howmuch > 0) { + HDlseek(outfid, (off_t) to, SEEK_SET); + HDlseek(infid, (off_t) from, SEEK_SET); + + if (howmuch > 512) { + nchars = HDread(infid, buf, (unsigned) 512); + } else { + nchars = HDread(infid, buf, (unsigned)howmuch); + } /* end if */ + + if (nchars <= 0) { + error_msg("Read error \n"); + HDexit(EXIT_FAILURE); + } /* end if */ + + if(HDwrite (outfid, buf, (unsigned) nchars) < 0) { + error_msg("Write error \n"); + HDexit(EXIT_FAILURE); + } - /* assert howmuch == 0 */ - /* assert tot == limit */ + tot += nchars; + howmuch -= nchars; + if(howmuch > 512) { + to -= nchars; + from -= nchars; + } else { + to -= howmuch; + from -= howmuch; + } /* end if */ + } /* end while */ - return ((hsize_t) tot + (hsize_t) startout); -} + return (hsize_t)tot + (hsize_t)startout; +} /* end copy_some_to_file() */ /*------------------------------------------------------------------------- @@ -539,28 +518,21 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, * * Return: Success: last byte written in the output. * Failure: Exits program with EXIT_FAILURE value. - * - * Programmer: - * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t compute_user_block_size (hsize_t ublock_size) { - hsize_t where = 512; + hsize_t where = 512; - if (ublock_size == 0) - return 0; + if(0 == ublock_size) + return 0; - while (where < ublock_size) - { - where *= 2; - } + while(where < ublock_size) + where *= 2; - return (where); -} + return where; +} /* end compute_user_block_size() */ /* * Write zeroes to fill the file from 'where' to 512, 1024, etc. bytes. diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 2addebf..f88ecf4 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -109,7 +109,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) @@ -133,9 +133,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -160,7 +160,7 @@ ) set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 4ab4f22..452f307 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -177,66 +177,65 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); static void usage (void) { - HDfprintf(rawerrorstream, "\ -usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ - OPTIONS\n\ - -h, -?, --help Print a usage message and exit\n\ - -a, --address Print raw data address. If dataset is contiguous, address\n\ - is offset in file of beginning of raw data. If chunked,\n\ - returned list of addresses indicates offset of each chunk.\n\ - Must be used with -v, --verbose option.\n\ - Provides no information for non-dataset objects.\n\ - -d, --data Print the values of datasets\n\ - --enable-error-stack\n\ - Prints messages from the HDF5 error stack as they occur.\n\ - --follow-symlinks\n\ - Follow symbolic links (soft links and external links)\n\ - to display target object information.\n\ - Without this option, h5ls identifies a symbolic link\n\ - as a soft link or external link and prints the value\n\ - assigned to the symbolic link; it does not provide any\n\ - information regarding the target object or determine\n\ - whether the link is a dangling link.\n\ - --no-dangling-links\n\ - Must be used with --follow-symlinks option;\n\ - otherwise, h5ls shows error message and returns an exit\n\ - code of 1. \n\ - Check for any symbolic links (soft links or external links)\n\ - that do not resolve to an existing object (dataset, group,\n\ - or named datatype).\n\ - If any dangling link is found, this situation is treated\n\ - as an error and h5ls returns an exit code of 1.\n\ - -f, --full Print full path names instead of base names\n\ - -g, --group Show information about a group, not its contents\n\ - -l, --label Label members of compound datasets\n\ - -r, --recursive List all groups recursively, avoiding cycles\n\ - -s, --string Print 1-byte integer datasets as ASCII\n\ - -S, --simple Use a machine-readable output format\n\ - -wN, --width=N Set the number of columns of output\n\ - -v, --verbose Generate more verbose output\n\ - -V, --version Print version number and exit\n\ - --vfd=DRIVER Use the specified virtual file driver\n\ - -x, --hexdump Show raw data in hexadecimal format\n\ -\n\ - file/OBJECT\n\ - Each object consists of an HDF5 file name optionally followed by a\n\ - slash and an object name within the file (if no object is specified\n\ - within the file then the contents of the root group are displayed).\n\ - The file name may include a printf(3C) integer format such as\n\ - \"%%05d\" to open a file family.\n\ -\n\ - Deprecated Options\n\ - The following options have been deprecated in HDF5. While they remain\n\ - available, they have been superseded as indicated and may be removed\n\ - from HDF5 in the future. Use the indicated replacement option in all\n\ - new work; where possible, existing scripts, et cetera, should also be\n\ - updated to use the replacement option.\n\ -\n\ - -E or --external Follow external links.\n\ - Replaced by --follow-symlinks.\n\ - -e, --errors Show all HDF5 error reporting\n\ - Replaced by --enable-error-stack.\n", - h5tools_getprogname()); + FLUSHSTREAM(rawoutstream); + PRINTVALSTREAM(rawoutstream, "usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n"); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, -?, --help Print a usage message and exit\n"); + PRINTVALSTREAM(rawoutstream, " -a, --address Print raw data address. If dataset is contiguous, address\n"); + PRINTVALSTREAM(rawoutstream, " is offset in file of beginning of raw data. If chunked,\n"); + PRINTVALSTREAM(rawoutstream, " returned list of addresses indicates offset of each chunk.\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with -v, --verbose option.\n"); + PRINTVALSTREAM(rawoutstream, " Provides no information for non-dataset objects.\n"); + PRINTVALSTREAM(rawoutstream, " -d, --data Print the values of datasets\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); + PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); + PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links)\n"); + PRINTVALSTREAM(rawoutstream, " to display target object information.\n"); + PRINTVALSTREAM(rawoutstream, " Without this option, h5ls identifies a symbolic link\n"); + PRINTVALSTREAM(rawoutstream, " as a soft link or external link and prints the value\n"); + PRINTVALSTREAM(rawoutstream, " assigned to the symbolic link; it does not provide any\n"); + PRINTVALSTREAM(rawoutstream, " information regarding the target object or determine\n"); + PRINTVALSTREAM(rawoutstream, " whether the link is a dangling link.\n"); + PRINTVALSTREAM(rawoutstream, " --no-dangling-links\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with --follow-symlinks option;\n"); + PRINTVALSTREAM(rawoutstream, " otherwise, h5ls shows error message and returns an exit\n"); + PRINTVALSTREAM(rawoutstream, " code of 1. \n"); + PRINTVALSTREAM(rawoutstream, " Check for any symbolic links (soft links or external links)\n"); + PRINTVALSTREAM(rawoutstream, " that do not resolve to an existing object (dataset, group,\n"); + PRINTVALSTREAM(rawoutstream, " or named datatype).\n"); + PRINTVALSTREAM(rawoutstream, " If any dangling link is found, this situation is treated\n"); + PRINTVALSTREAM(rawoutstream, " as an error and h5ls returns an exit code of 1.\n"); + PRINTVALSTREAM(rawoutstream, " -f, --full Print full path names instead of base names\n"); + PRINTVALSTREAM(rawoutstream, " -g, --group Show information about a group, not its contents\n"); + PRINTVALSTREAM(rawoutstream, " -l, --label Label members of compound datasets\n"); + PRINTVALSTREAM(rawoutstream, " -r, --recursive List all groups recursively, avoiding cycles\n"); + PRINTVALSTREAM(rawoutstream, " -s, --string Print 1-byte integer datasets as ASCII\n"); + PRINTVALSTREAM(rawoutstream, " -S, --simple Use a machine-readable output format\n"); + PRINTVALSTREAM(rawoutstream, " -wN, --width=N Set the number of columns of output\n"); + PRINTVALSTREAM(rawoutstream, " -v, --verbose Generate more verbose output\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " --vfd=DRIVER Use the specified virtual file driver\n"); + PRINTVALSTREAM(rawoutstream, " -x, --hexdump Show raw data in hexadecimal format\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " file/OBJECT\n"); + PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n"); + PRINTVALSTREAM(rawoutstream, " slash and an object name within the file (if no object is specified\n"); + PRINTVALSTREAM(rawoutstream, " within the file then the contents of the root group are displayed).\n"); + PRINTVALSTREAM(rawoutstream, " The file name may include a printf(3C) integer format such as\n"); + PRINTVALSTREAM(rawoutstream, " \"%%05d\" to open a file family.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Deprecated Options\n"); + PRINTVALSTREAM(rawoutstream, " The following options have been deprecated in HDF5. While they remain\n"); + PRINTVALSTREAM(rawoutstream, " available, they have been superseded as indicated and may be removed\n"); + PRINTVALSTREAM(rawoutstream, " from HDF5 in the future. Use the indicated replacement option in all\n"); + PRINTVALSTREAM(rawoutstream, " new work; where possible, existing scripts, et cetera, should also be\n"); + PRINTVALSTREAM(rawoutstream, " updated to use the replacement option.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " -E or --external Follow external links.\n"); + PRINTVALSTREAM(rawoutstream, " Replaced by --follow-symlinks.\n"); + PRINTVALSTREAM(rawoutstream, " -e, --errors Show all HDF5 error reporting\n"); + PRINTVALSTREAM(rawoutstream, " Replaced by --enable-error-stack.\n"); } @@ -2795,9 +2794,8 @@ main(int argc, const char *argv[]) file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername); if(file >= 0) { - if(verbose_g) { + if(verbose_g) PRINTSTREAM(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername); - } break; /*success*/ } /* end if */ diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index fa454ce..0ed2804 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -19,7 +19,7 @@ set (VFD_LIST ${VFD_LIST} direct) endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" @@ -35,7 +35,7 @@ set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - ENDMACRO () + endmacro () endif () # -------------------------------------------------------------------- @@ -109,7 +109,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_HELP_TEST testname resultcode) + macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) @@ -131,9 +131,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_OLD testname testtype testfile) + macro (ADD_H5_TEST_OLD testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -155,9 +155,9 @@ ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST testname testtype testfile) + macro (ADD_H5_TEST testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -179,9 +179,9 @@ ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -213,9 +213,9 @@ set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) + macro (ADD_H5_DMP_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -246,9 +246,9 @@ set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) + macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -310,9 +310,9 @@ endif () endif () endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_TEST_META testname testfile) + macro (ADD_H5_TEST_META testname testfile) add_test ( NAME H5REPACK_META-${testname}_N COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 @@ -329,9 +329,9 @@ add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) - ENDMACRO () + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -370,7 +370,7 @@ ) set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## @@ -982,7 +982,7 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## - ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,1,8,18) + ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters diff --git a/tools/h5repack/dynlib_rpk.c b/tools/h5repack/dynlib_rpk.c index 70333f8..3469e58 100644 --- a/tools/h5repack/dynlib_rpk.c +++ b/tools/h5repack/dynlib_rpk.c @@ -38,8 +38,8 @@ const H5Z_class2_t H5Z_DYNLIB1[1] = {{ (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ }}; -H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib1 diff --git a/tools/h5repack/dynlib_vrpk.c b/tools/h5repack/dynlib_vrpk.c index 97cb211..8da0270 100644 --- a/tools/h5repack/dynlib_vrpk.c +++ b/tools/h5repack/dynlib_vrpk.c @@ -67,19 +67,19 @@ H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, /* Check for the library version */ if(H5get_libversion(&ver_info[0], &ver_info[1], &ver_info[2]) < 0) { PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion"); - return 0; + return(0); } /* Check for the correct number of parameters */ if(cd_nelmts == 0) - return 0; + return(0); /* Check that permanent parameters are set correctly */ if(cd_values[0] > 9) - return 0; + return(0); if(ver_info[0] != cd_values[1] || ver_info[1] != cd_values[2]) { PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion does not match"); - return 0; + return(0); } add_on = (int)cd_values[0]; diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 3f99374..0c14992 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -79,21 +79,21 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { */ int h5repack_init(pack_opt_t *options, int verbose) { - int k, n; - - HDmemset(options, 0, sizeof(pack_opt_t)); - options->min_comp = 0; - options->verbose = verbose; - options->layout_g = H5D_LAYOUT_ERROR; - - for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { - options->filter_g[n].filtn = -1; - options->filter_g[n].cd_nelmts = 0; - for (k = 0; k < CD_VALUES; k++) - options->filter_g[n].cd_values[k] = 0; - } + int k, n; + + HDmemset(options, 0, sizeof(pack_opt_t)); + options->min_comp = 0; + options->verbose = verbose; + options->layout_g = H5D_LAYOUT_ERROR; + + for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { + options->filter_g[n].filtn = -1; + options->filter_g[n].cd_nelmts = 0; + for (k = 0; k < CD_VALUES; k++) + options->filter_g[n].cd_values[k] = 0; + } - return (options_table_init(&(options->op_tbl))); + return (options_table_init(&(options->op_tbl))); } /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 9573ee8..c31f400 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -54,12 +54,12 @@ *------------------------------------------------------------------------- */ static int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], - size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); + size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr); static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options); + pack_opt_t *options); static int copy_user_block(const char *infile, const char *outfile, - hsize_t size); + hsize_t size); #if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif @@ -67,10 +67,10 @@ static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void /* get the major number from the error stack. */ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) { - if (err_desc) - *((hid_t *) udata) = err_desc->maj_num; + if (err_desc) + *((hid_t *) udata) = err_desc->maj_num; - return 0; + return 0; } /*------------------------------------------------------------------------- @@ -84,28 +84,18 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t * * Date: October, 23, 2003 * - * Modification: - * Peter Cao, June 13, 2007 - * Add "-L, --latest" and other options to pack a file with the latest file format - * - * Peter Cao, September 25, 2007 - * Copy user block when repacking a file - * - * Pedro Vicente, August 20, 2008 - * Add a user block to file if requested - * *------------------------------------------------------------------------- */ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin; - hid_t fidout = -1; - trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ - hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin; + hid_t fidout = -1; + trav_table_t *travt = NULL; + hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ + hid_t fapl = H5P_DEFAULT; /* file access property list ID */ /*------------------------------------------------------------------------- * open input file @@ -659,7 +649,7 @@ done: */ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options) /* repack options */ + pack_opt_t *options) /* repack options */ { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t grp_in = -1; /* group ID */ @@ -1497,65 +1487,65 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ int fh; /* file handle */ - hsize_t ub_size; /* user block size */ - hsize_t size; /* size read */ - hid_t fcpl; /* file creation property list ID for HDF5 file */ - int i; - - /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg("failed to retrieve file creation property list\n"); + hsize_t ub_size; /* user block size */ + hsize_t size; /* size read */ + hid_t fcpl; /* file creation property list ID for HDF5 file */ + int i; + + /* get user block size */ + if(( fcpl = H5Fget_create_plist(fid)) < 0) { + error_msg("failed to retrieve file creation property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed"); } - if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); + if(H5Pget_userblock(fcpl, &ub_size) < 0) { + error_msg("failed to retrieve userblock size\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed"); } - if(H5Pclose(fcpl) < 0) { - error_msg("failed to close property list\n"); + if(H5Pclose(fcpl) < 0) { + error_msg("failed to close property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed"); } - /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + /* open file */ + if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); } - size = ub_size; + size = ub_size; - /* read file */ - while(size > 0) { - ssize_t nread; /* # of bytes read */ - char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ + /* read file */ + while(size > 0) { + ssize_t nread; /* # of bytes read */ + char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ - /* read buffer */ - if(size > USERBLOCK_XFER_SIZE) - nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); - else - nread = HDread(fh, rbuf, (size_t)size); + /* read buffer */ + if(size > USERBLOCK_XFER_SIZE) + nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); + else + nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) { + for(i = 0; i < nread; i++) { - printf("%c ", rbuf[i]); + printf("%c ", rbuf[i]); - } - printf("\n"); + } + printf("\n"); - if(nread < 0) { + if(nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); } - /* update size of userblock left to transfer */ - size -= nread; - } + /* update size of userblock left to transfer */ + size -= nread; + } done: - if(fh > 0) - HDclose(fh); + if(fh > 0) + HDclose(fh); - return; + return; } #endif diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 7998ae8..912126f 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -191,14 +191,12 @@ static void usage(const char *prog) { * Programmer: Quincey Koziol * Saturday, 31. January 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ -static void leave(int ret) { - h5tools_close(); - - HDexit(ret); +static void leave(int ret) +{ + h5tools_close(); + HDexit(ret); } /*------------------------------------------------------------------------- @@ -214,134 +212,133 @@ static void leave(int ret) { * *------------------------------------------------------------------------- */ - static -int read_info(const char *filename, pack_opt_t *options) { - - char stype[10]; - char comp_info[1024]; - FILE *fp = NULL; - char c; - int i, rc = 1; - int ret_value = EXIT_SUCCESS; - - if ((fp = HDfopen(filename, "r")) == (FILE *) NULL) { - error_msg("cannot open options file %s\n", filename); - h5tools_setstatus(EXIT_FAILURE); - ret_value = EXIT_FAILURE; - goto done; - } - - /* cycle until end of file reached */ - while (1) { - rc = fscanf(fp, "%s", stype); - if (rc == -1) - break; - - /*------------------------------------------------------------------------- - * filter - *------------------------------------------------------------------------- - */ - if (HDstrcmp(stype,"-f") == 0) { - /* find begining of info */ - i = 0; - c = '0'; - while (c != ' ') { - if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { +int read_info(const char *filename, pack_opt_t *options) +{ + char stype[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char comp_info[1024]; + FILE *fp = NULL; + char c; + int i, rc = 1; + int ret_value = EXIT_SUCCESS; + + if ((fp = HDfopen(filename, "r")) == (FILE *) NULL) { + error_msg("cannot open options file %s\n", filename); + h5tools_setstatus(EXIT_FAILURE); + ret_value = EXIT_FAILURE; + goto done; + } + + /* cycle until end of file reached */ + while (1) { + rc = fscanf(fp, "%s", stype); + if (rc == -1) + break; + + /*------------------------------------------------------------------------- + * filter + *------------------------------------------------------------------------- + */ + if (HDstrcmp(stype,"-f") == 0) { + /* find begining of info */ + i = 0; + c = '0'; + while (c != ' ') { + if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } /* end if */ - if (HDfeof(fp)) - break; - } - c = '0'; - /* go until end */ - while (c != ' ') { - if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfeof(fp)) + break; + } + c = '0'; + /* go until end */ + while (c != ' ') { + if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } /* end if */ - comp_info[i] = c; - i++; - if (HDfeof(fp)) - break; - if (c == 10 /*eol*/) - break; - } - comp_info[i - 1] = '\0'; /*cut the last " */ - - if (h5repack_addfilter(comp_info, options) == -1) { - error_msg("could not add compression option\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = EXIT_FAILURE; - goto done; - } - } - /*------------------------------------------------------------------------- - * layout - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(stype,"-l") == 0) { - - /* find begining of info */ - i = 0; - c = '0'; - while (c != ' ') { - if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + comp_info[i] = c; + i++; + if (HDfeof(fp)) + break; + if (c == 10 /*eol*/) + break; + } + comp_info[i - 1] = '\0'; /*cut the last " */ + + if (h5repack_addfilter(comp_info, options) == -1) { + error_msg("could not add compression option\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = EXIT_FAILURE; + goto done; + } + } + /*------------------------------------------------------------------------- + * layout + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(stype,"-l") == 0) { + + /* find begining of info */ + i = 0; + c = '0'; + while (c != ' ') { + if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } /* end if */ - if (HDfeof(fp)) - break; - } - c = '0'; - /* go until end */ - while (c != ' ') { - if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfeof(fp)) + break; + } + c = '0'; + /* go until end */ + while (c != ' ') { + if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } /* end if */ - comp_info[i] = c; - i++; - if (HDfeof(fp)) - break; - if (c == 10 /*eol*/) - break; - } - comp_info[i - 1] = '\0'; /*cut the last " */ - - if (h5repack_addlayout(comp_info, options) == -1) { - error_msg("could not add chunck option\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = EXIT_FAILURE; - goto done; - } - } - /*------------------------------------------------------------------------- - * not valid - *------------------------------------------------------------------------- - */ - else { - error_msg("bad file format for %s", filename); - h5tools_setstatus(EXIT_FAILURE); - ret_value = EXIT_FAILURE; - goto done; - } - } + comp_info[i] = c; + i++; + if (HDfeof(fp)) + break; + if (c == 10 /*eol*/) + break; + } + comp_info[i - 1] = '\0'; /*cut the last " */ + + if (h5repack_addlayout(comp_info, options) == -1) { + error_msg("could not add chunck option\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = EXIT_FAILURE; + goto done; + } + } + /*------------------------------------------------------------------------- + * not valid + *------------------------------------------------------------------------- + */ + else { + error_msg("bad file format for %s", filename); + h5tools_setstatus(EXIT_FAILURE); + ret_value = EXIT_FAILURE; + goto done; + } + } done: - if (fp) - HDfclose(fp); + if (fp) + HDfclose(fp); - return ret_value; + return ret_value; } /*------------------------------------------------------------------------- @@ -351,184 +348,178 @@ done: * *------------------------------------------------------------------------- */ - static -int parse_command_line(int argc, const char **argv, pack_opt_t* options) { - - int opt; - int ret_value = 0; - - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char) opt) { - - /* -i for backward compability */ - case 'i': - infile = opt_arg; - has_i_o = 1; - break; - - /* -o for backward compability */ - case 'o': - outfile = opt_arg; - has_i_o = 1; - break; - - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'v': - options->verbose = 1; - break; - - case 'f': - /* parse the -f filter option */ - if (h5repack_addfilter(opt_arg, options) < 0) { - error_msg("in parsing filter\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'l': - /* parse the -l layout option */ - if (h5repack_addlayout(opt_arg, options) < 0) { - error_msg("in parsing layout\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'm': - options->min_comp = HDstrtoull(opt_arg , NULL, 0); - if ((int) options->min_comp <= 0) { - error_msg("invalid minimum compress size <%s>\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'e': - ret_value = read_info(opt_arg, options); - if (ret_value < 0) - goto done; - break; - - case 'n': - options->use_native = 1; - break; - - case 'L': - options->latest = 1; - break; - - case 'c': - options->grp_compact = HDatoi( opt_arg ); - if (options->grp_compact > 0) - options->latest = 1; /* must use latest format */ - break; - - case 'd': - options->grp_indexed = HDatoi( opt_arg ); - if (options->grp_indexed > 0) - options->latest = 1; /* must use latest format */ - break; - - case 's': - { - int idx = 0; - int ssize = 0; - char *msgPtr = HDstrchr( opt_arg, ':'); - options->latest = 1; /* must use latest format */ - if (msgPtr == NULL) { - ssize = HDatoi( opt_arg ); - for (idx = 0; idx < 5; idx++) - options->msg_size[idx] = ssize; - } - else { - char msgType[10]; - HDstrcpy(msgType, msgPtr + 1); - msgPtr[0] = '\0'; - ssize = HDatoi( opt_arg ); - if (HDstrncmp(msgType, "dspace",6) == 0) { - options->msg_size[0] = ssize; - } - else if (HDstrncmp(msgType, "dtype", 5) == 0) { - options->msg_size[1] = ssize; - } - else if (HDstrncmp(msgType, "fill", 4) == 0) { - options->msg_size[2] = ssize; - } - else if (HDstrncmp(msgType, "pline", 5) == 0) { - options->msg_size[3] = ssize; - } - else if (HDstrncmp(msgType, "attr", 4) == 0) { - options->msg_size[4] = ssize; - } - } - } - break; - - case 'u': - options->ublock_filename = opt_arg; - break; - - case 'b': - options->ublock_size = (hsize_t) HDatol( opt_arg ); - break; - - case 'M': - options->meta_block_size = (hsize_t) HDatol( opt_arg ); - break; - - case 't': - options->threshold = (hsize_t) HDatol( opt_arg ); - break; - - case 'a': - options->alignment = HDstrtoull(opt_arg , NULL, 0); - if (options->alignment < 1) { - error_msg("invalid alignment size\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'E': - enable_error_stack = TRUE; - break; +int parse_command_line(int argc, const char **argv, pack_opt_t* options) +{ + int opt; + int ret_value = 0; + + /* parse command line options */ + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char) opt) { + + /* -i for backward compability */ + case 'i': + infile = opt_arg; + has_i_o = 1; + break; + + /* -o for backward compability */ + case 'o': + outfile = opt_arg; + has_i_o = 1; + break; + + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; - default: - break; - } /* switch */ + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; + + case 'v': + options->verbose = 1; + break; + + case 'f': + /* parse the -f filter option */ + if (h5repack_addfilter(opt_arg, options) < 0) { + error_msg("in parsing filter\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'l': + /* parse the -l layout option */ + if (h5repack_addlayout(opt_arg, options) < 0) { + error_msg("in parsing layout\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + case 'm': + options->min_comp = HDstrtoull(opt_arg , NULL, 0); + if ((int) options->min_comp <= 0) { + error_msg("invalid minimum compress size <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'e': + ret_value = read_info(opt_arg, options); + if (ret_value < 0) + goto done; + break; + + case 'n': + options->use_native = 1; + break; + + case 'L': + options->latest = TRUE; + break; + + case 'c': + options->grp_compact = HDatoi( opt_arg ); + if (options->grp_compact > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 'd': + options->grp_indexed = HDatoi( opt_arg ); + if (options->grp_indexed > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 's': + { + int idx = 0; + int ssize = 0; + char *msgPtr = HDstrchr( opt_arg, ':'); + options->latest = TRUE; /* must use latest format */ + if (msgPtr == NULL) { + ssize = HDatoi( opt_arg ); + for (idx = 0; idx < 5; idx++) + options->msg_size[idx] = ssize; + } + else { + char msgType[10]; + + HDstrcpy(msgType, msgPtr + 1); + msgPtr[0] = '\0'; + ssize = HDatoi( opt_arg ); + if (HDstrncmp(msgType, "dspace",6) == 0) + options->msg_size[0] = ssize; + else if (HDstrncmp(msgType, "dtype", 5) == 0) + options->msg_size[1] = ssize; + else if (HDstrncmp(msgType, "fill", 4) == 0) + options->msg_size[2] = ssize; + else if (HDstrncmp(msgType, "pline", 5) == 0) + options->msg_size[3] = ssize; + else if (HDstrncmp(msgType, "attr", 4) == 0) + options->msg_size[4] = ssize; + } + } + break; + + case 'u': + options->ublock_filename = opt_arg; + break; + + case 'b': + options->ublock_size = (hsize_t) HDatol( opt_arg ); + break; + + case 'M': + options->meta_block_size = (hsize_t) HDatol( opt_arg ); + break; + + case 't': + options->threshold = (hsize_t) HDatol( opt_arg ); + break; + + case 'a': + options->alignment = HDstrtoull(opt_arg , NULL, 0); + if (options->alignment < 1) { + error_msg("invalid alignment size\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'E': + enable_error_stack = TRUE; + break; + + default: + break; + } /* switch */ } /* while */ if (has_i_o == 0) { - /* check for file names to be processed */ - if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { - error_msg("missing file names\n"); - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - } - } + /* check for file names to be processed */ + if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { + error_msg("missing file names\n"); + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + } + } done: - return ret_value; + return ret_value; } /*------------------------------------------------------------------------- @@ -548,16 +539,16 @@ done: * *------------------------------------------------------------------------- */ -int main(int argc, const char **argv) { +int main(int argc, const char **argv) +{ + pack_opt_t options; /*the global options */ H5E_auto2_t func; H5E_auto2_t tools_func; void *edata; void *tools_edata; - pack_opt_t options; /*the global options */ - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); @@ -610,12 +601,12 @@ int main(int argc, const char **argv) { } /* pack it */ - h5tools_setstatus(h5repack(infile, outfile, &options)); + h5tools_setstatus(h5repack(infile, outfile, &options)); done: - /* free tables */ - h5repack_end(&options); + /* free tables */ + h5repack_end(&options); - leave(h5tools_getstatus()); + leave(h5tools_getstatus()); } diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 004b9e4..6759169 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -47,9 +47,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, int k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; - char scomp[10]; - char stype[6]; - char smask[3]; + char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char stype[6] = {0, 0, 0, 0, 0, 0}; + char smask[3] = {0, 0, 0}; obj_list_t* obj_list = NULL; unsigned pixels_per_block; @@ -396,6 +396,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("invalid filter type in <%s>\n", str); HDexit(EXIT_FAILURE); } + break; } } /*i*/ diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in index 336b3a4..ce77e43 100644 --- a/tools/h5repack/h5repack_plugin.sh.in +++ b/tools/h5repack/h5repack_plugin.sh.in @@ -1,16 +1,16 @@ #! /bin/sh # -# Copyright by The HDF Group. -# 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 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. +# 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 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. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ @@ -246,9 +246,10 @@ TOOLTEST_DUMP() ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,4,9,1,8,18" +arg="h5repack_layout.h5 -v -f UD=260,4,9,$version_str" TOOLTEST_DUMP plugin_version_test $arg arg="h5repack_layout.h5 -v -f UD=257,1,9" diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 60962aa..4993cbd 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -39,11 +39,6 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil * Programmer: Pedro Vicente, pvn@hdfgroup.org * * Date: December 19, 2003 - * Modified: December, 19, 2007 (exactly 4 years later :-) ) - * Separate into 3 cases - * 1) no filter input, get all datasets and compare DCPLs. TO DO - * 2) filter input on selected datasets, get each one trough OBJ and match - * 3) filter input on all datasets, get all objects and match * *------------------------------------------------------------------------- */ @@ -524,7 +519,7 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) { case H5Z_FILTER_NONE: - break; + break; case H5Z_FILTER_SHUFFLE: /* 1 private client value is returned by DCPL */ diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 8221160..32d69bb 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1537,7 +1537,7 @@ int main (void) hid_t fapl; fapl = h5_fileaccess(); - h5_cleanup(H5REPACK_FILENAMES, fapl); + h5_clean_files(H5REPACK_FILENAMES, fapl); } diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 9f69270..09b2484 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 18 } + PARAMS { 9 1 8 19 } } } FILLVALUE { diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index a3db0fc..12145f8 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -63,7 +63,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) @@ -86,7 +86,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 4cdb816..de406fd 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -293,7 +293,7 @@ ceil_log10(unsigned long x) ret++; } /* end while */ - return(ret); + return ret; } /* ceil_log10() */ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index d7f5cb5..b275ab8 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -659,7 +659,8 @@ hsize_t h5diff(const char *fname1, { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - HDasprintf(&obj1fullname, "/%s", objname1); + if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) + goto out; #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2); @@ -1167,7 +1168,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name); + if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) + goto out; #else /* H5_HAVE_ASPRINTF */ obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1); HDstrcpy(obj1_fullpath, grp1_path); @@ -1177,7 +1179,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name); + if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) + goto out; #else /* H5_HAVE_ASPRINTF */ obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1); HDstrcpy(obj2_fullpath, grp2_path); @@ -1471,6 +1474,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } #endif /* H5_HAVE_PARALLEL */ +out: /* free table */ if (table) trav_table_free(table); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index c3c9269..3dd8208 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -106,11 +106,9 @@ static void table_attrs_free( table_attrs_t *table ) *------------------------------------------------------------------------*/ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table) { - size_t curr_val; - + if(table->nattrs == table->size) { match_attr_t *new_attrs; - if(table->nattrs == table->size) { table->size = MAX(1, table->size * 2); new_attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t)); if(new_attrs) @@ -118,6 +116,8 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta } /* end if */ if(table->nattrs < table->size) { + size_t curr_val; + curr_val = table->nattrs; table->attrs[curr_val].exist[0] = exist[0]; table->attrs[curr_val].exist[1] = exist[1]; diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index b8d44de..fc0c782 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -199,9 +199,8 @@ set_time(io_time_t *pt, timer_type t, int start_stop) break; default: HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); - return (NULL); - break; - } + return NULL; + } /* end switch */ #if 0 /* this does not belong here. Need fix in h5perf code when set_time() is called. -AKC- */ diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index ee60bf8..9c38132 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -69,7 +69,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode resultoption) + macro (ADD_H5_TEST resultfile resultcode resultoption) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-${resultfile}-clear-objects @@ -105,9 +105,9 @@ ) set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_CMP resultfile resultcode) + macro (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) else () @@ -131,7 +131,7 @@ ) set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 9c9153a..e37bcb3 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -57,15 +57,15 @@ /*------------------------------------------------------------------------- * Function: get_H5B2_class * - * Purpose: Determine the v2 B-tree class from the buffer read in. + * Purpose: Determine the v2 B-tree class from the buffer read in. * B-trees are debugged through the B-tree subclass. The subclass * identifier is two bytes after the B-tree signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -143,16 +143,18 @@ get_H5B2_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl, dxpl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; + H5E_auto2_t func; + void *edata; herr_t status = SUCCEED; if(argc == 1) { - HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); + HDexit(1); } /* end if */ /* Initialize the library */ @@ -161,6 +163,10 @@ main(int argc, char *argv[]) HDexit(1); } /* end if */ + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + /* * Open the file and get the file descriptor. */ @@ -448,6 +454,8 @@ main(int argc, char *argv[]) H5Pclose(fapl); H5Fclose(fid); + H5Eset_auto2(H5E_DEFAULT, func, edata); + return 0; } /* main() */ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 8dee706..4ec923a 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -328,9 +328,6 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } /* end if */ - /* Shut down h5tools lib */ - h5tools_close(); - leave(EXIT_SUCCESS); } /* end main() */ diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index ffd52e8..e44c957 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -194,27 +194,25 @@ main (int argc, char *argv[]) int src, dst=-1; /*source & destination files */ int need_seek=FALSE; /*destination needs to seek? */ int need_write; /*data needs to be written? */ - /*struct stat sb; temporary file stat buffer */ - /*struct _stati64 sb;*/ - h5_stat_t sb; + h5_stat_t sb; /*temporary file stat buffer */ int verbose=FALSE; /*display file names? */ - const char *src_gen_name; /*general source name */ - char src_name[NAMELEN]; /*source member name */ + const char *src_gen_name; /*general source name */ + char *src_name=NULL; /*source member name */ int src_is_family; /*is source name a family name? */ int src_membno=0; /*source member number */ - const char *dst_gen_name; /*general destination name */ - char dst_name[NAMELEN]; /*destination member name */ + const char *dst_gen_name; /*general destination name */ + char *dst_name=NULL; /*destination member name */ int dst_is_family; /*is dst name a family name? */ int dst_membno=0; /*destination member number */ off_t left_overs=0; /*amount of zeros left over */ off_t src_offset=0; /*offset in source member */ off_t dst_offset=0; /*offset in destination member */ - off_t src_size; /*source logical member size */ + off_t src_size; /*source logical member size */ off_t src_act_size; /*source actual member size */ off_t dst_size=1 GB; /*destination logical memb size */ hid_t fapl; /*file access property list */ @@ -232,24 +230,30 @@ main (int argc, char *argv[]) * Parse switches. */ while (argno=0) { if(H5Fclose(file)<0) { perror ("H5Fclose"); exit (EXIT_FAILURE); - } - } + } /* end if */ + } /* end if */ if(H5Pclose(fapl)<0) { perror ("H5Pclose"); exit (EXIT_FAILURE); - } + } /* end if */ /* Free resources and return */ - HDfree (buf); + HDfree(src_name); + HDfree(dst_name); + HDfree(buf); return EXIT_SUCCESS; -} +} /* end main */ diff --git a/tools/perform/chunk.c b/tools/perform/chunk.c index d16fbd3..b1419ee 100644 --- a/tools/perform/chunk.c +++ b/tools/perform/chunk.c @@ -17,9 +17,9 @@ * Programmer: Robb Matzke * Thursday, May 14, 1998 * - * Purpose: Checks the effect of various I/O request sizes and raw data - * cache sizes. Performance depends on the amount of data read - * from disk and we use a filter to get that number. + * Purpose: Checks the effect of various I/O request sizes and raw data + * cache sizes. Performance depends on the amount of data read + * from disk and we use a filter to get that number. */ /* See H5private.h for how to include headers */ @@ -42,68 +42,68 @@ # define H5_ATTR_UNUSED __attribute__((unused)) #endif -#define FILE_NAME "chunk.h5" -#define LINESPOINTS "lines" -#define CH_SIZE 100 /*squared in terms of bytes */ -#define DS_SIZE 20 /*squared in terms of chunks */ -#define FILTER_COUNTER 305 -#define READ 0 -#define WRITE 1 -#define MIN(X,Y) ((X)<(Y)?(X):(Y)) -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) -#define SQUARE(X) ((X)*(X)) +#define FILE_NAME "chunk.h5" +#define LINESPOINTS "lines" +#define CH_SIZE 100 /*squared in terms of bytes */ +#define DS_SIZE 20 /*squared in terms of chunks */ +#define FILTER_COUNTER 305 +#define READ 0 +#define WRITE 1 +#define MIN(X,Y) ((X)<(Y)?(X):(Y)) +#define MAX(X,Y) ((X)>(Y)?(X):(Y)) +#define SQUARE(X) ((X)*(X)) /* The row-major test */ -#define RM_CACHE_STRT 25 -#define RM_CACHE_END 25 -#define RM_CACHE_DELT 5 -#define RM_START (double)0.50F -#define RM_END (double)5.00F -#define RM_DELTA (double)0.50F -#define RM_W0 0.0F -#define RM_NRDCC 521 +#define RM_CACHE_STRT 25 +#define RM_CACHE_END 25 +#define RM_CACHE_DELT 5 +#define RM_START (double)0.50F +#define RM_END (double)5.00F +#define RM_DELTA (double)0.50F +#define RM_W0 0.0F +#define RM_NRDCC 521 /* Diagonal test */ -#define DIAG_CACHE_STRT 25 -#define DIAG_CACHE_END 25 -#define DIAG_CACHE_DELT 5 -#define DIAG_START (double)0.50F -#define DIAG_END (double)5.00F -#define DIAG_DELTA (double)0.50F -/* #define DIAG_W0 0.65F */ -/* #define DIAG_NRDCC 521 */ - -static size_t nio_g; -static hid_t fapl_g = -1; +#define DIAG_CACHE_STRT 25 +#define DIAG_CACHE_END 25 +#define DIAG_CACHE_DELT 5 +#define DIAG_START (double)0.50F +#define DIAG_END (double)5.00F +#define DIAG_DELTA (double)0.50F +/* #define DIAG_W0 0.65F */ +/* #define DIAG_NRDCC 521 */ + +static size_t nio_g; +static hid_t fapl_g = -1; /* Local function prototypes */ static size_t counter (unsigned H5_ATTR_UNUSED flags, size_t cd_nelmts, - const unsigned *cd_values, size_t nbytes, - size_t *buf_size, void **buf); + const unsigned *cd_values, size_t nbytes, + size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_COUNTER[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - FILTER_COUNTER, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "counter", /* Filter name for debugging */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER_COUNTER, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "counter", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - counter, /* The actual filter function */ + counter, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: counter + * Function: counter * - * Purpose: Count number of bytes but don't do anything. + * Purpose: Count number of bytes but don't do anything. * - * Return: Success: src_nbytes-1 + * Return: Success: src_nbytes-1 * - * Failure: never fails + * Failure: never fails * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Modifications: @@ -112,8 +112,8 @@ const H5Z_class2_t H5Z_COUNTER[1] = {{ */ static size_t counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, - const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes, - size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) + const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { nio_g += nbytes; return nbytes; @@ -121,16 +121,16 @@ counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, /*------------------------------------------------------------------------- - * Function: create_dataset + * Function: create_dataset * - * Purpose: Creates a square dataset with square chunks, registers a - * stupid compress/uncompress pair for counting I/O, and - * initializes the dataset. The chunk size is in bytes, the - * dataset size is in terms of chunks. + * Purpose: Creates a square dataset with square chunks, registers a + * stupid compress/uncompress pair for counting I/O, and + * initializes the dataset. The chunk size is in bytes, the + * dataset size is in terms of chunks. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Modifications: @@ -140,13 +140,12 @@ counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, static void create_dataset (void) { - hid_t file, space, dcpl, dset; - hsize_t size[2]; - signed char *buf; + hid_t file, space, dcpl, dset; + hsize_t size[2]; + signed char *buf; /* The file */ file = H5Fcreate (FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_g); - assert(file>=0); /* The data space */ size[0] = size[1] = DS_SIZE * CH_SIZE; @@ -177,14 +176,14 @@ create_dataset (void) /*------------------------------------------------------------------------- - * Function: test_rowmaj + * Function: test_rowmaj * - * Purpose: Reads the entire dataset using the specified size-squared - * I/O requests in row major order. + * Purpose: Reads the entire dataset using the specified size-squared + * I/O requests in row major order. * - * Return: Efficiency: data requested divided by data actually read. + * Return: Efficiency: data requested divided by data actually read. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Modifications: @@ -194,13 +193,13 @@ create_dataset (void) static double test_rowmaj (int op, size_t cache_size, size_t io_size) { - hid_t file, dset, mem_space, file_space; - signed char *buf = (signed char *)calloc (1, (size_t)(SQUARE(io_size))); - hsize_t i, j, hs_size[2]; - hsize_t hs_offset[2]; - int mdc_nelmts; - size_t rdcc_nelmts; - double w0; + hid_t file, dset, mem_space, file_space; + signed char *buf = (signed char *)calloc (1, (size_t)(SQUARE(io_size))); + hsize_t i, j, hs_size[2]; + hsize_t hs_offset[2]; + int mdc_nelmts; + size_t rdcc_nelmts; + double w0; H5Pget_cache (fapl_g, &mdc_nelmts, &rdcc_nelmts, NULL, &w0); #ifdef RM_W0 @@ -210,7 +209,7 @@ test_rowmaj (int op, size_t cache_size, size_t io_size) rdcc_nelmts = RM_NRDCC; #endif H5Pset_cache (fapl_g, mdc_nelmts, rdcc_nelmts, - cache_size*SQUARE (CH_SIZE), w0); + cache_size*SQUARE (CH_SIZE), w0); file = H5Fopen(FILE_NAME, H5F_ACC_RDWR, fapl_g); dset = H5Dopen2(file, "dset", H5P_DEFAULT); file_space = H5Dget_space(dset); @@ -218,27 +217,27 @@ test_rowmaj (int op, size_t cache_size, size_t io_size) for (i=0; i0) nio -= SQUARE (io_size-offset); + hs_offset[0] = hs_offset[1] = i; + hs_size[0] = hs_size[1] = MIN (io_size, CH_SIZE*DS_SIZE-i); + mem_space = H5Screate_simple (2, hs_size, hs_size); + H5Sselect_hyperslab (file_space, H5S_SELECT_SET, hs_offset, NULL, + hs_size, NULL); + if (READ==op) { + H5Dread (dset, H5T_NATIVE_SCHAR, mem_space, file_space, + H5P_DEFAULT, buf); + } else { + H5Dwrite (dset, H5T_NATIVE_SCHAR, mem_space, file_space, + H5P_DEFAULT, buf); + } + H5Sclose (mem_space); + nio += hs_size[0]*hs_size[1]; + if (i>0) nio -= SQUARE (io_size-offset); } free (buf); @@ -326,15 +325,15 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: See file prologue. + * Purpose: See file prologue. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Modifications: @@ -344,11 +343,11 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) int main (void) { - size_t io_size; - double effic, io_percent; - FILE *f, *d; - size_t cache_size; - double w0; + size_t io_size; + double effic, io_percent; + FILE *f, *d; + size_t cache_size; + double w0; /* * Create a global file access property list. @@ -369,41 +368,41 @@ main (void) * windows. */ if (RM_CACHE_STRT==RM_CACHE_END) { - fprintf (f, "set yrange [0:1.2]\n"); - fprintf (f, "set ytics 0, 0.1, 1\n"); - fprintf (f, "set xlabel \"%s\"\n", - "Request size as a fraction of chunk size"); - fprintf (f, "set ylabel \"Efficiency\"\n"); - fprintf (f, "set title \"Cache %d chunks, w0=%g, " - "Size=(total=%d, chunk=%d)\"\n", - RM_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); + fprintf (f, "set yrange [0:1.2]\n"); + fprintf (f, "set ytics 0, 0.1, 1\n"); + fprintf (f, "set xlabel \"%s\"\n", + "Request size as a fraction of chunk size"); + fprintf (f, "set ylabel \"Efficiency\"\n"); + fprintf (f, "set title \"Cache %d chunks, w0=%g, " + "Size=(total=%d, chunk=%d)\"\n", + RM_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); } else { - fprintf (f, "set autoscale\n"); - fprintf (f, "set hidden3d\n"); + fprintf (f, "set autoscale\n"); + fprintf (f, "set hidden3d\n"); } fprintf (f, "set terminal postscript\nset output \"x-rowmaj-rd.ps\"\n"); fprintf (f, "%s \"x-rowmaj-rd.dat\" title \"RowMaj-Read\" with %s\n", - RM_CACHE_STRT==RM_CACHE_END?"plot":"splot", - LINESPOINTS); + RM_CACHE_STRT==RM_CACHE_END?"plot":"splot", + LINESPOINTS); fprintf (f, "set terminal x11\nreplot\n"); d = fopen ("x-rowmaj-rd.dat", "w"); for (cache_size=RM_CACHE_STRT; - cache_size<=RM_CACHE_END; - cache_size+=RM_CACHE_DELT) { - for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) { - io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); - printf ("Rowmaj-rd %8d %8.2f", (int)cache_size, io_percent); - fflush (stdout); - effic = test_rowmaj (READ, cache_size, io_size); - printf (" %8.2f\n", effic); - if (RM_CACHE_STRT==RM_CACHE_END) { - fprintf (d, "%g %g\n", io_percent, effic); - } else { - fprintf (d, "%g\n", effic); - } - } - fprintf (d, "\n"); + cache_size<=RM_CACHE_END; + cache_size+=RM_CACHE_DELT) { + for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) { + io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); + printf ("Rowmaj-rd %8d %8.2f", (int)cache_size, io_percent); + fflush (stdout); + effic = test_rowmaj (READ, cache_size, io_size); + printf (" %8.2f\n", effic); + if (RM_CACHE_STRT==RM_CACHE_END) { + fprintf (d, "%g %g\n", io_percent, effic); + } else { + fprintf (d, "%g\n", effic); + } + } + fprintf (d, "\n"); } fclose (d); fprintf (f, "pause -1\n"); @@ -415,41 +414,41 @@ main (void) * windows. */ if (RM_CACHE_STRT==RM_CACHE_END) { - fprintf (f, "set yrange [0:1.2]\n"); - fprintf (f, "set ytics 0, 0.1, 1\n"); - fprintf (f, "set xlabel \"%s\"\n", - "Request size as a fraction of chunk size"); - fprintf (f, "set ylabel \"Efficiency\"\n"); - fprintf (f, "set title \"Cache %d chunks,w0=%g, " - "Size=(total=%d, chunk=%d)\"\n", - RM_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); + fprintf (f, "set yrange [0:1.2]\n"); + fprintf (f, "set ytics 0, 0.1, 1\n"); + fprintf (f, "set xlabel \"%s\"\n", + "Request size as a fraction of chunk size"); + fprintf (f, "set ylabel \"Efficiency\"\n"); + fprintf (f, "set title \"Cache %d chunks,w0=%g, " + "Size=(total=%d, chunk=%d)\"\n", + RM_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); } else { - fprintf (f, "set autoscale\n"); - fprintf (f, "set hidden3d\n"); + fprintf (f, "set autoscale\n"); + fprintf (f, "set hidden3d\n"); } fprintf (f, "set terminal postscript\nset output \"x-rowmaj-wr.ps\"\n"); fprintf (f, "%s \"x-rowmaj-wr.dat\" title \"RowMaj-Write\" with %s\n", - RM_CACHE_STRT==RM_CACHE_END?"plot":"splot", - LINESPOINTS); + RM_CACHE_STRT==RM_CACHE_END?"plot":"splot", + LINESPOINTS); fprintf (f, "set terminal x11\nreplot\n"); d = fopen ("x-rowmaj-wr.dat", "w"); for (cache_size=RM_CACHE_STRT; - cache_size<=RM_CACHE_END; - cache_size+=RM_CACHE_DELT) { - for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) { - io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); - printf ("Rowmaj-wr %8d %8.2f", (int)cache_size, io_percent); - fflush (stdout); - effic = test_rowmaj (WRITE, cache_size, io_size); - printf (" %8.2f\n", effic); - if (RM_CACHE_STRT==RM_CACHE_END) { - fprintf (d, "%g %g\n", io_percent, effic); - } else { - fprintf (d, "%g\n", effic); - } - } - fprintf (d, "\n"); + cache_size<=RM_CACHE_END; + cache_size+=RM_CACHE_DELT) { + for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) { + io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); + printf ("Rowmaj-wr %8d %8.2f", (int)cache_size, io_percent); + fflush (stdout); + effic = test_rowmaj (WRITE, cache_size, io_size); + printf (" %8.2f\n", effic); + if (RM_CACHE_STRT==RM_CACHE_END) { + fprintf (d, "%g %g\n", io_percent, effic); + } else { + fprintf (d, "%g\n", effic); + } + } + fprintf (d, "\n"); } fclose (d); fprintf (f, "pause -1\n"); @@ -460,39 +459,39 @@ main (void) * Test diagonal read */ if (DIAG_CACHE_STRT==DIAG_CACHE_END) { - fprintf (f, "set yrange [0:1.2]\n"); - fprintf (f, "set ytics 0, 0.1, 1\n"); - fprintf (f, "set xlabel \"%s\"\n", - "Request size as a fraction of chunk size"); - fprintf (f, "set ylabel \"Efficiency\"\n"); - fprintf (f, "set title \"Cache %d chunks,w0=%g, " - "Size=(total=%d, chunk=%d)\"\n", - DIAG_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); + fprintf (f, "set yrange [0:1.2]\n"); + fprintf (f, "set ytics 0, 0.1, 1\n"); + fprintf (f, "set xlabel \"%s\"\n", + "Request size as a fraction of chunk size"); + fprintf (f, "set ylabel \"Efficiency\"\n"); + fprintf (f, "set title \"Cache %d chunks,w0=%g, " + "Size=(total=%d, chunk=%d)\"\n", + DIAG_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); } else { - fprintf (f, "set autoscale\n"); - fprintf (f, "set hidden3d\n"); + fprintf (f, "set autoscale\n"); + fprintf (f, "set hidden3d\n"); } fprintf (f, "set terminal postscript\nset output \"x-diag-rd.ps\"\n"); fprintf (f, "%s \"x-diag-rd.dat\" title \"Diag-Read\" with %s\n", - DIAG_CACHE_STRT==DIAG_CACHE_END?"plot":"splot", LINESPOINTS); + DIAG_CACHE_STRT==DIAG_CACHE_END?"plot":"splot", LINESPOINTS); fprintf (f, "set terminal x11\nreplot\n"); d = fopen ("x-diag-rd.dat", "w"); for (cache_size=DIAG_CACHE_STRT; - cache_size<=DIAG_CACHE_END; - cache_size+=DIAG_CACHE_DELT) { - for (io_percent=DIAG_START; io_percent<=DIAG_END; io_percent+=DIAG_DELTA) { - io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); - printf ("Diag-rd %8d %8.2f", (int)cache_size, io_percent); - fflush (stdout); - effic = test_diag (READ, cache_size, io_size, MAX (1, io_size/2)); - printf (" %8.2f\n", effic); - if (DIAG_CACHE_STRT==DIAG_CACHE_END) { - fprintf (d, "%g %g\n", io_percent, effic); - } else { - fprintf (d, "%g\n", effic); - } - } - fprintf (d, "\n"); + cache_size<=DIAG_CACHE_END; + cache_size+=DIAG_CACHE_DELT) { + for (io_percent=DIAG_START; io_percent<=DIAG_END; io_percent+=DIAG_DELTA) { + io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); + printf ("Diag-rd %8d %8.2f", (int)cache_size, io_percent); + fflush (stdout); + effic = test_diag (READ, cache_size, io_size, MAX (1, io_size/2)); + printf (" %8.2f\n", effic); + if (DIAG_CACHE_STRT==DIAG_CACHE_END) { + fprintf (d, "%g %g\n", io_percent, effic); + } else { + fprintf (d, "%g\n", effic); + } + } + fprintf (d, "\n"); } fclose (d); fprintf (f, "pause -1\n"); @@ -503,41 +502,41 @@ main (void) * Test diagonal write */ if (DIAG_CACHE_STRT==DIAG_CACHE_END) { - fprintf (f, "set yrange [0:1.2]\n"); - fprintf (f, "set ytics 0, 0.1, 1\n"); - fprintf (f, "set xlabel \"%s\"\n", - "Request size as a fraction of chunk size"); - fprintf (f, "set ylabel \"Efficiency\"\n"); - fprintf (f, "set title \"Cache %d chunks, w0=%g, " - "Size=(total=%d, chunk=%d)\"\n", - DIAG_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); + fprintf (f, "set yrange [0:1.2]\n"); + fprintf (f, "set ytics 0, 0.1, 1\n"); + fprintf (f, "set xlabel \"%s\"\n", + "Request size as a fraction of chunk size"); + fprintf (f, "set ylabel \"Efficiency\"\n"); + fprintf (f, "set title \"Cache %d chunks, w0=%g, " + "Size=(total=%d, chunk=%d)\"\n", + DIAG_CACHE_STRT, w0, DS_SIZE*CH_SIZE, CH_SIZE); } else { - fprintf (f, "set autoscale\n"); - fprintf (f, "set hidden3d\n"); + fprintf (f, "set autoscale\n"); + fprintf (f, "set hidden3d\n"); } fprintf (f, "set terminal postscript\nset output \"x-diag-wr.ps\"\n"); fprintf (f, "%s \"x-diag-wr.dat\" title \"Diag-Write\" with %s\n", - DIAG_CACHE_STRT==DIAG_CACHE_END?"plot":"splot", LINESPOINTS); + DIAG_CACHE_STRT==DIAG_CACHE_END?"plot":"splot", LINESPOINTS); fprintf (f, "set terminal x11\nreplot\n"); d = fopen ("x-diag-wr.dat", "w"); for (cache_size=DIAG_CACHE_STRT; - cache_size<=DIAG_CACHE_END; - cache_size+=DIAG_CACHE_DELT) { - for (io_percent=DIAG_START; - io_percent<=DIAG_END; - io_percent+=DIAG_DELTA) { - io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); - printf ("Diag-wr %8d %8.2f", (int)cache_size, io_percent); - fflush (stdout); - effic = test_diag (WRITE, cache_size, io_size, MAX (1, io_size/2)); - printf (" %8.2f\n", effic); - if (DIAG_CACHE_STRT==DIAG_CACHE_END) { - fprintf (d, "%g %g\n", io_percent, effic); - } else { - fprintf (d, "%g\n", effic); - } - } - fprintf (d, "\n"); + cache_size<=DIAG_CACHE_END; + cache_size+=DIAG_CACHE_DELT) { + for (io_percent=DIAG_START; + io_percent<=DIAG_END; + io_percent+=DIAG_DELTA) { + io_size = MAX (1, (size_t)(CH_SIZE*io_percent)); + printf ("Diag-wr %8d %8.2f", (int)cache_size, io_percent); + fflush (stdout); + effic = test_diag (WRITE, cache_size, io_size, MAX (1, io_size/2)); + printf (" %8.2f\n", effic); + if (DIAG_CACHE_STRT==DIAG_CACHE_END) { + fprintf (d, "%g %g\n", io_percent, effic); + } else { + fprintf (d, "%g\n", effic); + } + } + fprintf (d, "\n"); } fclose (d); fprintf (f, "pause -1\n"); diff --git a/tools/perform/perf_meta.c b/tools/perform/perf_meta.c index b52871e..2c3a19c 100644 --- a/tools/perform/perf_meta.c +++ b/tools/perform/perf_meta.c @@ -821,7 +821,7 @@ main(int argc, char **argv) if (H5Sclose(space) < 0) goto error; if (H5Sclose(small_space) < 0) goto error; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); #ifdef H5_HAVE_PARALLEL if(facc_type == FACC_MPIO) diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls index 9c19957..6d1da9e 100644 --- a/tools/testfiles/textlinksrc-nodangle-1.ls +++ b/tools/testfiles/textlinksrc-nodangle-1.ls @@ -1,5 +1,3 @@ -Error: --no-dangling-links must be used along with --follow-symlinks option! - usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit @@ -58,3 +56,5 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] Replaced by --follow-symlinks. -e, --errors Show all HDF5 error reporting Replaced by --enable-error-stack. +Error: --no-dangling-links must be used along with --follow-symlinks option! + diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index 893c9ce..069d43e 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -1,5 +1,3 @@ -Error: 'recursive' option not compatible with 'group info' option! - usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit @@ -58,3 +56,5 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] Replaced by --follow-symlinks. -e, --errors Show all HDF5 error reporting Replaced by --enable-error-stack. +Error: 'recursive' option not compatible with 'group info' option! + -- cgit v0.12 From 6e89ba320794568747456e826b263a2dc6e1f822 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 10:12:50 -0500 Subject: Add missing declarations --- test/h5test.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/h5test.h b/test/h5test.h index 065c089..0a7744d 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -157,6 +157,15 @@ H5TEST_DLL int print_func(const char *format, ...); H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name); H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); +/* Functions that will replace VFD-dependent functions that violate + * the single responsibility principle. Unlike their predecessors, + * these new functions do not have hidden side effects. + */ +/* h5_fileaccess() replacement */ +/* h5_clean_files() replacements */ +H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl); +H5TEST_DLL void h5_delete_all_test_files(const char *base_name[], hid_t fapl); + /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), -- cgit v0.12 From 7fce861b670331bced99d38a241677385cb746d1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:15:25 -0500 Subject: HDFFV-10143 Fix initial issues from review Fixed Conflicts: MANIFEST test/plugin.c --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5PL.c | 137 +++++++++++++---------------------------------- src/H5PLpkg.h | 50 ++++++++++++++++++ test/plugin.c | 152 ++++++++++++++++++++++++++++++++--------------------- 5 files changed, 181 insertions(+), 160 deletions(-) create mode 100644 src/H5PLpkg.h diff --git a/MANIFEST b/MANIFEST index bf8fcbd..24e00a8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -738,6 +738,7 @@ ./src/H5Pstrcpl.c ./src/H5Ptest.c ./src/H5PL.c +./src/H5PLpkg.h ./src/H5PLprivate.h ./src/H5PLpublic.h ./src/H5PLextern.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db12160..d343208 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -357,6 +357,7 @@ set (H5PL_SRCS set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h + ${HDF5_SRC_DIR}/H5PLpkg.h ${HDF5_SRC_DIR}/H5PLpublic.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) diff --git a/src/H5PL.c b/src/H5PL.c index 0e136a4..895471f 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -26,15 +26,34 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5MMprivate.h" /* Memory management */ -#include "H5PLprivate.h" /* Plugin */ +#include "H5PLpkg.h" /* Plugin */ #include "H5Zprivate.h" /* Filter pipeline */ /****************/ /* Local Macros */ /****************/ - -#define H5PL_MAX_PATH_NUM 16 +#ifdef H5_HAVE_WIN32_API +#define H5PL_EXPAND_ENV_VAR { \ + long bufCharCount; \ + char *tempbuf; \ + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \ + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \ + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \ + } \ + if(bufCharCount == 0) { \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \ + } \ + dl_path = (char *)H5MM_xfree(dl_path); \ + dl_path = H5MM_strdup(tempbuf); \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + } +#else +#define H5PL_EXPAND_ENV_VAR +#endif /* H5_HAVE_WIN32_API */ /****************************/ /* Macros for supporting @@ -402,25 +421,9 @@ H5PLappend(char* plugin_path) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dl_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_num_paths_g++; @@ -457,25 +460,9 @@ H5PLprepend(char* plugin_path) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if (NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if ((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if (bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; if (NULL == (H5PL_path_table_g[0] = H5MM_strdup(dl_path))) @@ -511,25 +498,9 @@ H5PLput(char* plugin_path, unsigned int index) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) @@ -567,25 +538,9 @@ H5PLinsert(char* plugin_path, unsigned int index) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) @@ -652,9 +607,9 @@ H5PLget(unsigned int index) FUNC_ENTER_API(NULL) if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, NULL, "no directories in table") if(NULL == (ret_value = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no directory path at index") done: FUNC_LEAVE_API(ret_value) @@ -710,25 +665,7 @@ H5PL__init_path_table(void) if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + H5PL_EXPAND_ENV_VAR /* Put paths in the path table. They are separated by ":" */ dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h new file mode 100644 index 0000000..2761a33 --- /dev/null +++ b/src/H5PLpkg.h @@ -0,0 +1,50 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !(defined H5PL_FRIEND || defined H5PL_MODULE) +#error "Do not include this file outside the H5PL package!" +#endif + +#ifndef _H5PLpkg_H +#define _H5PLpkg_H + +/* Include private header file */ +#include "H5PLprivate.h" /* Filter functions */ + +/* Other private headers needed by this file */ + +/**************************/ +/* Package Private Macros */ +/**************************/ + + +/****************************/ +/* Package Private Typedefs */ +/****************************/ + +#define H5PL_MAX_PATH_NUM 16 + + +/*****************************/ +/* Package Private Variables */ +/*****************************/ + + +/******************************/ +/* Package Private Prototypes */ +/******************************/ + +#endif /* _H5PLpkg_H */ + diff --git a/test/plugin.c b/test/plugin.c index f0c0dd0..6eae259 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -22,8 +22,10 @@ #include "H5srcdir.h" /* - * This file needs to access private datatypes from the H5Z package. + * This file needs to access private datatypes from the H5Z and H5PL package. */ +#define H5PL_PACKAGE +#include "H5PLpkg.h" #define H5Z_PACKAGE #include "H5Zpkg.h" @@ -114,7 +116,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); - printf(" Line %d: Incorrect filter availability\n",__LINE__); + HDprintf(" Line %d: Incorrect filter availability\n",__LINE__); TEST_ERROR } /* end if */ @@ -137,8 +139,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j<(size_t)size[1]; j++) { if(0!=check[i][j]) { H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", + HDprintf(" Read a non-zero value.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); TEST_ERROR } @@ -180,10 +182,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j 0; i--) { if (H5PLremove(i-1) < 0) { - fprintf(stderr," at %d: %s\n", i, pathname); + HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } @@ -772,9 +774,9 @@ test_filter_path_apis(void) TESTING(" append"); /* Create multiple paths to fill table */ for (i=0; i < 16; i++) { - sprintf(pathname, "a_path_%d", i); + HDsprintf(pathname, "a_path_%d", i); if (H5PLappend(pathname) < 0) { - fprintf(stderr," at %d: %s\n", i, pathname); + HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } @@ -785,11 +787,41 @@ test_filter_path_apis(void) TESTING(" append (exceed)"); /* Exceed the max path append */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 16); + HDsprintf(pathname, "a_path_%d", 16); ret = H5PLappend(pathname); } H5E_END_TRY if (ret >= 0) TEST_ERROR + + /* Exceed the max path removal */ + H5E_BEGIN_TRY { + ret = H5PLremove(16); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR + PASSED(); + + TESTING(" get (bounds)"); + HDsprintf(pathname, "%s", H5PLget(0)); + if (strcmp(pathname, "a_path_0") != 0) { + HDfprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + HDsprintf(pathname, "%s", H5PLget(1)); + if (strcmp(pathname, "a_path_1") != 0) { + HDfprintf(stderr," get 1: %s\n", pathname); + TEST_ERROR + } + HDsprintf(pathname, "%s", H5PLget(15)); + if (strcmp(pathname, "a_path_15") != 0) { + HDfprintf(stderr," get 15: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" get (bounds exceed)"); + if (H5PLget(16) != NULL) + TEST_ERROR PASSED(); TESTING(" remove (verify for prepend)"); @@ -797,9 +829,9 @@ test_filter_path_apis(void) if (H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(8)); + HDsprintf(pathname, "%s", H5PLget(8)); if (strcmp(pathname, "a_path_9") != 0) { - fprintf(stderr," get 8: %s\n", pathname); + HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } PASSED(); @@ -809,9 +841,9 @@ test_filter_path_apis(void) TESTING(" prepend"); /* Prepend one path*/ - sprintf(pathname, "a_path_%d", 17); + HDsprintf(pathname, "a_path_%d", 17); if (H5PLprepend(pathname) < 0) { - fprintf(stderr," prepend 17: %s\n", pathname); + HDfprintf(stderr," prepend 17: %s\n", pathname); TEST_ERROR } @@ -819,14 +851,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(8)); + HDsprintf(pathname, "%s", H5PLget(8)); if (strcmp(pathname, "a_path_7") != 0) { - fprintf(stderr," get 8: %s\n", pathname); + HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - sprintf(pathname, "%s", H5PLget(0)); + HDsprintf(pathname, "%s", H5PLget(0)); if (strcmp(pathname, "a_path_17") != 0) { - fprintf(stderr," get 0: %s\n", pathname); + HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } PASSED(); @@ -834,7 +866,7 @@ test_filter_path_apis(void) TESTING(" prepend (exceed)"); /* Exceed the max path prepend */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 18); + HDsprintf(pathname, "a_path_%d", 18); ret = H5PLprepend(pathname); } H5E_END_TRY if (ret >= 0) @@ -843,9 +875,9 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ - sprintf(pathname, "a_path_%d", 20); + HDsprintf(pathname, "a_path_%d", 20); if (H5PLput(pathname, 1) < 0) { - fprintf(stderr," replace 1: %s\n", pathname); + HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } @@ -853,14 +885,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were not moved */ - sprintf(pathname, "%s", H5PLget(0)); + HDsprintf(pathname, "%s", H5PLget(0)); if (strcmp(pathname, "a_path_17") != 0) { - fprintf(stderr," get 0: %s\n", pathname); + HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - sprintf(pathname, "%s", H5PLget(2)); + HDsprintf(pathname, "%s", H5PLget(2)); if (strcmp(pathname, "a_path_1") != 0) { - fprintf(stderr," get 2: %s\n", pathname); + HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR } PASSED(); @@ -870,9 +902,9 @@ test_filter_path_apis(void) if (H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(4)); + HDsprintf(pathname, "%s", H5PLget(4)); if (strcmp(pathname, "a_path_4") != 0) { - fprintf(stderr," get 4: %s\n", pathname); + HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); @@ -882,16 +914,16 @@ test_filter_path_apis(void) TESTING(" insert"); /* Insert one path*/ - sprintf(pathname, "a_path_%d", 21); + HDsprintf(pathname, "a_path_%d", 21); if (H5PLinsert(pathname, 3) < 0){ - fprintf(stderr," insert 3: %s\n", pathname); + HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR } /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(4)); + HDsprintf(pathname, "%s", H5PLget(4)); if (strcmp(pathname, "a_path_2") != 0){ - fprintf(stderr," get 4: %s\n", pathname); + HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); @@ -902,7 +934,7 @@ test_filter_path_apis(void) TESTING(" insert (exceed)"); /* Exceed the max path insert */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 22); + HDsprintf(pathname, "a_path_%d", 22); ret = H5PLinsert(pathname, 12); } H5E_END_TRY if (ret >= 0) @@ -968,11 +1000,11 @@ main(void) /* Set the FAPL for the type of format */ if(new_format) { - puts("\nTesting with new file format:"); + HDputs("\nTesting with new file format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old file format:"); + HDputs("Testing with old file format:"); my_fapl = fapl; } /* end else */ @@ -997,7 +1029,7 @@ main(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - puts("\nTesting reading data with with dynamic plugin filters:"); + HDputs("\nTesting reading data with with dynamic plugin filters:"); /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); @@ -1035,14 +1067,14 @@ main(void) if(nerrors) TEST_ERROR - printf("All plugin tests passed.\n"); + HDprintf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d PLUGIN TEST%s FAILED! *****\n", + HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } -- cgit v0.12 From 1988ea6a50c4a08683800c079a1181290d9e09d6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:17:48 -0500 Subject: HDFFV-10143 Use Windows A version of ExpandEnvironmentStrings --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 895471f..7f8c1b2 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -39,7 +39,7 @@ char *tempbuf; \ if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \ - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ + if((bufCharCount = ExpandEnvironmentStringsA(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ tempbuf = (char *)H5MM_xfree(tempbuf); \ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \ } \ -- cgit v0.12 From be52ecea8ca22aacf928d59cd09d13533c9fc8fb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:36:12 -0500 Subject: Remove redundant code --- src/H5PL.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 7f8c1b2..a359963 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -48,8 +48,7 @@ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \ } \ dl_path = (char *)H5MM_xfree(dl_path); \ - dl_path = H5MM_strdup(tempbuf); \ - tempbuf = (char *)H5MM_xfree(tempbuf); \ + dl_path = tempbuf; \ } #else #define H5PL_EXPAND_ENV_VAR @@ -424,8 +423,8 @@ H5PLappend(char* plugin_path) H5PL_EXPAND_ENV_VAR - if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[H5PL_num_paths_g] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -465,8 +464,8 @@ H5PLprepend(char* plugin_path) for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - if (NULL == (H5PL_path_table_g[0] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[0] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -503,8 +502,8 @@ H5PLput(char* plugin_path, unsigned int index) if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); - if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[index] = dl_path; + dl_path = NULL; done: if(dl_path) @@ -543,8 +542,8 @@ H5PLinsert(char* plugin_path, unsigned int index) for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[index] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -584,9 +583,6 @@ H5PLremove(unsigned int index) H5PL_path_table_g[H5PL_num_paths_g] = NULL; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLremove() */ -- cgit v0.12 From 4014d5109ce952e62cdaf8dd5f893f72c80d0779 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 13:22:43 -0500 Subject: HDFFV-10143 change put to replace and add const --- src/H5PL.c | 12 ++++++------ src/H5PLpublic.h | 8 ++++---- test/plugin.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index a359963..7986b30 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -407,7 +407,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(char* plugin_path) +H5PLappend(const char* plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -445,7 +445,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(char* plugin_path) +H5PLprepend(const char* plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -477,7 +477,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5PLput + * Function: H5PLreplace * * Purpose: Replace the path at the specified index. * @@ -486,7 +486,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLput(char* plugin_path, unsigned int index) +H5PLreplace(const char* plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -510,7 +510,7 @@ done: dl_path = (char *)H5MM_xfree(dl_path); FUNC_LEAVE_API(ret_value) -} /* end H5PLput() */ +} /* end H5PLreplace() */ /*------------------------------------------------------------------------- @@ -523,7 +523,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(char* plugin_path, unsigned int index) +H5PLinsert(const char* plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index f3fe497..ca46542 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -44,10 +44,10 @@ extern "C" { /* plugin state */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/); -H5_DLL herr_t H5PLappend(char* plugin_path); -H5_DLL herr_t H5PLprepend(char* plugin_path); -H5_DLL herr_t H5PLput(char* plugin_path, unsigned int index); -H5_DLL herr_t H5PLinsert(char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLappend(const char* plugin_path); +H5_DLL herr_t H5PLprepend(const char* plugin_path); +H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); H5_DLL const char* H5PLget(unsigned int index); H5_DLL unsigned int H5PLsize(void); diff --git a/test/plugin.c b/test/plugin.c index 6eae259..53eaf21 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -876,7 +876,7 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ HDsprintf(pathname, "a_path_%d", 20); - if (H5PLput(pathname, 1) < 0) { + if (H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } -- cgit v0.12 From 52b994bc5d49c5ab45991647444e353c0dfcc9d7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 14:40:03 -0500 Subject: HDFFV-10143 change h5PLget to use buffer like H5Iget_name --- src/H5PL.c | 63 ++++++++++++++++++++++++++++---------------------------- src/H5PLpublic.h | 2 +- test/plugin.c | 53 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 74 insertions(+), 44 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 7986b30..b063fd1 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -418,19 +418,15 @@ H5PLappend(const char* plugin_path) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR H5PL_path_table_g[H5PL_num_paths_g] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLappend() */ @@ -456,8 +452,7 @@ H5PLprepend(const char* plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -465,13 +460,9 @@ H5PLprepend(const char* plugin_path) for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; H5PL_path_table_g[0] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if (dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLprepend() */ @@ -494,8 +485,7 @@ H5PLreplace(const char* plugin_path, unsigned int index) FUNC_ENTER_API(FAIL) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -503,12 +493,8 @@ H5PLreplace(const char* plugin_path, unsigned int index) if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); H5PL_path_table_g[index] = dl_path; - dl_path = NULL; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLreplace() */ @@ -534,8 +520,7 @@ H5PLinsert(const char* plugin_path, unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -543,13 +528,9 @@ H5PLinsert(const char* plugin_path, unsigned int index) for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; H5PL_path_table_g[index] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLinsert() */ @@ -592,20 +573,40 @@ done: * * Purpose: Query the plugin path at the specified index. * - * Return: Non-NULL on success/NULL on failure + * Return: Success: The length of path. + * + * If `pathname' is non-NULL then write up to `size' bytes into that + * buffer and always return the length of the pathname. + * Otherwise `size' is ignored and the function does not store the pathname, + * just returning the number of characters required to store the pathname. + * If an error occurs then the buffer pointed to by `pathname' (NULL or non-NULL) + * is unchanged and the function returns a negative value. + * If a zero is returned for the name's length, then there is no pathname + * associated with the index. * *------------------------------------------------------------------------- */ -const char* -H5PLget(unsigned int index) +ssize_t +H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { - char* ret_value = NULL; /* Return value */ + ssize_t ret_value = FAIL; /* Return value */ + ssize_t len = 0; /* Length of pathname */ + char *dl_path = NULL; - FUNC_ENTER_API(NULL) + FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, NULL, "no directories in table") - if(NULL == (ret_value = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no directory path at index") + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(NULL == (dl_path = H5PL_path_table_g[index])) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + len = HDstrlen(dl_path); + if(pathname) { + HDstrncpy(pathname, dl_path, MIN((size_t)(len + 1), size)); + if((size_t)len >= size) + pathname[size - 1] = '\0'; + } /* end if */ + + /* Set return value */ + ret_value = len; done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index ca46542..5e4dcae 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -49,7 +49,7 @@ H5_DLL herr_t H5PLprepend(const char* plugin_path); H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); -H5_DLL const char* H5PLget(unsigned int index); +H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size); H5_DLL unsigned int H5PLsize(void); #ifdef __cplusplus diff --git a/test/plugin.c b/test/plugin.c index 53eaf21..e27ce01 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -744,6 +744,7 @@ test_filter_path_apis(void) int i; unsigned int ndx; herr_t ret; + int pathlen = -1; char pathname[256]; HDputs("Testing access to the filter path table"); @@ -801,18 +802,37 @@ test_filter_path_apis(void) TEST_ERROR PASSED(); - TESTING(" get (bounds)"); - HDsprintf(pathname, "%s", H5PLget(0)); + TESTING(" get (path name)"); + if ((pathlen = H5PLget(0, NULL, 0)) <= 0) { + HDfprintf(stderr," get path 0 length failed\n"); + TEST_ERROR + } + HDfprintf(stdout," get path 0 length %d\n", pathlen); + if (pathlen != 8) { + TEST_ERROR + } + if ((pathlen = H5PLget(0, pathname, 256)) <= 0) { + HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); + TEST_ERROR + } + HDfprintf(stdout," get path 0 length %d\n", pathlen); if (strcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(1)); + PASSED(); + + TESTING(" get (bounds)"); + if ((pathlen = H5PLget(1, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 1 length %d\n", pathlen); if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(15)); + if ((pathlen = H5PLget(15, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 15 length %d\n", pathlen); if (strcmp(pathname, "a_path_15") != 0) { HDfprintf(stderr," get 15: %s\n", pathname); TEST_ERROR @@ -820,16 +840,19 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if (H5PLget(16) != NULL) + if ((pathlen = H5PLget(16, NULL, 0)) > 0) TEST_ERROR PASSED(); + HDfprintf(stdout," get path 16 length %d\n", pathlen); TESTING(" remove (verify for prepend)"); /* Remove one path*/ if (H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(8)); + if ((pathlen = H5PLget(8, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 8 length %d\n", pathlen); if (strcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR @@ -851,12 +874,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(8)); + if (H5PLget(8, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_7") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(0)); + if (H5PLget(0, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_17") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR @@ -885,12 +910,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were not moved */ - HDsprintf(pathname, "%s", H5PLget(0)); + if (H5PLget(0, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_17") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(2)); + if (H5PLget(2, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR @@ -902,7 +929,8 @@ test_filter_path_apis(void) if (H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(4)); + if (H5PLget(4, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR @@ -921,7 +949,8 @@ test_filter_path_apis(void) } /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(4)); + if (H5PLget(4, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_2") != 0){ HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR -- cgit v0.12 From 06ed851867bd3751bcb7c888f5fd1a5a3aee5780 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 14:47:38 -0500 Subject: HDFFV-10143 remove debugging output --- test/plugin.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index e27ce01..dc2ce95 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -807,7 +807,6 @@ test_filter_path_apis(void) HDfprintf(stderr," get path 0 length failed\n"); TEST_ERROR } - HDfprintf(stdout," get path 0 length %d\n", pathlen); if (pathlen != 8) { TEST_ERROR } @@ -815,7 +814,6 @@ test_filter_path_apis(void) HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); TEST_ERROR } - HDfprintf(stdout," get path 0 length %d\n", pathlen); if (strcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR @@ -825,14 +823,12 @@ test_filter_path_apis(void) TESTING(" get (bounds)"); if ((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 1 length %d\n", pathlen); if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } if ((pathlen = H5PLget(15, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 15 length %d\n", pathlen); if (strcmp(pathname, "a_path_15") != 0) { HDfprintf(stderr," get 15: %s\n", pathname); TEST_ERROR @@ -843,7 +839,6 @@ test_filter_path_apis(void) if ((pathlen = H5PLget(16, NULL, 0)) > 0) TEST_ERROR PASSED(); - HDfprintf(stdout," get path 16 length %d\n", pathlen); TESTING(" remove (verify for prepend)"); /* Remove one path*/ @@ -852,7 +847,6 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if ((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 8 length %d\n", pathlen); if (strcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR -- cgit v0.12 From 4626032e030e2afcb71ca65b9df72b4aa66f9f8e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 15:03:31 -0500 Subject: HDFFV-10143 Cleanup due to comments --- src/H5PL.c | 6 ++---- src/H5PLpkg.h | 4 ++-- test/plugin.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index b063fd1..f6e8368 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -548,18 +548,16 @@ herr_t H5PLremove(unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; unsigned int plindex; FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") - if(NULL == (dl_path = H5PL_path_table_g[index])) + if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + H5PL_path_table_g[plindex] = (char *)H5MM_xfree(H5PL_path_table_g[plindex]); for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; - if(H5PL_path_table_g[plindex]) - dl_path = (char *)H5MM_xfree(dl_path); H5PL_num_paths_g--; H5PL_path_table_g[H5PL_num_paths_g] = NULL; diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 2761a33..5cf3096 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -29,13 +29,13 @@ /* Package Private Macros */ /**************************/ +#define H5PL_MAX_PATH_NUM 16 + /****************************/ /* Package Private Typedefs */ /****************************/ -#define H5PL_MAX_PATH_NUM 16 - /*****************************/ /* Package Private Variables */ diff --git a/test/plugin.c b/test/plugin.c index dc2ce95..05cfc31 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -774,7 +774,7 @@ test_filter_path_apis(void) TESTING(" append"); /* Create multiple paths to fill table */ - for (i=0; i < 16; i++) { + for (i=0; i < H5PL_MAX_PATH_NUM; i++) { HDsprintf(pathname, "a_path_%d", i); if (H5PLappend(pathname) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); @@ -782,7 +782,7 @@ test_filter_path_apis(void) } } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -796,7 +796,7 @@ test_filter_path_apis(void) /* Exceed the max path removal */ H5E_BEGIN_TRY { - ret = H5PLremove(16); + ret = H5PLremove(H5PL_MAX_PATH_NUM); } H5E_END_TRY if (ret >= 0) TEST_ERROR @@ -836,7 +836,7 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if ((pathlen = H5PLget(16, NULL, 0)) > 0) + if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0)) > 0) TEST_ERROR PASSED(); @@ -865,7 +865,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ if (H5PLget(8, pathname, 256) <= 0) @@ -901,7 +901,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ if (H5PLget(0, pathname, 256) <= 0) @@ -952,7 +952,7 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ -- cgit v0.12 From a27c4955fa67ae6e2c12ffa8cf4b5a5d1f25d93f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 16:48:10 -0500 Subject: Fix code error and use H5PL_MAX_PATH_NUM in test --- src/H5PL.c | 3 +-- test/plugin.c | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index f6e8368..a0692a0 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -417,7 +417,6 @@ H5PLappend(const char* plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -587,7 +586,7 @@ done: ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { - ssize_t ret_value = FAIL; /* Return value */ + ssize_t ret_value = 0; /* Return value */ ssize_t len = 0; /* Length of pathname */ char *dl_path = NULL; diff --git a/test/plugin.c b/test/plugin.c index 05cfc31..d2ed68b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -746,6 +746,7 @@ test_filter_path_apis(void) herr_t ret; int pathlen = -1; char pathname[256]; + char tempname[256]; HDputs("Testing access to the filter path table"); @@ -788,7 +789,7 @@ test_filter_path_apis(void) TESTING(" append (exceed)"); /* Exceed the max path append */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 16); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); ret = H5PLappend(pathname); } H5E_END_TRY if (ret >= 0) @@ -827,10 +828,11 @@ test_filter_path_apis(void) HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - if ((pathlen = H5PLget(15, pathname, 256)) <= 0) + if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_15") != 0) { - HDfprintf(stderr," get 15: %s\n", pathname); + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); + if (strcmp(pathname, tempname") != 0) { + HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } PASSED(); @@ -854,13 +856,13 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if (H5PLsize() != 15) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); /* Prepend one path*/ - HDsprintf(pathname, "a_path_%d", 17); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); if (H5PLprepend(pathname) < 0) { - HDfprintf(stderr," prepend 17: %s\n", pathname); + HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); TEST_ERROR } @@ -876,7 +878,8 @@ test_filter_path_apis(void) } if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_17") != 0) { + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if (strcmp(pathname, tempname") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -885,7 +888,7 @@ test_filter_path_apis(void) TESTING(" prepend (exceed)"); /* Exceed the max path prepend */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 18); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); ret = H5PLprepend(pathname); } H5E_END_TRY if (ret >= 0) @@ -894,7 +897,7 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ - HDsprintf(pathname, "a_path_%d", 20); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); if (H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR @@ -906,7 +909,8 @@ test_filter_path_apis(void) /* Verify that the entries were not moved */ if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_17") != 0) { + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if (strcmp(pathname, tempname") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -936,7 +940,7 @@ test_filter_path_apis(void) TESTING(" insert"); /* Insert one path*/ - HDsprintf(pathname, "a_path_%d", 21); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); if (H5PLinsert(pathname, 3) < 0){ HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR @@ -957,7 +961,7 @@ test_filter_path_apis(void) TESTING(" insert (exceed)"); /* Exceed the max path insert */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 22); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); ret = H5PLinsert(pathname, 12); } H5E_END_TRY if (ret >= 0) -- cgit v0.12 From 398424ccc079848ae281d159c27db89e6841036d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 16:55:33 -0500 Subject: HDFFV-10143 typo removed --- test/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index d2ed68b..cd8bf57 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -831,7 +831,7 @@ test_filter_path_apis(void) if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } -- cgit v0.12 From 7c0bf0c41d11e47f394587d5095ad29375ae43bc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:03:08 -0500 Subject: HDFFV-10143 typo cleanup --- test/plugin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index cd8bf57..eab0de9 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -741,10 +741,10 @@ error: static herr_t test_filter_path_apis(void) { - int i; + unsigned int i; unsigned int ndx; herr_t ret; - int pathlen = -1; + ssize_t pathlen = -1; char pathname[256]; char tempname[256]; @@ -879,7 +879,7 @@ test_filter_path_apis(void) if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -910,7 +910,7 @@ test_filter_path_apis(void) if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } -- cgit v0.12 From 774b1cfe79c92cb0048d89aaa741ca80c50b42c9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:11:50 -0500 Subject: HDFFV-10143 surround will fail with try block --- test/plugin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index eab0de9..cdd172c 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -838,7 +838,10 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0)) > 0) + H5E_BEGIN_TRY { + pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); + } H5E_END_TRY + if (pathlen > 0) TEST_ERROR PASSED(); -- cgit v0.12 From fd314f93b45fe59ceff3260f7143d831bcb1a152 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:15:54 -0500 Subject: HDFFV-10143 check for H5PL_PACKAGE in 1.8 --- src/H5PLpkg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 5cf3096..baa342e 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#if !(defined H5PL_FRIEND || defined H5PL_MODULE) +#ifndef H5PL_PACKAGE #error "Do not include this file outside the H5PL package!" #endif -- cgit v0.12 From fbfe6f00fce1caeaed690b4aa04c855c640fad1e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:40:44 -0500 Subject: HDFFV-10143 fix use before set --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index a0692a0..68ced18 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -554,7 +554,7 @@ H5PLremove(unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") - H5PL_path_table_g[plindex] = (char *)H5MM_xfree(H5PL_path_table_g[plindex]); + H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; H5PL_num_paths_g--; -- cgit v0.12 From 2e022912f4fb79771f9a0691337cb4da7d602326 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:43:24 -0500 Subject: FIX pkg include error --- src/H5PL.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5PL.c b/src/H5PL.c index 68ced18..683c53d 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -11,6 +11,7 @@ * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#define H5PL_PACKAGE /*suppress error about including H5PLpkg */ /****************/ /* Module Setup */ -- cgit v0.12 From a1e68e2424a9854bf49ca877045c0e7ea498a5f6 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 31 Mar 2017 11:00:54 -0500 Subject: Added comment to file to address HDFFFV-8270 --- bin/output_filter.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/output_filter.sh b/bin/output_filter.sh index 58f1c48..b8b7ff0 100644 --- a/bin/output_filter.sh +++ b/bin/output_filter.sh @@ -17,6 +17,21 @@ # Created Date: 2011/5/3 +# Comment added to address HDFFV-8270: +# As I understand it, the purpose of this file is to remove extraneous messages +# that appear in stdout and stderr on some machines that have been tested outside +# of the HDF Group realm. The purpose of this script is to filter those +# extraneous messages from stdout and stderr so that when the output files are +# compared to the expected output, the extra messages will not cause failures in +# the tests. The system messages in the comments below are out of date, meaning +# I suppose that while the script code to filter messages on the system was +# correct correct when last used, the output in the comments doesn't match the +# script code that follows. I don't currently have access to any of these +# systems to see the current output and the effect of the script code. If using +# this file in the future, please update the comments to match the scripts in use. +# Larry Knox 2017/3/15 + + # Some systems will dump some messages to stdout for various reasons. # Remove them from the stdout result file. # $1 is the file name of the file to be filtered. -- cgit v0.12 From ea1bb348c5da7195e7767bad66707a0dd1c18de1 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sun, 2 Apr 2017 21:18:16 -0500 Subject: Incorporate patch from GE Heathcare (HDFFV-9934) 1) Integrate the patch 2) Fix bugs when debugging the patch 3) Add test to hl/test/test_dset_opt.c Tested on moohan, ostrich, platypus, emu, osx1010test, quail, kituo, mayll. --- hl/src/H5DO.c | 78 +++++++++- hl/src/H5DOpublic.h | 13 ++ hl/test/test_dset_opt.c | 380 +++++++++++++++++++++++++++++++++++++++--------- src/H5D.c | 43 +++++- src/H5Dchunk.c | 306 ++++++++++++++++++++++++++++++++------ src/H5Dio.c | 210 ++++++++++++++++---------- src/H5Dpkg.h | 4 + src/H5Dpublic.h | 11 +- src/H5Pdxpl.c | 28 ++++ 9 files changed, 872 insertions(+), 201 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 99dbd93..151481e 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -29,7 +29,7 @@ /*------------------------------------------------------------------------- * Function: H5DOwrite_chunk * - * Purpose: Writes an entire chunk to the file directly. + * Purpose: Writes an entire chunk to the file directly. * * Return: Non-negative on success/Negative on failure * @@ -39,14 +39,15 @@ *------------------------------------------------------------------------- */ herr_t -H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, +H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf) { hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ hbool_t do_direct_write = TRUE; /* Flag for direct writes */ + hbool_t tt=FALSE; /* Flag for direct writes */ uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ herr_t ret_value = FAIL; /* Return value */ - + /* Check arguments */ if(dset_id < 0) goto done; @@ -89,11 +90,80 @@ done: if(H5Pclose(dxpl_id) < 0) ret_value = FAIL; } /* end if */ - else + else { /* Reset the direct write flag on user DXPL */ + do_direct_write = FALSE; if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) ret_value = FAIL; + } return(ret_value); } /* end H5DOwrite_chunk() */ +/*------------------------------------------------------------------------- + * Function: H5DOread_chunk + * + * Purpose: Reads an entire chunk from the file directly. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 14 February 2016 + * + *------------ ------------------------------------------------------------- + */ +herr_t +H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, + void *buf) +{ + hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ + hbool_t do_direct_read = TRUE; /* Flag for direct writes */ + herr_t ret_value = FAIL; /* Return value */ + + /* Check arguments */ + if(dset_id < 0) + goto done; + if(!buf) + goto done; + if(!offset) + goto done; + if(!filters) + goto done; + + /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ + if(H5P_DEFAULT == dxpl_id) { + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto done; + created_dxpl = TRUE; + } /* end if */ + + /* Set direct write parameters */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &do_direct_read) < 0) + goto done; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &offset) < 0) + goto done; + + /* Read chunk */ + if(H5Dread(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) + goto done; + /* Get the filter mask */ + if(H5Pget(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, filters) < 0) + goto done; + + /* Indicate success */ + ret_value = SUCCEED; + +done: + if(created_dxpl) { + if(H5Pclose(dxpl_id) < 0) + ret_value = FAIL; + } /* end if */ + else { + /* Reset the direct read flag on user DXPL */ + do_direct_read = FALSE; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &do_direct_read) < 0) + ret_value = FAIL; + } + + return(ret_value); +} /* end H5DOread_chunk() */ diff --git a/hl/src/H5DOpublic.h b/hl/src/H5DOpublic.h index 774709e..52c6a09 100644 --- a/hl/src/H5DOpublic.h +++ b/hl/src/H5DOpublic.h @@ -34,6 +34,19 @@ H5_HLDLL herr_t H5DOwrite_chunk(hid_t dset_id, size_t data_size, const void *buf); +/*------------------------------------------------------------------------- + * + * Direct chunk read function + * + *------------------------------------------------------------------------- + */ + +H5_HLDLL herr_t H5DOread_chunk(hid_t dset_id, /*in*/ + hid_t dxpl_id, /*in*/ + const hsize_t *offset, /*in*/ + uint32_t *filters, /*out*/ + void *buf); /*out*/ + #ifdef __cplusplus } #endif diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index a8ffa44..1e7c8e8 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -79,11 +79,10 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ /*------------------------------------------------------------------------- * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk/H5DOread_chunk * * Return: Success: 0 - * - * Failure: 1 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -106,24 +105,32 @@ test_direct_chunk_write (hid_t file) int i, j, n; unsigned filter_mask = 0; + unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ + int aggression = 9; /* Compression aggression setting */ void *outbuf = NULL; /* Pointer to new buffer */ + /* For H5DOread_chunk() */ + void *readbuf = NULL; /* Buffer for reading data */ + const Bytef *pt_readbuf; /* Point to the buffer for data read */ + hsize_t read_chunk_nbytes; /* Size of chunk on disk */ + int read_dst_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to hold un-compressed data */ + + hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("basic functionality of H5DOwrite_chunk"); + TESTING("basic functionality of H5DOwrite_chunk/H5DOread_chunk"); /* * Create the data space with unlimited dimensions. @@ -157,7 +164,7 @@ test_direct_chunk_write (hid_t file) /* Initialize the dataset */ for(i = n = 0; i < NX; i++) for(j = 0; j < NY; j++) - data[i][j] = n++; + data[i][j] = n++; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; @@ -173,7 +180,7 @@ test_direct_chunk_write (hid_t file) /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -187,10 +194,10 @@ test_direct_chunk_write (hid_t file) fprintf(stderr, "overflow"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + fprintf(stderr, "deflate memory error"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "other deflate error"); + fprintf(stderr, "other deflate error"); goto error; } @@ -217,6 +224,59 @@ test_direct_chunk_write (hid_t file) if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) goto error; + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + + /* Get the size of the compressed chunk */ + ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); + + if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { + fprintf(stderr, "Read/write chunk size not the same."); + goto error; + } + + readbuf = HDmalloc(read_chunk_nbytes); + pt_readbuf = (const Bytef *)readbuf; + + /* Test to use H5DOread_chunk() to read the chunk back */ + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) + goto error; + + if(read_filter_mask != filter_mask) { + fprintf(stderr, " Read/write filter mask not the same."); + goto error; + } + + /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ + ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); + + /* Check for various zlib errors */ + if(Z_BUF_ERROR == ret) { + fprintf(stderr, "error: not enough room in output buffer"); + goto error; + } else if(Z_MEM_ERROR == ret) { + fprintf(stderr, "error: not enough memory"); + goto error; + } else if(Z_OK != ret) { + fprintf(stderr, "error: corrupted input data"); + goto error; + } + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(direct_buf[i][j] != read_dst_buf[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" direct_buf=%d, read_dst_buf=%d\n", direct_buf[i][j], read_dst_buf[i][j]); + goto error; + } + } + } + + if(readbuf) + HDfree(readbuf); + /* * Select hyperslab for one chunk in the file */ @@ -227,7 +287,7 @@ test_direct_chunk_write (hid_t file) if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - /* Read the chunk back */ + /* Test to use H5Dread() to read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -243,10 +303,11 @@ test_direct_chunk_write (hid_t file) } } + /* Reinitialize different data for one chunk */ for(i = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = i + j; + direct_buf[i][j] = i + j; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -260,10 +321,10 @@ test_direct_chunk_write (hid_t file) fprintf(stderr, "overflow"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + fprintf(stderr, "deflate memory error"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "other deflate error"); + fprintf(stderr, "other deflate error"); goto error; } @@ -291,7 +352,60 @@ test_direct_chunk_write (hid_t file) if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) goto error; - /* Read the chunk back */ + offset[0] = CHUNK_NX; + offset[1] = CHUNK_NY; + + /* Get the size of the compressed chunk */ + ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); + + if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { + fprintf(stderr, "Read/write chunk size not the same."); + goto error; + } + + readbuf = HDmalloc(read_chunk_nbytes); + pt_readbuf = (const Bytef *)readbuf; + + /* Test to use H5DOread_chunk() to read the chunk back */ + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) + goto error; + + if(read_filter_mask != filter_mask) { + fprintf(stderr, " Read/write filter mask not the same."); + goto error; + } + + /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ + ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); + + /* Check for various zlib errors */ + if(Z_BUF_ERROR == ret) { + fprintf(stderr, "error: not enough room in output buffer"); + goto error; + } else if(Z_MEM_ERROR == ret) { + fprintf(stderr, "error: not enough memory"); + goto error; + } else if(Z_OK != ret) { + fprintf(stderr, "error: corrupted input data"); + goto error; + } + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(direct_buf[i][j] != read_dst_buf[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" direct_buf=%d, my_buf=%d\n", direct_buf[i][j], read_dst_buf[i][j]); + goto error; + } + } + } + + if(readbuf) + HDfree(readbuf); + + /* Test to use H5Dread() to read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -330,9 +444,11 @@ error: if(outbuf) HDfree(outbuf); + if(readbuf) + HDfree(readbuf); return 1; -} +} /* test_direct_chunk_write() */ #endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- @@ -342,8 +458,7 @@ error: * for the dataset * * Return: Success: 0 - * - * Failure: 1 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -363,6 +478,7 @@ test_skip_compress_write1(hid_t file) int i, j, n; unsigned filter_mask = 0; + unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; @@ -374,7 +490,7 @@ test_skip_compress_write1(hid_t file) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("skipping compression filter for H5DOwrite_chunk"); + TESTING("skipping compression filter for H5DOwrite_chunk/H5DOread_chunk"); /* * Create the data space with unlimited dimensions. @@ -411,8 +527,8 @@ test_skip_compress_write1(hid_t file) /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) { - direct_buf[i][j] = n++; - } + direct_buf[i][j] = n++; + } /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. * Indicate skipping the compression filter. */ @@ -433,6 +549,29 @@ test_skip_compress_write1(hid_t file) if((dataset = H5Dopen2(file, DATASETNAME2, H5P_DEFAULT)) < 0) goto error; + /* Use H5DOread_chunk() to read the uncompressed data */ + if((status = H5DOread_chunk(dataset, dxpl, offset, &read_filter_mask, check_chunk)) < 0) + goto error; + + if(read_filter_mask != filter_mask) { + fprintf(stderr, " Read/write filter mask not the same."); + goto error; + } + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(direct_buf[i][j] != check_chunk[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + goto error; + } + } + } + + /* Clear the buffer */ + HDmemset(check_chunk, 0, buf_size); /* * Select hyperslab for the chunk just written in the file */ @@ -443,7 +582,7 @@ test_skip_compress_write1(hid_t file) if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - /* Read the chunk back */ + /* Use H5Dread() to read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -486,7 +625,7 @@ error: /*------------------------------------------------------------------------- * Function: filter_bogus1 * - * Purpose: A bogus filte that adds ADD_ON to the original value + * Purpose: A bogus filter that adds ADD_ON to the original value * * Return: Success: Data chunk size * @@ -565,8 +704,7 @@ filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, * for the dataset * * Return: Success: 0 - * - * Failure: 1 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -586,6 +724,7 @@ test_skip_compress_write2(hid_t file) int i, j, n; unsigned filter_mask = 0; + unsigned read_filter_mask = 0; int origin_direct_buf[CHUNK_NX][CHUNK_NY]; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; @@ -621,10 +760,10 @@ test_skip_compress_write2(hid_t file) /* Register and enable first bogus filter */ if(H5Zregister (H5Z_BOGUS1) < 0) - goto error; + goto error; if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS1, 0, (size_t)0, NULL) < 0) - goto error; + goto error; /* Enable compression filter */ if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0) @@ -632,10 +771,10 @@ test_skip_compress_write2(hid_t file) /* Register and enable second bogus filter */ if(H5Zregister (H5Z_BOGUS2) < 0) - goto error; + goto error; if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS2, 0, (size_t)0, NULL) < 0) - goto error; + goto error; /* * Create a new dataset within the file using cparms @@ -651,9 +790,9 @@ test_skip_compress_write2(hid_t file) /* Initialize data for one chunk. Apply operations of two bogus filters to the chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) { - origin_direct_buf[i][j] = n++; - direct_buf[i][j] = (origin_direct_buf[i][j] + ADD_ON) * FACTOR; - } + origin_direct_buf[i][j] = n++; + direct_buf[i][j] = (origin_direct_buf[i][j] + ADD_ON) * FACTOR; + } /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. * Indicate skipping the compression filter but keep the other two bogus filters */ @@ -675,6 +814,35 @@ test_skip_compress_write2(hid_t file) if((dataset = H5Dopen2(file, DATASETNAME3, H5P_DEFAULT)) < 0) goto error; + /* Use H5DOread_chunk() to read the uncompressed data */ + if((status = H5DOread_chunk(dataset, dxpl, offset, &read_filter_mask, check_chunk)) < 0) + goto error; + + if(read_filter_mask != filter_mask) { + fprintf(stderr, " Read/write filter mask not the same."); + goto error; + } + + /* De-compress the operations of the two bogus filters to the chunk */ + for(i = n = 0; i < CHUNK_NX; i++) + for(j = 0; j < CHUNK_NY; j++) + check_chunk[i][j] = (check_chunk[i][j]/FACTOR) - ADD_ON; + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(origin_direct_buf[i][j] != check_chunk[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); + goto error; + } + } + } + + /* Clear the buffer */ + HDmemset(check_chunk, 0, buf_size); + /* * Select hyperslab for one chunk in the file */ @@ -685,7 +853,7 @@ test_skip_compress_write2(hid_t file) if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - /* Read the chunk back */ + /* Use H5Dread() to read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -731,8 +899,7 @@ error: * Purpose: Test data conversion * * Return: Success: 0 - * - * Failure: 1 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -743,10 +910,10 @@ static int test_data_conv(hid_t file) { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_type_t; typedef struct { - int a, c[4], e; + int a, c[4], e; } dst_type_t; hid_t dataspace = -1, dataset = -1; @@ -764,6 +931,8 @@ test_data_conv(hid_t file) unsigned filter_mask = 0; src_type_t direct_buf[CHUNK_NX][CHUNK_NY]; dst_type_t check_chunk[CHUNK_NX][CHUNK_NY]; + src_type_t read_chunk[CHUNK_NX][CHUNK_NY]; /* For H5DOread_chunk */ + hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(src_type_t); @@ -772,7 +941,7 @@ test_data_conv(hid_t file) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("data conversion for H5DOwrite_chunk"); + TESTING("data conversion for H5DOwrite_chunk/H5DOread_chunk"); /* * Create the data space with unlimited dimensions. @@ -857,6 +1026,35 @@ test_data_conv(hid_t file) if((dataset = H5Dopen2(file, DATASETNAME4, H5P_DEFAULT)) < 0) goto error; + /* Use H5DOread_chunk() to read the uncompressed data */ + if((status = H5DOread_chunk(dataset, dxpl, offset, &filter_mask, read_chunk)) < 0) + goto error; + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if ((direct_buf[i][j]).a != (read_chunk[i][j]).a || + (direct_buf[i][j]).b != (read_chunk[i][j]).b || + (direct_buf[i][j]).c[0] != (read_chunk[i][j]).c[0] || + (direct_buf[i][j]).c[1] != (read_chunk[i][j]).c[1] || + (direct_buf[i][j]).c[2] != (read_chunk[i][j]).c[2] || + (direct_buf[i][j]).c[3] != (read_chunk[i][j]).c[3] || + (direct_buf[i][j]).d != (read_chunk[i][j]).d || + (direct_buf[i][j]).e != (read_chunk[i][j]).e) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], + (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); + printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + (read_chunk[i][j]).a, (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1], + (read_chunk[i][j]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d, (read_chunk[i][j]).e); + + goto error; + } + } + } + /* * Select hyperslab for the chunk just written in the file */ @@ -874,22 +1072,22 @@ test_data_conv(hid_t file) /* Check that the values read are the same as the values written */ for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { - if ((direct_buf[i][j]).a != (check_chunk[i][j]).a || - (direct_buf[i][j]).c[0] != (check_chunk[i][j]).c[0] || - (direct_buf[i][j]).c[1] != (check_chunk[i][j]).c[1] || - (direct_buf[i][j]).c[2] != (check_chunk[i][j]).c[2] || - (direct_buf[i][j]).c[3] != (check_chunk[i][j]).c[3] || - (direct_buf[i][j]).e != (check_chunk[i][j]).e) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], - (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); - printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", - (check_chunk[i][j]).a, (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2], - (check_chunk[i][j]).c[3], (check_chunk[i][j]).e); - - goto error; + if ((direct_buf[i][j]).a != (check_chunk[i][j]).a || + (direct_buf[i][j]).c[0] != (check_chunk[i][j]).c[0] || + (direct_buf[i][j]).c[1] != (check_chunk[i][j]).c[1] || + (direct_buf[i][j]).c[2] != (check_chunk[i][j]).c[2] || + (direct_buf[i][j]).c[3] != (check_chunk[i][j]).c[3] || + (direct_buf[i][j]).e != (check_chunk[i][j]).e) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], + (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); + printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", + (check_chunk[i][j]).a, (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2], + (check_chunk[i][j]).c[3], (check_chunk[i][j]).e); + + goto error; } } } @@ -926,11 +1124,10 @@ error: /*------------------------------------------------------------------------- * Function: test_invalid_parameters * - * Purpose: Test invalid parameters for H5DOwrite_chunk + * Purpose: Test invalid parameters for H5DOwrite_chunk and H5DOread_chunk * * Return: Success: 0 - * - * Failure: 1 + * ` Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -954,7 +1151,9 @@ test_invalid_parameters(hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); int aggression = 9; /* Compression aggression setting */ - TESTING("invalid parameters for H5DOwrite_chunk"); + hsize_t chunk_nbytes; /* Chunk size */ + + TESTING("invalid parameters for H5DOwrite_chunk/H5DOread_chunk"); /* * Create the data space with unlimited dimensions. @@ -972,7 +1171,7 @@ test_invalid_parameters(hid_t file) goto error; /* - * Create a new contiguous dataset to verify H5DOwrite_chunk doesn't work + * Create a new contiguous dataset to verify H5DOwrite_chunk/H5DOread_chunk doesn't work */ if((dataset = H5Dcreate2(file, DATASETNAME5, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) @@ -984,8 +1183,8 @@ test_invalid_parameters(hid_t file) /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) { - direct_buf[i][j] = n++; - } + direct_buf[i][j] = n++; + } /* Try to write the chunk data to contiguous dataset. It should fail */ offset[0] = CHUNK_NX; @@ -996,9 +1195,22 @@ test_invalid_parameters(hid_t file) goto error; } H5E_END_TRY; + /* Try to get chunk size for a contiguous dataset. It should fail */ + H5E_BEGIN_TRY { + if((status = H5Dget_chunk_storage_size(dataset, offset, &chunk_nbytes)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Try to H5DOread_chunk from the contiguous dataset. It should fail */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + if(H5Dclose(dataset) < 0) goto error; + /* Create a chunked dataset with compression filter */ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0) goto error; @@ -1014,25 +1226,40 @@ test_invalid_parameters(hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; - /* Check invalid dataset ID */ + /* Check invalid dataset ID for H5DOwrite_chunk and H5DOread_chunk */ H5E_BEGIN_TRY { if((status = H5DOwrite_chunk((hid_t)-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } H5E_END_TRY; - /* Check invalid DXPL ID */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk((hid_t)-1, dxpl, offset, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Check invalid DXPL ID for H5DOwrite_chunk and H5DOread_chunk */ H5E_BEGIN_TRY { if((status = H5DOwrite_chunk(dataset, (hid_t)-1, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } H5E_END_TRY; - /* Check invalid OFFSET */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, (hid_t)-1, offset, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Check invalid OFFSET for H5DOwrite_chunk and H5DOread_chunk */ H5E_BEGIN_TRY { if((status = H5DOwrite_chunk(dataset, dxpl, filter_mask, NULL, buf_size, direct_buf)) != FAIL) goto error; } H5E_END_TRY; - /* Check when OFFSET is out of dataset range */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, dxpl, NULL, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Check when OFFSET is out of dataset range for H5DOwrite_chunk and H5DOread_chunk */ offset[0] = NX + 1; offset[1] = NY; H5E_BEGIN_TRY { @@ -1040,7 +1267,12 @@ test_invalid_parameters(hid_t file) goto error; } H5E_END_TRY; - /* Check when OFFSET is not on chunk boundary */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Check when OFFSET is not on chunk boundary for H5DOwrite_chunk and H5DOread_chunk */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY + 1; H5E_BEGIN_TRY { @@ -1048,7 +1280,12 @@ test_invalid_parameters(hid_t file) goto error; } H5E_END_TRY; - /* Check invalid buffer size */ + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) + goto error; + } H5E_END_TRY; + + /* Check invalid buffer size for H5DOwrite_chunk only */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY; buf_size = 0; @@ -1057,13 +1294,18 @@ test_invalid_parameters(hid_t file) goto error; } H5E_END_TRY; - /* Check invalid data buffer */ + /* Check invalid data buffer for H5DOwrite_chunk and H5DOread_chunk */ buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); H5E_BEGIN_TRY { if((status = H5DOwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, NULL)) != FAIL) goto error; } H5E_END_TRY; + H5E_BEGIN_TRY { + if((status = H5DOread_chunk(dataset, dxpl, offset, &filter_mask, NULL)) != FAIL) + goto error; + } H5E_END_TRY; + if(H5Dclose(dataset) < 0) goto error; @@ -1115,7 +1357,7 @@ int main( void ) if((file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - /* Test direct chunk write */ + /* Test direct chunk write and direct chunk read */ #ifdef H5_HAVE_FILTER_DEFLATE nerrors += test_direct_chunk_write(file_id); #endif /* H5_HAVE_FILTER_DEFLATE */ diff --git a/src/H5D.c b/src/H5D.c index cd3d989..7f2a96d 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -416,7 +416,7 @@ H5Dclose(hid_t dset_id) /* * Decrement the counter on the dataset. It will be freed if the count - * reaches zero. + * reaches zero. * * Pass in TRUE for the 3rd parameter to tell the function to remove * dataset's ID even though the freeing function might fail. Please @@ -1002,3 +1002,44 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dset_extent() */ + +/*------------------------------------------------------------------------- + * Function: H5Dget_chunk_storage_size + * + * Purpose: Returns the size of an allocated of chunk. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 20 October 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes) +{ + H5D_t *dset = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE1("h", "i", dset_id); + + /* Check arguments */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + if( NULL == offset ) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)") + if( NULL == chunk_nbytes ) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)") + + if(H5D_CHUNKED != dset->shared->layout.type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + + /* Call private function */ + if(H5D__get_chunk_storage_size(dset, H5AC_ind_dxpl_id, offset, chunk_nbytes) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk") + +done: + FUNC_LEAVE_API(ret_value); +} + diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 3bac996..a55a156 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -242,6 +242,9 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); #endif /* H5_HAVE_PARALLEL */ +static int +H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); + /*********************/ /* Package Variables */ /*********************/ @@ -303,8 +306,7 @@ H5FL_BLK_DEFINE_STATIC(chunk); /*------------------------------------------------------------------------- * Function: H5D__chunk_direct_write * - * Purpose: Internal routine to write a chunk - * directly into the file. + * Purpose: Internal routine to write a chunk directly into the file. * * Return: Non-negative on success/Negative on failure * @@ -314,16 +316,16 @@ H5FL_BLK_DEFINE_STATIC(chunk); *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, +H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ - hsize_t chunk_idx; + hsize_t chunk_idx; /* Index of chunk cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - int space_ndims; /* Dataset's space rank */ + unsigned space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value = SUCCEED; /* Return value */ @@ -331,17 +333,16 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz /* Allocate data space and initialize it if it hasn't been. */ if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) - /* Allocate storage */ + /* Allocate storage */ if(H5D__alloc_storage(dset, dxpl_id, H5D_ALLOC_WRITE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") /* Retrieve the dataset dimensions */ - if((space_ndims = H5S_get_simple_extent_dims(dset->shared->space, space_dim, NULL)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get simple dataspace info") + space_ndims = dset->shared->layout.u.chunk.ndims - 1; /* Calculate the index of this chunk */ - if(H5VM_chunk_index((unsigned)space_ndims, offset, - layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) + if(H5VM_chunk_index(space_ndims, offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") /* Find out the file address of the chunk */ @@ -354,28 +355,28 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz * the 'insert' operation could resize it) */ { - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ - /* Compose chunked index info struct */ - idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; - idx_info.pline = &(dset->shared->dcpl_cache.pline); - idx_info.layout = &(dset->shared->layout.u.chunk); - idx_info.storage = &(dset->shared->layout.storage.u.chunk); + /* Compose chunked index info struct */ + idx_info.f = dset->oloc.file; + idx_info.dxpl_id = dxpl_id; + idx_info.pline = &(dset->shared->dcpl_cache.pline); + idx_info.layout = &(dset->shared->layout.u.chunk); + idx_info.storage = &(dset->shared->layout.storage.u.chunk); - /* Set up the size of chunk for user data */ - udata.nbytes = data_size; + /* Set up the size of chunk for user data */ + udata.nbytes = data_size; /* Create the chunk it if it doesn't exist, or reallocate the chunk * if its size changed. */ - if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk") + if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk") - /* Make sure the address of the chunk is returned. */ - if(!H5F_addr_defined(udata.addr)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") - } /* end if */ + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.addr)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + } /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) @@ -385,7 +386,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz * it to disk */ if(UINT_MAX != udata.idx_hint) if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") /* Write the data to the file */ if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, data_size, dxpl_id, buf) < 0) @@ -395,6 +396,222 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_direct_write() */ +/*------------------------------------------------------------------------- + * Function: H5D__chunk_direct_read + * + * Purpose: Internal routine to read a chunk directly from the file. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 14 February 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, + uint32_t* filters, void *buf) +{ + const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ + H5D_chunk_ud_t udata; /* User data for querying chunk info */ + unsigned space_ndims; /* Dataset's space rank */ + hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ + hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Dataset's chunk offset */ + hsize_t chunk_idx; /* Index of chunk cache entry */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + HDassert(dset && H5D_CHUNKED == layout->type); + HDassert(offset); + HDassert(filters); + HDassert(buf); + + /* Retrieve the dataset dimensions */ + space_ndims = dset->shared->layout.u.chunk.ndims - 1; + + /* Check if chunk storage is allocated for dataset */ + if(H5D__chunk_is_space_alloc(&(layout->storage)) == FALSE) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "storage is not initialized") + + /* Initialize the chunk offset */ + HDmemcpy(chunk_offset, offset, (space_ndims * sizeof(chunk_offset[0]))); + chunk_offset[space_ndims] = (hsize_t)0; + + /* Calculate the index of this chunk */ + if(H5VM_chunk_index(space_ndims, chunk_offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") + + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.filter_mask = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; + + /* Find out the file address of the chunk */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + /* Check if the requested chunk exists in the chunk cache */ + if(UINT_MAX != udata.idx_hint) { + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + + /* Sanity checks */ + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); + + /* If the cached chunk is dirty, it must be flushed to get accurate size */ + if( ent->dirty == TRUE ) { + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.filter_mask = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; + + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + } + } + + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.addr)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + + /* Read the chunk data into the supplied buffer */ + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, udata.nbytes, dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Return the filter mask */ + *filters = udata.filter_mask; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__chunk_direct_read() */ + +/*------------------------------------------------------------------------- + * Function: H5D__get_chunk_storage_size + * + * Purpose: Internal routine to read the storage size of a chunk on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 20 October 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size) +{ + const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ + H5D_chunk_ud_t udata; /* User data for querying chunk info */ + unsigned space_ndims; /* Dataset's space rank */ + hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ + hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Dataset's chunk offset */ + hsize_t chunk_idx; /* Index of chunk cache entry */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + HDassert(dset && H5D_CHUNKED == layout->type); + HDassert(offset); + HDassert(filters); + HDassert(buf); + + /* Retrieve the dataset dimensions */ + space_ndims = dset->shared->layout.u.chunk.ndims - 1; + + if(H5D__chunk_is_space_alloc(&(layout->storage)) == FALSE) { + *storage_size = 0; + HGOTO_DONE(SUCCEED) + } + + /* Initialize the chunk offset */ + HDmemcpy(chunk_offset, offset, (space_ndims * sizeof(chunk_offset[0]))); + chunk_offset[space_ndims] = (hsize_t)0; + + /* Calculate the index of this chunk */ + if(H5VM_chunk_index(space_ndims, chunk_offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") + + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; + + /* Find out the file address of the chunk */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + /* The requested chunk is not in cache or on disk */ + if(!H5F_addr_defined(udata.addr) && UINT_MAX == udata.idx_hint) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk storage is not allocated") + + /* Check if there are filters registered to the dataset */ + if( dset->shared->dcpl_cache.pline.nused > 0 ) { + /* Check if the requested chunk exists in the chunk cache */ + if(UINT_MAX != udata.idx_hint) { + /* Sanity checks */ + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + + /* If the cached chunk is dirty, it must be flushed to get accurate size */ + if( ent->dirty == TRUE ) { + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; + + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + } + } + + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.addr)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + + /* Return the chunk size on disk */ + *storage_size = udata.nbytes; + } + /* There are no filters registered, return the chunk size from the storage layout */ + else + *storage_size = dset->shared->layout.u.chunk.size; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__get_chunk_storage_size */ + + /*------------------------------------------------------------------------- * Function: H5D__chunk_set_info_real @@ -2636,25 +2853,25 @@ H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t HDassert(ent->idx < rdcc->nslots); if(flush) { - /* Flush */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) - HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") + /* Flush */ + if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { /* Don't flush, just free chunk */ - if(ent->chunk != NULL) - ent->chunk = (uint8_t *)H5D__chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); + if(ent->chunk != NULL) + ent->chunk = (uint8_t *)H5D__chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); } /* end else */ /* Unlink from list */ if(ent->prev) - ent->prev->next = ent->next; + ent->prev->next = ent->next; else - rdcc->head = ent->next; + rdcc->head = ent->next; if(ent->next) - ent->next->prev = ent->prev; + ent->next->prev = ent->prev; else - rdcc->tail = ent->prev; + rdcc->tail = ent->prev; ent->prev = ent->next = NULL; /* Remove from cache */ @@ -3534,7 +3751,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, chunk_size, + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, chunk_size, dxpl_id, fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") #ifdef H5_HAVE_PARALLEL @@ -3600,7 +3817,7 @@ done: * Function: H5D__chunk_collective_fill * * Purpose: Use MPIO collective write to fill the chunks (if number of - * chunks to fill is greater than the number of MPI procs; + * chunks to fill is greater than the number of MPI procs; * otherwise use independent I/O). * * Return: Non-negative on success/Negative on failure @@ -3683,13 +3900,13 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, distributing. If there are, then round robin the distribution to processes 0 -> leftover. */ if(leftover && leftover > mpi_rank) { - chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks*mpi_size + mpi_rank]; + chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks*mpi_size + mpi_rank]; block_lens[blocks] = block_len; blocks++; } /* MSC - * should not have a special case for blocks == 0, but ompi (as of 1.8.1) has a bug + * should not have a special case for blocks == 0, but ompi (as of 1.8.1) has a bug * in file_set_view when a zero size datatype is create with hindexed or hvector. */ if(0 == blocks) { @@ -3701,11 +3918,11 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } else { - /* MSC - * should use this if MPI_type_create_hindexed block is working + /* MSC + * should use this if MPI_type_create_hindexed block is working * mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE, &file_type); */ - mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, + mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type); if(mpi_code != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) @@ -3740,7 +3957,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, } /* low level write */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, data_dxpl_id, fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") @@ -5158,7 +5375,7 @@ H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) nerrors++; } /* end for */ - + /* Continue even if there are failures. */ if(nerrors) HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") @@ -5351,4 +5568,3 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__nonexistent_readvv() */ - diff --git a/src/H5Dio.c b/src/H5Dio.c index 58031e8..58fc855 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -55,7 +55,7 @@ static herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, const void *buf); -static herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +static herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); /* Setup/teardown routines */ @@ -127,9 +127,13 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { H5D_t *dset = NULL; + H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ + hsize_t *direct_offset = NULL; + hbool_t direct_read = FALSE; + uint32_t direct_filters = 0; FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, @@ -137,28 +141,28 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(NULL == dset->oloc.file) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(mem_space_id < 0 || file_space_id < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(H5S_ALL != mem_space_id) { - if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Check for valid selection */ - if(H5S_SELECT_VALID(mem_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") + /* Check for valid selection */ + if(H5S_SELECT_VALID(mem_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } /* end if */ if(H5S_ALL != file_space_id) { - if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") + /* Check for valid selection */ + if(H5S_SELECT_VALID(file_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } /* end if */ /* Get the default dataset transfer property list if the user didn't provide one */ @@ -168,9 +172,58 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* read raw data */ - if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Retrieve the 'direct read' flag */ + if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &direct_read) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") + + if(direct_read) { + unsigned u; + int ndims = 0; + hsize_t dims[H5O_LAYOUT_NDIMS]; + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + + if(H5D_CHUNKED != dset->shared->layout.type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + /* Get the direct chunk offset property */ + if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &direct_offset) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting direct offset from xfer properties") + + /* The library's chunking code requires the offset terminates with a zero. So transfer the + * offset array to an internal offset array */ + if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") + + for(u = 0; u < ndims; u++) { + /* Make sure the offset doesn't exceed the dataset's dimensions */ + if(direct_offset[u] > dims[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") + + /* Make sure the offset fall right on a chunk's boundary */ + if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") + + internal_offset[u] = direct_offset[u]; + } /* end for */ + + /* Terminate the offset with a zero */ + internal_offset[ndims] = 0; + + /* Read the raw chunk */ + if(H5D__chunk_direct_read(dset, plist_id, internal_offset, &direct_filters, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read chunk directly") + /* Set the chunk filter mask property */ + if(H5P_set(plist, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &direct_filters) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error setting filter mask xfer property") + } + else { + /* read raw data */ + if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") + } done: FUNC_LEAVE_API(ret_value) @@ -225,9 +278,9 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(NULL == dset->oloc.file) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Get the default dataset transfer property list if the user didn't provide one */ if(H5P_DEFAULT == dxpl_id) @@ -249,26 +302,26 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(mem_space_id < 0 || file_space_id < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - if(H5S_ALL != mem_space_id) { - if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - - /* Check for valid selection */ - if(H5S_SELECT_VALID(mem_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "memory selection+offset not within extent") - } /* end if */ - if(H5S_ALL != file_space_id) { - if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - - /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") - } /* end if */ + if(H5S_ALL != mem_space_id) { + if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Check for valid selection */ + if(H5S_SELECT_VALID(mem_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "memory selection+offset not within extent") + } /* end if */ + if(H5S_ALL != file_space_id) { + if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Check for valid selection */ + if(H5S_SELECT_VALID(file_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") + } /* end if */ } - if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") + if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: FUNC_LEAVE_API(ret_value) @@ -278,7 +331,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__pre_write * - * Purpose: Preparation for writing data. + * Purpose: Preparation for writing data. * * Return: Non-negative on success/Negative on failure * @@ -288,8 +341,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, +H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, + const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf) { herr_t ret_value = SUCCEED; /* Return value */ @@ -302,17 +355,17 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, uint32_t direct_filters; hsize_t *direct_offset; uint32_t direct_datasize; - int ndims = 0; - hsize_t dims[H5O_LAYOUT_NDIMS]; - hsize_t internal_offset[H5O_LAYOUT_NDIMS]; - unsigned u; + int ndims = 0; + hsize_t dims[H5O_LAYOUT_NDIMS]; + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + unsigned u; /* Get the dataset transfer property list */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") if(H5D_CHUNKED != dset->shared->layout.type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") /* Retrieve parameters for direct chunk write */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) @@ -322,34 +375,34 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") - /* The library's chunking code requires the offset terminates with a zero. So transfer the - * offset array to an internal offset array */ - if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") + /* The library's chunking code requires the offset terminates with a zero. So transfer the + * offset array to an internal offset array */ + if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") - for(u = 0; u < ndims; u++) { - /* Make sure the offset doesn't exceed the dataset's dimensions */ + for(u = 0; u < ndims; u++) { + /* Make sure the offset doesn't exceed the dataset's dimensions */ if(direct_offset[u] > dims[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") /* Make sure the offset fall right on a chunk's boundary */ - if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") - - internal_offset[u] = direct_offset[u]; - } /* end for */ - - /* Terminate the offset with a zero */ - internal_offset[ndims] = 0; - - /* write raw data */ - if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") + if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") + + internal_offset[u] = direct_offset[u]; + } /* end for */ + + /* Terminate the offset with a zero */ + internal_offset[ndims] = 0; + + /* write raw data */ + if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") } /* end if */ else { /* Normal write */ /* write raw data */ if(H5D__write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") } /* end else */ done: @@ -430,7 +483,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && + if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && !(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") #endif /*H5_HAVE_PARALLEL*/ @@ -459,16 +512,16 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "memory dataspace does not have extent set") /* H5S_select_shape_same() has been modified to accept topologically identical - * selections with different rank as having the same shape (if the most - * rapidly changing coordinates match up), but the I/O code still has + * selections with different rank as having the same shape (if the most + * rapidly changing coordinates match up), but the I/O code still has * difficulties with the notion. * - * To solve this, we check to see if H5S_select_shape_same() returns true, - * and if the ranks of the mem and file spaces are different. If the are, - * construct a new mem space that is equivalent to the old mem space, and + * To solve this, we check to see if H5S_select_shape_same() returns true, + * and if the ranks of the mem and file spaces are different. If the are, + * construct a new mem space that is equivalent to the old mem space, and * use that instead. * - * Note that in general, this requires us to touch up the memory buffer as + * Note that in general, this requires us to touch up the memory buffer as * well. */ if(TRUE == H5S_select_shape_same(mem_space, file_space) && @@ -715,17 +768,17 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(!(H5S_has_extent(mem_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "memory dataspace does not have extent set") - /* H5S_select_shape_same() has been modified to accept topologically - * identical selections with different rank as having the same shape - * (if the most rapidly changing coordinates match up), but the I/O + /* H5S_select_shape_same() has been modified to accept topologically + * identical selections with different rank as having the same shape + * (if the most rapidly changing coordinates match up), but the I/O * code still has difficulties with the notion. * - * To solve this, we check to see if H5S_select_shape_same() returns - * true, and if the ranks of the mem and file spaces are different. - * If the are, construct a new mem space that is equivalent to the + * To solve this, we check to see if H5S_select_shape_same() returns + * true, and if the ranks of the mem and file spaces are different. + * If the are, construct a new mem space that is equivalent to the * old mem space, and use that instead. * - * Note that in general, this requires us to touch up the memory buffer + * Note that in general, this requires us to touch up the memory buffer * as well. */ if(TRUE == H5S_select_shape_same(mem_space, file_space) && @@ -1237,4 +1290,3 @@ H5D__typeinfo_term(const H5D_type_info_t *type_info) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__typeinfo_term() */ - diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index ff01041..48999e6 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -1,3 +1,4 @@ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -538,6 +539,7 @@ H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); +H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size); H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, @@ -638,6 +640,8 @@ H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *store); H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, uint32_t data_size, const void *buf); +H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, + uint32_t *filters, void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); #endif /* H5D_CHUNK_DEBUG */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index e7ae3ae..2eb5ff8 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -34,12 +34,17 @@ #define H5D_CHUNK_CACHE_NBYTES_DEFAULT ((size_t) -1) #define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0f) -/* Property names for H5LTDdirect_chunk_write */ +/* Property names for H5LTDdirect_chunk_write */ #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME "direct_chunk_flag" #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME "direct_chunk_filters" #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME "direct_chunk_offset" #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME "direct_chunk_datasize" - + +/* Property names for H5LTDdirect_chunk_read */ +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag" +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset" +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters" + /*******************/ /* Public Typedefs */ /*******************/ @@ -128,6 +133,7 @@ H5_DLL hid_t H5Dget_type(hid_t dset_id); H5_DLL hid_t H5Dget_create_plist(hid_t dset_id); H5_DLL hid_t H5Dget_access_plist(hid_t dset_id); H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id); +H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes); H5_DLL haddr_t H5Dget_offset(hid_t dset_id); H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); @@ -170,4 +176,3 @@ H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]); } #endif #endif /* _H5Dpublic_H */ - diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index ce16036..d9e7ec7 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -137,6 +137,13 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t) #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0 +/* Definitions for properties of direct chunk read */ +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_SIZE sizeof(hbool_t) +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_DEF FALSE +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_SIZE sizeof(uint32_t) +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF 0 +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_SIZE sizeof(hsize_t *) +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF NULL /******************/ /* Local Typedefs */ @@ -241,6 +248,9 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) uint32_t direct_chunk_filters = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */ hsize_t *direct_chunk_offset = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */ uint32_t direct_chunk_datasize = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ + hbool_t direct_chunk_read_flag = H5D_XFER_DIRECT_CHUNK_READ_FLAG_DEF; /* Default value for the flag of direct chunk read */ + hsize_t *direct_chunk_read_offset = H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF; /* Default value for the offset of direct chunk read */ + uint32_t direct_chunk_read_filters = H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF; /* Default value for the filters of direct chunk read */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -365,6 +375,24 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the property of flag for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, H5D_XFER_DIRECT_CHUNK_READ_FLAG_SIZE, &direct_chunk_read_flag, + NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the property of filter for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_SIZE, &direct_chunk_read_filters, + NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the property of offset for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_SIZE, &direct_chunk_read_offset, + NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dxfr_reg_prop() */ -- cgit v0.12 From 4992a26ab3e920dadb8f3f05202a93ce81a353c7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 3 Apr 2017 08:04:44 -0500 Subject: Correct usuage of HD prefix --- test/plugin.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index cdd172c..2e5319d 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -116,7 +116,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); - HDprintf(" Line %d: Incorrect filter availability\n",__LINE__); + printf(" Line %d: Incorrect filter availability\n",__LINE__); TEST_ERROR } /* end if */ @@ -139,8 +139,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j<(size_t)size[1]; j++) { if(0!=check[i][j]) { H5_FAILED(); - HDprintf(" Read a non-zero value.\n"); - HDprintf(" At index %lu,%lu\n", + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); TEST_ERROR } @@ -219,8 +219,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j Date: Mon, 3 Apr 2017 12:34:17 -0500 Subject: Update with checks for index bounds --- src/H5PL.c | 11 ++++++++++- test/plugin.c | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 683c53d..9570289 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -485,6 +485,8 @@ H5PLreplace(const char* plugin_path, unsigned int index) FUNC_ENTER_API(FAIL) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -520,6 +522,8 @@ H5PLinsert(const char* plugin_path, unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -553,12 +557,15 @@ H5PLremove(unsigned int index) FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); + + H5PL_num_paths_g--; for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; - H5PL_num_paths_g--; H5PL_path_table_g[H5PL_num_paths_g] = NULL; done: @@ -594,6 +601,8 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5PL_path_table_g[index])) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") len = HDstrlen(dl_path); diff --git a/test/plugin.c b/test/plugin.c index 2e5319d..a706476 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -750,6 +750,8 @@ test_filter_path_apis(void) HDputs("Testing access to the filter path table"); + if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + ndx = H5PLsize(); TESTING(" remove"); @@ -764,7 +766,7 @@ test_filter_path_apis(void) if (H5PLsize() > 0) TEST_ERROR PASSED(); - TESTING(" remove (exceed)"); + TESTING(" remove (exceed min)"); /* Exceed the min path removal */ H5E_BEGIN_TRY { ret = H5PLremove(0); @@ -795,6 +797,7 @@ test_filter_path_apis(void) if (ret >= 0) TEST_ERROR + TESTING(" remove (exceed max)"); /* Exceed the max path removal */ H5E_BEGIN_TRY { ret = H5PLremove(H5PL_MAX_PATH_NUM); -- cgit v0.12 From e7c1ef33425e7cdcf4486b79e0b95e77a6110f30 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 3 Apr 2017 17:45:25 -0500 Subject: Made corrections according to code review. 1) Change fprintf to HDfprintf in hl/test/test_dset_opt.c 2) Remove extra line in src/H5Dpkg.h 3) Add one more test to hl/test/test_dset_opt.c Tested on mayll and osx1010test. --- hl/src/H5DO.c | 2 +- hl/test/test_dset_opt.c | 105 +++++++++++++++++++++++++++++++++++------------- src/H5Dpkg.h | 1 - 3 files changed, 78 insertions(+), 30 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 151481e..be5f658 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -63,7 +63,7 @@ H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *o /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ if(H5P_DEFAULT == dxpl_id) { - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto done; created_dxpl = TRUE; } /* end if */ diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 1e7c8e8..bec0ae3 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -161,22 +161,71 @@ test_direct_chunk_write (hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; - /* Initialize the dataset */ - for(i = n = 0; i < NX; i++) - for(j = 0; j < NY; j++) - data[i][j] = n++; - if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; - /* - * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5DOwrite_chunk calls. - */ + HDmemset(data, 0, sizeof(data)); + /* Initialize data for the first chunk */ + for(i = n = 0; i < CHUNK_NX; i++) + for(j = 0; j < CHUNK_NY; j++) + data[i][j] = n++; + + /* Write the data to the dataset. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, data)) < 0) goto error; + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + goto error; + + if(H5Dclose(dataset) < 0) + goto error; + + if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) + goto error; + + offset[0] = offset[1] = 0; + + /* Get the size of the compressed chunk */ + ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); + + readbuf = HDmalloc(read_chunk_nbytes); + pt_readbuf = (const Bytef *)readbuf; + + /* Test to use H5DOread_chunk() to read the chunk back */ + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) + goto error; + + /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ + ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); + + /* Check for various zlib errors */ + if(Z_BUF_ERROR == ret) { + HDfprintf(stderr, "error: not enough room in output buffer"); + goto error; + } else if(Z_MEM_ERROR == ret) { + HDfprintf(stderr, "error: not enough memory"); + goto error; + } else if(Z_OK != ret) { + HDfprintf(stderr, "error: corrupted input data"); + goto error; + } + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(data[i][j] != read_dst_buf[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" data=%d, read_dst_buf=%d\n", data[i][j], read_dst_buf[i][j]); + goto error; + } + } + } + + if(readbuf) + HDfree(readbuf); + /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) @@ -191,13 +240,13 @@ test_direct_chunk_write (hid_t file) /* Check for various zlib errors */ if(Z_BUF_ERROR == ret) { - fprintf(stderr, "overflow"); + HDfprintf(stderr, "overflow"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + HDfprintf(stderr, "deflate memory error"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "other deflate error"); + HDfprintf(stderr, "other deflate error"); goto error; } @@ -231,7 +280,7 @@ test_direct_chunk_write (hid_t file) ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { - fprintf(stderr, "Read/write chunk size not the same."); + HDfprintf(stderr, "Read/write chunk size not the same."); goto error; } @@ -243,7 +292,7 @@ test_direct_chunk_write (hid_t file) goto error; if(read_filter_mask != filter_mask) { - fprintf(stderr, " Read/write filter mask not the same."); + HDfprintf(stderr, " Read/write filter mask not the same."); goto error; } @@ -252,13 +301,13 @@ test_direct_chunk_write (hid_t file) /* Check for various zlib errors */ if(Z_BUF_ERROR == ret) { - fprintf(stderr, "error: not enough room in output buffer"); + HDfprintf(stderr, "error: not enough room in output buffer"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "error: not enough memory"); + HDfprintf(stderr, "error: not enough memory"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "error: corrupted input data"); + HDfprintf(stderr, "error: corrupted input data"); goto error; } @@ -318,13 +367,13 @@ test_direct_chunk_write (hid_t file) /* Check for various zlib errors */ if(Z_BUF_ERROR == ret) { - fprintf(stderr, "overflow"); + HDfprintf(stderr, "overflow"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + HDfprintf(stderr, "deflate memory error"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "other deflate error"); + HDfprintf(stderr, "other deflate error"); goto error; } @@ -359,7 +408,7 @@ test_direct_chunk_write (hid_t file) ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { - fprintf(stderr, "Read/write chunk size not the same."); + HDfprintf(stderr, "Read/write chunk size not the same."); goto error; } @@ -371,7 +420,7 @@ test_direct_chunk_write (hid_t file) goto error; if(read_filter_mask != filter_mask) { - fprintf(stderr, " Read/write filter mask not the same."); + HDfprintf(stderr, " Read/write filter mask not the same."); goto error; } @@ -380,13 +429,13 @@ test_direct_chunk_write (hid_t file) /* Check for various zlib errors */ if(Z_BUF_ERROR == ret) { - fprintf(stderr, "error: not enough room in output buffer"); + HDfprintf(stderr, "error: not enough room in output buffer"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "error: not enough memory"); + HDfprintf(stderr, "error: not enough memory"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "error: corrupted input data"); + HDfprintf(stderr, "error: corrupted input data"); goto error; } @@ -449,7 +498,7 @@ error: return 1; } /* test_direct_chunk_write() */ -#endif /* H5_HAVE_FILTER_DEFLATE */ +#endif /*------------------------------------------------------------------------- * Function: test_skip_compress_write1 @@ -554,7 +603,7 @@ test_skip_compress_write1(hid_t file) goto error; if(read_filter_mask != filter_mask) { - fprintf(stderr, " Read/write filter mask not the same."); + HDfprintf(stderr, " Read/write filter mask not the same."); goto error; } @@ -819,7 +868,7 @@ test_skip_compress_write2(hid_t file) goto error; if(read_filter_mask != filter_mask) { - fprintf(stderr, " Read/write filter mask not the same."); + HDfprintf(stderr, " Read/write filter mask not the same."); goto error; } diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 48999e6..91cf5f3 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -1,4 +1,3 @@ - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * -- cgit v0.12 From ceb8bdc33d3f06787d837b4287327b20e42364e4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 09:53:42 -0500 Subject: HDFFV-10143 clean up format and function return --- test/plugin.c | 656 +++++++++++++++++++++++++++------------------------------- 1 file changed, 307 insertions(+), 349 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index a706476..b35b367 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -44,8 +44,8 @@ const char *FILENAME[] = { /* Dataset names for testing filters */ #define DSET_DEFLATE_NAME "deflate" #define DSET_DYNLIB1_NAME "dynlib1" -#define DSET_DYNLIB2_NAME "dynlib2" -#define DSET_DYNLIB4_NAME "dynlib4" +#define DSET_DYNLIB2_NAME "dynlib2" +#define DSET_DYNLIB4_NAME "dynlib4" /* Parameters for internal filter test */ #define FILTER_CHUNK_DIM1 2 @@ -65,39 +65,36 @@ const char *FILENAME[] = { #define GROUP_ITERATION 1000 int points_deflate[DSET_DIM1][DSET_DIM2], - points_dynlib1[DSET_DIM1][DSET_DIM2], - points_dynlib2[DSET_DIM1][DSET_DIM2], - points_dynlib4[DSET_DIM1][DSET_DIM2], - points_bzip2[DSET_DIM1][DSET_DIM2]; + points_dynlib1[DSET_DIM1][DSET_DIM2], + points_dynlib2[DSET_DIM1][DSET_DIM2], + points_dynlib4[DSET_DIM1][DSET_DIM2], + points_bzip2[DSET_DIM1][DSET_DIM2]; /*------------------------------------------------------------------------- - * Function: test_filter_internal + * Function: test_filter_internal * - * Purpose: Tests writing entire data and partial data with filters + * Purpose: Tests writing entire data and partial data with filters * * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 27 February 2013 - * + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl) { - hid_t dataset; /* Dataset ID */ - hid_t dxpl; /* Dataset xfer property list ID */ - hid_t write_dxpl; /* Dataset xfer property list ID for writing */ - hid_t sid; /* Dataspace ID */ - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + herr_t ret_value = -1; + hid_t dataset = -1; /* Dataset ID */ + hid_t dxpl = -1; /* Dataset xfer property list ID */ + hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */ + hid_t sid = -1; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ - const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ void *tconv_buf = NULL; /* Temporary conversion buffer */ - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - size_t i, j; /* Local index variables */ - int n = 0; + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ + int n = 0; /* Create the data space */ if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR @@ -114,15 +111,14 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (setup)"); /* Check if all the filters are available */ - if(H5Pall_filters_avail(dcpl)!=TRUE) { + if(H5Pall_filters_avail(dcpl) != TRUE) { H5_FAILED(); - printf(" Line %d: Incorrect filter availability\n",__LINE__); + HDprintf(" Line %d: Incorrect filter availability\n", __LINE__); TEST_ERROR } /* end if */ /* Create the dataset */ - if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, - dcpl, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR PASSED(); @@ -132,20 +128,16 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (uninitialized read)"); - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; - for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(0!=check[i][j]) { - H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - TEST_ERROR - } - } - } + for(i=0; i<(size_t)size[0]; i++) + for(j=0; j<(size_t)size[1]; j++) + if(0 != check[i][j]) { + H5_FAILED(); + HDprintf(" Read a non-zero value.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + TEST_ERROR + } /* end if */ PASSED(); /*---------------------------------------------------------------------- @@ -156,14 +148,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (write)"); n = 0; - for(i=0; i 0; i--) { - if (H5PLremove(i-1) < 0) { + for(i=ndx; i > 0; i--) + if(H5PLremove(i-1) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR - } - } + } /* end if */ /* Verify the table is empty */ - if (H5PLsize() > 0) TEST_ERROR + if(H5PLsize() > 0) TEST_ERROR PASSED(); TESTING(" remove (exceed min)"); @@ -771,21 +751,20 @@ test_filter_path_apis(void) H5E_BEGIN_TRY { ret = H5PLremove(0); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" append"); /* Create multiple paths to fill table */ - for (i=0; i < H5PL_MAX_PATH_NUM; i++) { + for(i=0; i < H5PL_MAX_PATH_NUM; i++) { HDsprintf(pathname, "a_path_%d", i); - if (H5PLappend(pathname) < 0) { + if(H5PLappend(pathname) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -794,47 +773,42 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); ret = H5PLappend(pathname); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR TESTING(" remove (exceed max)"); /* Exceed the max path removal */ H5E_BEGIN_TRY { ret = H5PLremove(H5PL_MAX_PATH_NUM); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" get (path name)"); - if ((pathlen = H5PLget(0, NULL, 0)) <= 0) { + if((pathlen = H5PLget(0, NULL, 0)) <= 0) { HDfprintf(stderr," get path 0 length failed\n"); TEST_ERROR } - if (pathlen != 8) { - TEST_ERROR - } - if ((pathlen = H5PLget(0, pathname, 256)) <= 0) { + if(pathlen != 8) TEST_ERROR + + if((pathlen = H5PLget(0, pathname, 256)) <= 0) { HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); TEST_ERROR } - if (HDstrcmp(pathname, "a_path_0") != 0) { + if(HDstrcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } PASSED(); TESTING(" get (bounds)"); - if ((pathlen = H5PLget(1, pathname, 256)) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_1") != 0) { + if((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) - TEST_ERROR + if((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } @@ -844,18 +818,16 @@ test_filter_path_apis(void) H5E_BEGIN_TRY { pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); } H5E_END_TRY - if (pathlen > 0) - TEST_ERROR + if(pathlen > 0) TEST_ERROR PASSED(); TESTING(" remove (verify for prepend)"); /* Remove one path*/ - if (H5PLremove(8) < 0) TEST_ERROR + if(H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - if ((pathlen = H5PLget(8, pathname, 256)) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_9") != 0) { + if((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } @@ -867,25 +839,23 @@ test_filter_path_apis(void) TESTING(" prepend"); /* Prepend one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (H5PLprepend(pathname) < 0) { + if(H5PLprepend(pathname) < 0) { HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); TEST_ERROR } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ - if (H5PLget(8, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_7") != 0) { + if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_7") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - if (H5PLget(0, pathname, 256) <= 0) - TEST_ERROR + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -897,32 +867,29 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); ret = H5PLprepend(pathname); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" replace"); /* Replace one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); - if (H5PLreplace(pathname, 1) < 0) { + if(H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ - if (H5PLget(0, pathname, 256) <= 0) - TEST_ERROR + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - if (H5PLget(2, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_1") != 0) { + if(H5PLget(2, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR } @@ -930,39 +897,37 @@ test_filter_path_apis(void) TESTING(" remove (verify for insert)"); /* Remove one path*/ - if (H5PLremove(4) < 0) TEST_ERROR + if H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - if (H5PLget(4, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_4") != 0) { + if H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); /* Verify the table is not full */ - if (H5PLsize() != 15) TEST_ERROR + if(H5PLsize() != 15) TEST_ERROR TESTING(" insert"); /* Insert one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); - if (H5PLinsert(pathname, 3) < 0){ + if(H5PLinsert(pathname, 3) < 0) { HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR } /* Verify that the entries were moved */ - if (H5PLget(4, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_2") != 0){ + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_2") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ @@ -970,15 +935,14 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); ret = H5PLinsert(pathname, 12); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR - PASSED (); + PASSED(); - return 0; + ret_value = 0; error: - return -1; + return ret_value; } @@ -1000,24 +964,24 @@ int main(void) { char filename[FILENAME_BUF_SIZE]; - hid_t file, fapl, fapl2; - unsigned new_format; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; + hid_t file = -1; + hid_t fapl = -1; + hid_t fapl2 = -1; + unsigned new_format; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) - TEST_ERROR + if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR rdcc_nbytes = 0; - if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) - TEST_ERROR + if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -1042,8 +1006,7 @@ main(void) } /* end else */ /* Create the file for this test */ - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); @@ -1051,8 +1014,7 @@ main(void) /* Test dynamically loaded filters for groups */ nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR } /* end for */ /* Close FAPL */ @@ -1069,14 +1031,13 @@ main(void) fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with filters */ - nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); /* Open the groups with filters */ - nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1086,29 +1047,26 @@ main(void) fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with disabled filters */ nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR /* Test the APIs for access to the filter plugin path table */ nerrors += (test_filter_path_apis() < 0 ? 1 : 0); - if(nerrors) - TEST_ERROR - printf("All plugin tests passed.\n"); + if(nerrors) TEST_ERROR + + HDprintf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d PLUGIN TEST%s FAILED! *****\n", - nerrors, 1 == nerrors ? "" : "S"); + HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } -- cgit v0.12 From a957bb0f05d2e4f7986265982fabc64082f842df Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 10:07:41 -0500 Subject: HDFFV-10143 Update new feature section. --- release_docs/RELEASE.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ca292d2..40c9644 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -63,7 +63,10 @@ New Features Library ------- - - None + + - Filter plugin API added to access the table of paths to search for a + library. + (HDFFV-10143 ADB 2017/04/04) Parallel Library -- cgit v0.12 From 790f8fcf039c7407f2b24a413de5911bdc3d4f48 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 10:15:56 -0500 Subject: Fix typo deletion --- test/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index b35b367..4d0db27 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -897,10 +897,10 @@ test_filter_path_apis(void) TESTING(" remove (verify for insert)"); /* Remove one path*/ - if H5PLremove(4) < 0) TEST_ERROR + if(H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - if H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR if(HDstrcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR -- cgit v0.12 From d28a427769c4bc1ff3076a74dcff524db29e593b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 13:34:54 -0500 Subject: HDFFV-10143 branch does not have HDprintf --- test/plugin.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 4d0db27..3491ab7 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -113,7 +113,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl) != TRUE) { H5_FAILED(); - HDprintf(" Line %d: Incorrect filter availability\n", __LINE__); + printf(" Line %d: Incorrect filter availability\n", __LINE__); TEST_ERROR } /* end if */ @@ -134,8 +134,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j<(size_t)size[1]; j++) if(0 != check[i][j]) { H5_FAILED(); - HDprintf(" Read a non-zero value.\n"); - HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); TEST_ERROR } /* end if */ PASSED(); @@ -202,8 +202,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j Date: Thu, 6 Apr 2017 12:15:57 -0500 Subject: Fix illegal references for sanity checks. Correct illegal references for HDassert() checks when in debug mode. Tested on emu, osx1010test, mayll, kituo, ostrich. --- src/H5Dchunk.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index a55a156..ab2cb8f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -462,8 +462,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; /* Sanity checks */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); + HDassert(udata.idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata.idx_hint]); /* If the cached chunk is dirty, it must be flushed to get accurate size */ if( ent->dirty == TRUE ) { @@ -533,8 +533,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); HDassert(offset); - HDassert(filters); - HDassert(buf); + HDassert(storage_size); /* Retrieve the dataset dimensions */ space_ndims = dset->shared->layout.u.chunk.ndims - 1; @@ -571,8 +570,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* Check if the requested chunk exists in the chunk cache */ if(UINT_MAX != udata.idx_hint) { /* Sanity checks */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); + HDassert(udata.idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata.idx_hint]); H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; /* If the cached chunk is dirty, it must be flushed to get accurate size */ -- cgit v0.12 From a77dec357bc5c19a1101b94a697fee59456b8b78 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 6 Apr 2017 14:29:47 -0500 Subject: Add missing test status --- test/plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/plugin.c b/test/plugin.c index 3491ab7..f65d345 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -774,6 +774,7 @@ test_filter_path_apis(void) ret = H5PLappend(pathname); } H5E_END_TRY if(ret >= 0) TEST_ERROR + PASSED(); TESTING(" remove (exceed max)"); /* Exceed the max path removal */ -- cgit v0.12 From bee3ca742946eff20f64e35048dc00429b99e362 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 11 Apr 2017 14:44:31 -0500 Subject: Description: Only format changes: mostly tabs vs. spaces Platforms tested: Linux/64 (jelly) --- c++/examples/chunks.cpp | 338 +++---- c++/examples/compound.cpp | 16 +- c++/examples/create.cpp | 12 +- c++/examples/extend_ds.cpp | 24 +- c++/examples/h5group.cpp | 288 +++--- c++/examples/h5tutr_cmprss.cpp | 198 ++-- c++/examples/h5tutr_crtatt.cpp | 60 +- c++/examples/h5tutr_crtdat.cpp | 56 +- c++/examples/h5tutr_crtgrp.cpp | 36 +- c++/examples/h5tutr_crtgrpar.cpp | 56 +- c++/examples/h5tutr_crtgrpd.cpp | 138 +-- c++/examples/h5tutr_extend.cpp | 220 ++-- c++/examples/h5tutr_rdwt.cpp | 50 +- c++/examples/h5tutr_subset.cpp | 194 ++-- c++/examples/readdata.cpp | 36 +- c++/examples/writedata.cpp | 518 +++++----- c++/src/H5AbstractDs.cpp | 186 ++-- c++/src/H5AbstractDs.h | 68 +- c++/src/H5ArrayType.cpp | 96 +- c++/src/H5ArrayType.h | 42 +- c++/src/H5AtomType.cpp | 206 ++-- c++/src/H5AtomType.h | 60 +- c++/src/H5Attribute.cpp | 462 ++++----- c++/src/H5Attribute.h | 112 +-- c++/src/H5Classes.h | 52 +- c++/src/H5CommonFG.cpp | 974 +++++++++--------- c++/src/H5CommonFG.h | 220 ++-- c++/src/H5CompType.cpp | 310 +++--- c++/src/H5CompType.h | 120 +-- c++/src/H5CppDoc.h | 18 +- c++/src/H5DataSet.cpp | 556 +++++----- c++/src/H5DataSet.h | 114 +-- c++/src/H5DataSpace.cpp | 466 ++++----- c++/src/H5DataSpace.h | 152 +-- c++/src/H5DataType.cpp | 566 +++++------ c++/src/H5DataType.h | 146 +-- c++/src/H5DcreatProp.cpp | 590 +++++------ c++/src/H5DcreatProp.h | 138 +-- c++/src/H5DxferProp.cpp | 366 +++---- c++/src/H5DxferProp.h | 126 +-- c++/src/H5EnumType.cpp | 170 ++-- c++/src/H5EnumType.h | 66 +- c++/src/H5Exception.cpp | 472 ++++----- c++/src/H5Exception.h | 148 +-- c++/src/H5FaccProp.cpp | 474 ++++----- c++/src/H5FaccProp.h | 164 +-- c++/src/H5FcreatProp.cpp | 176 ++-- c++/src/H5FcreatProp.h | 78 +- c++/src/H5File.cpp | 528 +++++----- c++/src/H5File.h | 122 +-- c++/src/H5FloatType.cpp | 202 ++-- c++/src/H5FloatType.h | 60 +- c++/src/H5Group.cpp | 144 +-- c++/src/H5Group.h | 46 +- c++/src/H5IdComponent.cpp | 266 ++--- c++/src/H5IdComponent.h | 104 +- c++/src/H5Include.h | 4 +- c++/src/H5IntType.cpp | 72 +- c++/src/H5IntType.h | 36 +- c++/src/H5Library.cpp | 126 +-- c++/src/H5Library.h | 36 +- c++/src/H5Location.cpp | 792 +++++++-------- c++/src/H5Location.h | 198 ++-- c++/src/H5Object.cpp | 32 +- c++/src/H5Object.h | 48 +- c++/src/H5OcreatProp.cpp | 112 +-- c++/src/H5OcreatProp.h | 42 +- c++/src/H5PredType.cpp | 442 ++++---- c++/src/H5PredType.h | 328 +++--- c++/src/H5PropList.cpp | 476 ++++----- c++/src/H5PropList.h | 142 +-- c++/src/H5StrType.cpp | 184 ++-- c++/src/H5StrType.h | 50 +- c++/src/H5VarLenType.cpp | 42 +- c++/src/H5VarLenType.h | 26 +- c++/test/dsets.cpp | 1652 +++++++++++++++--------------- c++/test/h5cpputil.cpp | 122 +-- c++/test/h5cpputil.h | 58 +- c++/test/tarray.cpp | 448 ++++----- c++/test/tattr.cpp | 2064 +++++++++++++++++++------------------- c++/test/tcompound.cpp | 952 +++++++++--------- c++/test/tdspl.cpp | 124 +-- c++/test/testhdf5.cpp | 92 +- c++/test/tfile.cpp | 618 ++++++------ c++/test/tfilter.cpp | 70 +- c++/test/th5s.cpp | 576 +++++------ c++/test/tlinks.cpp | 308 +++--- c++/test/tobject.cpp | 362 +++---- c++/test/trefer.cpp | 1054 +++++++++---------- c++/test/ttypes.cpp | 592 +++++------ c++/test/tvlstr.cpp | 1016 +++++++++---------- 91 files changed, 12451 insertions(+), 12451 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 286934a..f8e45b8 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -47,194 +47,194 @@ const int RANKC = 1; int main (void) { - hsize_t i, j; + hsize_t i, j; // Try block to detect exceptions raised by any of the calls inside it try { - /* - * Turn off the auto-printing when failure occurs so that we can - * handle the errors appropriately - */ - Exception::dontPrint(); - - /* - * Open the file and the dataset. - */ - H5File file( FILE_NAME, H5F_ACC_RDONLY ); - DataSet dataset = file.openDataSet( DATASET_NAME ); - - /* - * Get filespace for rank and dimension - */ - DataSpace filespace = dataset.getSpace(); - - /* - * Get number of dimensions in the file dataspace - */ - int rank = filespace.getSimpleExtentNdims(); - - /* - * Get and print the dimension sizes of the file dataspace - */ - hsize_t dims[2]; // dataset dimensions - rank = filespace.getSimpleExtentDims( dims ); - cout << "dataset rank = " << rank << ", dimensions " - << (unsigned long)(dims[0]) << " x " - << (unsigned long)(dims[1]) << endl; - - /* - * Define the memory space to read dataset. - */ - DataSpace mspace1(RANK, dims); - - /* - * Read dataset back and display. - */ - int data_out[NX][NY]; // buffer for dataset to be read - dataset.read( data_out, PredType::NATIVE_INT, mspace1, filespace ); - - cout << "\n"; - cout << "Dataset: \n"; - for (j = 0; j < dims[0]; j++) - { - for (i = 0; i < dims[1]; i++) - cout << data_out[j][i] << " "; - cout << endl; - } - - /* - * dataset rank 2, dimensions 10 x 5 - * chunk rank 2, dimensions 2 x 5 - - * Dataset: - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - */ - - /* - * Read the third column from the dataset. - * First define memory dataspace, then define hyperslab - * and read it into column array. - */ - hsize_t col_dims[1]; - col_dims[0] = 10; - DataSpace mspace2( RANKC, col_dims ); - - /* - * Define the column (hyperslab) to read. - */ - hsize_t offset[2] = { 0, 2 }; - hsize_t count[2] = { 10, 1 }; - int column[10]; // buffer for column to be read - - /* - * Define hyperslab and read. - */ - filespace.selectHyperslab( H5S_SELECT_SET, count, offset ); - dataset.read( column, PredType::NATIVE_INT, mspace2, filespace ); - - cout << endl; - cout << "Third column: " << endl; - for (i = 0; i < 10; i++) - cout << column[i] << endl; - - /* - * Third column: - * 1 - * 1 - * 1 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - */ - - /* - * Get creation properties list. - */ - DSetCreatPropList cparms = dataset.getCreatePlist(); - - /* - * Check if dataset is chunked. - */ - hsize_t chunk_dims[2]; - int rank_chunk; - if( H5D_CHUNKED == cparms.getLayout() ) - { - /* - * Get chunking information: rank and dimensions - */ - rank_chunk = cparms.getChunk( 2, chunk_dims); - cout << "chunk rank " << rank_chunk << "dimensions " - << (unsigned long)(chunk_dims[0]) << " x " - << (unsigned long)(chunk_dims[1]) << endl; - - /* - * Define the memory space to read a chunk. - */ - DataSpace mspace3( rank_chunk, chunk_dims ); - - /* - * Define chunk in the file (hyperslab) to read. - */ - offset[0] = 2; - offset[1] = 0; - count[0] = chunk_dims[0]; - count[1] = chunk_dims[1]; - filespace.selectHyperslab( H5S_SELECT_SET, count, offset ); - - /* - * Read chunk back and display. - */ - int chunk_out[2][5]; // buffer for chunk to be read - dataset.read( chunk_out, PredType::NATIVE_INT, mspace3, filespace ); - cout << endl; - cout << "Chunk:" << endl; - for (j = 0; j < chunk_dims[0]; j++) - { - for (i = 0; i < chunk_dims[1]; i++) - cout << chunk_out[j][i] << " "; - cout << endl; - } - /* - * Chunk: - * 1 1 1 0 0 - * 2 0 0 0 0 - */ - } + /* + * Turn off the auto-printing when failure occurs so that we can + * handle the errors appropriately + */ + Exception::dontPrint(); + + /* + * Open the file and the dataset. + */ + H5File file( FILE_NAME, H5F_ACC_RDONLY ); + DataSet dataset = file.openDataSet( DATASET_NAME ); + + /* + * Get filespace for rank and dimension + */ + DataSpace filespace = dataset.getSpace(); + + /* + * Get number of dimensions in the file dataspace + */ + int rank = filespace.getSimpleExtentNdims(); + + /* + * Get and print the dimension sizes of the file dataspace + */ + hsize_t dims[2]; // dataset dimensions + rank = filespace.getSimpleExtentDims( dims ); + cout << "dataset rank = " << rank << ", dimensions " + << (unsigned long)(dims[0]) << " x " + << (unsigned long)(dims[1]) << endl; + + /* + * Define the memory space to read dataset. + */ + DataSpace mspace1(RANK, dims); + + /* + * Read dataset back and display. + */ + int data_out[NX][NY]; // buffer for dataset to be read + dataset.read( data_out, PredType::NATIVE_INT, mspace1, filespace ); + + cout << "\n"; + cout << "Dataset: \n"; + for (j = 0; j < dims[0]; j++) + { + for (i = 0; i < dims[1]; i++) + cout << data_out[j][i] << " "; + cout << endl; + } + + /* + * dataset rank 2, dimensions 10 x 5 + * chunk rank 2, dimensions 2 x 5 + + * Dataset: + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + */ + + /* + * Read the third column from the dataset. + * First define memory dataspace, then define hyperslab + * and read it into column array. + */ + hsize_t col_dims[1]; + col_dims[0] = 10; + DataSpace mspace2( RANKC, col_dims ); + + /* + * Define the column (hyperslab) to read. + */ + hsize_t offset[2] = { 0, 2 }; + hsize_t count[2] = { 10, 1 }; + int column[10]; // buffer for column to be read + + /* + * Define hyperslab and read. + */ + filespace.selectHyperslab( H5S_SELECT_SET, count, offset ); + dataset.read( column, PredType::NATIVE_INT, mspace2, filespace ); + + cout << endl; + cout << "Third column: " << endl; + for (i = 0; i < 10; i++) + cout << column[i] << endl; + + /* + * Third column: + * 1 + * 1 + * 1 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + */ + + /* + * Get creation properties list. + */ + DSetCreatPropList cparms = dataset.getCreatePlist(); + + /* + * Check if dataset is chunked. + */ + hsize_t chunk_dims[2]; + int rank_chunk; + if( H5D_CHUNKED == cparms.getLayout() ) + { + /* + * Get chunking information: rank and dimensions + */ + rank_chunk = cparms.getChunk( 2, chunk_dims); + cout << "chunk rank " << rank_chunk << "dimensions " + << (unsigned long)(chunk_dims[0]) << " x " + << (unsigned long)(chunk_dims[1]) << endl; + + /* + * Define the memory space to read a chunk. + */ + DataSpace mspace3( rank_chunk, chunk_dims ); + + /* + * Define chunk in the file (hyperslab) to read. + */ + offset[0] = 2; + offset[1] = 0; + count[0] = chunk_dims[0]; + count[1] = chunk_dims[1]; + filespace.selectHyperslab( H5S_SELECT_SET, count, offset ); + + /* + * Read chunk back and display. + */ + int chunk_out[2][5]; // buffer for chunk to be read + dataset.read( chunk_out, PredType::NATIVE_INT, mspace3, filespace ); + cout << endl; + cout << "Chunk:" << endl; + for (j = 0; j < chunk_dims[0]; j++) + { + for (i = 0; i < chunk_dims[1]; i++) + cout << chunk_out[j][i] << " "; + cout << endl; + } + /* + * Chunk: + * 1 1 1 0 0 + * 2 0 0 0 0 + */ + } } // end of try block // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; } diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index dfc5d81..1e19229 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -51,15 +51,15 @@ int main(void) { /* First structure and dataset*/ typedef struct s1_t { - int a; - float b; - double c; + int a; + float b; + double c; } s1_t; /* Second structure (subset of s1_t) and dataset*/ typedef struct s2_t { - double c; - int a; + double c; + int a; } s2_t; // Try block to detect exceptions raised by any of the calls inside it @@ -145,12 +145,12 @@ int main(void) */ cout << endl << "Field c : " << endl; for( i = 0; i < LENGTH; i++) - cout << s2[i].c << " "; + cout << s2[i].c << " "; cout << endl; cout << endl << "Field a : " << endl; for( i = 0; i < LENGTH; i++) - cout << s2[i].a << " "; + cout << s2[i].a << " "; cout << endl; /* @@ -171,7 +171,7 @@ int main(void) */ cout << endl << "Field b : " << endl; for( i = 0; i < LENGTH; i++) - cout << s3[i] << " "; + cout << s3[i] << " "; cout << endl; /* diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index b4cc768..5ea24ef 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -30,11 +30,11 @@ using namespace H5; #endif -const H5std_string FILE_NAME( "SDS.h5" ); -const H5std_string DATASET_NAME( "IntArray" ); -const int NX = 5; // dataset dimensions -const int NY = 6; -const int RANK = 2; +const H5std_string FILE_NAME( "SDS.h5" ); +const H5std_string DATASET_NAME( "IntArray" ); +const int NX = 5; // dataset dimensions +const int NY = 6; +const int RANK = 2; int main (void) { @@ -46,7 +46,7 @@ int main (void) for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) - data[j][i] = i + j; + data[j][i] = i + j; } /* * 0 1 2 3 4 5 diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 2723263..f8570d2 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -113,8 +113,8 @@ int main (void) * Write the data to the hyperslab. */ int data1[3][3] = { {1, 1, 1}, /* data to write */ - {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1}, + {1, 1, 1} }; dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 ); /* @@ -187,16 +187,16 @@ int main (void) /* * Resulting dataset * - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 */ /* * Display the result. diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index a5137bc..9f81885 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -43,7 +43,7 @@ #endif const H5std_string FILE_NAME( "Group.h5" ); -const int RANK = 2; +const int RANK = 2; // Operator function extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, @@ -58,169 +58,169 @@ int main(void) // Try block to detect exceptions raised by any of the calls inside it try { - /* - * Turn off the auto-printing when failure occurs so that we can - * handle the errors appropriately - */ - Exception::dontPrint(); - - /* - * Create the named file, truncating the existing one if any, - * using default create and access property lists. - */ - H5File *file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); - - /* - * Create a group in the file - */ - Group* group = new Group( file->createGroup( "/Data" )); - - /* - * Create dataset "Compressed Data" in the group using absolute - * name. Dataset creation property list is modified to use - * GZIP compression with the compression effort set to 6. - * Note that compression can be used only when dataset is chunked. - */ - dims[0] = 1000; - dims[1] = 20; - cdims[0] = 20; - cdims[1] = 20; - DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace - DSetCreatPropList ds_creatplist; // create dataset creation prop list - ds_creatplist.setChunk( 2, cdims ); // then modify it for compression - ds_creatplist.setDeflate( 6 ); - - /* - * Create the first dataset. - */ - DataSet* dataset = new DataSet(file->createDataSet( - "/Data/Compressed_Data", PredType::NATIVE_INT, - *dataspace, ds_creatplist )); - - /* - * Close the first dataset. - */ - delete dataset; - delete dataspace; - - /* - * Create the second dataset. - */ - dims[0] = 500; - dims[1] = 20; - dataspace = new DataSpace(RANK, dims); // create second dspace - dataset = new DataSet(file->createDataSet("/Data/Float_Data", - PredType::NATIVE_FLOAT, *dataspace)); - - delete dataset; - delete dataspace; - delete group; - delete file; - - /* - * Now reopen the file and group in the file. - */ - file = new H5File(FILE_NAME, H5F_ACC_RDWR); - group = new Group(file->openGroup("Data")); - - /* - * Access "Compressed_Data" dataset in the group. - */ - try { // to determine if the dataset exists in the group - dataset = new DataSet( group->openDataSet( "Compressed_Data" )); - } - catch( GroupIException not_found_error ) { - cout << " Dataset is not found." << endl; - } - cout << "dataset \"/Data/Compressed_Data\" is open" << endl; - - /* - * Close the dataset. - */ - delete dataset; - - /* - * Create hard link to the Data group. - */ - file->link( H5L_TYPE_HARD, "Data", "Data_new" ); - - /* - * We can access "Compressed_Data" dataset using created - * hard link "Data_new". - */ - try { // to determine if the dataset exists in the file - dataset = new DataSet(file->openDataSet( "/Data_new/Compressed_Data" )); - } - catch( FileIException not_found_error ) - { - cout << " Dataset is not found." << endl; - } - cout << "dataset \"/Data_new/Compressed_Data\" is open" << endl; - - /* - * Close the dataset. - */ - delete dataset; - - /* - * Use iterator to see the names of the objects in the file - * root directory. - */ - cout << endl << "Iterating over elements in the file" << endl; - herr_t idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL); - cout << endl; - - /* - * Unlink name "Data" and use iterator to see the names - * of the objects in the file root direvtory. - */ - cout << "Unlinking..." << endl; - try { // attempt to unlink the dataset - file->unlink( "Data" ); - } - catch( FileIException unlink_error ) - { - cout << " unlink failed." << endl; - } - cout << "\"Data\" is unlinked" << endl; - - cout << endl << "Iterating over elements in the file again" << endl; - idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL); - cout << endl; - - /* - * Close the group and file. - */ - delete group; - delete file; + /* + * Turn off the auto-printing when failure occurs so that we can + * handle the errors appropriately + */ + Exception::dontPrint(); + + /* + * Create the named file, truncating the existing one if any, + * using default create and access property lists. + */ + H5File *file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); + + /* + * Create a group in the file + */ + Group* group = new Group( file->createGroup( "/Data" )); + + /* + * Create dataset "Compressed Data" in the group using absolute + * name. Dataset creation property list is modified to use + * GZIP compression with the compression effort set to 6. + * Note that compression can be used only when dataset is chunked. + */ + dims[0] = 1000; + dims[1] = 20; + cdims[0] = 20; + cdims[1] = 20; + DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace + DSetCreatPropList ds_creatplist; // create dataset creation prop list + ds_creatplist.setChunk( 2, cdims ); // then modify it for compression + ds_creatplist.setDeflate( 6 ); + + /* + * Create the first dataset. + */ + DataSet* dataset = new DataSet(file->createDataSet( + "/Data/Compressed_Data", PredType::NATIVE_INT, + *dataspace, ds_creatplist )); + + /* + * Close the first dataset. + */ + delete dataset; + delete dataspace; + + /* + * Create the second dataset. + */ + dims[0] = 500; + dims[1] = 20; + dataspace = new DataSpace(RANK, dims); // create second dspace + dataset = new DataSet(file->createDataSet("/Data/Float_Data", + PredType::NATIVE_FLOAT, *dataspace)); + + delete dataset; + delete dataspace; + delete group; + delete file; + + /* + * Now reopen the file and group in the file. + */ + file = new H5File(FILE_NAME, H5F_ACC_RDWR); + group = new Group(file->openGroup("Data")); + + /* + * Access "Compressed_Data" dataset in the group. + */ + try { // to determine if the dataset exists in the group + dataset = new DataSet( group->openDataSet( "Compressed_Data" )); + } + catch( GroupIException not_found_error ) { + cout << " Dataset is not found." << endl; + } + cout << "dataset \"/Data/Compressed_Data\" is open" << endl; + + /* + * Close the dataset. + */ + delete dataset; + + /* + * Create hard link to the Data group. + */ + file->link( H5L_TYPE_HARD, "Data", "Data_new" ); + + /* + * We can access "Compressed_Data" dataset using created + * hard link "Data_new". + */ + try { // to determine if the dataset exists in the file + dataset = new DataSet(file->openDataSet( "/Data_new/Compressed_Data" )); + } + catch( FileIException not_found_error ) + { + cout << " Dataset is not found." << endl; + } + cout << "dataset \"/Data_new/Compressed_Data\" is open" << endl; + + /* + * Close the dataset. + */ + delete dataset; + + /* + * Use iterator to see the names of the objects in the file + * root directory. + */ + cout << endl << "Iterating over elements in the file" << endl; + herr_t idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL); + cout << endl; + + /* + * Unlink name "Data" and use iterator to see the names + * of the objects in the file root direvtory. + */ + cout << "Unlinking..." << endl; + try { // attempt to unlink the dataset + file->unlink( "Data" ); + } + catch( FileIException unlink_error ) + { + cout << " unlink failed." << endl; + } + cout << "\"Data\" is unlinked" << endl; + + cout << endl << "Iterating over elements in the file again" << endl; + idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL); + cout << endl; + + /* + * Close the group and file. + */ + delete group; + delete file; } // end of try block // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the Attribute operations catch( AttributeIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; } diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index e9c87f1..3dcc4e4 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -31,130 +31,130 @@ #endif // H5_NO_STD #endif -const H5std_string FILE_NAME("h5tutr_cmprss.h5"); -const H5std_string DATASET_NAME("Compressed_Data"); -const int DIM0 = 100; -const int DIM1 = 20; +const H5std_string FILE_NAME("h5tutr_cmprss.h5"); +const H5std_string DATASET_NAME("Compressed_Data"); +const int DIM0 = 100; +const int DIM1 = 20; int main (void) { - hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions - hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions + hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions + hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions int i,j, buf[DIM0][DIM1]; // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Create a new file using the default property lists. - H5File file(FILE_NAME, H5F_ACC_TRUNC); + // Create a new file using the default property lists. + H5File file(FILE_NAME, H5F_ACC_TRUNC); - // Create the data space for the dataset. - DataSpace *dataspace = new DataSpace(2, dims); + // Create the data space for the dataset. + DataSpace *dataspace = new DataSpace(2, dims); - // Modify dataset creation property to enable chunking - DSetCreatPropList *plist = new DSetCreatPropList; - plist->setChunk(2, chunk_dims); + // Modify dataset creation property to enable chunking + DSetCreatPropList *plist = new DSetCreatPropList; + plist->setChunk(2, chunk_dims); - // Set ZLIB (DEFLATE) Compression using level 6. - // To use SZIP compression comment out this line. - plist->setDeflate(6); + // Set ZLIB (DEFLATE) Compression using level 6. + // To use SZIP compression comment out this line. + plist->setDeflate(6); - // Uncomment these lines to set SZIP Compression - // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; - // unsigned szip_pixels_per_block = 16; - // plist->setSzip(szip_options_mask, szip_pixels_per_block); + // Uncomment these lines to set SZIP Compression + // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; + // unsigned szip_pixels_per_block = 16; + // plist->setSzip(szip_options_mask, szip_pixels_per_block); - // Create the dataset. - DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, - PredType::STD_I32BE, *dataspace, *plist) ); - - for (i = 0; i< DIM0; i++) - for (j=0; jwrite(buf, PredType::NATIVE_INT); - - // Close objects and file. Either approach will close the HDF5 item. - delete dataspace; - delete dataset; - delete plist; - file.close(); - - // ----------------------------------------------- - // Re-open the file and dataset, retrieve filter - // information for dataset and read the data back. - // ----------------------------------------------- - - int rbuf[DIM0][DIM1]; - int numfilt; - size_t nelmts={1}, namelen={1}; - unsigned flags, filter_info, cd_values[1], idx; - char name[1]; - H5Z_filter_t filter_type; - - // Open the file and the dataset in the file. - file.openFile(FILE_NAME, H5F_ACC_RDONLY); - dataset = new DataSet(file.openDataSet( DATASET_NAME)); - - // Get the create property list of the dataset. - plist = new DSetCreatPropList(dataset->getCreatePlist ()); - - // Get the number of filters associated with the dataset. - numfilt = plist->getNfilters(); - cout << "Number of filters associated with dataset: " << numfilt << endl; - - for (idx=0; idx < numfilt; idx++) { - nelmts = 0; - - filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info); - - cout << "Filter Type: "; - - switch (filter_type) { - case H5Z_FILTER_DEFLATE: - cout << "H5Z_FILTER_DEFLATE" << endl; - break; - case H5Z_FILTER_SZIP: - cout << "H5Z_FILTER_SZIP" << endl; - break; - default: - cout << "Other filter type included." << endl; - } - } - - // Read data. - dataset->read(rbuf, PredType::NATIVE_INT); - - delete plist; - delete dataset; - file.close(); // can be skipped + // Create the dataset. + DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, + PredType::STD_I32BE, *dataspace, *plist) ); + + for (i = 0; i< DIM0; i++) + for (j=0; jwrite(buf, PredType::NATIVE_INT); + + // Close objects and file. Either approach will close the HDF5 item. + delete dataspace; + delete dataset; + delete plist; + file.close(); + + // ----------------------------------------------- + // Re-open the file and dataset, retrieve filter + // information for dataset and read the data back. + // ----------------------------------------------- + + int rbuf[DIM0][DIM1]; + int numfilt; + size_t nelmts={1}, namelen={1}; + unsigned flags, filter_info, cd_values[1], idx; + char name[1]; + H5Z_filter_t filter_type; + + // Open the file and the dataset in the file. + file.openFile(FILE_NAME, H5F_ACC_RDONLY); + dataset = new DataSet(file.openDataSet( DATASET_NAME)); + + // Get the create property list of the dataset. + plist = new DSetCreatPropList(dataset->getCreatePlist ()); + + // Get the number of filters associated with the dataset. + numfilt = plist->getNfilters(); + cout << "Number of filters associated with dataset: " << numfilt << endl; + + for (idx=0; idx < numfilt; idx++) { + nelmts = 0; + + filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info); + + cout << "Filter Type: "; + + switch (filter_type) { + case H5Z_FILTER_DEFLATE: + cout << "H5Z_FILTER_DEFLATE" << endl; + break; + case H5Z_FILTER_SZIP: + cout << "H5Z_FILTER_SZIP" << endl; + break; + default: + cout << "Other filter type included." << endl; + } + } + + // Read data. + dataset->read(rbuf, PredType::NATIVE_INT); + + delete plist; + delete dataset; + file.close(); // can be skipped } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index df8ca5a..affaf8c 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -27,11 +27,11 @@ using namespace H5; #endif -const H5std_string FILE_NAME( "h5tutr_dset.h5" ); -const H5std_string DATASET_NAME( "dset" ); -const H5std_string ATTR_NAME( "Units" ); +const H5std_string FILE_NAME( "h5tutr_dset.h5" ); +const H5std_string DATASET_NAME( "dset" ); +const H5std_string ATTR_NAME( "Units" ); -const int DIM1 = 2; +const int DIM1 = 2; int main (void) { @@ -42,52 +42,52 @@ int main (void) // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Open an existing file and dataset. - H5File file( FILE_NAME, H5F_ACC_RDWR ); - DataSet dataset = file.openDataSet( DATASET_NAME ); + // Open an existing file and dataset. + H5File file( FILE_NAME, H5F_ACC_RDWR ); + DataSet dataset = file.openDataSet( DATASET_NAME ); - // Create the data space for the attribute. - DataSpace attr_dataspace = DataSpace (1, dims ); + // Create the data space for the attribute. + DataSpace attr_dataspace = DataSpace (1, dims ); - // Create a dataset attribute. - Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, - attr_dataspace); + // Create a dataset attribute. + Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, + attr_dataspace); - // Write the attribute data. - attribute.write( PredType::NATIVE_INT, attr_data); + // Write the attribute data. + attribute.write( PredType::NATIVE_INT, attr_data); } // end of try block // catch failure caused by the H5File operations catch( DataSpaceIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the H5File operations catch( AttributeIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index c767f72..765801d 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -27,54 +27,54 @@ using namespace H5; #endif -const H5std_string FILE_NAME("h5tutr_dset.h5"); -const H5std_string DATASET_NAME("dset"); -const int NX = 4; // dataset dimensions -const int NY = 6; -const int RANK = 2; +const H5std_string FILE_NAME("h5tutr_dset.h5"); +const H5std_string DATASET_NAME("dset"); +const int NX = 4; // dataset dimensions +const int NY = 6; +const int RANK = 2; int main (void) { // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Create a new file using the default property lists. - H5File file(FILE_NAME, H5F_ACC_TRUNC); + // Create a new file using the default property lists. + H5File file(FILE_NAME, H5F_ACC_TRUNC); - // Create the data space for the dataset. - hsize_t dims[2]; // dataset dimensions - dims[0] = NX; - dims[1] = NY; - DataSpace dataspace(RANK, dims); + // Create the data space for the dataset. + hsize_t dims[2]; // dataset dimensions + dims[0] = NX; + dims[1] = NY; + DataSpace dataspace(RANK, dims); - // Create the dataset. - DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace); + // Create the dataset. + DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace); } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index 3db4e72..02ceb5f 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -38,31 +38,31 @@ int main(void) // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Create a new file using default property lists. - H5File file(FILE_NAME, H5F_ACC_TRUNC); - - // Create a group named "/MygGroup" in the file - Group group(file.createGroup("/MyGroup")); + // Create a new file using default property lists. + H5File file(FILE_NAME, H5F_ACC_TRUNC); + + // Create a group named "/MygGroup" in the file + Group group(file.createGroup("/MyGroup")); - // File and group will be closed as their instances go out of scope. + // File and group will be closed as their instances go out of scope. } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index f6e031f..56980e2 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -40,50 +40,50 @@ int main(void) try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately. + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately. - Exception::dontPrint(); + Exception::dontPrint(); - // Create a new file using default properties. + // Create a new file using default properties. - H5File file(FILE_NAME, H5F_ACC_TRUNC); + H5File file(FILE_NAME, H5F_ACC_TRUNC); - // Create group "MyGroup" in the root group using an absolute name. - - Group group1(file.createGroup( "/MyGroup")); + // Create group "MyGroup" in the root group using an absolute name. + + Group group1(file.createGroup( "/MyGroup")); - // Create group "Group_A" in group "MyGroup" using an - // absolute name. + // Create group "Group_A" in group "MyGroup" using an + // absolute name. - Group group2(file.createGroup("/MyGroup/Group_A")); + Group group2(file.createGroup("/MyGroup/Group_A")); - // Create group "Group_B" in group "MyGroup" using a - // relative name. + // Create group "Group_B" in group "MyGroup" using a + // relative name. - Group group3(group1.createGroup ("Group_B")); + Group group3(group1.createGroup ("Group_B")); - // Close the groups and file. + // Close the groups and file. - group1.close(); - group2.close(); - group3.close(); - file.close(); + group1.close(); + group2.close(); + group3.close(); + file.close(); } // end of try block // catch failure caused by the File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index f0bde52..34ef83d 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -34,11 +34,11 @@ const H5std_string FILE_NAME("h5tutr_groups.h5"); const H5std_string DATASET_NAME1("/MyGroup/dset1"); const H5std_string DATASET_NAME2("dset2"); -const int RANK = 2; -const int D1DIM1 = 3; -const int D1DIM2 = 3; -const int D2DIM1 = 2; -const int D2DIM2 = 10; +const int RANK = 2; +const int D1DIM1 = 3; +const int D1DIM2 = 3; +const int D2DIM1 = 2; +const int D2DIM2 = 10; int main(void) { @@ -48,93 +48,93 @@ int main(void) // Try block to catch exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Initialize the first dataset. - for (i = 0; i < D1DIM1; i++) - for (j = 0; j < D1DIM2; j++) - dset1_data[i][j] = j + 1; + // Initialize the first dataset. + for (i = 0; i < D1DIM1; i++) + for (j = 0; j < D1DIM2; j++) + dset1_data[i][j] = j + 1; - // Initialize the second dataset. - for (i = 0; i < D2DIM1; i++) - for (j = 0; j < D2DIM2; j++) - dset2_data[i][j] = j + 1; + // Initialize the second dataset. + for (i = 0; i < D2DIM1; i++) + for (j = 0; j < D2DIM2; j++) + dset2_data[i][j] = j + 1; - // Open an existing file and dataset. - H5File file(FILE_NAME, H5F_ACC_RDWR); + // Open an existing file and dataset. + H5File file(FILE_NAME, H5F_ACC_RDWR); // Create the data space for the first dataset. Note the use of // pointer for the instance 'dataspace'. It can be deleted and // used again later for another data space. An HDF5 identifier is // closed by the destructor or the method 'close()'. - hsize_t dims[RANK]; // dataset dimensions - dims[0] = D1DIM1; - dims[1] = D1DIM2; - DataSpace *dataspace = new DataSpace (RANK, dims); - - // Create the dataset in group "MyGroup". Same note as for the - // dataspace above. - DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, - PredType::STD_I32BE, *dataspace)); - - // Write the data to the dataset using default memory space, file - // space, and transfer properties. - dataset->write(dset1_data, PredType::NATIVE_INT); - - // Close the current dataset and data space. - delete dataset; - delete dataspace; - - // Create the data space for the second dataset. - dims[0] = D2DIM1; - dims[1] = D2DIM2; - dataspace = new DataSpace (RANK, dims); - - // Create group "Group_A" in group "MyGroup". - Group group(file.openGroup("/MyGroup/Group_A")); - - // Create the second dataset in group "Group_A". - dataset = new DataSet (group.createDataSet(DATASET_NAME2, - PredType::STD_I32BE, *dataspace)); - - // Write the data to the dataset using default memory space, file - // space, and transfer properties. - dataset->write(dset2_data, PredType::NATIVE_INT); - - // Close all objects. - delete dataspace; - delete dataset; - group.close(); + hsize_t dims[RANK]; // dataset dimensions + dims[0] = D1DIM1; + dims[1] = D1DIM2; + DataSpace *dataspace = new DataSpace (RANK, dims); + + // Create the dataset in group "MyGroup". Same note as for the + // dataspace above. + DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, + PredType::STD_I32BE, *dataspace)); + + // Write the data to the dataset using default memory space, file + // space, and transfer properties. + dataset->write(dset1_data, PredType::NATIVE_INT); + + // Close the current dataset and data space. + delete dataset; + delete dataspace; + + // Create the data space for the second dataset. + dims[0] = D2DIM1; + dims[1] = D2DIM2; + dataspace = new DataSpace (RANK, dims); + + // Create group "Group_A" in group "MyGroup". + Group group(file.openGroup("/MyGroup/Group_A")); + + // Create the second dataset in group "Group_A". + dataset = new DataSet (group.createDataSet(DATASET_NAME2, + PredType::STD_I32BE, *dataspace)); + + // Write the data to the dataset using default memory space, file + // space, and transfer properties. + dataset->write(dset2_data, PredType::NATIVE_INT); + + // Close all objects. + delete dataspace; + delete dataset; + group.close(); } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index 432ca5e..fe5eec9 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -31,17 +31,17 @@ #endif // H5_NO_STD #endif -const H5std_string FILE_NAME("h5tutr_extend.h5"); -const H5std_string DATASETNAME("ExtendibleArray"); +const H5std_string FILE_NAME("h5tutr_extend.h5"); +const H5std_string DATASETNAME("ExtendibleArray"); int main (void) { - hsize_t dims[2] = {3,3}; // dataset dimensions at creation + hsize_t dims[2] = {3,3}; // dataset dimensions at creation hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; - int data[3][3] = { {1, 1, 1}, // data to write - {1, 1, 1}, - {1, 1, 1} }; + int data[3][3] = { {1, 1, 1}, // data to write + {1, 1, 1}, + {1, 1, 1} }; // Variables used in extending and writing to the extended portion of dataset @@ -49,127 +49,127 @@ int main (void) hsize_t offset[2]; hsize_t dimsext[2] = {7, 3}; // extend dimensions int dataext[7][3] = { {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4}, - {2, 3, 4} }; + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4}, + {2, 3, 4} }; // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); - - // Create a new file using the default property lists. - H5File file(FILE_NAME, H5F_ACC_TRUNC); - - // Create the data space for the dataset. Note the use of pointer - // for the instance 'dataspace'. It can be deleted and used again - // later for another dataspace. An HDF5 identifier can be closed - // by the destructor or the method 'close()'. - DataSpace *dataspace = new DataSpace (2, dims, maxdims); - - // Modify dataset creation property to enable chunking - DSetCreatPropList prop; - prop.setChunk(2, chunk_dims); - - // Create the chunked dataset. Note the use of pointer. - DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, - PredType::STD_I32BE, *dataspace, prop) ); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); + + // Create a new file using the default property lists. + H5File file(FILE_NAME, H5F_ACC_TRUNC); + + // Create the data space for the dataset. Note the use of pointer + // for the instance 'dataspace'. It can be deleted and used again + // later for another dataspace. An HDF5 identifier can be closed + // by the destructor or the method 'close()'. + DataSpace *dataspace = new DataSpace (2, dims, maxdims); + + // Modify dataset creation property to enable chunking + DSetCreatPropList prop; + prop.setChunk(2, chunk_dims); + + // Create the chunked dataset. Note the use of pointer. + DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, + PredType::STD_I32BE, *dataspace, prop) ); - // Write data to dataset. - dataset->write(data, PredType::NATIVE_INT); - - // Extend the dataset. Dataset becomes 10 x 3. - size[0] = dims[0] + dimsext[0]; - size[1] = dims[1]; - dataset->extend(size); - - // Select a hyperslab in extended portion of the dataset. - DataSpace *filespace = new DataSpace(dataset->getSpace ()); - offset[0] = 3; - offset[1] = 0; - filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset); - - // Define memory space. - DataSpace *memspace = new DataSpace(2, dimsext, NULL); - - // Write data to the extended portion of the dataset. - dataset->write(dataext, PredType::NATIVE_INT, *memspace, *filespace); - - // Close all objects and file. - prop.close(); - delete filespace; - delete memspace; - delete dataspace; - delete dataset; - file.close(); - - // --------------------------------------- - // Re-open the file and read the data back - // --------------------------------------- - - int rdata[10][3]; - int i,j, rank, rank_chunk; - hsize_t chunk_dimsr[2], dimsr[2]; - - // Open the file and dataset. - file.openFile(FILE_NAME, H5F_ACC_RDONLY); - dataset = new DataSet(file.openDataSet( DATASETNAME)); - - // Get the dataset's dataspace and creation property list. - filespace = new DataSpace(dataset->getSpace()); - prop = dataset->getCreatePlist(); - - // Get information to obtain memory dataspace. - rank = filespace->getSimpleExtentNdims(); - herr_t status_n = filespace->getSimpleExtentDims(dimsr); - - if (H5D_CHUNKED == prop.getLayout()) - rank_chunk = prop.getChunk(rank, chunk_dimsr); - cout << "rank chunk = " << rank_chunk << endl;; - - memspace = new DataSpace(rank, dimsr, NULL); - dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace); + // Write data to dataset. + dataset->write(data, PredType::NATIVE_INT); + + // Extend the dataset. Dataset becomes 10 x 3. + size[0] = dims[0] + dimsext[0]; + size[1] = dims[1]; + dataset->extend(size); + + // Select a hyperslab in extended portion of the dataset. + DataSpace *filespace = new DataSpace(dataset->getSpace ()); + offset[0] = 3; + offset[1] = 0; + filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset); + + // Define memory space. + DataSpace *memspace = new DataSpace(2, dimsext, NULL); + + // Write data to the extended portion of the dataset. + dataset->write(dataext, PredType::NATIVE_INT, *memspace, *filespace); + + // Close all objects and file. + prop.close(); + delete filespace; + delete memspace; + delete dataspace; + delete dataset; + file.close(); + + // --------------------------------------- + // Re-open the file and read the data back + // --------------------------------------- + + int rdata[10][3]; + int i,j, rank, rank_chunk; + hsize_t chunk_dimsr[2], dimsr[2]; + + // Open the file and dataset. + file.openFile(FILE_NAME, H5F_ACC_RDONLY); + dataset = new DataSet(file.openDataSet( DATASETNAME)); + + // Get the dataset's dataspace and creation property list. + filespace = new DataSpace(dataset->getSpace()); + prop = dataset->getCreatePlist(); + + // Get information to obtain memory dataspace. + rank = filespace->getSimpleExtentNdims(); + herr_t status_n = filespace->getSimpleExtentDims(dimsr); + + if (H5D_CHUNKED == prop.getLayout()) + rank_chunk = prop.getChunk(rank, chunk_dimsr); + cout << "rank chunk = " << rank_chunk << endl;; + + memspace = new DataSpace(rank, dimsr, NULL); + dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace); - cout << endl; - for (j = 0; j < dimsr[0]; j++) { - for (i = 0; i < dimsr[1]; i++) - cout << " " << rdata[j][i]; - cout << endl; - } - - // Close all objects and file. - prop.close(); - delete filespace; - delete memspace; - delete dataset; - file.close(); + cout << endl; + for (j = 0; j < dimsr[0]; j++) { + for (i = 0; i < dimsr[1]; i++) + cout << " " << rdata[j][i]; + cout << endl; + } + + // Close all objects and file. + prop.close(); + delete filespace; + delete memspace; + delete dataset; + file.close(); } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index 68c28ca..8a369a4 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -27,10 +27,10 @@ using namespace H5; #endif -const H5std_string FILE_NAME("h5tutr_dset.h5"); -const H5std_string DATASET_NAME("dset"); -const int DIM0 = 4; // dataset dimensions -const int DIM1 = 6; +const H5std_string FILE_NAME("h5tutr_dset.h5"); +const H5std_string DATASET_NAME("dset"); +const int DIM0 = 4; // dataset dimensions +const int DIM1 = 6; int main (void) { @@ -38,41 +38,41 @@ int main (void) // Data initialization. int i, j; - int data[DIM0][DIM1]; // buffer for data to write + int data[DIM0][DIM1]; // buffer for data to write for (j = 0; j < DIM0; j++) - for (i = 0; i < DIM1; i++) - data[j][i] = i * 6 + j + 1; + for (i = 0; i < DIM1; i++) + data[j][i] = i * 6 + j + 1; // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); - // Open an existing file and dataset. - H5File file(FILE_NAME, H5F_ACC_RDWR); - DataSet dataset = file.openDataSet(DATASET_NAME); + // Open an existing file and dataset. + H5File file(FILE_NAME, H5F_ACC_RDWR); + DataSet dataset = file.openDataSet(DATASET_NAME); - // Write the data to the dataset using default memory space, file - // space, and transfer properties. - dataset.write(data, PredType::NATIVE_INT); + // Write the data to the dataset using default memory space, file + // space, and transfer properties. + dataset.write(data, PredType::NATIVE_INT); } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index ad52747..4bc8946 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * + * 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 * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -31,13 +31,13 @@ #endif // H5_NO_STD #endif -const H5std_string FILE_NAME("h5tutr_subset.h5"); -const H5std_string DATASET_NAME("IntArray"); +const H5std_string FILE_NAME("h5tutr_subset.h5"); +const H5std_string DATASET_NAME("IntArray"); const int RANK = 2; -const int DIM0_SUB = 3; // subset dimensions +const int DIM0_SUB = 3; // subset dimensions const int DIM1_SUB = 4; -const int DIM0 = 8; // size of dataset +const int DIM0 = 8; // size of dataset const int DIM1 = 10; int main (void) @@ -48,134 +48,134 @@ int main (void) // Try block to detect exceptions raised by any of the calls inside it try { - // Turn off the auto-printing when failure occurs so that we can - // handle the errors appropriately - Exception::dontPrint(); - - // --------------------------------------------------- - // Create a new file using the default property lists. - // Then create a dataset and write data to it. - // Close the file and dataset. - // --------------------------------------------------- + // Turn off the auto-printing when failure occurs so that we can + // handle the errors appropriately + Exception::dontPrint(); + + // --------------------------------------------------- + // Create a new file using the default property lists. + // Then create a dataset and write data to it. + // Close the file and dataset. + // --------------------------------------------------- - H5File file(FILE_NAME, H5F_ACC_TRUNC); + H5File file(FILE_NAME, H5F_ACC_TRUNC); - hsize_t dims[2]; - dims[0] = DIM0; - dims[1] = DIM1; - DataSpace dataspace = DataSpace (RANK, dims); + hsize_t dims[2]; + dims[0] = DIM0; + dims[1] = DIM1; + DataSpace dataspace = DataSpace (RANK, dims); - DataSet dataset(file.createDataSet( DATASET_NAME, - PredType::STD_I32BE, dataspace) ); + DataSet dataset(file.createDataSet( DATASET_NAME, + PredType::STD_I32BE, dataspace) ); - for (j = 0; j < DIM0; j++) { - for (i = 0; i < DIM1; i++) - if (i< (DIM1/2)) - data[j][i] = 1; - else - data[j][i] = 2; - } + for (j = 0; j < DIM0; j++) { + for (i = 0; i < DIM1; i++) + if (i< (DIM1/2)) + data[j][i] = 1; + else + data[j][i] = 2; + } - dataset.write(data, PredType::NATIVE_INT); + dataset.write(data, PredType::NATIVE_INT); - cout << endl << "Data Written to File:" << endl; - for (j = 0; j < DIM0; j++) { - for (i = 0; i < DIM1; i++) - cout << " " << data[j][i]; - cout << endl; - } + cout << endl << "Data Written to File:" << endl; + for (j = 0; j < DIM0; j++) { + for (i = 0; i < DIM1; i++) + cout << " " << data[j][i]; + cout << endl; + } - dataspace.close(); - dataset.close(); - file.close(); + dataspace.close(); + dataset.close(); + file.close(); - // --------------------------------------------------- - // Reopen the file and dataset and write a subset of - // values to the dataset. - // --------------------------------------------------- + // --------------------------------------------------- + // Reopen the file and dataset and write a subset of + // values to the dataset. + // --------------------------------------------------- - hsize_t offset[2], count[2], stride[2], block[2]; - hsize_t dimsm[2]; + hsize_t offset[2], count[2], stride[2], block[2]; + hsize_t dimsm[2]; - file.openFile(FILE_NAME, H5F_ACC_RDWR); - dataset = file.openDataSet(DATASET_NAME); + file.openFile(FILE_NAME, H5F_ACC_RDWR); + dataset = file.openDataSet(DATASET_NAME); - // Specify size and shape of subset to write. + // Specify size and shape of subset to write. - offset[0] = 1; - offset[1] = 2; + offset[0] = 1; + offset[1] = 2; - count[0] = DIM0_SUB; - count[1] = DIM1_SUB; + count[0] = DIM0_SUB; + count[1] = DIM1_SUB; - stride[0] = 1; - stride[1] = 1; + stride[0] = 1; + stride[1] = 1; - block[0] = 1; - block[1] = 1; + block[0] = 1; + block[1] = 1; - // Define Memory Dataspace. Get file dataspace and select - // a subset from the file dataspace. + // Define Memory Dataspace. Get file dataspace and select + // a subset from the file dataspace. - dimsm[0] = DIM0_SUB; - dimsm[1] = DIM1_SUB; + dimsm[0] = DIM0_SUB; + dimsm[1] = DIM1_SUB; - DataSpace memspace(RANK, dimsm, NULL); + DataSpace memspace(RANK, dimsm, NULL); - dataspace = dataset.getSpace(); - dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); + dataspace = dataset.getSpace(); + dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); - // Write a subset of data to the dataset, then read the - // entire dataset back from the file. + // Write a subset of data to the dataset, then read the + // entire dataset back from the file. - cout << endl << "Write subset to file specifying: " << endl; - cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl; - for (j = 0; j < DIM0_SUB; j++) { - for (i = 0; i < DIM1_SUB; i++) - sdata[j][i] = 5; - } - - dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace); - dataset.read(rdata, PredType::NATIVE_INT); + cout << endl << "Write subset to file specifying: " << endl; + cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl; + for (j = 0; j < DIM0_SUB; j++) { + for (i = 0; i < DIM1_SUB; i++) + sdata[j][i] = 5; + } + + dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace); + dataset.read(rdata, PredType::NATIVE_INT); - cout << endl << "Data in File after Subset is Written:" << endl; - for (i = 0; i < DIM0; i++) { - for (j = 0; j < DIM1; j++) - cout << " " << rdata[i][j]; - cout << endl; - } - cout << endl; - - // It is not necessary to close these objects because close() will - // be called when the object instances are going out of scope. - dataspace.close(); - memspace.close(); - dataset.close(); - file.close(); + cout << endl << "Data in File after Subset is Written:" << endl; + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) + cout << " " << rdata[i][j]; + cout << endl; + } + cout << endl; + + // It is not necessary to close these objects because close() will + // be called when the object instances are going out of scope. + dataspace.close(); + memspace.close(); + dataset.close(); + file.close(); } // end of try block // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; // successfully terminated diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index b615a40..91813fb 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -41,9 +41,9 @@ const H5std_string FILE_NAME( "SDS.h5" ); const H5std_string DATASET_NAME( "IntArray" ); -const int NX_SUB = 3; // hyperslab dimensions +const int NX_SUB = 3; // hyperslab dimensions const int NY_SUB = 4; -const int NX = 7; // output buffer dimensions +const int NX = 7; // output buffer dimensions const int NY = 7; const int NZ = 3; const int RANK_OUT = 3; @@ -59,8 +59,8 @@ int main (void) { for (i = 0; i < NY; i++) { - for (k = 0; k < NZ ; k++) - data_out[j][i][k] = 0; + for (k = 0; k < NZ ; k++) + data_out[j][i][k] = 0; } } @@ -91,19 +91,19 @@ int main (void) */ if( type_class == H5T_INTEGER ) { - cout << "Data set has INTEGER type" << endl; + cout << "Data set has INTEGER type" << endl; /* - * Get the integer datatype + * Get the integer datatype */ - IntType intype = dataset.getIntType(); + IntType intype = dataset.getIntType(); /* * Get order of datatype and print message if it's a little endian. */ - H5std_string order_string; + H5std_string order_string; H5T_order_t order = intype.getOrder( order_string ); - cout << order_string << endl; + cout << order_string << endl; /* * Get size of the data element stored in file and print it. @@ -129,15 +129,15 @@ int main (void) hsize_t dims_out[2]; int ndims = dataspace.getSimpleExtentDims( dims_out, NULL); cout << "rank " << rank << ", dimensions " << - (unsigned long)(dims_out[0]) << " x " << - (unsigned long)(dims_out[1]) << endl; + (unsigned long)(dims_out[0]) << " x " << + (unsigned long)(dims_out[1]) << endl; /* * Define hyperslab in the dataset; implicitly giving strike and * block NULL. */ - hsize_t offset[2]; // hyperslab offset in the file - hsize_t count[2]; // size of the hyperslab in the file + hsize_t offset[2]; // hyperslab offset in the file + hsize_t count[2]; // size of the hyperslab in the file offset[0] = 1; offset[1] = 2; count[0] = NX_SUB; @@ -156,8 +156,8 @@ int main (void) /* * Define memory hyperslab. */ - hsize_t offset_out[3]; // hyperslab offset in memory - hsize_t count_out[3]; // size of the hyperslab in memory + hsize_t offset_out[3]; // hyperslab offset in memory + hsize_t count_out[3]; // size of the hyperslab in memory offset_out[0] = 3; offset_out[1] = 0; offset_out[2] = 0; @@ -174,9 +174,9 @@ int main (void) for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - cout << data_out[j][i][0] << " "; - cout << endl; + for (i = 0; i < NY; i++) + cout << data_out[j][i][0] << " "; + cout << endl; } /* * 0 0 0 0 0 0 0 diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 496c5d1..d0eacc0 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -44,19 +44,19 @@ const H5std_string FILE_NAME( "Select.h5" ); const H5std_string DATASET_NAME( "Matrix in file" ); -const int MSPACE1_RANK = 1; // Rank of the first dataset in memory +const int MSPACE1_RANK = 1; // Rank of the first dataset in memory const int MSPACE1_DIM = 50; // Dataset size in memory -const int MSPACE2_RANK = 1; // Rank of the second dataset in memory -const int MSPACE2_DIM = 4; // Dataset size in memory -const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file -const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is -const int FSPACE_DIM2 = 12; // stored in the file -const int MSPACE_RANK = 2; // Rank of the first dataset in memory -const int MSPACE_DIM1 = 8; // We will read dataset back from the file -const int MSPACE_DIM2 = 9; // to the dataset in memory with these - // dataspace parameters -const int NPOINTS = 4; // Number of points that will be selected - // and overwritten +const int MSPACE2_RANK = 1; // Rank of the second dataset in memory +const int MSPACE2_DIM = 4; // Dataset size in memory +const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file +const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is +const int FSPACE_DIM2 = 12; // stored in the file +const int MSPACE_RANK = 2; // Rank of the first dataset in memory +const int MSPACE_DIM1 = 8; // We will read dataset back from the file +const int MSPACE_DIM2 = 9; // to the dataset in memory with these + // dataspace parameters +const int NPOINTS = 4; // Number of points that will be selected + // and overwritten int main (void) { @@ -67,271 +67,271 @@ int main (void) */ try { - /* - * Turn off the auto-printing when failure occurs so that we can - * handle the errors appropriately - */ - Exception::dontPrint(); - - /* - * Create a file. - */ - H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); - - /* - * Create property list for a dataset and set up fill values. - */ - int fillvalue = 0; /* Fill value for the dataset */ - DSetCreatPropList plist; - plist.setFillValue(PredType::NATIVE_INT, &fillvalue); - - /* - * Create dataspace for the dataset in the file. - */ - hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk) - DataSpace fspace( FSPACE_RANK, fdim ); - - /* - * Create dataset and write it into the file. - */ - DataSet* dataset = new DataSet(file->createDataSet( - DATASET_NAME, PredType::NATIVE_INT, fspace, plist)); - - /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, - * (4,3) stride and (2,4) count starting at the position (0,1). - */ - hsize_t start[2]; // Start of hyperslab - hsize_t stride[2]; // Stride of hyperslab - hsize_t count[2]; // Block count - hsize_t block[2]; // Block sizes - start[0] = 0; start[1] = 1; - stride[0] = 4; stride[1] = 3; - count[0] = 2; count[1] = 4; - block[0] = 3; block[1] = 2; - fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); - - /* - * Create dataspace for the first dataset. - */ - hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ - DataSpace mspace1( MSPACE1_RANK, dim1 ); - - /* - * Select hyperslab. - * We will use 48 elements of the vector buffer starting at the - * second element. Selected elements are 1 2 3 . . . 48 - */ - start[0] = 1; - stride[0] = 1; - count[0] = 48; - block[0] = 1; - mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); - - /* - * Write selection from the vector buffer to the dataset in the file. - * - * File dataset should look like this: - * 0 1 2 0 3 4 0 5 6 0 7 8 - * 0 9 10 0 11 12 0 13 14 0 15 16 - * 0 17 18 0 19 20 0 21 22 0 23 24 - * 0 0 0 0 0 0 0 0 0 0 0 0 - * 0 25 26 0 27 28 0 29 30 0 31 32 - * 0 33 34 0 35 36 0 37 38 0 39 40 - * 0 41 42 0 43 44 0 45 46 0 47 48 - * 0 0 0 0 0 0 0 0 0 0 0 0 - */ - int vector[MSPACE1_DIM]; // vector buffer for dset - - /* - * Buffer initialization. - */ - vector[0] = vector[MSPACE1_DIM - 1] = -1; - for (i = 1; i < MSPACE1_DIM - 1; i++) - vector[i] = i; - - dataset->write( vector, PredType::NATIVE_INT, mspace1, fspace ); - - /* - * Reset the selection for the file dataspace fid. - */ - fspace.selectNone(); - - /* - * Create dataspace for the second dataset. - */ - hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset - (in memory */ - DataSpace mspace2( MSPACE2_RANK, dim2 ); - - /* - * Select sequence of NPOINTS points in the file dataspace. - */ - hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points - from the file dataspace */ - coord[0][0] = 0; coord[0][1] = 0; - coord[1][0] = 3; coord[1][1] = 3; - coord[2][0] = 3; coord[2][1] = 5; - coord[3][0] = 5; coord[3][1] = 6; - - fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord); - - /* - * Write new selection of points to the dataset. - */ - int values[] = {53, 59, 61, 67}; /* New values to be written */ - dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); - - /* - * File dataset should look like this: - * 53 1 2 0 3 4 0 5 6 0 7 8 - * 0 9 10 0 11 12 0 13 14 0 15 16 - * 0 17 18 0 19 20 0 21 22 0 23 24 - * 0 0 0 59 0 61 0 0 0 0 0 0 - * 0 25 26 0 27 28 0 29 30 0 31 32 - * 0 33 34 0 35 36 67 37 38 0 39 40 - * 0 41 42 0 43 44 0 45 46 0 47 48 - * 0 0 0 0 0 0 0 0 0 0 0 0 - * - */ - - /* - * Close the dataset and the file. - */ - delete dataset; - delete file; - - /* - * Open the file. - */ - file = new H5File( FILE_NAME, H5F_ACC_RDONLY ); - - /* - * Open the dataset. - */ - dataset = new DataSet( file->openDataSet( DATASET_NAME )); - - /* - * Get dataspace of the dataset. - */ - fspace = dataset->getSpace(); - - /* - * Select first hyperslab for the dataset in the file. The following - * elements are selected: - * 10 0 11 12 - * 18 0 19 20 - * 0 59 0 61 - * - */ - start[0] = 1; start[1] = 2; - block[0] = 1; block[1] = 1; - stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; - fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); - - /* - * Add second selected hyperslab to the selection. - * The following elements are selected: - * 19 20 0 21 22 - * 0 61 0 0 0 - * 27 28 0 29 30 - * 35 36 67 37 38 - * 43 44 0 45 46 - * 0 0 0 0 0 - * Note that two hyperslabs overlap. Common elements are: - * 19 20 - * 0 61 - */ - start[0] = 2; start[1] = 4; - block[0] = 1; block[1] = 1; - stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; - fspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block); - - /* - * Create memory dataspace. - */ - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the + /* + * Turn off the auto-printing when failure occurs so that we can + * handle the errors appropriately + */ + Exception::dontPrint(); + + /* + * Create a file. + */ + H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); + + /* + * Create property list for a dataset and set up fill values. + */ + int fillvalue = 0; /* Fill value for the dataset */ + DSetCreatPropList plist; + plist.setFillValue(PredType::NATIVE_INT, &fillvalue); + + /* + * Create dataspace for the dataset in the file. + */ + hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk) + DataSpace fspace( FSPACE_RANK, fdim ); + + /* + * Create dataset and write it into the file. + */ + DataSet* dataset = new DataSet(file->createDataSet( + DATASET_NAME, PredType::NATIVE_INT, fspace, plist)); + + /* + * Select hyperslab for the dataset in the file, using 3x2 blocks, + * (4,3) stride and (2,4) count starting at the position (0,1). + */ + hsize_t start[2]; // Start of hyperslab + hsize_t stride[2]; // Stride of hyperslab + hsize_t count[2]; // Block count + hsize_t block[2]; // Block sizes + start[0] = 0; start[1] = 1; + stride[0] = 4; stride[1] = 3; + count[0] = 2; count[1] = 4; + block[0] = 3; block[1] = 2; + fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); + + /* + * Create dataspace for the first dataset. + */ + hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ + DataSpace mspace1( MSPACE1_RANK, dim1 ); + + /* + * Select hyperslab. + * We will use 48 elements of the vector buffer starting at the + * second element. Selected elements are 1 2 3 . . . 48 + */ + start[0] = 1; + stride[0] = 1; + count[0] = 48; + block[0] = 1; + mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); + + /* + * Write selection from the vector buffer to the dataset in the file. + * + * File dataset should look like this: + * 0 1 2 0 3 4 0 5 6 0 7 8 + * 0 9 10 0 11 12 0 13 14 0 15 16 + * 0 17 18 0 19 20 0 21 22 0 23 24 + * 0 0 0 0 0 0 0 0 0 0 0 0 + * 0 25 26 0 27 28 0 29 30 0 31 32 + * 0 33 34 0 35 36 0 37 38 0 39 40 + * 0 41 42 0 43 44 0 45 46 0 47 48 + * 0 0 0 0 0 0 0 0 0 0 0 0 + */ + int vector[MSPACE1_DIM]; // vector buffer for dset + + /* + * Buffer initialization. + */ + vector[0] = vector[MSPACE1_DIM - 1] = -1; + for (i = 1; i < MSPACE1_DIM - 1; i++) + vector[i] = i; + + dataset->write( vector, PredType::NATIVE_INT, mspace1, fspace ); + + /* + * Reset the selection for the file dataspace fid. + */ + fspace.selectNone(); + + /* + * Create dataspace for the second dataset. + */ + hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset + (in memory */ + DataSpace mspace2( MSPACE2_RANK, dim2 ); + + /* + * Select sequence of NPOINTS points in the file dataspace. + */ + hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points + from the file dataspace */ + coord[0][0] = 0; coord[0][1] = 0; + coord[1][0] = 3; coord[1][1] = 3; + coord[2][0] = 3; coord[2][1] = 5; + coord[3][0] = 5; coord[3][1] = 6; + + fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord); + + /* + * Write new selection of points to the dataset. + */ + int values[] = {53, 59, 61, 67}; /* New values to be written */ + dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); + + /* + * File dataset should look like this: + * 53 1 2 0 3 4 0 5 6 0 7 8 + * 0 9 10 0 11 12 0 13 14 0 15 16 + * 0 17 18 0 19 20 0 21 22 0 23 24 + * 0 0 0 59 0 61 0 0 0 0 0 0 + * 0 25 26 0 27 28 0 29 30 0 31 32 + * 0 33 34 0 35 36 67 37 38 0 39 40 + * 0 41 42 0 43 44 0 45 46 0 47 48 + * 0 0 0 0 0 0 0 0 0 0 0 0 + * + */ + + /* + * Close the dataset and the file. + */ + delete dataset; + delete file; + + /* + * Open the file. + */ + file = new H5File( FILE_NAME, H5F_ACC_RDONLY ); + + /* + * Open the dataset. + */ + dataset = new DataSet( file->openDataSet( DATASET_NAME )); + + /* + * Get dataspace of the dataset. + */ + fspace = dataset->getSpace(); + + /* + * Select first hyperslab for the dataset in the file. The following + * elements are selected: + * 10 0 11 12 + * 18 0 19 20 + * 0 59 0 61 + * + */ + start[0] = 1; start[1] = 2; + block[0] = 1; block[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 3; count[1] = 4; + fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); + + /* + * Add second selected hyperslab to the selection. + * The following elements are selected: + * 19 20 0 21 22 + * 0 61 0 0 0 + * 27 28 0 29 30 + * 35 36 67 37 38 + * 43 44 0 45 46 + * 0 0 0 0 0 + * Note that two hyperslabs overlap. Common elements are: + * 19 20 + * 0 61 + */ + start[0] = 2; start[1] = 4; + block[0] = 1; block[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 6; count[1] = 5; + fspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block); + + /* + * Create memory dataspace. + */ + hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the dataset in memory when we read selection from the dataset on the disk */ - DataSpace mspace(MSPACE_RANK, mdim); - - /* - * Select two hyperslabs in memory. Hyperslabs has the same - * size and shape as the selected hyperslabs for the file dataspace. - */ - start[0] = 0; start[1] = 0; - block[0] = 1; block[1] = 1; - stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; - mspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); - start[0] = 1; start[1] = 2; - block[0] = 1; block[1] = 1; - stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; - mspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block); - - /* - * Initialize data buffer. - */ - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; - for (i = 0; i < MSPACE_DIM1; i++) - for (j = 0; j < MSPACE_DIM2; j++) - matrix_out[i][j] = 0; - - /* - * Read data back to the buffer matrix. - */ - dataset->read(matrix_out, PredType::NATIVE_INT, mspace, fspace); - - /* - * Display the result. Memory dataset is: - * - * 10 0 11 12 0 0 0 0 0 - * 18 0 19 20 0 21 22 0 0 - * 0 59 0 61 0 0 0 0 0 - * 0 0 27 28 0 29 30 0 0 - * 0 0 35 36 67 37 38 0 0 - * 0 0 43 44 0 45 46 0 0 - * 0 0 0 0 0 0 0 0 0 - * 0 0 0 0 0 0 0 0 0 - */ - for (i=0; i < MSPACE_DIM1; i++) - { - for(j=0; j < MSPACE_DIM2; j++) - cout << matrix_out[i][j] << " "; - cout << endl; - } - - /* - * Close the dataset and the file. - */ - delete dataset; - delete file; + DataSpace mspace(MSPACE_RANK, mdim); + + /* + * Select two hyperslabs in memory. Hyperslabs has the same + * size and shape as the selected hyperslabs for the file dataspace. + */ + start[0] = 0; start[1] = 0; + block[0] = 1; block[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 3; count[1] = 4; + mspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); + start[0] = 1; start[1] = 2; + block[0] = 1; block[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 6; count[1] = 5; + mspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block); + + /* + * Initialize data buffer. + */ + int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; + for (i = 0; i < MSPACE_DIM1; i++) + for (j = 0; j < MSPACE_DIM2; j++) + matrix_out[i][j] = 0; + + /* + * Read data back to the buffer matrix. + */ + dataset->read(matrix_out, PredType::NATIVE_INT, mspace, fspace); + + /* + * Display the result. Memory dataset is: + * + * 10 0 11 12 0 0 0 0 0 + * 18 0 19 20 0 21 22 0 0 + * 0 59 0 61 0 0 0 0 0 + * 0 0 27 28 0 29 30 0 0 + * 0 0 35 36 67 37 38 0 0 + * 0 0 43 44 0 45 46 0 0 + * 0 0 0 0 0 0 0 0 0 + * 0 0 0 0 0 0 0 0 0 + */ + for (i=0; i < MSPACE_DIM1; i++) + { + for(j=0; j < MSPACE_DIM2; j++) + cout << matrix_out[i][j] << " "; + cout << endl; + } + + /* + * Close the dataset and the file. + */ + delete dataset; + delete file; } // end of try block // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); - return -1; + error.printError(); + return -1; } return 0; diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index e58bb03..7568404 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -30,16 +30,16 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Default constructor -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Default constructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::AbstractDs(){} //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Creates an AbstractDs instance using an existing id. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Creates an AbstractDs instance using an existing id. +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -50,12 +50,12 @@ AbstractDs::AbstractDs(){} // Mar 2016 -BMR, AbstractDs::AbstractDs(const hid_t ds_id){} //-------------------------------------------------------------------------- -// Function: AbstractDs::getTypeClass -///\brief Returns the class of the datatype that is used by this -/// object, which can be a dataset or an attribute. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getTypeClass +///\brief Returns the class of the datatype that is used by this +/// object, which can be a dataset or an attribute. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t AbstractDs::getTypeClass() const { @@ -81,29 +81,29 @@ H5T_class_t AbstractDs::getTypeClass() const if (ret_value < 0) { if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); + throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); + throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); } // Check on the returned type_class if (type_class == H5T_NO_CLASS) { if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); } return(type_class); } //-------------------------------------------------------------------------- -// Function: AbstractDs::getDataType -///\brief Returns the generic datatype of this abstract dataset, which -/// can be a dataset or an attribute. -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getDataType +///\brief Returns the generic datatype of this abstract dataset, which +/// can be a dataset or an attribute. +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType AbstractDs::getDataType() const { @@ -112,9 +112,9 @@ DataType AbstractDs::getDataType() const // depending on which object invokes getDataType. Then, create and // return the DataType object try { - DataType datatype; - f_DataType_setId(&datatype, p_get_type()); - return(datatype); + DataType datatype; + f_DataType_setId(&datatype, p_get_type()); + return(datatype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); @@ -125,12 +125,12 @@ DataType AbstractDs::getDataType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getArrayType -///\brief Returns the array datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getArrayType +///\brief Returns the array datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType AbstractDs::getArrayType() const { @@ -139,11 +139,11 @@ ArrayType AbstractDs::getArrayType() const // depending on which object invokes getArrayType. Then, create and // return the ArrayType object try { - // Create ArrayType and set values this way to work around the - // problem described in the JIRA issue HDFFV-7947 - ArrayType arraytype; - f_DataType_setId(&arraytype, p_get_type()); - return(arraytype); + // Create ArrayType and set values this way to work around the + // problem described in the JIRA issue HDFFV-7947 + ArrayType arraytype; + f_DataType_setId(&arraytype, p_get_type()); + return(arraytype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); @@ -154,12 +154,12 @@ ArrayType AbstractDs::getArrayType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getCompType -///\brief Returns the compound datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getCompType +///\brief Returns the compound datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType AbstractDs::getCompType() const { @@ -168,9 +168,9 @@ CompType AbstractDs::getCompType() const // depending on which object invokes getCompType. Then, create and // return the CompType object try { - CompType comptype; - f_DataType_setId(&comptype, p_get_type()); - return(comptype); + CompType comptype; + f_DataType_setId(&comptype, p_get_type()); + return(comptype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); @@ -181,12 +181,12 @@ CompType AbstractDs::getCompType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getEnumType -///\brief Returns the enumeration datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getEnumType +///\brief Returns the enumeration datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType AbstractDs::getEnumType() const { @@ -195,9 +195,9 @@ EnumType AbstractDs::getEnumType() const // depending on which object invokes getEnumType. Then, create and // return the EnumType object try { - EnumType enumtype; - f_DataType_setId(&enumtype, p_get_type()); - return(enumtype); + EnumType enumtype; + f_DataType_setId(&enumtype, p_get_type()); + return(enumtype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); @@ -208,12 +208,12 @@ EnumType AbstractDs::getEnumType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getIntType -///\brief Returns the integer datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getIntType +///\brief Returns the integer datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType AbstractDs::getIntType() const { @@ -222,9 +222,9 @@ IntType AbstractDs::getIntType() const // depending on which object invokes getIntType. Then, create and // return the IntType object try { - IntType inttype; - f_DataType_setId(&inttype, p_get_type()); - return(inttype); + IntType inttype; + f_DataType_setId(&inttype, p_get_type()); + return(inttype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); @@ -235,12 +235,12 @@ IntType AbstractDs::getIntType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getFloatType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getFloatType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType AbstractDs::getFloatType() const { @@ -249,9 +249,9 @@ FloatType AbstractDs::getFloatType() const // depending on which object invokes getFloatType. Then, create and // return the FloatType object try { - FloatType floatype; - f_DataType_setId(&floatype, p_get_type()); - return(floatype); + FloatType floatype; + f_DataType_setId(&floatype, p_get_type()); + return(floatype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); @@ -262,12 +262,12 @@ FloatType AbstractDs::getFloatType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getStrType -///\brief Returns the string datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getStrType +///\brief Returns the string datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType AbstractDs::getStrType() const { @@ -276,9 +276,9 @@ StrType AbstractDs::getStrType() const // depending on which object invokes getStrType. Then, create and // return the StrType object try { - StrType strtype; - f_DataType_setId(&strtype, p_get_type()); - return(strtype); + StrType strtype; + f_DataType_setId(&strtype, p_get_type()); + return(strtype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); @@ -289,12 +289,12 @@ StrType AbstractDs::getStrType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs::getVarLenType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getVarLenType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType AbstractDs::getVarLenType() const { @@ -303,9 +303,9 @@ VarLenType AbstractDs::getVarLenType() const // depending on which object invokes getVarLenType. Then, create and // return the VarLenType object try { - VarLenType varlentype; - f_DataType_setId(&varlentype, p_get_type()); - return(varlentype); + VarLenType varlentype; + f_DataType_setId(&varlentype, p_get_type()); + return(varlentype); } catch (DataSetIException& E) { throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); @@ -316,9 +316,9 @@ VarLenType AbstractDs::getVarLenType() const } //-------------------------------------------------------------------------- -// Function: AbstractDs destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::~AbstractDs() {} diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 1b4775c..eaa9d14 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -37,44 +37,44 @@ class DataSpace; */ class H5_DLLCPP AbstractDs { public: - // Gets a copy the datatype of that this abstract dataset uses. - // Note that this datatype is a generic one and can only be accessed - // via generic member functions, i.e., member functions belong - // to DataType. To get specific datatype, i.e. EnumType, FloatType, - // etc..., use the specific functions, that follow, instead. - DataType getDataType() const; + // Gets a copy the datatype of that this abstract dataset uses. + // Note that this datatype is a generic one and can only be accessed + // via generic member functions, i.e., member functions belong + // to DataType. To get specific datatype, i.e. EnumType, FloatType, + // etc..., use the specific functions, that follow, instead. + DataType getDataType() const; - // Gets a copy of the specific datatype of this abstract dataset. - ArrayType getArrayType() const; - CompType getCompType() const; - EnumType getEnumType() const; - IntType getIntType() const; - FloatType getFloatType() const; - StrType getStrType() const; - VarLenType getVarLenType() const; + // Gets a copy of the specific datatype of this abstract dataset. + ArrayType getArrayType() const; + CompType getCompType() const; + EnumType getEnumType() const; + IntType getIntType() const; + FloatType getFloatType() const; + StrType getStrType() const; + VarLenType getVarLenType() const; - ///\brief Gets the size in memory of this abstract dataset. - virtual size_t getInMemDataSize() const = 0; + ///\brief Gets the size in memory of this abstract dataset. + virtual size_t getInMemDataSize() const = 0; - ///\brief Gets the dataspace of this abstract dataset - pure virtual. - virtual DataSpace getSpace() const = 0; + ///\brief Gets the dataspace of this abstract dataset - pure virtual. + virtual DataSpace getSpace() const = 0; - // Gets the class of the datatype that is used by this abstract - // dataset. - H5T_class_t getTypeClass() const; + // Gets the class of the datatype that is used by this abstract + // dataset. + H5T_class_t getTypeClass() const; - ///\brief Returns the amount of storage size required - pure virtual. - virtual hsize_t getStorageSize() const = 0; + ///\brief Returns the amount of storage size required - pure virtual. + virtual hsize_t getStorageSize() const = 0; - // Returns this class name - pure virtual. - virtual H5std_string fromClass() const = 0; + // Returns this class name - pure virtual. + virtual H5std_string fromClass() const = 0; - // Destructor - virtual ~AbstractDs(); + // Destructor + virtual ~AbstractDs(); protected: - // Default constructor - AbstractDs(); + // Default constructor + AbstractDs(); // *** Deprecation warning *** // The following two constructors are no longer appropriate after the @@ -83,14 +83,14 @@ class H5_DLLCPP AbstractDs { // other will be removed from 1.10 release, and then from 1.8 if its // removal does not raise any problems in two 1.10 releases. - // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); + // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); - // Copy constructor - // AbstractDs( const AbstractDs& original ); + // Copy constructor + // AbstractDs( const AbstractDs& original ); private: - // This member function is implemented by DataSet and Attribute - pure virtual. - virtual hid_t p_get_type() const = 0; + // This member function is implemented by DataSet and Attribute - pure virtual. + virtual hid_t p_get_type() const = 0; }; } #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 3df9c47..658946b 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -29,59 +29,59 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: ArrayType default constructor -///\brief Default constructor: Creates a stub ArrayType -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType default constructor +///\brief Default constructor: Creates a stub ArrayType +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType() : DataType() {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: ArrayType copy constructor -///\brief Copy constructor: makes a copy of the original ArrayType object. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType copy constructor +///\brief Copy constructor: makes a copy of the original ArrayType object. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const ArrayType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates a new array data type based on the specified -/// \a base_type. -///\param base_type - IN: Existing datatype -///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] -///\param dims - IN: Size of each array dimension -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates a new array data type based on the specified +/// \a base_type. +///\param base_type - IN: Existing datatype +///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] +///\param dims - IN: Size of each array dimension +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { // Call C API to create an array data type hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); if (new_type_id < 0) - throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); // Set the id for this object id = new_type_id; } //-------------------------------------------------------------------------- -// Function: ArrayType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing array datatype -///\return Reference to ArrayType instance -///\exception H5::DataTypeIException +// Function: ArrayType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing array datatype +///\return Reference to ArrayType instance +///\exception H5::DataTypeIException // Description -// Closes the id on the lhs object first with setId, then copies -// each data member from the rhs object. (Issue HDFFV-9562) -// Programmer Binh-Minh Ribler - Mar 2016 +// Closes the id on the lhs object first with setId, then copies +// each data member from the rhs object. (Issue HDFFV-9562) +// Programmer Binh-Minh Ribler - Mar 2016 // Modification //-------------------------------------------------------------------------- ArrayType& ArrayType::operator=(const ArrayType& rhs) @@ -102,14 +102,14 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayNDims -///\brief Returns the number of dimensions for an array datatype. -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayNDims +///\brief Returns the number of dimensions for an array datatype. +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() const { @@ -117,38 +117,38 @@ int ArrayType::getArrayNDims() const int ndims = H5Tget_array_ndims(id); if (ndims < 0) { - throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); } return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayDims -///\brief Retrieves the size of all dimensions of an array datatype. -///\param dims - OUT: Sizes of dimensions -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayDims +///\brief Retrieves the size of all dimensions of an array datatype. +///\param dims - OUT: Sizes of dimensions +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) const { // Get the dimensions int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); + throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // Return the number of dimensions return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType destructor -///\brief Properly terminates access to this array datatype. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType destructor +///\brief Properly terminates access to this array datatype. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::~ArrayType() {} diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 4407ba0..82a4e7f 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -25,35 +25,35 @@ namespace H5 { */ class H5_DLLCPP ArrayType : public DataType { public: - // Constructor that creates a new array data type based on the - // specified base type. - ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); + // Constructor that creates a new array data type based on the + // specified base type. + ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); - // Assignment operator - ArrayType& operator=(const ArrayType& rhs); + // Assignment operator + ArrayType& operator=(const ArrayType& rhs); - // Returns the number of dimensions of this array datatype. - int getArrayNDims() const; - //int getArrayNDims(); // removed 1.8.18 and 1.10.1 + // Returns the number of dimensions of this array datatype. + int getArrayNDims() const; + //int getArrayNDims(); // removed 1.8.18 and 1.10.1 - // Returns the sizes of dimensions of this array datatype. - int getArrayDims(hsize_t* dims) const; - //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 + // Returns the sizes of dimensions of this array datatype. + int getArrayDims(hsize_t* dims) const; + //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ArrayType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ArrayType"); } - // Copy constructor: makes copy of the original object. - ArrayType( const ArrayType& original ); + // Copy constructor: makes copy of the original object. + ArrayType( const ArrayType& original ); - // Constructor that takes an existing id - ArrayType( const hid_t existing_id ); + // Constructor that takes an existing id + ArrayType( const hid_t existing_id ); - // Noop destructor - virtual ~ArrayType(); + // Noop destructor + virtual ~ArrayType(); - // Default constructor - ArrayType(); + // Default constructor + ArrayType(); }; } #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 00922b1..172f625 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -30,35 +30,35 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType default constructor [protected] -// Purpose Default constructor: creates a stub atomic datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType default constructor [protected] +// Purpose Default constructor: creates a stub atomic datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType() : DataType() {} //-------------------------------------------------------------------------- -// Function: AtomType overloaded constructor [protected] -// Purpose Creates an AtomType object using an existing id. -// Parameter existing_id - IN: Id of an existing datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType overloaded constructor [protected] +// Purpose Creates an AtomType object using an existing id. +// Parameter existing_id - IN: Id of an existing datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: AtomType copy constructor -///\brief Copy constructor: makes a copy of the original AtomType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType copy constructor +///\brief Copy constructor: makes a copy of the original AtomType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType( const AtomType& original ) : DataType( original ) {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType::setSize -///\brief Sets the total size for an atomic datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setSize +///\brief Sets the total size for an atomic datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setSize( size_t size ) const { @@ -71,14 +71,14 @@ void AtomType::setSize( size_t size ) const } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief Returns the byte order of an atomic datatype. -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: AtomType::getOrder +///\brief Returns the byte order of an atomic datatype. +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5T_order_t AtomType::getOrder() const { @@ -89,27 +89,27 @@ H5T_order_t AtomType::getOrder() const if( type_order == H5T_ORDER_ERROR ) { throw DataTypeIException(inMemFunc("getOrder"), - "H5Tget_order returns H5T_ORDER_ERROR"); + "H5Tget_order returns H5T_ORDER_ERROR"); } return( type_order ); } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer that -/// provide the text description of the returned byte order. -/// The text description can be either of the following: -/// "Little endian byte ordering (0)"; -/// "Big endian byte ordering (1)"; -/// "VAX mixed byte ordering (2)"; -///\param order_string - OUT: Text description of the returned byte order -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::getOrder +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer that +/// provide the text description of the returned byte order. +/// The text description can be either of the following: +/// "Little endian byte ordering (0)"; +/// "Big endian byte ordering (1)"; +/// "VAX mixed byte ordering (2)"; +///\param order_string - OUT: Text description of the returned byte order +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_order_t AtomType::getOrder( H5std_string& order_string ) const { @@ -127,14 +127,14 @@ H5T_order_t AtomType::getOrder( H5std_string& order_string ) const } //-------------------------------------------------------------------------- -// Function: AtomType::setOrder -///\brief Sets the byte ordering of an atomic datatype. -///\param order - IN: Byte ordering constant, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setOrder +///\brief Sets the byte ordering of an atomic datatype. +///\param order - IN: Byte ordering constant, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOrder( H5T_order_t order ) const { @@ -147,15 +147,15 @@ void AtomType::setOrder( H5T_order_t order ) const } //-------------------------------------------------------------------------- -// Function: AtomType::getPrecision -///\brief Returns the precision of an atomic datatype. -///\return Number of significant bits -///\exception H5::DataTypeIException +// Function: AtomType::getPrecision +///\brief Returns the precision of an atomic datatype. +///\return Number of significant bits +///\exception H5::DataTypeIException ///\par Description -/// The precision is the number of significant bits which, -/// unless padding is present, is 8 times larger than the -/// value returned by \c DataType::getSize(). -// Programmer Binh-Minh Ribler - 2000 +/// The precision is the number of significant bits which, +/// unless padding is present, is 8 times larger than the +/// value returned by \c DataType::getSize(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t AtomType::getPrecision() const { @@ -165,20 +165,20 @@ size_t AtomType::getPrecision() const if( num_signi_bits == 0 ) { throw DataTypeIException(inMemFunc("getPrecision"), - "H5Tget_precision returns invalid number of significant bits"); + "H5Tget_precision returns invalid number of significant bits"); } return( num_signi_bits ); } //-------------------------------------------------------------------------- -// Function: AtomType::setPrecision -///\brief Sets the precision of an atomic datatype. -///\param precision - IN: Number of bits of precision -///\exception H5::DataTypeIException +// Function: AtomType::setPrecision +///\brief Sets the precision of an atomic datatype. +///\param precision - IN: Number of bits of precision +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision( size_t precision ) const { @@ -191,18 +191,18 @@ void AtomType::setPrecision( size_t precision ) const } //-------------------------------------------------------------------------- -// Function: AtomType::getOffset -///\brief Retrieves the bit offset of the first significant bit. -///\return Offset value -///\exception H5::DataTypeIException +// Function: AtomType::getOffset +///\brief Retrieves the bit offset of the first significant bit. +///\return Offset value +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 12/05/00: due to C API change -// - return type changed from size_t to int -// - offset = -1 when failure occurs vs. 0 +// 12/05/00: due to C API change +// - return type changed from size_t to int +// - offset = -1 when failure occurs vs. 0 //-------------------------------------------------------------------------- int AtomType::getOffset() const { @@ -212,20 +212,20 @@ int AtomType::getOffset() const if( offset == -1 ) { throw DataTypeIException(inMemFunc("getOffset"), - "H5Tget_offset returns a negative offset value"); + "H5Tget_offset returns a negative offset value"); } return( offset ); } //-------------------------------------------------------------------------- -// Function: AtomType::setOffset -///\brief Sets the bit offset of the first significant bit. -///\param offset - IN: Offset of first significant bit -///\exception H5::DataTypeIException +// Function: AtomType::setOffset +///\brief Sets the bit offset of the first significant bit. +///\param offset - IN: Offset of first significant bit +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset( size_t offset ) const { @@ -238,18 +238,18 @@ void AtomType::setOffset( size_t offset ) const } //-------------------------------------------------------------------------- -// Function: AtomType::getPad -///\brief Retrieves the padding type of the least and most-significant -/// bit padding. -///\param lsb - OUT: Least-significant bit padding type -///\param msb - OUT: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::getPad +///\brief Retrieves the padding type of the least and most-significant +/// bit padding. +///\param lsb - OUT: Least-significant bit padding type +///\param msb - OUT: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Possible values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Possible values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const { @@ -262,17 +262,17 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const } //-------------------------------------------------------------------------- -// Function: AtomType::setPad -///\brief Sets the least and most-significant bits padding types. -///\param lsb - IN: Least-significant bit padding type -///\param msb - IN: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::setPad +///\brief Sets the least and most-significant bits padding types. +///\param lsb - IN: Least-significant bit padding type +///\param msb - IN: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const { @@ -286,9 +286,9 @@ void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::~AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 9cfc6de..1851a57 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -28,53 +28,53 @@ namespace H5 { */ class H5_DLLCPP AtomType : public DataType { public: - // Returns the byte order of an atomic datatype. - H5T_order_t getOrder() const; - H5T_order_t getOrder( H5std_string& order_string ) const; + // Returns the byte order of an atomic datatype. + H5T_order_t getOrder() const; + H5T_order_t getOrder( H5std_string& order_string ) const; - // Sets the byte ordering of an atomic datatype. - void setOrder( H5T_order_t order ) const; + // Sets the byte ordering of an atomic datatype. + void setOrder( H5T_order_t order ) const; - // Retrieves the bit offset of the first significant bit. - // 12/05/00 - changed return type to int from size_t - C API - int getOffset() const; + // Retrieves the bit offset of the first significant bit. + // 12/05/00 - changed return type to int from size_t - C API + int getOffset() const; - // Sets the bit offset of the first significant bit. - void setOffset( size_t offset ) const; + // Sets the bit offset of the first significant bit. + void setOffset( size_t offset ) const; - // Retrieves the padding type of the least and most-significant bit padding. - void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; + // Retrieves the padding type of the least and most-significant bit padding. + void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; - // Sets the least and most-significant bits padding types - void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; + // Sets the least and most-significant bits padding types + void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; - // Returns the precision of an atomic datatype. - size_t getPrecision() const; + // Returns the precision of an atomic datatype. + size_t getPrecision() const; - // Sets the precision of an atomic datatype. - void setPrecision( size_t precision ) const; + // Sets the precision of an atomic datatype. + void setPrecision( size_t precision ) const; - // Sets the total size for an atomic datatype. - void setSize( size_t size ) const; + // Sets the total size for an atomic datatype. + void setSize( size_t size ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("AtomType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor - makes copy of the original object - AtomType( const AtomType& original ); + // Copy constructor - makes copy of the original object + AtomType( const AtomType& original ); - // Noop destructor - virtual ~AtomType(); + // Noop destructor + virtual ~AtomType(); #endif // DOXYGEN_SHOULD_SKIP_THIS protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Default constructor - AtomType(); + // Default constructor + AtomType(); - // Constructor that takes an existing id - AtomType( const hid_t existing_id ); + // Constructor that takes an existing id + AtomType( const hid_t existing_id ); #endif // DOXYGEN_SHOULD_SKIP_THIS }; } diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 1ba8c79..3162151 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -35,7 +35,7 @@ #include "H5DataSpace.h" #include "H5File.h" #include "H5Attribute.h" -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree namespace H5 { #ifndef H5_NO_STD @@ -46,17 +46,17 @@ namespace H5 { class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate //-------------------------------------------------------------------------- -// Function: Attribute default constructor -///\brief Default constructor: Creates a stub attribute -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute default constructor +///\brief Default constructor: Creates a stub attribute +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Attribute copy constructor -///\brief Copy constructor: makes a copy of the original Attribute object. -///\param original - IN: Original Attribute object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute copy constructor +///\brief Copy constructor: makes a copy of the original Attribute object. +///\param original - IN: Original Attribute object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), id(original.id) { @@ -64,12 +64,12 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), i } //-------------------------------------------------------------------------- -// Function: Attribute overloaded constructor -///\brief Creates an Attribute object using the id of an existing -/// attribute. -///\param existing_id - IN: Id of an existing attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute overloaded constructor +///\brief Creates an Attribute object using the id of an existing +/// attribute. +///\param existing_id - IN: Id of an existing attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent(), id(existing_id) { @@ -77,12 +77,12 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent(), id( } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief Writes data to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::write +///\brief Writes data to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::write( const DataType& mem_type, const void *buf ) const { @@ -94,13 +94,13 @@ void Attribute::write( const DataType& mem_type, const void *buf ) const } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief This is an overloaded member function, provided for convenience. -/// It writes a \a H5std_string to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::write +///\brief This is an overloaded member function, provided for convenience. +/// It writes a \a H5std_string to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 //-------------------------------------------------------------------------- void Attribute::write(const DataType& mem_type, const H5std_string& strg) const { @@ -109,7 +109,7 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); if (is_variable_len < 0) { - throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); } // Convert string to C-string const char* strg_C; @@ -119,26 +119,26 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Awrite(id, mem_type.getId(), strg_C); + ret_value = H5Awrite(id, mem_type.getId(), strg_C); } else { - // passing third argument by address - ret_value = H5Awrite(id, mem_type.getId(), &strg_C); + // passing third argument by address + ret_value = H5Awrite(id, mem_type.getId(), &strg_C); } if (ret_value < 0) { - throw AttributeIException("Attribute::write", "H5Awrite failed"); + throw AttributeIException("Attribute::write", "H5Awrite failed"); } } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief Reads data from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - OUT: Buffer for read data -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::read +///\brief Reads data from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - OUT: Buffer for read data +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::read( const DataType& mem_type, void *buf ) const { @@ -150,24 +150,24 @@ void Attribute::read( const DataType& mem_type, void *buf ) const } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief This is an overloaded member function, provided for convenience. -/// It reads a \a H5std_string from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Buffer for read string -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::read +///\brief This is an overloaded member function, provided for convenience. +/// It reads a \a H5std_string from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Buffer for read string +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 // Modification -// Mar 2008 -// Corrected a misunderstanding that H5Aread would allocate -// space for the buffer. Obtained the attribute size and -// allocated memory properly. -BMR -// Apr 2009 -// Used getInMemDataSize to get attribute data size. -BMR -// Jul 2009 -// Divided into specific private functions for fixed- and -// variable-len string data: p_read_fixed_len and -// p_read_variable_len. This should improve readability. -BMR +// Mar 2008 +// Corrected a misunderstanding that H5Aread would allocate +// space for the buffer. Obtained the attribute size and +// allocated memory properly. -BMR +// Apr 2009 +// Used getInMemDataSize to get attribute data size. -BMR +// Jul 2009 +// Divided into specific private functions for fixed- and +// variable-len string data: p_read_fixed_len and +// p_read_variable_len. This should improve readability. -BMR //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { @@ -190,11 +190,11 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const } //-------------------------------------------------------------------------- -// Function: Attribute::getInMemDataSize -///\brief Gets the size in memory of the attribute's data. -///\return Size of data (in memory) -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: Attribute::getInMemDataSize +///\brief Gets the size in memory of the attribute's data. +///\return Size of data (in memory) +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t Attribute::getInMemDataSize() const { @@ -204,7 +204,7 @@ size_t Attribute::getInMemDataSize() const hid_t mem_type_id = H5Aget_type(id); if( mem_type_id < 0 ) { - throw AttributeIException(func, "H5Aget_type failed"); + throw AttributeIException(func, "H5Aget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -212,22 +212,22 @@ size_t Attribute::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw AttributeIException(func, "H5Tget_native_type failed"); + throw AttributeIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw AttributeIException(func, "H5Tget_size failed"); + throw AttributeIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this attribute. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the attribute by first getting its dataspace @@ -235,18 +235,18 @@ size_t Attribute::getInMemDataSize() const hid_t space_id = H5Aget_space(id); if (space_id < 0) { - throw AttributeIException(func, "H5Aget_space failed"); + throw AttributeIException(func, "H5Aget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); + throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -255,11 +255,11 @@ size_t Attribute::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: Attribute::getSpace -///\brief Gets a copy of the dataspace for this attribute. -///\return Dataspace instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getSpace +///\brief Gets a copy of the dataspace for this attribute. +///\return Dataspace instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace Attribute::getSpace() const { @@ -269,9 +269,9 @@ DataSpace Attribute::getSpace() const // If the dataspace id is valid, create and return the DataSpace object if( dataspace_id > 0 ) { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, dataspace_id); - return(dataspace); + DataSpace dataspace; + f_DataSpace_setId(&dataspace, dataspace_id); + return(dataspace); } else { @@ -280,11 +280,11 @@ DataSpace Attribute::getSpace() const } //-------------------------------------------------------------------------- -// Function: Attribute::getFileName -///\brief Gets the name of the file, in which this attribute belongs. -///\return File name -///\exception H5::IdComponentException -// Programmer Binh-Minh Ribler - Jul, 2004 +// Function: Attribute::getFileName +///\brief Gets the name of the file, in which this attribute belongs. +///\return File name +///\exception H5::IdComponentException +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string Attribute::getFileName() const { @@ -297,21 +297,21 @@ H5std_string Attribute::getFileName() const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as char* -///\param buf_size - IN: Length of the buffer, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as char* +///\param buf_size - IN: Length of the buffer, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves \a buf_size chars of the attribute's -/// name including null termination. Thus, if the actual length -/// of the name is more than buf_size-1, the retrieved name will -/// be truncated to accommodate the null terminator. -/// To get length of the attribute's name for buffer allocation, -/// an application can call this function passing in NULL for the -/// first argument and ignore the second argument. -// Programmer Binh-Minh Ribler - Mar, 2014 +/// This function retrieves \a buf_size chars of the attribute's +/// name including null termination. Thus, if the actual length +/// of the name is more than buf_size-1, the retrieved name will +/// be truncated to accommodate the null terminator. +/// To get length of the attribute's name for buffer allocation, +/// an application can call this function passing in NULL for the +/// first argument and ignore the second argument. +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t Attribute::getName(char* attr_name, size_t buf_size) const { @@ -321,25 +321,25 @@ ssize_t Attribute::getName(char* attr_name, size_t buf_size) const // If H5Aget_name returns a negative value, raise an exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Return length of the name return(name_size); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Returns the name of this attribute as an \a H5std_string. -///\return Name of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute::getName +///\brief Returns the name of this attribute as an \a H5std_string. +///\return Name of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 2014 - BMR -// Revised to use the modified getName() above +// Mar 2014 - BMR +// Revised to use the modified getName() above //-------------------------------------------------------------------------- H5std_string Attribute::getName() const { @@ -351,11 +351,11 @@ H5std_string Attribute::getName() const // If H5Aget_name failed, throw exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Attribute's name exists, retrieve it else if (name_size > 0) @@ -378,44 +378,44 @@ H5std_string Attribute::getName() const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an integer -/// specifying a desired length to be retrieved of the name. -///\return Name (or part of name) of the attribute -///\param len - IN: Desired length of the name -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getName +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an integer +/// specifying a desired length to be retrieved of the name. +///\return Name (or part of name) of the attribute +///\param len - IN: Desired length of the name +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Mar 2014 - BMR -// Revised to use the new getName() below +// Mar 2014 - BMR +// Revised to use the new getName() below //-------------------------------------------------------------------------- H5std_string Attribute::getName(size_t len) const { H5std_string attr_name; ssize_t name_size = getName(attr_name, len); if (name_size < 0) - return(""); + return(""); else - return(attr_name); + return(attr_name); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as \a H5std_string -///\param len - IN: Desired length of the name, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as \a H5std_string +///\param len - IN: Desired length of the name, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves the attribute's name as a string. The -/// buf_size can specify a specific length or default to 0, in -/// which case the entire name will be retrieved. -// Programmer Binh-Minh Ribler - Nov, 2001 +/// This function retrieves the attribute's name as a string. The +/// buf_size can specify a specific length or default to 0, in +/// which case the entire name will be retrieved. +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Mar 2014 - BMR -// Added to replace getName(size_t, H5std_string&) so that it'll -// allow the argument "len" to be skipped. +// Mar 2014 - BMR +// Added to replace getName(size_t, H5std_string&) so that it'll +// allow the argument "len" to be skipped. //-------------------------------------------------------------------------- ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const { @@ -425,7 +425,7 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const if (len == 0) { attr_name = getName(); - name_size = attr_name.length(); + name_size = attr_name.length(); } // If length is provided, get that number of characters in name else @@ -449,19 +449,19 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -// Purpose This function is replaced by the previous function, which -// provides more convenient prototype. It will be removed -// in future release. -// Param len - IN: Desired length of the name -// Param attr_name - OUT: Buffer for the name string -// Return Actual length of the attribute name -// Exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Nov, 2001 +// Function: Attribute::getName +// Purpose This function is replaced by the previous function, which +// provides more convenient prototype. It will be removed +// in future release. +// Param len - IN: Desired length of the name +// Param attr_name - OUT: Buffer for the name string +// Return Actual length of the attribute name +// Exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const //{ @@ -469,13 +469,13 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const //} //-------------------------------------------------------------------------- -// Function: Attribute::getStorageSize -///\brief Returns the amount of storage size required for this attribute. -///\return Size of the storage or 0, for no data -///\exception H5::AttributeIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: Attribute::getStorageSize +///\brief Returns the amount of storage size required for this attribute. +///\return Size of the storage or 0, for no data +///\exception H5::AttributeIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t Attribute::getStorageSize() const { @@ -484,20 +484,20 @@ hsize_t Attribute::getStorageSize() const } //-------------------------------------------------------------------------- -// Function: Attribute::flush -///\brief Flushes all buffers associated with a file specified by -/// this attribute, to disk. -///\param scope - IN: Specifies the scope of the flushing action, -/// which can be either of these values: -/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file -/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file -///\exception H5::AttributeIException +// Function: Attribute::flush +///\brief Flushes all buffers associated with a file specified by +/// this attribute, to disk. +///\param scope - IN: Specifies the scope of the flushing action, +/// which can be either of these values: +/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file +/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file +///\exception H5::AttributeIException ///\par Description -/// This attribute is used to identify the file to be flushed. -// Programmer Binh-Minh Ribler - 2013 +/// This attribute is used to identify the file to be flushed. +// Programmer Binh-Minh Ribler - 2013 // Modification -// Mar 2013 - BMR -// Duplicated from H5Location +// Mar 2013 - BMR +// Duplicated from H5Location //-------------------------------------------------------------------------- void Attribute::flush(H5F_scope_t scope) const { @@ -510,13 +510,13 @@ void Attribute::flush(H5F_scope_t scope) const //-------------------------------------------------------------------------- // Function: Attribute::getId -///\brief Get the id of this attribute -///\return Attribute identifier +///\brief Get the id of this attribute +///\return Attribute identifier // Description: -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t Attribute::getId() const @@ -525,13 +525,13 @@ hid_t Attribute::getId() const } //-------------------------------------------------------------------------- -// Function: Attribute::p_get_type (private) -// Purpose Gets the datatype of this attribute. -// Return Id of the datatype -// Exception H5::AttributeIException +// Function: Attribute::p_get_type (private) +// Purpose Gets the datatype of this attribute. +// Return Id of the datatype +// Exception H5::AttributeIException // Description -// This private function is used in AbstractDs. -// Programmer Binh-Minh Ribler - 2000 +// This private function is used in AbstractDs. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t Attribute::p_get_type() const { @@ -545,16 +545,16 @@ hid_t Attribute::p_get_type() const } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the fixed length case from the original -// Attribute::read +// Jul 2009 +// Separated the fixed length case from the original +// Attribute::read //-------------------------------------------------------------------------- void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const { @@ -566,31 +566,31 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c // If there is data, allocate buffer and read it. if (attr_size > 0) { - char *strg_C = new char[attr_size+1]; - herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); - if( ret_value < 0 ) - { - delete []strg_C; // de-allocate for fixed-len string - throw AttributeIException("Attribute::read", "H5Aread failed"); - } - // Get string from the C char* and release resource allocated locally - strg_C[attr_size] = '\0'; - strg = strg_C; - delete []strg_C; + char *strg_C = new char[attr_size+1]; + herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); + if( ret_value < 0 ) + { + delete []strg_C; // de-allocate for fixed-len string + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + // Get string from the C char* and release resource allocated locally + strg_C[attr_size] = '\0'; + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the variable length case from the original -// Attribute::read. -BMR +// Jul 2009 +// Separated the variable length case from the original +// Attribute::read. -BMR //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { @@ -602,7 +602,7 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg if( ret_value < 0 ) { - throw AttributeIException("Attribute::read", "H5Aread failed"); + throw AttributeIException("Attribute::read", "H5Aread failed"); } // Get string from the C char* and release resource allocated by C API @@ -616,21 +616,21 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::p_setId(const hid_t new_id) { // handling references to this old id try { - close(); + close(); } catch (Exception& close_error) { - throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); + throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); } // reset object's id to the given id id = new_id; @@ -638,43 +638,43 @@ void Attribute::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Attribute::close -///\brief Closes this attribute. +// Function: Attribute::close +///\brief Closes this attribute. /// -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Attribute::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Aclose(id); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::close", "H5Aclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Aclose(id); + if( ret_value < 0 ) + { + throw AttributeIException("Attribute::close", "H5Aclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: Attribute destructor -///\brief Properly terminates access to this attribute. -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute destructor +///\brief Properly terminates access to this attribute. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Attribute::~Attribute() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; + cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 4a27add..1a45154 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -30,87 +30,87 @@ namespace H5 { class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { public: - // Copy constructor: makes a copy of an existing Attribute object. - Attribute( const Attribute& original ); + // Copy constructor: makes a copy of an existing Attribute object. + Attribute( const Attribute& original ); - // Default constructor - Attribute(); + // Default constructor + Attribute(); - // Creates a copy of an existing attribute using the attribute id - Attribute( const hid_t attr_id ); + // Creates a copy of an existing attribute using the attribute id + Attribute( const hid_t attr_id ); - // Closes this attribute. - virtual void close(); + // Closes this attribute. + virtual void close(); - // Gets the name of the file, in which this attribute belongs. - H5std_string getFileName() const; + // Gets the name of the file, in which this attribute belongs. + H5std_string getFileName() const; - // Gets the name of this attribute. - ssize_t getName(char* attr_name, size_t buf_size = 0) const; - H5std_string getName(size_t len) const; - H5std_string getName() const; - ssize_t getName(H5std_string& attr_name, size_t len = 0) const; - // The overloaded function below is replaced by the one above and it - // is kept for backward compatibility purpose. - ssize_t getName( size_t buf_size, H5std_string& attr_name ) const; + // Gets the name of this attribute. + ssize_t getName(char* attr_name, size_t buf_size = 0) const; + H5std_string getName(size_t len) const; + H5std_string getName() const; + ssize_t getName(H5std_string& attr_name, size_t len = 0) const; + // The overloaded function below is replaced by the one above and it + // is kept for backward compatibility purpose. + ssize_t getName( size_t buf_size, H5std_string& attr_name ) const; - // Gets a copy of the dataspace for this attribute. - virtual DataSpace getSpace() const; + // Gets a copy of the dataspace for this attribute. + virtual DataSpace getSpace() const; - // Returns the amount of storage size required for this attribute. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this attribute. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Reads data from this attribute. - void read( const DataType& mem_type, void *buf ) const; - void read( const DataType& mem_type, H5std_string& strg ) const; + // Reads data from this attribute. + void read( const DataType& mem_type, void *buf ) const; + void read( const DataType& mem_type, H5std_string& strg ) const; - // Writes data to this attribute. - void write(const DataType& mem_type, const void *buf ) const; - void write(const DataType& mem_type, const H5std_string& strg ) const; + // Writes data to this attribute. + void write(const DataType& mem_type, const void *buf ) const; + void write(const DataType& mem_type, const H5std_string& strg ) const; - // Flushes all buffers associated with the file specified by this - // attribute to disk. - void flush( H5F_scope_t scope ) const; + // Flushes all buffers associated with the file specified by this + // attribute to disk. + void flush( H5F_scope_t scope ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Attribute"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Attribute"); } - // Gets the attribute id. - virtual hid_t getId() const; + // Gets the attribute id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this attribute. - virtual ~Attribute(); + // Destructor: properly terminates access to this attribute. + virtual ~Attribute(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the attribute id. - virtual void p_setId(const hid_t new_id); + // Sets the attribute id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 attribute id + hid_t id; // HDF5 attribute id - // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType - // defined in AbstractDs for generic datatype and specific - // sub-types - virtual hid_t p_get_type() const; + // This function contains the common code that is used by + // getTypeClass and various API functions getXxxType + // defined in AbstractDs for generic datatype and specific + // sub-types + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this attribute. - void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; - void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; + // Reads variable or fixed len strings from this attribute. + void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; + void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; - // do not inherit H5Object::iterateAttrs - int iterateAttrs() { return 0; } + // do not inherit H5Object::iterateAttrs + int iterateAttrs() { return 0; } - // do not inherit H5Object::renameAttr - void renameAttr() {} + // do not inherit H5Object::renameAttr + void renameAttr() {} - // Friend function to set Attribute id. For library use only. - friend void f_Attribute_setId(Attribute* attr, hid_t new_id); + // Friend function to set Attribute id. For library use only. + friend void f_Attribute_setId(Attribute* attr, hid_t new_id); }; } diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index e45c627..23004b1 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -18,31 +18,31 @@ #define __H5Classes_H namespace H5 { - class Exception; - class IdComponent; - class H5Location; - class H5Object; - class PropList; - class FileCreatPropList; - class FileAccPropList; - class DSetCreatPropList; - class DSetMemXferPropList; - class DTypePropList; - class DataType; - class DataSpace; - class AtomType; - class PredType; - class EnumType; - class IntType; - class FloatType; - class StrType; - class CompType; - //class RefType; - class AbstractDs; - class DataSet; - class Group; - class H5File; - class Attribute; - class H5Library; + class Exception; + class IdComponent; + class H5Location; + class H5Object; + class PropList; + class FileCreatPropList; + class FileAccPropList; + class DSetCreatPropList; + class DSetMemXferPropList; + class DTypePropList; + class DataType; + class DataSpace; + class AtomType; + class PredType; + class EnumType; + class IntType; + class FloatType; + class StrType; + class CompType; + //class RefType; + class AbstractDs; + class DataSet; + class Group; + class H5File; + class Attribute; + class H5Library; } #endif // __H5Classes_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 1f9f1f9..725ab83 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -32,7 +32,7 @@ #include "H5DataSet.h" #include "H5File.h" #include "H5Alltypes.h" -#include "H5private.h" // for HDstrcpy +#include "H5private.h" // for HDstrcpy // There are a few comments that are common to most of the functions // defined in this file so they are listed here. @@ -50,20 +50,20 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: CommonFG::createGroup -///\brief Creates a new group at this location which can be a file -/// or another group. -///\param name - IN: Name of the group to create -///\param size_hint - IN: Indicates the number of bytes to reserve for -/// the names that will appear in the group -///\return Group instance -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::createGroup +///\brief Creates a new group at this location which can be a file +/// or another group. +///\param name - IN: Name of the group to create +///\param size_hint - IN: Indicates the number of bytes to reserve for +/// the names that will appear in the group +///\return Group instance +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The optional \a size_hint specifies how much file space to -/// reserve for storing the names that will appear in this new -/// group. If a non-positive value is provided for the \a size_hint -/// then a default size is chosen. -// Programmer Binh-Minh Ribler - 2000 +/// The optional \a size_hint specifies how much file space to +/// reserve for storing the names that will appear in this new +/// group. If a non-positive value is provided for the \a size_hint +/// then a default size is chosen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::createGroup( const char* name, size_t size_hint ) const { @@ -103,11 +103,11 @@ namespace H5 { } //-------------------------------------------------------------------------- -// Function: CommonFG::createGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::createGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const { @@ -115,13 +115,13 @@ Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openGroup -///\brief Opens an existing group in a location which can be a file -/// or another group. -///\param name - IN: Name of the group to open -///\return Group instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openGroup +///\brief Opens an existing group in a location which can be a file +/// or another group. +///\param name - IN: Name of the group to open +///\return Group instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::openGroup( const char* name ) const { @@ -141,11 +141,11 @@ Group CommonFG::openGroup( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::openGroup( const H5std_string& name ) const { @@ -153,15 +153,15 @@ Group CommonFG::openGroup( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::createDataSet -///\brief Creates a new dataset at this location. -///\param name - IN: Name of the dataset to create -///\param data_type - IN: Datatype of the dataset -///\param data_space - IN: Dataspace for the dataset -///\param create_plist - IN: Creation properly list for the dataset -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::createDataSet +///\brief Creates a new dataset at this location. +///\param name - IN: Name of the dataset to create +///\param data_type - IN: Datatype of the dataset +///\param data_space - IN: Dataspace for the dataset +///\param create_plist - IN: Creation properly list for the dataset +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const { @@ -184,11 +184,11 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co } //-------------------------------------------------------------------------- -// Function: CommonFG::createDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::createDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const { @@ -196,12 +196,12 @@ DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_ } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataSet -///\brief Opens an existing dataset at this location. -///\param name - IN: Name of the dataset to open -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataSet +///\brief Opens an existing dataset at this location. +///\param name - IN: Name of the dataset to open +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::openDataSet( const char* name ) const { @@ -220,11 +220,11 @@ DataSet CommonFG::openDataSet( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::openDataSet( const H5std_string& name ) const { @@ -232,26 +232,26 @@ DataSet CommonFG::openDataSet( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::link -///\brief Creates a link of the specified type from \a new_name to -/// \a curr_name. -///\param link_type - IN: Link type; possible values are -/// \li \c H5G_LINK_HARD -/// \li \c H5G_LINK_SOFT -///\param curr_name - IN: Name of the existing object if link is a hard -/// link; can be anything for the soft link -///\param new_name - IN: New name for the object -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::link +///\brief Creates a link of the specified type from \a new_name to +/// \a curr_name. +///\param link_type - IN: Link type; possible values are +/// \li \c H5G_LINK_HARD +/// \li \c H5G_LINK_SOFT +///\param curr_name - IN: Name of the existing object if link is a hard +/// link; can be anything for the soft link +///\param new_name - IN: New name for the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating hard link and soft link, please -/// refer to the C layer Reference Manual at: +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating hard link and soft link, please +/// refer to the C layer Reference Manual at: /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const { @@ -266,9 +266,9 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne ret_value = H5Lcreate_soft( curr_name, getLocId(), new_name, H5P_DEFAULT, H5P_DEFAULT ); break; - case H5L_TYPE_ERROR: - case H5L_TYPE_EXTERNAL: - case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: + case H5L_TYPE_EXTERNAL: + case H5L_TYPE_MAX: default: throwException("link", "unknown link type"); break; @@ -279,11 +279,11 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne } //-------------------------------------------------------------------------- -// Function: CommonFG::link -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a curr_name and \a new_name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const { @@ -291,13 +291,13 @@ void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const } //-------------------------------------------------------------------------- -// Function: CommonFG::unlink -///\brief Removes the specified name at this location. -///\param name - IN: Name of the object to be removed -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::unlink +///\brief Removes the specified name at this location. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- void CommonFG::unlink( const char* name ) const { @@ -307,11 +307,11 @@ void CommonFG::unlink( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::unlink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::unlink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::unlink( const H5std_string& name ) const { @@ -319,19 +319,19 @@ void CommonFG::unlink( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::move -///\brief Renames an object at this location. -///\param src - IN: Object's original name -///\param dst - IN: Object's new name -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::move +///\brief Renames an object at this location. +///\param src - IN: Object's original name +///\param dst - IN: Object's new name +///\exception H5::FileIException or H5::GroupIException ///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with Group::move. Please refer -/// to the Group Interface in the HDF5 User's Guide for details at: +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with Group::move. Please refer +/// to the Group Interface in the HDF5 User's Guide for details at: /// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- void CommonFG::move( const char* src, const char* dst ) const { @@ -341,11 +341,11 @@ void CommonFG::move( const char* src, const char* dst ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::move -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src and \a dst. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::move +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src and \a dst. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const { @@ -354,17 +354,17 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: CommonFG::getObjinfo -///\brief Returns information about an object. -///\param name - IN: Name of the object -///\param follow_link - IN: Link flag -///\param statbuf - OUT: Buffer to return information about the object -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::getObjinfo +///\brief Returns information about an object. +///\param name - IN: Name of the object +///\param follow_link - IN: Link flag +///\param statbuf - OUT: Buffer to return information about the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const { @@ -374,11 +374,11 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const { @@ -386,11 +386,11 @@ void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_st } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above functions in that it doesn't have -/// the paramemter \a follow_link. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: CommonFG::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above functions in that it doesn't have +/// the paramemter \a follow_link. +// Programmer Binh-Minh Ribler - Nov, 2005 // Note: need to modify to use H5Oget_info and H5Lget_info - BMR //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const @@ -401,11 +401,11 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: CommonFG::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const { @@ -414,18 +414,18 @@ void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: CommonFG::getLinkval -///\brief Returns the name of the object that the symbolic link points to. -///\param name - IN: Symbolic link to the object -///\param size - IN: Maximum number of characters of value to be returned -///\return Name of the object -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::getLinkval +///\brief Returns the name of the object that the symbolic link points to. +///\param name - IN: Symbolic link to the object +///\param size - IN: Maximum number of characters of value to be returned +///\return Name of the object +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string CommonFG::getLinkval( const char* name, size_t size ) const { H5L_info_t linkinfo; - char *value_C; // value in C string + char *value_C; // value in C string size_t val_size = size; H5std_string value = ""; herr_t ret_value; @@ -433,38 +433,38 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const // if user doesn't provide buffer size, determine it if (size == 0) { - ret_value = H5Lget_info(getLocId(), name, &linkinfo, H5P_DEFAULT); - if( ret_value < 0 ) - throwException("getLinkval", "H5Lget_info to find buffer size failed"); + ret_value = H5Lget_info(getLocId(), name, &linkinfo, H5P_DEFAULT); + if( ret_value < 0 ) + throwException("getLinkval", "H5Lget_info to find buffer size failed"); - val_size = linkinfo.u.val_size; + val_size = linkinfo.u.val_size; } // if link has value, retrieve the value, otherwise, return null string if (val_size > 0) { - value_C = new char[val_size+1]; // temporary C-string for C API - HDmemset(value_C, 0, val_size+1); // clear buffer - - ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); - if( ret_value < 0 ) - { - delete []value_C; - throwException("getLinkval", "H5Lget_val failed"); - } - - value = H5std_string(value_C); - delete []value_C; + value_C = new char[val_size+1]; // temporary C-string for C API + HDmemset(value_C, 0, val_size+1); // clear buffer + + ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); + if( ret_value < 0 ) + { + delete []value_C; + throwException("getLinkval", "H5Lget_val failed"); + } + + value = H5std_string(value_C); + delete []value_C; } return(value); } //-------------------------------------------------------------------------- -// Function: CommonFG::getLinkval -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::getLinkval +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const { @@ -472,15 +472,15 @@ H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::mount -///\brief Mounts the file \a child onto this group. -///\param name - IN: Name of the group -///\param child - IN: File to mount -///\param plist - IN: Property list to use -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2014 (original 2000) +// Function: CommonFG::mount +///\brief Mounts the file \a child onto this group. +///\param name - IN: Name of the group +///\param child - IN: File to mount +///\param plist - IN: Property list to use +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2014 (original 2000) // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void CommonFG::mount(const char* name, const H5File& child, const PropList& plist ) const { @@ -497,19 +497,19 @@ void CommonFG::mount(const char* name, const H5File& child, const PropList& plis } //-------------------------------------------------------------------------- -// Function: CommonFG::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param name - IN: Name of the group -// Param child - IN: File to mount -// Param plist - IN: Property list to use -// Exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param name - IN: Name of the group +// Param child - IN: File to mount +// Param plist - IN: Property list to use +// Exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void CommonFG::mount(const char* name, H5File& child, PropList& plist) const //{ @@ -517,12 +517,12 @@ void CommonFG::mount(const char* name, const H5File& child, const PropList& plis //} //-------------------------------------------------------------------------- -// Function: CommonFG::mount -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::mount +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void CommonFG::mount(const H5std_string& name, const H5File& child, const PropList& plist) const { @@ -530,15 +530,15 @@ void CommonFG::mount(const H5std_string& name, const H5File& child, const PropLi } //-------------------------------------------------------------------------- -// Function: CommonFG::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Programmer Binh-Minh Ribler - 2014 +// Function: CommonFG::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Programmer Binh-Minh Ribler - 2014 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void CommonFG::mount(const H5std_string& name, H5File& child, PropList& plist) const //{ @@ -546,11 +546,11 @@ void CommonFG::mount(const H5std_string& name, const H5File& child, const PropLi //} //-------------------------------------------------------------------------- -// Function: CommonFG::unmount -///\brief Unmounts the specified file. -///\param name - IN: Name of the file to unmount -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::unmount +///\brief Unmounts the specified file. +///\param name - IN: Name of the file to unmount +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::unmount( const char* name ) const { @@ -563,11 +563,11 @@ void CommonFG::unmount( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::unmount -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::unmount +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::unmount( const H5std_string& name ) const { @@ -575,12 +575,12 @@ void CommonFG::unmount( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief Opens the named generic datatype at this location. -///\param name - IN: Name of the datatype to open -///\return DataType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief Opens the named generic datatype at this location. +///\param name - IN: Name of the datatype to open +///\return DataType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType CommonFG::openDataType( const char* name ) const { @@ -599,11 +599,11 @@ DataType CommonFG::openDataType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType CommonFG::openDataType( const H5std_string& name ) const { @@ -611,12 +611,12 @@ DataType CommonFG::openDataType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief Opens the named array datatype at this location. -///\param name - IN: Name of the array datatype to open -///\return ArrayType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief Opens the named array datatype at this location. +///\param name - IN: Name of the array datatype to open +///\return ArrayType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType CommonFG::openArrayType( const char* name ) const { @@ -635,11 +635,11 @@ ArrayType CommonFG::openArrayType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType CommonFG::openArrayType( const H5std_string& name ) const { @@ -647,12 +647,12 @@ ArrayType CommonFG::openArrayType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief Opens the named compound datatype at this location. -///\param name - IN: Name of the compound datatype to open -///\return CompType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief Opens the named compound datatype at this location. +///\param name - IN: Name of the compound datatype to open +///\return CompType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType CommonFG::openCompType( const char* name ) const { @@ -671,11 +671,11 @@ CompType CommonFG::openCompType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType CommonFG::openCompType( const H5std_string& name ) const { @@ -683,12 +683,12 @@ CompType CommonFG::openCompType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief Opens the named enumeration datatype at this location. -///\param name - IN: Name of the enumeration datatype to open -///\return EnumType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief Opens the named enumeration datatype at this location. +///\param name - IN: Name of the enumeration datatype to open +///\return EnumType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const char* name ) const { @@ -707,11 +707,11 @@ EnumType CommonFG::openEnumType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const H5std_string& name ) const { @@ -719,12 +719,12 @@ EnumType CommonFG::openEnumType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief Opens the named integer datatype at this location. -///\param name - IN: Name of the integer datatype to open -///\return IntType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief Opens the named integer datatype at this location. +///\param name - IN: Name of the integer datatype to open +///\return IntType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const char* name ) const { @@ -743,11 +743,11 @@ IntType CommonFG::openIntType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const H5std_string& name ) const { @@ -755,12 +755,12 @@ IntType CommonFG::openIntType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief Opens the named floating-point datatype at this location. -///\param name - IN: Name of the floating-point datatype to open -///\return FloatType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief Opens the named floating-point datatype at this location. +///\param name - IN: Name of the floating-point datatype to open +///\return FloatType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const char* name ) const { @@ -779,11 +779,11 @@ FloatType CommonFG::openFloatType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const H5std_string& name ) const { @@ -791,12 +791,12 @@ FloatType CommonFG::openFloatType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief Opens the named string datatype at this location. -///\param name - IN: Name of the string datatype to open -///\return StrType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief Opens the named string datatype at this location. +///\param name - IN: Name of the string datatype to open +///\return StrType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType CommonFG::openStrType( const char* name ) const { @@ -815,11 +815,11 @@ StrType CommonFG::openStrType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType CommonFG::openStrType( const H5std_string& name ) const { @@ -827,12 +827,12 @@ StrType CommonFG::openStrType( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief Opens the named variable length datatype at this location. -///\param name - IN: Name of the variable length datatype to open -///\return VarLenType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief Opens the named variable length datatype at this location. +///\param name - IN: Name of the variable length datatype to open +///\return VarLenType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType CommonFG::openVarLenType( const char* name ) const { @@ -851,11 +851,11 @@ VarLenType CommonFG::openVarLenType( const char* name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType CommonFG::openVarLenType( const H5std_string& name ) const { @@ -864,17 +864,17 @@ VarLenType CommonFG::openVarLenType( const H5std_string& name ) const #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: CommonFG::iterateElems -///\brief Iterates a user's function over the entries of a group. -///\param name - IN : Name of group to iterate over -///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices -///\param op - IN : User's function to operate on each entry -///\param op_data - IN/OUT: Data associated with the operation -///\return The return value of the first operator that returns non-zero, -/// or zero if all members were processed with no operator -/// returning non-zero. -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::iterateElems +///\brief Iterates a user's function over the entries of a group. +///\param name - IN : Name of group to iterate over +///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices +///\param op - IN : User's function to operate on each entry +///\param op_data - IN/OUT: Data associated with the operation +///\return The return value of the first operator that returns non-zero, +/// or zero if all members were processed with no operator +/// returning non-zero. +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data ) { @@ -887,11 +887,11 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* } //-------------------------------------------------------------------------- -// Function: CommonFG::iterateElems -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::iterateElems +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data ) { @@ -900,15 +900,15 @@ int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: CommonFG::getNumObjs -///\brief Returns the number of objects in this group. -///\return Number of objects -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: CommonFG::getNumObjs +///\brief Returns the number of objects in this group. +///\return Number of objects +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- hsize_t CommonFG::getNumObjs() const { - H5G_info_t ginfo; /* Group information */ + H5G_info_t ginfo; /* Group information */ herr_t ret_value = H5Gget_info(getLocId(), &ginfo); if(ret_value < 0) @@ -917,19 +917,19 @@ hsize_t CommonFG::getNumObjs() const } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjnameByIdx -///\brief Returns the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object name -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::getObjnameByIdx +///\brief Returns the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c CommonFG::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - Mar, 2005 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c CommonFG::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const { @@ -946,8 +946,8 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const if (name_len < 0) { - delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + delete []name_C; + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); } // clean up and return the string @@ -957,21 +957,21 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjnameByIdx -///\brief Retrieves the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\param name - IN/OUT: Retrieved name of the object -///\param size - IN: Length to retrieve -///\return Actual size of the object name or 0, if object has no name -///\exception H5::FileIException or H5::GroupIException +// Function: CommonFG::getObjnameByIdx +///\brief Retrieves the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\param name - IN/OUT: Retrieved name of the object +///\param size - IN: Length to retrieve +///\return Actual size of the object name or 0, if object has no name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c CommonFG::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - January, 2003 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c CommonFG::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const { @@ -983,11 +983,11 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjnameByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - January, 2003 +// Function: CommonFG::getObjnameByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const { @@ -1009,22 +1009,22 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) } //-------------------------------------------------------------------------- -// Function: CommonFG::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's name. -///\param objname - IN: Name of the object -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 +// Function: CommonFG::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's name. +///\param objname - IN: Name of the object +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t CommonFG::childObjType(const char* objname) const { @@ -1036,33 +1036,33 @@ H5O_type_t CommonFG::childObjType(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_name failed"); + throwException("childObjType", "H5Oget_info_by_name failed"); // Return a valid type or throw an exception for unknown type else switch (objinfo.type) { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); } return(objtype); } //-------------------------------------------------------------------------- -// Function: CommonFG::childObjType -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: CommonFG::childObjType +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t CommonFG::childObjType(const H5std_string& objname) const { @@ -1072,33 +1072,33 @@ H5O_type_t CommonFG::childObjType(const H5std_string& objname) const } //-------------------------------------------------------------------------- -// Function: CommonFG::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's index and its type and order. -///\param index - IN: Position of the object -///\param index_type - IN: Type of the index, default to H5_INDEX_NAME -///\param order - IN: Traversing order, default to H5_ITER_INC -///\param objname - IN: Name of the object, default to "." -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above +// Function: CommonFG::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's index and its type and order. +///\param index - IN: Position of the object +///\param index_type - IN: Type of the index, default to H5_INDEX_NAME +///\param order - IN: Traversing order, default to H5_ITER_INC +///\param objname - IN: Name of the object, default to "." +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above // Developer's Notes: -// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name -// like the previous childObjType() -// - index is the required argument so, first -// - objname is last because it's more likely the location is already -// fully specified -// - Leave property list out for now because C API is not using it, it -// can be added later when needed. -// Programmer Binh-Minh Ribler - April, 2014 +// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name +// like the previous childObjType() +// - index is the required argument so, first +// - objname is last because it's more likely the location is already +// fully specified +// - Leave property list out for now because C API is not using it, it +// can be added later when needed. +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const { @@ -1111,37 +1111,37 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_ // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_idx failed"); + throwException("childObjType", "H5Oget_info_by_idx failed"); // Return a valid type or throw an exception for unknown type else switch (objinfo.type) { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); } return(objtype); } //-------------------------------------------------------------------------- -// Function: CommonFG::childObjVersion -///\brief Returns the object header version of an object in this file/group, -/// given the object's name. -///\param objname - IN: Name of the object -///\return Object version, which can have the following values: -/// \li \c H5O_VERSION_1 -/// \li \c H5O_VERSION_2 -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - version number is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 +// Function: CommonFG::childObjVersion +///\brief Returns the object header version of an object in this file/group, +/// given the object's name. +///\param objname - IN: Name of the object +///\return Object version, which can have the following values: +/// \li \c H5O_VERSION_1 +/// \li \c H5O_VERSION_2 +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - version number is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned CommonFG::childObjVersion(const char* objname) const { @@ -1153,26 +1153,26 @@ unsigned CommonFG::childObjVersion(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjVersion", "H5Oget_info_by_name failed"); + throwException("childObjVersion", "H5Oget_info_by_name failed"); // Return a valid version or throw an exception for invalid value else { - version = objinfo.hdr.version; - if (version != H5O_VERSION_1 && version != H5O_VERSION_2) - throwException("childObjVersion", "Invalid version for object"); + version = objinfo.hdr.version; + if (version != H5O_VERSION_1 && version != H5O_VERSION_2) + throwException("childObjVersion", "Invalid version for object"); } return(version); } //-------------------------------------------------------------------------- -// Function: CommonFG::childObjVersion -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: CommonFG::childObjVersion +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned CommonFG::childObjVersion(const H5std_string& objname) const { @@ -1184,13 +1184,13 @@ unsigned CommonFG::childObjVersion(const H5std_string& objname) const #ifndef H5_NO_DEPRECATED_SYMBOLS #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: CommonFG::getObjTypeByIdx -///\brief Returns the type of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: CommonFG::getObjTypeByIdx +///\brief Returns the type of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const { @@ -1202,17 +1202,17 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (char*) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - May, 2010 +// Function: CommonFG::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (char*) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - May, 2010 // Modification -// Modified to use the other function. -BMR, 2016/03/07 +// Modified to use the other function. -BMR, 2016/03/07 //-------------------------------------------------------------------------- H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const { @@ -1220,15 +1220,15 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const return(getObjTypeByIdx(idx, stype_name)); } //-------------------------------------------------------------------------- -// Function: CommonFG::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (H5std_string&) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: CommonFG::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (H5std_string&) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const { @@ -1240,10 +1240,10 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const case H5G_DATASET: type_name = H5std_string("dataset"); break; case H5G_TYPE: type_name = H5std_string("datatype"); break; case H5G_UNKNOWN: - case H5G_UDLINK: - case H5G_RESERVED_5: - case H5G_RESERVED_6: - case H5G_RESERVED_7: + case H5G_UDLINK: + case H5G_RESERVED_5: + case H5G_RESERVED_6: + case H5G_RESERVED_7: default: throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); } @@ -1255,28 +1255,28 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: CommonFG default constructor -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG default constructor +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CommonFG::CommonFG() {} //-------------------------------------------------------------------------- -// Function: CommonFG destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CommonFG::~CommonFG() {} //-------------------------------------------------------------------------- -// Function: f_DataType_setId - friend -// Purpose: This function is friend to class H5::DataType so that it -// can set DataType::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. +// Function: f_DataType_setId - friend +// Purpose: This function is friend to class H5::DataType so that it +// can set DataType::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. // param dtype - IN/OUT: DataType object to be changed // param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_DataType_setId(DataType* dtype, hid_t new_id) { @@ -1284,14 +1284,14 @@ void f_DataType_setId(DataType* dtype, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: f_DataSet_setId - friend -// Purpose: This function is friend to class H5::DataSet so that it -// can set DataSet::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. +// Function: f_DataSet_setId - friend +// Purpose: This function is friend to class H5::DataSet so that it +// can set DataSet::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. // param dset - IN/OUT: DataSet object to be changed // param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_DataSet_setId(DataSet* dset, hid_t new_id) { diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index f700943..62c333d 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -32,140 +32,140 @@ class VarLenType; */ class H5_DLLCPP CommonFG { public: - // Creates a new group at this location which can be a file - // or another group. - Group createGroup(const char* name, size_t size_hint = 0) const; - Group createGroup(const H5std_string& name, size_t size_hint = 0) const; - - // Opens an existing group in a location which can be a file - // or another group. - Group openGroup(const char* name) const; - Group openGroup(const H5std_string& name) const; - - // Creates a new dataset at this location. - DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - - // Opens an existing dataset at this location. - DataSet openDataSet(const char* name) const; - DataSet openDataSet(const H5std_string& name) const; - - // Returns the value of a symbolic link. - H5std_string getLinkval(const char* link_name, size_t size=0) const; - H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; - - // Returns the number of objects in this group. - hsize_t getNumObjs() const; - - // Retrieves the name of an object in this group, given the - // object's index. - H5std_string getObjnameByIdx(hsize_t idx) const; - ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; - ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; - - // Retrieves the type of an object in this file or group, given the - // object's name - H5O_type_t childObjType(const H5std_string& objname) const; - H5O_type_t childObjType(const char* objname) const; - H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; - - // Returns the object header version of an object in this file or group, - // given the object's name. - unsigned childObjVersion(const char* objname) const; - unsigned childObjVersion(const H5std_string& objname) const; + // Creates a new group at this location which can be a file + // or another group. + Group createGroup(const char* name, size_t size_hint = 0) const; + Group createGroup(const H5std_string& name, size_t size_hint = 0) const; + + // Opens an existing group in a location which can be a file + // or another group. + Group openGroup(const char* name) const; + Group openGroup(const H5std_string& name) const; + + // Creates a new dataset at this location. + DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + + // Opens an existing dataset at this location. + DataSet openDataSet(const char* name) const; + DataSet openDataSet(const H5std_string& name) const; + + // Returns the value of a symbolic link. + H5std_string getLinkval(const char* link_name, size_t size=0) const; + H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; + + // Returns the number of objects in this group. + hsize_t getNumObjs() const; + + // Retrieves the name of an object in this group, given the + // object's index. + H5std_string getObjnameByIdx(hsize_t idx) const; + ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; + ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; + + // Retrieves the type of an object in this file or group, given the + // object's name + H5O_type_t childObjType(const H5std_string& objname) const; + H5O_type_t childObjType(const char* objname) const; + H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; + + // Returns the object header version of an object in this file or group, + // given the object's name. + unsigned childObjVersion(const char* objname) const; + unsigned childObjVersion(const H5std_string& objname) const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Returns the type of an object in this group, given the - // object's index. - H5G_obj_t getObjTypeByIdx(hsize_t idx) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; - - // Returns information about an HDF5 object, given by its name, - // at this location. - void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const char* name, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; - - // Iterates over the elements of this group - not implemented in - // C++ style yet. - int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); - int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); + // Returns the type of an object in this group, given the + // object's index. + H5G_obj_t getObjTypeByIdx(hsize_t idx) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; + + // Returns information about an HDF5 object, given by its name, + // at this location. + void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const char* name, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; + + // Iterates over the elements of this group - not implemented in + // C++ style yet. + int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); + int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Creates a link of the specified type from new_name to current_name; - // both names are interpreted relative to the specified location id. - void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; - void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; + // Creates a link of the specified type from new_name to current_name; + // both names are interpreted relative to the specified location id. + void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; + void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; - // Removes the specified name at this location. - void unlink(const char* name) const; - void unlink(const H5std_string& name) const; + // Removes the specified name at this location. + void unlink(const char* name) const; + void unlink(const H5std_string& name) const; - // Mounts the file 'child' onto this location. - void mount(const char* name, const H5File& child, const PropList& plist) const; - //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; - //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + // Mounts the file 'child' onto this location. + void mount(const char* name, const H5File& child, const PropList& plist) const; + //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; + //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - // Unmounts the file named 'name' from this parent location. - void unmount(const char* name) const; - void unmount(const H5std_string& name) const; + // Unmounts the file named 'name' from this parent location. + void unmount(const char* name) const; + void unmount(const H5std_string& name) const; - // Renames an object at this location. - void move(const char* src, const char* dst) const; - void move(const H5std_string& src, const H5std_string& dst) const; + // Renames an object at this location. + void move(const char* src, const char* dst) const; + void move(const H5std_string& src, const H5std_string& dst) const; - // Opens a generic named datatype in this location. - DataType openDataType(const char* name) const; - DataType openDataType(const H5std_string& name) const; + // Opens a generic named datatype in this location. + DataType openDataType(const char* name) const; + DataType openDataType(const H5std_string& name) const; - // Opens a named array datatype in this location. - ArrayType openArrayType(const char* name) const; - ArrayType openArrayType(const H5std_string& name) const; + // Opens a named array datatype in this location. + ArrayType openArrayType(const char* name) const; + ArrayType openArrayType(const H5std_string& name) const; - // Opens a named compound datatype in this location. - CompType openCompType(const char* name) const; - CompType openCompType(const H5std_string& name) const; + // Opens a named compound datatype in this location. + CompType openCompType(const char* name) const; + CompType openCompType(const H5std_string& name) const; - // Opens a named enumeration datatype in this location. - EnumType openEnumType(const char* name) const; - EnumType openEnumType(const H5std_string& name) const; + // Opens a named enumeration datatype in this location. + EnumType openEnumType(const char* name) const; + EnumType openEnumType(const H5std_string& name) const; - // Opens a named integer datatype in this location. - IntType openIntType(const char* name) const; - IntType openIntType(const H5std_string& name) const; + // Opens a named integer datatype in this location. + IntType openIntType(const char* name) const; + IntType openIntType(const H5std_string& name) const; - // Opens a named floating-point datatype in this location. - FloatType openFloatType(const char* name) const; - FloatType openFloatType(const H5std_string& name) const; + // Opens a named floating-point datatype in this location. + FloatType openFloatType(const char* name) const; + FloatType openFloatType(const H5std_string& name) const; - // Opens a named string datatype in this location. - StrType openStrType(const char* name) const; - StrType openStrType(const H5std_string& name) const; + // Opens a named string datatype in this location. + StrType openStrType(const char* name) const; + StrType openStrType(const H5std_string& name) const; - // Opens a named variable length datatype in this location. - VarLenType openVarLenType(const char* name) const; - VarLenType openVarLenType(const H5std_string& name) const; + // Opens a named variable length datatype in this location. + VarLenType openVarLenType(const char* name) const; + VarLenType openVarLenType(const H5std_string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS - /// For subclasses, H5File and Group, to return the correct - /// object id, i.e. file or group id. - virtual hid_t getLocId() const = 0; + /// For subclasses, H5File and Group, to return the correct + /// object id, i.e. file or group id. + virtual hid_t getLocId() const = 0; - /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; + /// For subclasses, H5File and Group, to throw appropriate exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; - // Default constructor. - CommonFG(); + // Default constructor. + CommonFG(); - // Noop destructor. - virtual ~CommonFG(); + // Noop destructor. + virtual ~CommonFG(); protected: - virtual void p_setId(const hid_t new_id) = 0; + virtual void p_setId(const hid_t new_id) = 0; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 28ea281..2a60333 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -33,47 +33,47 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: CompType default constructor -///\brief Default constructor: Creates a stub compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType default constructor +///\brief Default constructor: Creates a stub compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType() : DataType() {} //-------------------------------------------------------------------------- -// Function: CompType copy constructor -///\brief Copy constructor: makes copy of the original CompType object -///\param original - IN: Original CompType instance -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType copy constructor +///\brief Copy constructor: makes copy of the original CompType object +///\param original - IN: Original CompType instance +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType( const CompType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates a CompType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Creates a CompType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an empty compound datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: CompType overloaded constructor +///\brief Creates an empty compound datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the compound datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the compound datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Gets the compound datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Gets the compound datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType( const DataSet& dataset ) : DataType() { @@ -88,11 +88,11 @@ CompType::CompType( const DataSet& dataset ) : DataType() } //-------------------------------------------------------------------------- -// Function: CompType::getNmembers -///\brief Returns the number of members in this compound datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getNmembers +///\brief Returns the number of members in this compound datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CompType::getNmembers() const { @@ -100,26 +100,26 @@ int CompType::getNmembers() const if( num_members < 0 ) { throw DataTypeIException("CompType::getNmembers", - "H5Tget_nmembers returns negative number of members"); + "H5Tget_nmembers returns negative number of members"); } return( num_members ); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberName -///\brief Returns the name of a member in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return Name of member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberName +///\brief Returns the name of a member in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return Name of member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string CompType::getMemberName( unsigned member_num ) const { char* member_name_C = H5Tget_member_name( id, member_num ); if( member_name_C == NULL ) // NULL means failure { - throw DataTypeIException("CompType::getMemberName", - "H5Tget_member_name returns NULL for member name"); + throw DataTypeIException("CompType::getMemberName", + "H5Tget_member_name returns NULL for member name"); } H5std_string member_name = H5std_string(member_name_C); // convert C string to string H5free_memory(member_name_C); // free the C string @@ -127,16 +127,16 @@ H5std_string CompType::getMemberName( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIndex -///\brief Returns the index of a member in this compound datatype. -///\param name - IN: Name of the member -///\return Index of member -///\exception H5::DataTypeIException +// Function: CompType::getMemberIndex +///\brief Returns the index of a member in this compound datatype. +///\param name - IN: Name of the member +///\return Index of member +///\exception H5::DataTypeIException ///\par Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. -// Programmer Binh-Minh Ribler - May 16, 2002 +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. +// Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int CompType::getMemberIndex(const char* name) const { @@ -144,7 +144,7 @@ int CompType::getMemberIndex(const char* name) const if( member_index < 0 ) { throw DataTypeIException("CompType::getMemberIndex", - "H5Tget_member_index returns negative value"); + "H5Tget_member_index returns negative value"); } return( member_index ); } @@ -154,20 +154,20 @@ int CompType::getMemberIndex(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberOffset -///\brief Returns the byte offset of the beginning of a member with -/// respect to the beginning of the compound data type datum. -///\param member_num - IN: Zero-based index of the member -///\return Byte offset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberOffset +///\brief Returns the byte offset of the beginning of a member with +/// respect to the beginning of the compound data type datum. +///\param member_num - IN: Zero-based index of the member +///\return Byte offset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. // -// Note that byte offset being returned as 0 doesn't indicate -// a failure. (According to Quincey) +// Note that byte offset being returned as 0 doesn't indicate +// a failure. (According to Quincey) //-------------------------------------------------------------------------- size_t CompType::getMemberOffset( unsigned member_num ) const { @@ -176,14 +176,14 @@ size_t CompType::getMemberOffset( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberClass -///\brief Gets the type class of the specified member. -///\param member_num - IN: Zero-based index of the member -///\return Type class of the member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberClass +///\brief Gets the type class of the specified member. +///\param member_num - IN: Zero-based index of the member +///\return Type class of the member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to use H5Tget_member_class instead. - Jul, 2005 +// Modified to use H5Tget_member_class instead. - Jul, 2005 //-------------------------------------------------------------------------- H5T_class_t CompType::getMemberClass( unsigned member_num ) const { @@ -191,7 +191,7 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const if( member_class == H5T_NO_CLASS ) { throw DataTypeIException("CompType::getMemberClass", - "H5Tget_member_class returns H5T_NO_CLASS"); + "H5Tget_member_class returns H5T_NO_CLASS"); } return(member_class); } @@ -215,41 +215,41 @@ hid_t CompType::p_get_member_type(unsigned member_num) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberDataType -///\brief Returns the generic datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberDataType +///\brief Returns the generic datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType CompType::getMemberDataType( unsigned member_num ) const { try { - DataType datatype; - f_DataType_setId(&datatype, p_get_member_type(member_num)); - return(datatype); + DataType datatype; + f_DataType_setId(&datatype, p_get_member_type(member_num)); + return(datatype); } catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); + throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberArrayType -///\brief Returns the array datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberArrayType +///\brief Returns the array datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType CompType::getMemberArrayType( unsigned member_num ) const { try { - ArrayType arraytype(p_get_member_type(member_num)); - f_DataType_setId(&arraytype, p_get_member_type(member_num)); - return(arraytype); + ArrayType arraytype(p_get_member_type(member_num)); + f_DataType_setId(&arraytype, p_get_member_type(member_num)); + return(arraytype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); @@ -257,19 +257,19 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberCompType -///\brief Returns the compound datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberCompType +///\brief Returns the compound datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType CompType::getMemberCompType( unsigned member_num ) const { try { CompType comptype(p_get_member_type(member_num)); - f_DataType_setId(&comptype, p_get_member_type(member_num)); + f_DataType_setId(&comptype, p_get_member_type(member_num)); return(comptype); } catch (DataTypeIException& E) { @@ -278,19 +278,19 @@ CompType CompType::getMemberCompType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberEnumType -///\brief Returns the enumeration datatype of the specified member in -/// this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberEnumType +///\brief Returns the enumeration datatype of the specified member in +/// this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CompType::getMemberEnumType( unsigned member_num ) const { try { EnumType enumtype(p_get_member_type(member_num)); - f_DataType_setId(&enumtype, p_get_member_type(member_num)); + f_DataType_setId(&enumtype, p_get_member_type(member_num)); return(enumtype); } catch (DataTypeIException& E) { @@ -299,19 +299,19 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIntType -///\brief Returns the integer datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberIntType +///\brief Returns the integer datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CompType::getMemberIntType( unsigned member_num ) const { try { IntType inttype(p_get_member_type(member_num)); - f_DataType_setId(&inttype, p_get_member_type(member_num)); + f_DataType_setId(&inttype, p_get_member_type(member_num)); return(inttype); } catch (DataTypeIException& E) { @@ -320,19 +320,19 @@ IntType CompType::getMemberIntType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberFloatType -///\brief Returns the floating-point datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberFloatType +///\brief Returns the floating-point datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CompType::getMemberFloatType( unsigned member_num ) const { try { FloatType floatype(p_get_member_type(member_num)); - f_DataType_setId(&floatype, p_get_member_type(member_num)); + f_DataType_setId(&floatype, p_get_member_type(member_num)); return(floatype); } catch (DataTypeIException& E) { @@ -341,19 +341,19 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberStrType -///\brief Returns the string datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberStrType +///\brief Returns the string datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType CompType::getMemberStrType( unsigned member_num ) const { try { StrType strtype(p_get_member_type(member_num)); - f_DataType_setId(&strtype, p_get_member_type(member_num)); + f_DataType_setId(&strtype, p_get_member_type(member_num)); return(strtype); } catch (DataTypeIException& E) { @@ -362,19 +362,19 @@ StrType CompType::getMemberStrType( unsigned member_num ) const } //-------------------------------------------------------------------------- -// Function: CompType::getMemberVarLenType -///\brief Returns the variable length datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberVarLenType +///\brief Returns the variable length datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType CompType::getMemberVarLenType( unsigned member_num ) const { try { VarLenType varlentype(p_get_member_type(member_num)); - f_DataType_setId(&varlentype, p_get_member_type(member_num)); + f_DataType_setId(&varlentype, p_get_member_type(member_num)); return(varlentype); } catch (DataTypeIException& E) { @@ -416,13 +416,13 @@ void CompType::getMemberType( unsigned member_num, StrType& strtype ) const */ //-------------------------------------------------------------------------- -// Function: CompType::insertMember -///\brief Inserts a new member to this compound datatype. -///\param name - IN: Name of the new member -///\param offset - IN: Offset in memory structure of the field to insert -///\param new_member - IN: New member to be inserted -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::insertMember +///\brief Inserts a new member to this compound datatype. +///\param name - IN: Name of the new member +///\param offset - IN: Offset in memory structure of the field to insert +///\param new_member - IN: New member to be inserted +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CompType::insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const { @@ -441,11 +441,11 @@ void CompType::insertMember( const H5std_string& name, size_t offset, const Data } //-------------------------------------------------------------------------- -// Function: CompType::pack -///\brief Recursively removes padding from within a compound datatype. +// Function: CompType::pack +///\brief Recursively removes padding from within a compound datatype. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CompType::pack() const { @@ -458,13 +458,13 @@ void CompType::pack() const } //-------------------------------------------------------------------------- -// Function: CompType::setSize -///\brief Sets the total size for this compound datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException +// Function: CompType::setSize +///\brief Sets the total size for this compound datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException // Note -// H5Tset_size works on atom datatypes and compound datatypes only -// Programmer Binh-Minh Ribler - 2014 +// H5Tset_size works on atom datatypes and compound datatypes only +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- void CompType::setSize(size_t size) const { @@ -472,7 +472,7 @@ void CompType::setSize(size_t size) const herr_t ret_value = H5Tset_size(id, size); if (ret_value < 0) { - throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); + throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); } } diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index b651523..581ec79 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -25,90 +25,90 @@ namespace H5 { */ class H5_DLLCPP CompType : public DataType { public: - // Default constructor - CompType(); + // Default constructor + CompType(); - // Creates a compound datatype using an existing id - CompType( const hid_t existing_id ); + // Creates a compound datatype using an existing id + CompType( const hid_t existing_id ); - // Creates a new compound datatype, given the type's size - CompType( size_t size ); // H5Tcreate + // Creates a new compound datatype, given the type's size + CompType( size_t size ); // H5Tcreate - // Gets the compound datatype of the specified dataset - CompType( const DataSet& dataset ); // H5Dget_type + // Gets the compound datatype of the specified dataset + CompType( const DataSet& dataset ); // H5Dget_type - // Copy constructor - makes a copy of original object - CompType( const CompType& original ); + // Copy constructor - makes a copy of original object + CompType( const CompType& original ); - // Returns the type class of the specified member of this compound - // datatype. It provides to the user a way of knowing what type - // to create another datatype of the same class - H5T_class_t getMemberClass( unsigned member_num ) const; + // Returns the type class of the specified member of this compound + // datatype. It provides to the user a way of knowing what type + // to create another datatype of the same class + H5T_class_t getMemberClass( unsigned member_num ) const; - // Returns the index of a member in this compound data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this compound data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the offset of a member of this compound datatype. - size_t getMemberOffset( unsigned memb_no ) const; + // Returns the offset of a member of this compound datatype. + size_t getMemberOffset( unsigned memb_no ) const; - // Returns the name of a member of this compound datatype. - H5std_string getMemberName( unsigned member_num ) const; + // Returns the name of a member of this compound datatype. + H5std_string getMemberName( unsigned member_num ) const; - // Returns the generic datatype of the specified member in - // this compound datatype. - DataType getMemberDataType( unsigned member_num ) const; + // Returns the generic datatype of the specified member in + // this compound datatype. + DataType getMemberDataType( unsigned member_num ) const; - // Returns the array datatype of the specified member in - // this compound datatype. - ArrayType getMemberArrayType( unsigned member_num ) const; + // Returns the array datatype of the specified member in + // this compound datatype. + ArrayType getMemberArrayType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in - // this compound datatype. - CompType getMemberCompType( unsigned member_num ) const; + // Returns the compound datatype of the specified member in + // this compound datatype. + CompType getMemberCompType( unsigned member_num ) const; - // Returns the enumeration datatype of the specified member in - // this compound datatype. - EnumType getMemberEnumType( unsigned member_num ) const; + // Returns the enumeration datatype of the specified member in + // this compound datatype. + EnumType getMemberEnumType( unsigned member_num ) const; - // Returns the integer datatype of the specified member in - // this compound datatype. - IntType getMemberIntType( unsigned member_num ) const; + // Returns the integer datatype of the specified member in + // this compound datatype. + IntType getMemberIntType( unsigned member_num ) const; - // Returns the floating-point datatype of the specified member in - // this compound datatype. - FloatType getMemberFloatType( unsigned member_num ) const; + // Returns the floating-point datatype of the specified member in + // this compound datatype. + FloatType getMemberFloatType( unsigned member_num ) const; - // Returns the string datatype of the specified member in - // this compound datatype. - StrType getMemberStrType( unsigned member_num ) const; + // Returns the string datatype of the specified member in + // this compound datatype. + StrType getMemberStrType( unsigned member_num ) const; - // Returns the variable length datatype of the specified member in - // this compound datatype. - VarLenType getMemberVarLenType( unsigned member_num ) const; + // Returns the variable length datatype of the specified member in + // this compound datatype. + VarLenType getMemberVarLenType( unsigned member_num ) const; - // Returns the number of members in this compound datatype. - int getNmembers() const; + // Returns the number of members in this compound datatype. + int getNmembers() const; - // Adds a new member to this compound datatype. - void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const; + // Adds a new member to this compound datatype. + void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const; - // Recursively removes padding from within this compound datatype. - void pack() const; + // Recursively removes padding from within this compound datatype. + void pack() const; - // Sets the total size for this compound datatype. - void setSize(size_t size) const; + // Sets the total size for this compound datatype. + void setSize(size_t size) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("CompType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("CompType"); } - // Noop destructor. - virtual ~CompType(); + // Noop destructor. + virtual ~CompType(); private: - // Contains common code that is used by the member functions - // getMemberXxxType - hid_t p_get_member_type(unsigned member_num) const; + // Contains common code that is used by the member functions + // getMemberXxxType + hid_t p_get_member_type(unsigned member_num) const; }; } #endif // __H5CompType_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 2420586..b0bc9d7 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -67,34 +67,34 @@ *
*/ -/// This example shows how to create datasets. +/// This example shows how to create datasets. ///\par ///\example create.cpp ///\par -/// This example shows how to write datasets. +/// This example shows how to write datasets. ///\example writedata.cpp ///\par -/// This example shows how to read datasets. +/// This example shows how to read datasets. ///\example readdata.cpp ///\par -/// This example shows how to create a compound datatype, -/// write an array which has the compound datatype to the file, -/// and read back fields' subsets. +/// This example shows how to create a compound datatype, +/// write an array which has the compound datatype to the file, +/// and read back fields' subsets. ///\example compound.cpp ///\par -/// This example shows how to work with extendible datasets. +/// This example shows how to work with extendible datasets. ///\example extend_ds.cpp ///\par -/// This example shows how to read data from a chunked dataset. +/// This example shows how to read data from a chunked dataset. ///\example chunks.cpp ///\par -/// This example shows how to work with groups. +/// This example shows how to work with groups. ///\example h5group.cpp #endif // __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 608ec5f..cc2e6b4 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -38,7 +38,7 @@ #include "H5File.h" #include "H5Attribute.h" #include "H5DataSet.h" -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree namespace H5 { #ifndef H5_NO_STD @@ -47,23 +47,23 @@ namespace H5 { #endif // H5_NO_STD //-------------------------------------------------------------------------- -// Function: DataSet default constructor -///\brief Default constructor: creates a stub DataSet. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet default constructor +///\brief Default constructor: creates a stub DataSet. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataSet overloaded constructor -///\brief Creates an DataSet object using the id of an existing dataset. -///\param existing_id - IN: Id of an existing dataset -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet overloaded constructor +///\brief Creates an DataSet object using the id of an existing dataset. +///\param existing_id - IN: Id of an existing dataset +// Programmer Binh-Minh Ribler - 2000 // Description -// incRefCount() is needed here to prevent the id from being closed -// prematurely. That is, when application uses the id of an -// existing DataSet object to create another DataSet object. So, -// when one of those objects is deleted, the id will be closed if -// the reference counter is only 1. +// incRefCount() is needed here to prevent the id from being closed +// prematurely. That is, when application uses the id of an +// existing DataSet object to create another DataSet object. So, +// when one of those objects is deleted, the id will be closed if +// the reference counter is only 1. //-------------------------------------------------------------------------- DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existing_id) { @@ -71,10 +71,10 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin } //-------------------------------------------------------------------------- -// Function: DataSet copy constructor -///\brief Copy constructor: makes a copy of the original DataSet object. -///\param original - IN: DataSet instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet copy constructor +///\brief Copy constructor: makes a copy of the original DataSet object. +///\param original - IN: DataSet instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(original.id) { @@ -82,21 +82,21 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 location, creates a -/// DataSet object -///\param loc - IN: Dataset reference object is in or location of -/// object that the dataset is located within. -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::DataSetIException +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 location, creates a +/// DataSet object +///\param loc - IN: Dataset reference object is in or location of +/// object that the dataset is located within. +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::DataSetIException ///\par Description -/// \c loc can be DataSet, Group, H5File, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c loc can be DataSet, Group, H5File, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { @@ -104,17 +104,17 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type) : } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 attribute, creates a -/// DataSet object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 attribute, creates a +/// DataSet object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { @@ -122,11 +122,11 @@ DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type) : } //-------------------------------------------------------------------------- -// Function: DataSet::getSpace -///\brief Gets a copy of the dataspace of this dataset. -///\return DataSpace instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpace +///\brief Gets a copy of the dataspace of this dataset. +///\return DataSpace instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace DataSet::getSpace() const { @@ -159,11 +159,11 @@ hid_t DataSet::p_get_type() const } //-------------------------------------------------------------------------- -// Function: DataSet::getCreatePlist -///\brief Gets the dataset creation property list. -///\return DSetCreatPropList instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getCreatePlist +///\brief Gets the dataset creation property list. +///\return DSetCreatPropList instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList DataSet::getCreatePlist() const { @@ -180,13 +180,13 @@ DSetCreatPropList DataSet::getCreatePlist() const } //-------------------------------------------------------------------------- -// Function: DataSet::getStorageSize -///\brief Returns the amount of storage required for a dataset. -///\return Size of the storage or 0, for no data -///\exception H5::DataSetIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: DataSet::getStorageSize +///\brief Returns the amount of storage required for a dataset. +///\return Size of the storage or 0, for no data +///\exception H5::DataSetIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t DataSet::getStorageSize() const { @@ -195,11 +195,11 @@ hsize_t DataSet::getStorageSize() const } //-------------------------------------------------------------------------- -// Function: DataSet::getInMemDataSize -///\brief Gets the size in memory of the dataset's data. -///\return Size of data (in memory) -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: DataSet::getInMemDataSize +///\brief Gets the size in memory of the dataset's data. +///\return Size of data (in memory) +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t DataSet::getInMemDataSize() const { @@ -209,7 +209,7 @@ size_t DataSet::getInMemDataSize() const hid_t mem_type_id = H5Dget_type(id); if( mem_type_id < 0 ) { - throw DataSetIException(func, "H5Dget_type failed"); + throw DataSetIException(func, "H5Dget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -217,22 +217,22 @@ size_t DataSet::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw DataSetIException(func, "H5Tget_native_type failed"); + throw DataSetIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw DataSetIException(func, "H5Tget_size failed"); + throw DataSetIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this dataset. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the dataset by first getting its dataspace, @@ -240,18 +240,18 @@ size_t DataSet::getInMemDataSize() const hid_t space_id = H5Dget_space(id); if (space_id < 0) { - throw DataSetIException(func, "H5Dget_space failed"); + throw DataSetIException(func, "H5Dget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); + throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -260,11 +260,11 @@ size_t DataSet::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: DataSet::getOffset -///\brief Returns the address of this dataset in the file. -///\return Address of dataset -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getOffset +///\brief Returns the address of this dataset in the file. +///\return Address of dataset +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- haddr_t DataSet::getOffset() const { @@ -279,11 +279,11 @@ haddr_t DataSet::getOffset() const } //-------------------------------------------------------------------------- -// Function: DataSet::getSpaceStatus -///\brief Determines whether space has been allocated for a dataset. -///\param status - OUT: Space allocation status -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpaceStatus +///\brief Determines whether space has been allocated for a dataset. +///\param status - OUT: Space allocation status +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::getSpaceStatus(H5D_space_status_t& status) const { @@ -295,15 +295,15 @@ void DataSet::getSpaceStatus(H5D_space_status_t& status) const } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -///\brief Returns the number of bytes required to store VL data. -///\param type - IN: Datatype, which is the datatype for the buffer -///\param space - IN: Selection for the memory buffer -///\return Amount of storage -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +///\brief Returns the number of bytes required to store VL data. +///\param type - IN: Datatype, which is the datatype for the buffer +///\param space - IN: Selection for the memory buffer +///\return Amount of storage +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const { @@ -322,17 +322,17 @@ hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) c } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Return Amount of storage -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Return Amount of storage +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const //{ @@ -340,15 +340,15 @@ hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) c //} //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ) { @@ -365,18 +365,18 @@ void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DS } //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //\parDescription -// This function has better prototype for the users than the -// other, which might be removed at some point. BMR - 2006/12/20 +// This function has better prototype for the users than the +// other, which might be removed at some point. BMR - 2006/12/20 //-------------------------------------------------------------------------- void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist) { @@ -393,19 +393,19 @@ void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& spac } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief Reads raw data from the specified dataset. -///\param buf - IN: Buffer for read data -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::read +///\brief Reads raw data from the specified dataset. +///\param buf - IN: Buffer for read data +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function reads raw data from this dataset into the -/// buffer \a buf, converting from file datatype and dataspace -/// to memory datatype \a mem_type and dataspace \a mem_space. -// Programmer Binh-Minh Ribler - 2000 +/// This function reads raw data from this dataset into the +/// buffer \a buf, converting from file datatype and dataspace +/// to memory datatype \a mem_type and dataspace \a mem_space. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { @@ -423,23 +423,23 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -///\param strg - IN: Buffer for read data string -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::read +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +///\param strg - IN: Buffer for read data string +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Follow the change to Attribute::read and use the following -// private functions to read datasets with fixed- and -// variable-length string: -// DataSet::p_read_fixed_len and -// DataSet::p_read_variable_len +// Jul 2009 +// Follow the change to Attribute::read and use the following +// private functions to read datasets with fixed- and +// variable-length string: +// DataSet::p_read_fixed_len and +// DataSet::p_read_variable_len //-------------------------------------------------------------------------- void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { @@ -468,20 +468,20 @@ void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief Writes raw data from an application buffer to a dataset. -///\param buf - IN: Buffer containing data to be written -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::write +///\brief Writes raw data from an application buffer to a dataset. +///\param buf - IN: Buffer containing data to be written +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function writes raw data from an application buffer -/// \a buf to a dataset, converting from memory datatype -/// \a mem_type and dataspace \a mem_space to file datatype -/// and dataspace. -// Programmer Binh-Minh Ribler - 2000 +/// This function writes raw data from an application buffer +/// \a buf to a dataset, converting from memory datatype +/// \a mem_type and dataspace \a mem_space to file datatype +/// and dataspace. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { @@ -499,14 +499,14 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::write +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Modified to pass the buffer into H5Dwrite properly depending -// whether the dataset has variable- or fixed-length string. +// Jul 2009 +// Modified to pass the buffer into H5Dwrite properly depending +// whether the dataset has variable- or fixed-length string. //-------------------------------------------------------------------------- void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { @@ -546,21 +546,21 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D } //-------------------------------------------------------------------------- -// Function: DataSet::iterateElems -///\brief Iterates over all selected elements in a dataspace. -///\param buf - IN/OUT: Pointer to the buffer in memory containing the -/// elements to iterate over -///\param type - IN: Datatype for the elements stored in \a buf -///\param space - IN: Dataspace for \a buf. Also contains the selection -/// to iterate over. -///\param op - IN: Function pointer to the routine to be called for -/// each element in \a buf iterated over -///\param op_data - IN/OUT: Pointer to any user-defined data associated -/// with the operation -///\exception H5::DataSetIException -///\note This function may not work correctly yet - it's still -/// under development. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::iterateElems +///\brief Iterates over all selected elements in a dataspace. +///\param buf - IN/OUT: Pointer to the buffer in memory containing the +/// elements to iterate over +///\param type - IN: Datatype for the elements stored in \a buf +///\param space - IN: Dataspace for \a buf. Also contains the selection +/// to iterate over. +///\param op - IN: Function pointer to the routine to be called for +/// each element in \a buf iterated over +///\param op_data - IN/OUT: Pointer to any user-defined data associated +/// with the operation +///\exception H5::DataSetIException +///\note This function may not work correctly yet - it's still +/// under development. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data ) { @@ -577,16 +577,16 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa } //-------------------------------------------------------------------------- -// Function: DataSet::extend -///\brief Extends a dataset with unlimited dimension. -///\param size - IN: Array containing the new magnitude of each dimension -///\exception H5::DataSetIException +// Function: DataSet::extend +///\brief Extends a dataset with unlimited dimension. +///\param size - IN: Array containing the new magnitude of each dimension +///\exception H5::DataSetIException ///\par Description -/// For more information, please see the Description section in -/// C layer Reference Manual at: +/// For more information, please see the Description section in +/// C layer Reference Manual at: ///\par /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend( const hsize_t* size ) const { @@ -596,15 +596,15 @@ void DataSet::extend( const hsize_t* size ) const } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with a value. -///\param fill - IN: Pointer to fill value to use - default NULL -///\param fill_type - IN: Datatype of the fill value -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2014 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with a value. +///\param fill - IN: Pointer to fill value to use - default NULL +///\param fill_type - IN: Datatype of the fill value +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2014 // Modification //-------------------------------------------------------------------------- void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const @@ -615,26 +615,26 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, herr_t ret_value = H5Dfill(fill, fill_type_id, buf, buf_type_id, space_id); if( ret_value < 0 ) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param fill - IN: Pointer to fill value to use - default NULL -// Param fill_type - IN: Datatype of the fill value -// Param buf - IN/OUT: Memory buffer to fill selection within -// Param buf_type - IN: Datatype of the elements in buffer -// Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param fill - IN: Pointer to fill value to use - default NULL +// Param fill_type - IN: Datatype of the fill value +// Param buf - IN/OUT: Memory buffer to fill selection within +// Param buf_type - IN: Datatype of the elements in buffer +// Param space - IN: Dataspace describing memory buffer & containing selection to use +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space) //{ @@ -642,15 +642,15 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, //} //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with 0. -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with 0. +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const { @@ -659,24 +659,24 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s herr_t ret_value = H5Dfill(NULL, buf_type_id, buf, buf_type_id, space_id); if( ret_value < 0 ) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- // Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. // Param buf - IN/OUT: Memory buffer to fill selection within // Param buf_type - IN: Datatype of the elements in buffer // Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException +// Exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) //{ @@ -685,8 +685,8 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- // Function: DataSet::getId -///\brief Get the id of this dataset. -///\return DataSet identifier +///\brief Get the id of this dataset. +///\return DataSet identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDs and Attribute are moved out of H5Object. In @@ -700,15 +700,15 @@ hid_t DataSet::getId() const } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from a dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from a dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -720,33 +720,33 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id // If there is data, allocate buffer and read it. if (data_size > 0) { - char *strg_C = new char [data_size+1]; - HDmemset(strg_C, 0, data_size+1); // clear buffer + char *strg_C = new char [data_size+1]; + HDmemset(strg_C, 0, data_size+1); // clear buffer - herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); + herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); - if( ret_value < 0 ) - { - delete []strg_C; // de-allocate for fixed-len string - throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); - } + if( ret_value < 0 ) + { + delete []strg_C; // de-allocate for fixed-len string + throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); + } - // Get string from the C char* and release resource allocated locally - strg = strg_C; - delete []strg_C; + // Get string from the C char* and release resource allocated locally + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -758,7 +758,7 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space if( ret_value < 0 ) { - throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); + throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); } // Get string from the C char* and release resource allocated by C API @@ -810,43 +810,43 @@ void f_PropList_setId(PropList* plist, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSet::close -///\brief Closes this dataset. +// Function: DataSet::close +///\brief Closes this dataset. /// -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSet::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Dclose( id ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::close", "H5Dclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Dclose( id ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::close", "H5Dclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSet destructor -///\brief Properly terminates access to this dataset. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet destructor +///\brief Properly terminates access to this dataset. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSet::~DataSet() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; + cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index e92118d..a424b21 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -29,82 +29,82 @@ namespace H5 { class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: - // Close this dataset. - virtual void close(); + // Close this dataset. + virtual void close(); - // Extends the dataset with unlimited dimension. - void extend( const hsize_t* size ) const; + // Extends the dataset with unlimited dimension. + void extend( const hsize_t* size ) const; - // Fills a selection in memory with a value - void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with a value + void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Fills a selection in memory with zero - void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with zero + void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Gets the creation property list of this dataset. - DSetCreatPropList getCreatePlist() const; + // Gets the creation property list of this dataset. + DSetCreatPropList getCreatePlist() const; - // Returns the address of this dataset in the file. - haddr_t getOffset() const; + // Returns the address of this dataset in the file. + haddr_t getOffset() const; - // Gets the dataspace of this dataset. - virtual DataSpace getSpace() const; + // Gets the dataspace of this dataset. + virtual DataSpace getSpace() const; - // Determines whether space has been allocated for a dataset. - void getSpaceStatus(H5D_space_status_t& status) const; + // Determines whether space has been allocated for a dataset. + void getSpaceStatus(H5D_space_status_t& status) const; - // Returns the amount of storage size required for this dataset. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this dataset. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Returns the number of bytes required to store VL data. - hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; - //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 + // Returns the number of bytes required to store VL data. + hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; + //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 - // Reclaims VL datatype memory buffers. - static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); - static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); + // Reclaims VL datatype memory buffers. + static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); + static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); - // Reads the data of this dataset and stores it in the provided buffer. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + // Reads the data of this dataset and stores it in the provided buffer. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - // Writes the buffered data to this dataset. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + // Writes the buffered data to this dataset. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet + // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL ); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSet"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSet"); } - // Creates a dataset by way of dereference. - DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + // Creates a dataset by way of dereference. + DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - // Default constructor. - DataSet(); + // Default constructor. + DataSet(); - // Copy constructor. - DataSet( const DataSet& original ); + // Copy constructor. + DataSet( const DataSet& original ); - // Creates a copy of an existing DataSet using its id. - DataSet(const hid_t existing_id); + // Creates a copy of an existing DataSet using its id. + DataSet(const hid_t existing_id); // Gets the dataset id. virtual hid_t getId() const; - // Destructor: properly terminates access to this dataset. - virtual ~DataSet(); + // Destructor: properly terminates access to this dataset. + virtual ~DataSet(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -113,20 +113,20 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataset id + hid_t id; // HDF5 dataset id // This function contains the common code that is used by // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types - virtual hid_t p_get_type() const; + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this dataset. - void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + // Reads variable or fixed len strings from this dataset. + void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - // Friend function to set DataSet id. For library use only. - friend void f_DataSet_setId(DataSet* dset, hid_t new_id); + // Friend function to set DataSet id. For library use only. + friend void f_DataSet_setId(DataSet* dset, hid_t new_id); }; } diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 1b18300..4869a0c 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -40,14 +40,14 @@ namespace H5 { DataSpace* DataSpace::ALL_ = 0; //-------------------------------------------------------------------------- -// Function: DataSpace::getConstant -// Creates a DataSpace object representing the HDF5 constant -// H5S_ALL, pointed to by DataSpace::ALL_ -// Exception H5::DataSpaceIException +// Function: DataSpace::getConstant +// Creates a DataSpace object representing the HDF5 constant +// H5S_ALL, pointed to by DataSpace::ALL_ +// Exception H5::DataSpaceIException // Description -// If DataSpace::ALL_ already points to an allocated object, throw -// a DataSpaceIException. This scenario should not happen. -// Programmer Binh-Minh Ribler - 2015 +// If DataSpace::ALL_ already points to an allocated object, throw +// a DataSpaceIException. This scenario should not happen. +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- DataSpace* DataSpace::getConstant() { @@ -80,20 +80,20 @@ void DataSpace::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataspace. +// Purpose Constant for default dataspace. //-------------------------------------------------------------------------- const DataSpace& DataSpace::ALL = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace constructor -///\brief Creates a new dataspace given a dataspace type. -///\param type - IN: Type of the dataspace to be created, which -/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; -/// default to \c H5S_SCALAR. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace constructor +///\brief Creates a new dataspace given a dataspace type. +///\param type - IN: Type of the dataspace to be created, which +/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; +/// default to \c H5S_SCALAR. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(H5S_class_t type) : IdComponent() { @@ -105,13 +105,13 @@ DataSpace::DataSpace(H5S_class_t type) : IdComponent() } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a new simple dataspace. -///\param rank - IN: Number of dimensions of dataspace. -///\param dims - IN: An array of the size of each dimension. -///\param maxdims - IN: An array of the maximum size of each dimension. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a new simple dataspace. +///\param rank - IN: Number of dimensions of dataspace. +///\param dims - IN: An array of the size of each dimension. +///\param maxdims - IN: An array of the maximum size of each dimension. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() { @@ -123,12 +123,12 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a DataSpace object using the id of an existing -/// dataspace. -///\param existing_id - IN: Id of an existing dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a DataSpace object using the id of an existing +/// dataspace. +///\param existing_id - IN: Id of an existing dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) { @@ -136,10 +136,10 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataSpace copy constructor -///\brief Copy constructor: makes a copy of the original DataSpace object. -///\param original - IN: DataSpace object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace copy constructor +///\brief Copy constructor: makes a copy of the original DataSpace object. +///\param original - IN: DataSpace object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) { @@ -147,16 +147,16 @@ DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: DataSpace::copy -///\brief Makes a copy of an existing dataspace. -///\param like_space - IN: Dataspace to be copied -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::copy +///\brief Makes a copy of an existing dataspace. +///\param like_space - IN: Dataspace to be copied +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void DataSpace::copy( const DataSpace& like_space ) { @@ -178,15 +178,15 @@ void DataSpace::copy( const DataSpace& like_space ) } //-------------------------------------------------------------------------- -// Function: DataSpace::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing dataspace -///\return Reference to DataSpace instance -///\exception H5::DataSpaceIException +// Function: DataSpace::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing dataspace +///\return Reference to DataSpace instance +///\exception H5::DataSpaceIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace& DataSpace::operator=( const DataSpace& rhs ) { @@ -196,12 +196,12 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) } //-------------------------------------------------------------------------- -// Function: DataSpace::isSimple -///\brief Determines whether this dataspace is a simple dataspace. -///\return \c true if the dataspace is a simple dataspace, and \c false, -/// otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::isSimple +///\brief Determines whether this dataspace is a simple dataspace. +///\return \c true if the dataspace is a simple dataspace, and \c false, +/// otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::isSimple () const { @@ -213,21 +213,21 @@ bool DataSpace::isSimple () const else { throw DataSpaceIException("DataSpace::isSimple", - "H5Sis_simple returns negative value"); + "H5Sis_simple returns negative value"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::offsetSimple -///\brief Sets the offset of this simple dataspace. -///\param offset - IN: Offset to position the selection at -///\exception H5::DataSpaceIException +// Function: DataSpace::offsetSimple +///\brief Sets the offset of this simple dataspace. +///\param offset - IN: Offset to position the selection at +///\exception H5::DataSpaceIException ///\par Description -/// This function creates an offset for the selection within -/// an extent, allowing the same shaped selection to be moved -/// to different locations within a dataspace without requiring -/// it to be re-defined. -// Programmer Binh-Minh Ribler - 2000 +/// This function creates an offset for the selection within +/// an extent, allowing the same shaped selection to be moved +/// to different locations within a dataspace without requiring +/// it to be re-defined. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::offsetSimple ( const hssize_t* offset ) const { @@ -239,14 +239,14 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentDims -///\brief Retrieves dataspace dimension size and maximum size. -///\param dims - IN: Name of the new member -///\param maxdims - IN: Pointer to the value of the new member -///\return Number of dimensions, the same value as returned by -/// \c DataSpace::getSimpleExtentNdims() -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentDims +///\brief Retrieves dataspace dimension size and maximum size. +///\param dims - IN: Name of the new member +///\param maxdims - IN: Pointer to the value of the new member +///\return Number of dimensions, the same value as returned by +/// \c DataSpace::getSimpleExtentNdims() +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const { @@ -254,17 +254,17 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const if( ndims < 0 ) { throw DataSpaceIException("DataSpace::getSimpleExtentDims", - "H5Sget_simple_extent_dims returns negative number of dimensions"); + "H5Sget_simple_extent_dims returns negative number of dimensions"); } return( ndims ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNdims -///\brief Returns the dimensionality of a dataspace. -///\return Number of dimensions -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentNdims +///\brief Returns the dimensionality of a dataspace. +///\return Number of dimensions +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DataSpace::getSimpleExtentNdims () const { @@ -272,21 +272,21 @@ int DataSpace::getSimpleExtentNdims () const if( ndims < 0 ) { throw DataSpaceIException("DataSpace::getSimpleExtentNdims", - "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); + "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); } return( ndims ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNpoints -///\brief Returns the number of elements in a dataspace. -///\return Number of elements -///\exception H5::DataSpaceIException +// Function: DataSpace::getSimpleExtentNpoints +///\brief Returns the number of elements in a dataspace. +///\return Number of elements +///\exception H5::DataSpaceIException // Modification -// 12/05/00: due to C API change -// return type hssize_t vs. hsize_t -// num_elements = -1 when failure occurs vs. 0 -// Programmer Binh-Minh Ribler - 2000 +// 12/05/00: due to C API change +// return type hssize_t vs. hsize_t +// num_elements = -1 when failure occurs vs. 0 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSimpleExtentNpoints () const { @@ -297,16 +297,16 @@ hssize_t DataSpace::getSimpleExtentNpoints () const else { throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", - "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); + "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentType -///\brief Returns the current class of a dataspace. -///\return Class of the dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentType +///\brief Returns the current class of a dataspace. +///\return Class of the dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5S_class_t DataSpace::getSimpleExtentType () const { @@ -314,19 +314,19 @@ H5S_class_t DataSpace::getSimpleExtentType () const if( class_name == H5S_NO_CLASS ) { throw DataSpaceIException("DataSpace::getSimpleExtentType", - "H5Sget_simple_extent_type returns H5S_NO_CLASS"); + "H5Sget_simple_extent_type returns H5S_NO_CLASS"); } return( class_name ); } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -///\brief Copies the extent of a dataspace. -///\param dest_space - IN: Dataspace to copy from -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +///\brief Copies the extent of a dataspace. +///\param dest_space - IN: Dataspace to copy from +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void DataSpace::extentCopy (const DataSpace& dest_space) const { @@ -339,17 +339,17 @@ void DataSpace::extentCopy (const DataSpace& dest_space) const } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const. This wrapper will be removed in future release. -// Param dest_space - IN: Dataspace to copy from -// Exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const. This wrapper will be removed in future release. +// Param dest_space - IN: Dataspace to copy from +// Exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSpace::extentCopy( DataSpace& dest_space ) const //{ @@ -357,13 +357,13 @@ void DataSpace::extentCopy (const DataSpace& dest_space) const //} //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentSimple -///\brief Sets or resets the size of an existing dataspace. -///\param rank - IN: Rank of the dataspace -///\param current_size - IN: Array containing current size of dataspace -///\param maximum_size - IN: Array containing maximum size of dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::setExtentSimple +///\brief Sets or resets the size of an existing dataspace. +///\param rank - IN: Rank of the dataspace +///\param current_size - IN: Array containing current size of dataspace +///\param maximum_size - IN: Array containing maximum size of dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const { @@ -376,11 +376,11 @@ void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hs } //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentNone -///\brief Removes the extent from a dataspace. +// Function: DataSpace::setExtentNone +///\brief Removes the extent from a dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::setExtentNone () const { @@ -392,11 +392,11 @@ void DataSpace::setExtentNone () const } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectNpoints -///\brief Returns the number of elements in a dataspace selection. -///\return Number of elements -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectNpoints +///\brief Returns the number of elements in a dataspace selection. +///\return Number of elements +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectNpoints () const { @@ -404,17 +404,17 @@ hssize_t DataSpace::getSelectNpoints () const if( num_elements < 0 ) { throw DataSpaceIException("DataSpace::getSelectNpoints", - "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); + "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); } return( num_elements ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperNblocks -///\brief Returns number of hyperslab blocks. -///\return Number of hyperslab blocks -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperNblocks +///\brief Returns number of hyperslab blocks. +///\return Number of hyperslab blocks +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectHyperNblocks () const { @@ -422,19 +422,19 @@ hssize_t DataSpace::getSelectHyperNblocks () const if( num_blocks < 0 ) { throw DataSpaceIException("DataSpace::getSelectHyperNblocks", - "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); + "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); } return( num_blocks ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperBlocklist -///\brief Gets the list of hyperslab blocks currently selected -///\param startblock - IN: Hyperslab block to start with -///\param numblocks - IN: Number of hyperslab blocks to get -///\param buf - IN: List of hyperslab blocks selected -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperBlocklist +///\brief Gets the list of hyperslab blocks currently selected +///\param startblock - IN: Hyperslab block to start with +///\param numblocks - IN: Number of hyperslab blocks to get +///\param buf - IN: List of hyperslab blocks selected +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const { @@ -443,16 +443,16 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", - "H5Sget_select_hyper_blocklist failed"); + "H5Sget_select_hyper_blocklist failed"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemNpoints -///\brief Returns the number of element points in the current selection. -///\return Number of element points -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectElemNpoints +///\brief Returns the number of element points in the current selection. +///\return Number of element points +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectElemNpoints () const { @@ -460,23 +460,23 @@ hssize_t DataSpace::getSelectElemNpoints () const if( num_points < 0 ) { throw DataSpaceIException("DataSpace::getSelectElemNpoints", - "H5Sget_select_elem_npoints failed"); + "H5Sget_select_elem_npoints failed"); } return( num_points ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemPointlist -///\brief Gets the list of element points currently selected -///\param startpoint - IN: Element point to start with -///\param numpoints - IN: Number of element points to get -///\param buf - IN: List of element points selected -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectElemPointlist +///\brief Gets the list of element points currently selected +///\param startpoint - IN: Element point to start with +///\param numpoints - IN: Number of element points to get +///\param buf - IN: List of element points selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const { @@ -485,22 +485,22 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::getSelectElemPointlist", - "H5Sget_select_elem_pointlist failed"); + "H5Sget_select_elem_pointlist failed"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectBounds -///\brief Gets the bounding box containing the current selection. -///\param start - IN: Starting coordinates of the bounding box -///\param end - IN: Ending coordinates of the bounding box, i.e., -/// the coordinates of the diagonally opposite corner -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectBounds +///\brief Gets the bounding box containing the current selection. +///\param start - IN: Starting coordinates of the bounding box +///\param end - IN: Ending coordinates of the bounding box, i.e., +/// the coordinates of the diagonally opposite corner +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const { @@ -508,25 +508,25 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::getSelectBounds", - "H5Sget_select_bounds failed"); + "H5Sget_select_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectElements -///\brief Selects array elements to be included in the selection for -/// this dataspace. -///\param op - IN: Operator specifying how the new selection is to be -/// combined with the existing selection for the dataspace -///\param num_elements - IN: Number of elements to be selected -///\param coord - IN: A 2-dimensional array of 0-based values -/// specifying the coordinates of the elements being selected -///\exception H5::DataSpaceIException +// Function: DataSpace::selectElements +///\brief Selects array elements to be included in the selection for +/// this dataspace. +///\param op - IN: Operator specifying how the new selection is to be +/// combined with the existing selection for the dataspace +///\param num_elements - IN: Number of elements to be selected +///\param coord - IN: A 2-dimensional array of 0-based values +/// specifying the coordinates of the elements being selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const { @@ -535,16 +535,16 @@ void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, co if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::selectElements", - "H5Sselect_elements failed"); + "H5Sselect_elements failed"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectAll -///\brief Selects the entire dataspace. +// Function: DataSpace::selectAll +///\brief Selects the entire dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectAll () const { @@ -556,11 +556,11 @@ void DataSpace::selectAll () const } //-------------------------------------------------------------------------- -// Function: DataSpace::selectNone -///\brief Resets the selection region to include no elements. +// Function: DataSpace::selectNone +///\brief Resets the selection region to include no elements. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectNone () const { @@ -568,18 +568,18 @@ void DataSpace::selectNone () const if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::selectNone", - "H5Sselect_none failed"); + "H5Sselect_none failed"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectValid -///\brief Verifies that the selection is within the extent of the -/// dataspace. -///\return \c true if the selection is within the extent of the -/// dataspace, and \c false, otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::selectValid +///\brief Verifies that the selection is within the extent of the +/// dataspace. +///\return \c true if the selection is within the extent of the +/// dataspace, and \c false, otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::selectValid () const { @@ -591,24 +591,24 @@ bool DataSpace::selectValid () const else { throw DataSpaceIException("DataSpace::selectValid", - "H5Sselect_valid returns negative value"); + "H5Sselect_valid returns negative value"); } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectHyperslab -///\brief Selects a hyperslab region to add to the current selected region. -///\param op - IN: Operation to perform on current selection -///\param count - IN: Number of blocks included in the hyperslab -///\param start - IN: Offset of the start of hyperslab -///\param stride - IN: Hyperslab stride - default to \c NULL -///\param block - IN: Size of block in the hyperslab - default to \c NULL -///\exception H5::DataSpaceIException +// Function: DataSpace::selectHyperslab +///\brief Selects a hyperslab region to add to the current selected region. +///\param op - IN: Operation to perform on current selection +///\param count - IN: Number of blocks included in the hyperslab +///\param start - IN: Offset of the start of hyperslab +///\param stride - IN: Hyperslab stride - default to \c NULL +///\param block - IN: Size of block in the hyperslab - default to \c NULL +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const { @@ -617,16 +617,16 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h if( ret_value < 0 ) { throw DataSpaceIException("DataSpace::selectHyperslab", - "H5Sselect_hyperslab failed"); + "H5Sselect_hyperslab failed"); } } //-------------------------------------------------------------------------- // Function: DataSpace::getId -///\brief Get the id of this dataspace -///\return Dataspace identifier +///\brief Get the id of this dataspace +///\return Dataspace identifier // Modification: -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -666,43 +666,43 @@ void DataSpace::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace::close -///\brief Closes this dataspace. +// Function: DataSpace::close +///\brief Closes this dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSpace::close() { // check if id is a valid hdf5 object id before trying to close it if (p_valid_id(id)) { - herr_t ret_value = H5Sclose(id); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Sclose(id); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSpace destructor -///\brief Properly terminates access to this dataspace. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace destructor +///\brief Properly terminates access to this dataspace. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSpace::~DataSpace() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; + cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 47fe168..a51266b 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -22,126 +22,126 @@ namespace H5 { //! Class DataSpace operates on HDF5 dataspaces. class H5_DLLCPP DataSpace : public IdComponent { public: - ///\brief Default DataSpace objects - static const DataSpace& ALL; + ///\brief Default DataSpace objects + static const DataSpace& ALL; - // Creates a dataspace object given the space type - DataSpace(H5S_class_t type = H5S_SCALAR); + // Creates a dataspace object given the space type + DataSpace(H5S_class_t type = H5S_SCALAR); - // Creates a simple dataspace - DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); + // Creates a simple dataspace + DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); - // Creates a DataSpace object using an existing dataspace id. - DataSpace(const hid_t space_id); + // Creates a DataSpace object using an existing dataspace id. + DataSpace(const hid_t space_id); - // Copy constructor: makes a copy of the original DataSpace object. - DataSpace(const DataSpace& original); + // Copy constructor: makes a copy of the original DataSpace object. + DataSpace(const DataSpace& original); - // Assignment operator - DataSpace& operator=( const DataSpace& rhs ); + // Assignment operator + DataSpace& operator=( const DataSpace& rhs ); - // Closes this dataspace. - virtual void close(); + // Closes this dataspace. + virtual void close(); - // Makes copy of an existing dataspace. - void copy(const DataSpace& like_space); + // Makes copy of an existing dataspace. + void copy(const DataSpace& like_space); - // Copies the extent of this dataspace. - void extentCopy(const DataSpace& dest_space) const; - // removed from 1.8.18 and 1.10.1 - //void extentCopy(DataSpace& dest_space) const; + // Copies the extent of this dataspace. + void extentCopy(const DataSpace& dest_space) const; + // removed from 1.8.18 and 1.10.1 + //void extentCopy(DataSpace& dest_space) const; - // Gets the bounding box containing the current selection. - void getSelectBounds( hsize_t* start, hsize_t* end ) const; + // Gets the bounding box containing the current selection. + void getSelectBounds( hsize_t* start, hsize_t* end ) const; - // Gets the number of element points in the current selection. - hssize_t getSelectElemNpoints() const; + // Gets the number of element points in the current selection. + hssize_t getSelectElemNpoints() const; - // Retrieves the list of element points currently selected. - void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; + // Retrieves the list of element points currently selected. + void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; - // Gets the list of hyperslab blocks currently selected. - void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; + // Gets the list of hyperslab blocks currently selected. + void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; - // Get number of hyperslab blocks. - hssize_t getSelectHyperNblocks() const; + // Get number of hyperslab blocks. + hssize_t getSelectHyperNblocks() const; - // Gets the number of elements in this dataspace selection. - hssize_t getSelectNpoints() const; + // Gets the number of elements in this dataspace selection. + hssize_t getSelectNpoints() const; - // Retrieves dataspace dimension size and maximum size. - int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; + // Retrieves dataspace dimension size and maximum size. + int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; - // Gets the dimensionality of this dataspace. - int getSimpleExtentNdims() const; + // Gets the dimensionality of this dataspace. + int getSimpleExtentNdims() const; - // Gets the number of elements in this dataspace. - // 12/05/00 - changed return type to hssize_t from hsize_t - C API - hssize_t getSimpleExtentNpoints() const; + // Gets the number of elements in this dataspace. + // 12/05/00 - changed return type to hssize_t from hsize_t - C API + hssize_t getSimpleExtentNpoints() const; - // Gets the current class of this dataspace. - H5S_class_t getSimpleExtentType() const; + // Gets the current class of this dataspace. + H5S_class_t getSimpleExtentType() const; - // Determines if this dataspace is a simple one. - bool isSimple() const; + // Determines if this dataspace is a simple one. + bool isSimple() const; - // Sets the offset of this simple dataspace. - void offsetSimple( const hssize_t* offset ) const; + // Sets the offset of this simple dataspace. + void offsetSimple( const hssize_t* offset ) const; - // Selects the entire dataspace. - void selectAll() const; + // Selects the entire dataspace. + void selectAll() const; - // Selects array elements to be included in the selection for - // this dataspace. - void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; + // Selects array elements to be included in the selection for + // this dataspace. + void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; - // Selects a hyperslab region to add to the current selected region. - void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; + // Selects a hyperslab region to add to the current selected region. + void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; - // Resets the selection region to include no elements. - void selectNone() const; + // Resets the selection region to include no elements. + void selectNone() const; - // Verifies that the selection is within the extent of the dataspace. - bool selectValid() const; + // Verifies that the selection is within the extent of the dataspace. + bool selectValid() const; - // Removes the extent from this dataspace. - void setExtentNone() const; + // Removes the extent from this dataspace. + void setExtentNone() const; - // Sets or resets the size of this dataspace. - void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; + // Sets or resets the size of this dataspace. + void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSpace"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSpace"); } - // Gets the dataspace id. - virtual hid_t getId() const; + // Gets the dataspace id. + virtual hid_t getId() const; - // Deletes the global constant - static void deleteConstants(); + // Deletes the global constant + static void deleteConstants(); - // Destructor: properly terminates access to this dataspace. - virtual ~DataSpace(); + // Destructor: properly terminates access to this dataspace. + virtual ~DataSpace(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the dataspace id. - virtual void p_setId(const hid_t new_id); + // Sets the dataspace id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataspace id + hid_t id; // HDF5 dataspace id #ifndef DOXYGEN_SHOULD_SKIP_THIS - static DataSpace* ALL_; + static DataSpace* ALL_; - // Creates the global constant - static DataSpace* getConstant(); + // Creates the global constant + static DataSpace* getConstant(); - // Friend function to set DataSpace id. For library use only. - friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); + // Friend function to set DataSpace id. For library use only. + friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 52994ff..c9a0c6b 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -48,24 +48,24 @@ namespace H5 { #endif // H5_NO_STD //-------------------------------------------------------------------------- -// Function: DataType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a datatype using an existing datatype's id -///\param existing_id - IN: Id of the existing datatype +// Function: DataType overloaded constructor +///\brief Creates a datatype using an existing datatype's id +///\param existing_id - IN: Id of the existing datatype // Description -// Constructor creates a copy of an existing DataType using -// its id. -// Programmer Binh-Minh Ribler - 2000 +// Constructor creates a copy of an existing DataType using +// its id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Dec, 2005 -// Removed second argument, "predefined", after changing to the -// new ref counting mechanism that relies on C's ref counting. +// Dec, 2005 +// Removed second argument, "predefined", after changing to the +// new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) { @@ -73,12 +73,12 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a object given its class and size -///\param type_class - IN: Class of datatype to create -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType overloaded constructor +///\brief Creates a object given its class and size +///\param type_class - IN: Class of datatype to create +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() { @@ -91,17 +91,17 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param loc - IN: Location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) { @@ -109,17 +109,17 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object() { @@ -127,9 +127,9 @@ DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) } //-------------------------------------------------------------------------- -// Function: DataType copy constructor -///\brief Copy constructor: makes a copy of the original DataType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType copy constructor +///\brief Copy constructor: makes a copy of the original DataType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType(const DataType& original) : H5Object(), id(original.id) { @@ -143,109 +143,109 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2015 // Description -// Copying the type so that when a predefined type is passed in, -// a copy of it is made, not just a duplicate of the HDF5 id. -// Note: calling DataType::copy will invoke DataType::close() -// unnecessarily and will produce undefined behavior. -// -BMR, Apr 2015 +// Copying the type so that when a predefined type is passed in, +// a copy of it is made, not just a duplicate of the HDF5 id. +// Note: calling DataType::copy will invoke DataType::close() +// unnecessarily and will produce undefined behavior. +// -BMR, Apr 2015 //-------------------------------------------------------------------------- DataType::DataType(const PredType& pred_type) : H5Object() { // call C routine to copy the datatype id = H5Tcopy( pred_type.getId() ); if (id < 0) - throw DataTypeIException("DataType constructor", "H5Tcopy failed"); + throw DataTypeIException("DataType constructor", "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies an existing datatype to this datatype object -///\param like_type - IN: Datatype to be copied -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::copy +///\brief Copies an existing datatype to this datatype object +///\param like_type - IN: Datatype to be copied +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void DataType::copy( const DataType& like_type ) { // close the current data type before copying like_type to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype id = H5Tcopy( like_type.getId() ); if( id < 0 ) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies the datatype of the given dataset to this datatype object -///\param dset - IN: Dataset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::copy +///\brief Copies the datatype of the given dataset to this datatype object +///\param dset - IN: Dataset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 ///\par Description -/// The resulted dataset will be transient and modifiable. +/// The resulted dataset will be transient and modifiable. //-------------------------------------------------------------------------- void DataType::copy(const DataSet& dset) { // close the current data type before copying dset's datatype to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype id = H5Tcopy( dset.getId() ); if( id < 0 ) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing datatype -///\return Reference to DataType instance -///\exception H5::DataTypeIException +// Function: DataType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing datatype +///\return Reference to DataType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Changed operator= to simply copy the id of rhs instead of -// calling H5Tcopy because, when the operator= is invoked, a -// different datatype id is created and it won't have the same -// characteristics as the original one, specifically, if the -// rhs represents a named datatype, "this" would still be a -// transient datatype. -// BMR - Mar, 2015 +// Changed operator= to simply copy the id of rhs instead of +// calling H5Tcopy because, when the operator= is invoked, a +// different datatype id is created and it won't have the same +// characteristics as the original one, specifically, if the +// rhs represents a named datatype, "this" would still be a +// transient datatype. +// BMR - Mar, 2015 //-------------------------------------------------------------------------- DataType& DataType::operator=( const DataType& rhs ) { if (this != &rhs) { - setId(rhs.id); + setId(rhs.id); } return(*this); } //-------------------------------------------------------------------------- -// Function: DataType::operator== -///\brief Compares this DataType against the given one to determines -/// whether the two objects refer to the same actual datatype. -///\param compared_type - IN: Reference to the datatype to compare -///\return true if the datatypes are equal, and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::operator== +///\brief Compares this DataType against the given one to determines +/// whether the two objects refer to the same actual datatype. +///\param compared_type - IN: Reference to the datatype to compare +///\return true if the datatypes are equal, and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataType::operator==(const DataType& compared_type ) const { @@ -263,18 +263,18 @@ bool DataType::operator==(const DataType& compared_type ) const } //-------------------------------------------------------------------------- -// Function: DataType::p_commit (private) -//\brief Commits a transient datatype to a file, creating a new -// named datatype -//\param loc_id - IN: The id of either a file, group, dataset, named -// datatype, or attribute. -//\param name - IN: Name of the datatype -//\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::p_commit (private) +//\brief Commits a transient datatype to a file, creating a new +// named datatype +//\param loc_id - IN: The id of either a file, group, dataset, named +// datatype, or attribute. +//\param name - IN: Name of the datatype +//\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification: -// Copied from DataType::commit and made into private function -// to be commonly used by several overloads of DataType::commit. -// BMR - Jan, 2007 +// Copied from DataType::commit and made into private function +// to be commonly used by several overloads of DataType::commit. +// BMR - Jan, 2007 //-------------------------------------------------------------------------- void DataType::p_commit(hid_t loc_id, const char* name) { @@ -285,13 +285,13 @@ void DataType::p_commit(hid_t loc_id, const char* name) } //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief Commits a transient datatype to a file, creating a new -/// named datatype -///\param loc - IN: A location (file, dataset, datatype, or group) -///\param name - IN: Name of the datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::commit +///\brief Commits a transient datatype to a file, creating a new +/// named datatype +///\param loc - IN: A location (file, dataset, datatype, or group) +///\param name - IN: Name of the datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const char* name) { @@ -299,18 +299,18 @@ void DataType::commit(const H5Location& loc, const char* name) } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const char* name) //{ @@ -318,11 +318,11 @@ void DataType::commit(const H5Location& loc, const char* name) //} //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::commit +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const H5std_string& name) { @@ -330,18 +330,18 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const H5std_string& name) //{ @@ -349,13 +349,13 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) //} //-------------------------------------------------------------------------- -// Function: DataType::committed -///\brief Determines whether a datatype is a named type or a -/// transient type. -///\return \c true if the datatype is a named type, and \c false, -/// otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::committed +///\brief Determines whether a datatype is a named type or a +/// transient type. +///\return \c true if the datatype is a named type, and \c false, +/// otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataType::committed() const { @@ -372,14 +372,14 @@ bool DataType::committed() const } //-------------------------------------------------------------------------- -// Function: DataType::find -///\brief Finds a conversion function that can handle a conversion -/// from this datatype to the specified datatype, \a dest. -///\param dest - IN: Destination datatype -///\param pcdata - IN: Pointer to type conversion data -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::find +///\brief Finds a conversion function that can handle a conversion +/// from this datatype to the specified datatype, \a dest. +///\param dest - IN: Destination datatype +///\param pcdata - IN: Pointer to type conversion data +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const { @@ -393,17 +393,17 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const } //-------------------------------------------------------------------------- -// Function: DataType::convert -///\brief Converts data from this datatype to the specified datatypes. -///\param dest - IN: Destination datatype -///\param nelmts - IN: Size of array \a buf -///\param buf - IN/OUT: Array containing pre- and post-conversion -/// values -///\param background - IN: Optional backgroud buffer -///\param plist - IN: Property list - default to PropList::DEFAULT -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::convert +///\brief Converts data from this datatype to the specified datatypes. +///\param dest - IN: Destination datatype +///\param nelmts - IN: Size of array \a buf +///\param buf - IN/OUT: Array containing pre- and post-conversion +/// values +///\param background - IN: Optional backgroud buffer +///\param plist - IN: Property list - default to PropList::DEFAULT +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist ) const { @@ -421,18 +421,18 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba } //-------------------------------------------------------------------------- -// Function: DataType::lock -///\brief Locks a datatype, making it read-only and non-destructible. +// Function: DataType::lock +///\brief Locks a datatype, making it read-only and non-destructible. /// -///\exception H5::DataTypeIException +///\exception H5::DataTypeIException ///\par Descrition -/// This is normally done by the library for predefined data -/// types so the application doesn't inadvertently change or -/// delete a predefined type. +/// This is normally done by the library for predefined data +/// types so the application doesn't inadvertently change or +/// delete a predefined type. /// -/// Once a data type is locked it can never be unlocked unless -/// the entire library is closed. -// Programmer Binh-Minh Ribler - 2000 +/// Once a data type is locked it can never be unlocked unless +/// the entire library is closed. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::lock() const { @@ -445,11 +445,11 @@ void DataType::lock() const } //-------------------------------------------------------------------------- -// Function: DataType::getClass -///\brief Returns the datatype class identifier. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getClass +///\brief Returns the datatype class identifier. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t DataType::getClass() const { @@ -464,11 +464,11 @@ H5T_class_t DataType::getClass() const } //-------------------------------------------------------------------------- -// Function: DataType::getSize -///\brief Returns the size of a datatype. -///\return Datatype size in bytes -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSize +///\brief Returns the size of a datatype. +///\return Datatype size in bytes +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t DataType::getSize() const { @@ -482,11 +482,11 @@ size_t DataType::getSize() const } //-------------------------------------------------------------------------- -// Function: DataType::getSuper -///\brief Returns the base datatype from which a datatype is derived. -///\return DataType object -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSuper +///\brief Returns the base datatype from which a datatype is derived. +///\return DataType object +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType DataType::getSuper() const { @@ -498,9 +498,9 @@ DataType DataType::getSuper() const // the base type, otherwise, raise exception if( base_type_id > 0 ) { - DataType base_type; - base_type.p_setId(base_type_id); - return(base_type); + DataType base_type; + base_type.p_setId(base_type_id); + return(base_type); } else { @@ -509,20 +509,20 @@ DataType DataType::getSuper() const } //-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief Registers the specified conversion function. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException +// Function: DataType::registerFunc +///\brief Registers the specified conversion function. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException ///\par Description -/// For more information, please see: +/// For more information, please see: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const { @@ -537,11 +537,11 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& } //-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::registerFunc +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const { @@ -549,17 +549,17 @@ void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const Da } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief Removes a conversion function from all conversion paths. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief Removes a conversion function from all conversion paths. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const { @@ -574,11 +574,11 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const { @@ -586,12 +586,12 @@ void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const Data } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief Tags an opaque datatype. -///\param tag - IN: Descriptive ASCII string with which the opaque -/// datatype is to be tagged. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief Tags an opaque datatype. +///\param tag - IN: Descriptive ASCII string with which the opaque +/// datatype is to be tagged. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::setTag( const char* tag ) const { @@ -604,11 +604,11 @@ void DataType::setTag( const char* tag ) const } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::setTag( const H5std_string& tag ) const { @@ -616,11 +616,11 @@ void DataType::setTag( const H5std_string& tag ) const } //-------------------------------------------------------------------------- -// Function: DataType::getTag -///\brief Gets the tag associated with an opaque datatype. -///\return Tag associated with the opaque datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getTag +///\brief Gets the tag associated with an opaque datatype. +///\return Tag associated with the opaque datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string DataType::getTag() const { @@ -630,24 +630,24 @@ H5std_string DataType::getTag() const // and return it, otherwise, raise an exception if( tag_Cstr != NULL ) { - H5std_string tag = H5std_string(tag_Cstr); // C string to string object - H5free_memory(tag_Cstr); // free the C string - return (tag); // return the tag + H5std_string tag = H5std_string(tag_Cstr); // C string to string object + H5free_memory(tag_Cstr); // free the C string + return (tag); // return the tag } else { - throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); + throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); } } //-------------------------------------------------------------------------- -// Function: DataType::detectClass -///\brief Checks whether a datatype contains (or is) a certain type of -/// datatype. -///\return true if this datatype contains or is the specified type, -/// and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::detectClass +///\brief Checks whether a datatype contains (or is) a certain type of +/// datatype. +///\return true if this datatype contains or is the specified type, +/// and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::detectClass(H5T_class_t cls) const { @@ -659,17 +659,17 @@ bool DataType::detectClass(H5T_class_t cls) const else { throw DataTypeIException(inMemFunc("detectClass"), - "H5Tdetect_class returns negative value"); + "H5Tdetect_class returns negative value"); } } //-------------------------------------------------------------------------- -// Function: DataType::isVariableStr -///\brief Check whether this datatype is a variable-length string. -///\return true if this datatype is a variable-length string, and -/// false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::isVariableStr +///\brief Check whether this datatype is a variable-length string. +///\return true if this datatype is a variable-length string, and +/// false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::isVariableStr() const { @@ -681,7 +681,7 @@ bool DataType::isVariableStr() const else { throw DataTypeIException(inMemFunc("isVariableStr"), - "H5Tis_variable_str returns negative value"); + "H5Tis_variable_str returns negative value"); } } @@ -730,52 +730,52 @@ void DataType::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataType::close -///\brief Closes the datatype if it is not a predefined type. +// Function: DataType::close +///\brief Closes the datatype if it is not a predefined type. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataType::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Tclose(id); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Tclose(id); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 -// - Added the use of H5CPP_EXITED to terminate the HDF5 library -// and elimiate previous memory leaks. See comments in the -// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 -// - Major re-implementation of the global constants was done -// to avoid relying on the order of the creation and deletion -// of the global constants. Hence, H5CPP_EXITED was removed. -// See Design Notes in "H5PredType.cpp" for details. -// - BMR, Sep 30, 2015 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 +// - Added the use of H5CPP_EXITED to terminate the HDF5 library +// and elimiate previous memory leaks. See comments in the +// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 +// - Major re-implementation of the global constants was done +// to avoid relying on the order of the creation and deletion +// of the global constants. Hence, H5CPP_EXITED was removed. +// See Design Notes in "H5PredType.cpp" for details. +// - BMR, Sep 30, 2015 //-------------------------------------------------------------------------- DataType::~DataType() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; + cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 159e3fc..69e5c6d 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -31,116 +31,116 @@ namespace H5 { */ class H5_DLLCPP DataType : public H5Object { public: - // Creates a datatype given its class and size - DataType( const H5T_class_t type_class, size_t size ); + // Creates a datatype given its class and size + DataType( const H5T_class_t type_class, size_t size ); - // Copy constructor: makes a copy of the original object - DataType( const DataType& original ); + // Copy constructor: makes a copy of the original object + DataType( const DataType& original ); - // Creates a copy of a predefined type - DataType(const PredType& pred_type); + // Creates a copy of a predefined type + DataType(const PredType& pred_type); - // Creates a datatype by way of dereference. - DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + // Creates a datatype by way of dereference. + DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - // Closes this datatype. - virtual void close(); + // Closes this datatype. + virtual void close(); - // Copies an existing datatype to this datatype object. - void copy(const DataType& like_type); + // Copies an existing datatype to this datatype object. + void copy(const DataType& like_type); - // Copies the datatype of dset to this datatype object. - void copy(const DataSet& dset); + // Copies the datatype of dset to this datatype object. + void copy(const DataSet& dset); - // Returns the datatype class identifier. - H5T_class_t getClass() const; + // Returns the datatype class identifier. + H5T_class_t getClass() const; - // Commits a transient datatype to a file; this datatype becomes - // a named datatype which can be accessed from the location. - void commit(const H5Location& loc, const char* name); - void commit(const H5Location& loc, const H5std_string& name); - // These two overloaded functions are kept for backward compatibility - // only; they missed the const - removed from 1.8.18 and 1.10.1 - //void commit(H5Location& loc, const char* name); - //void commit(H5Location& loc, const H5std_string& name); + // Commits a transient datatype to a file; this datatype becomes + // a named datatype which can be accessed from the location. + void commit(const H5Location& loc, const char* name); + void commit(const H5Location& loc, const H5std_string& name); + // These two overloaded functions are kept for backward compatibility + // only; they missed the const - removed from 1.8.18 and 1.10.1 + //void commit(H5Location& loc, const char* name); + //void commit(H5Location& loc, const H5std_string& name); - // Determines whether this datatype is a named datatype or - // a transient datatype. - bool committed() const; + // Determines whether this datatype is a named datatype or + // a transient datatype. + bool committed() const; // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. - H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; + H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; - // Converts data from between specified datatypes. - void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; + // Converts data from between specified datatypes. + void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; - // Assignment operator - DataType& operator=( const DataType& rhs ); + // Assignment operator + DataType& operator=( const DataType& rhs ); - // Determines whether two datatypes are the same. - bool operator==(const DataType& compared_type ) const; + // Determines whether two datatypes are the same. + bool operator==(const DataType& compared_type ) const; - // Locks a datatype. - void lock() const; + // Locks a datatype. + void lock() const; - // Returns the size of a datatype. - size_t getSize() const; + // Returns the size of a datatype. + size_t getSize() const; - // Returns the base datatype from which a datatype is derived. - // Note: not quite right for specific types yet??? - DataType getSuper() const; + // Returns the base datatype from which a datatype is derived. + // Note: not quite right for specific types yet??? + DataType getSuper() const; - // Registers a conversion function. - void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + // Registers a conversion function. + void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; + void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; - // Removes a conversion function from all conversion paths. - void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + // Removes a conversion function from all conversion paths. + void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; + void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; - // Tags an opaque datatype. - void setTag( const char* tag ) const; - void setTag( const H5std_string& tag ) const; + // Tags an opaque datatype. + void setTag( const char* tag ) const; + void setTag( const H5std_string& tag ) const; - // Gets the tag associated with an opaque datatype. - H5std_string getTag() const; + // Gets the tag associated with an opaque datatype. + H5std_string getTag() const; - // Checks whether this datatype contains (or is) a certain type class. - bool detectClass(H5T_class_t cls) const; + // Checks whether this datatype contains (or is) a certain type class. + bool detectClass(H5T_class_t cls) const; - // Checks whether this datatype is a variable-length string. - bool isVariableStr() const; + // Checks whether this datatype is a variable-length string. + bool isVariableStr() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataType"); } - // Creates a copy of an existing DataType using its id - DataType( const hid_t type_id ); + // Creates a copy of an existing DataType using its id + DataType( const hid_t type_id ); - // Default constructor - DataType(); + // Default constructor + DataType(); - // Gets the datatype id. - virtual hid_t getId() const; + // Gets the datatype id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this datatype. - virtual ~DataType(); + // Destructor: properly terminates access to this datatype. + virtual ~DataType(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - hid_t id; // HDF5 datatype id + hid_t id; // HDF5 datatype id - // Sets the datatype id. - virtual void p_setId(const hid_t new_id); + // Sets the datatype id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // Friend function to set DataType id. For library use only. - friend void f_DataType_setId(DataType* dtype, hid_t new_id); + // Friend function to set DataType id. For library use only. + friend void f_DataType_setId(DataType* dtype, hid_t new_id); - void p_commit(hid_t loc_id, const char* name); + void p_commit(hid_t loc_id, const char* name); }; } #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 61705cd..0aa9a91 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -39,7 +39,7 @@ DSetCreatPropList* DSetCreatPropList::DEFAULT_ = 0; // Function: DSetCreatPropList::getConstant // Purpose: Creates a DSetCreatPropList object representing the HDF5 // constant H5P_DATASET_CREATE, pointed to by -// DSetCreatPropList::DEFAULT_ +// DSetCreatPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetCreatPropList::DEFAULT_ already points to an allocated @@ -79,49 +79,49 @@ void DSetCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for dataset creation default property +// Purpose Constant for dataset creation default property //-------------------------------------------------------------------------- const DSetCreatPropList& DSetCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DSetCreatPropList default constructor -///\brief Default constructor: creates a stub dataset creation property list -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList default constructor +///\brief Default constructor: creates a stub dataset creation property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetCreatPropList object -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetCreatPropList object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : ObjCreatPropList(orig) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList overloaded constructor -///\brief Creates a DSetCreatPropList object using the id of an -/// existing dataset creation property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList overloaded constructor +///\brief Creates a DSetCreatPropList object using the id of an +/// existing dataset creation property list. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setChunk -///\brief Sets the size of the chunks used to store a chunked layout -/// dataset. -///\param ndims - IN: Number of dimensions of each chunk -///\param dim - IN: Array containing the size of each chunk -///\exception H5::PropListIException +// Function: DSetCreatPropList::setChunk +///\brief Sets the size of the chunks used to store a chunked layout +/// dataset. +///\param ndims - IN: Number of dimensions of each chunk +///\param dim - IN: Array containing the size of each chunk +///\exception H5::PropListIException ///\par Description -/// The \a ndims parameter currently must have the same value as -/// the rank of the dataset. The values of the \a dim array -/// define the size of the chunks to store the dataset's raw -/// data. As a side-effect, the layout of the dataset will be -/// changed to \c H5D_CHUNKED, if it is not so already. -// Programmer Binh-Minh Ribler - 2000 +/// The \a ndims parameter currently must have the same value as +/// the rank of the dataset. The values of the \a dim array +/// define the size of the chunks to store the dataset's raw +/// data. As a side-effect, the layout of the dataset will be +/// changed to \c H5D_CHUNKED, if it is not so already. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const { @@ -133,13 +133,13 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getChunk -///\brief Retrieves the size of the chunks used to store a chunked -/// layout dataset. -///\param max_ndims - IN: Size of \a dim array -///\param dim - OUT: Array to store the chunk dimensions -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getChunk +///\brief Retrieves the size of the chunks used to store a chunked +/// layout dataset. +///\param max_ndims - IN: Size of \a dim array +///\param dim - OUT: Array to store the chunk dimensions +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const { @@ -147,20 +147,20 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const if( chunk_size < 0 ) { throw PropListIException("DSetCreatPropList::getChunk", - "H5Pget_chunk returns negative chunk size"); + "H5Pget_chunk returns negative chunk size"); } return( chunk_size ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setLayout -///\brief Sets the type of storage used store the raw data for a dataset. -///\param layout - IN: Type of storage layout for raw data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setLayout +///\brief Sets the type of storage used store the raw data for a dataset. +///\param layout - IN: Type of storage layout for raw data +///\exception H5::PropListIException ///\par Description -/// For information on valid layout types, please refer to +/// For information on valid layout types, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const { @@ -168,25 +168,25 @@ void DSetCreatPropList::setLayout(H5D_layout_t layout) const if( ret_value < 0 ) { throw PropListIException("DSetCreatPropList::setLayout", - "H5Pset_layout failed"); + "H5Pset_layout failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getLayout -///\brief Retrieves the layout type of this property list -///\return Layout type, which can be: -/// \li \c H5D_COMPACT - raw data is stored in the object -/// header in the file. -/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the -/// object header in one contiguous chunk in -/// the file. -/// \li \c H5D_CHUNKED - raw data is stored separately from the -/// object header in chunks in separate locations -/// in the file. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getLayout +///\brief Retrieves the layout type of this property list +///\return Layout type, which can be: +/// \li \c H5D_COMPACT - raw data is stored in the object +/// header in the file. +/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the +/// object header in one contiguous chunk in +/// the file. +/// \li \c H5D_CHUNKED - raw data is stored separately from the +/// object header in chunks in separate locations +/// in the file. +///\exception H5::PropListIException ///\par Description -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_layout_t DSetCreatPropList::getLayout() const { @@ -194,22 +194,22 @@ H5D_layout_t DSetCreatPropList::getLayout() const if( layout == H5D_LAYOUT_ERROR ) { throw PropListIException("DSetCreatPropList::getLayout", - "H5Pget_layout returns H5D_LAYOUT_ERROR"); + "H5Pget_layout returns H5D_LAYOUT_ERROR"); } return( layout ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setDeflate -///\brief Sets compression method and compression level -///\param level - IN: Compression level, should [0..9], inclusive -///\exception H5::PropListIException +// Function: DSetCreatPropList::setDeflate +///\brief Sets compression method and compression level +///\param level - IN: Compression level, should [0..9], inclusive +///\exception H5::PropListIException ///\par Description -/// The function sets the compression method for this property -/// list to \c H5D_COMPRESS_DEFLATE and the compression level to -/// \a level. Lower compression levels are faster but result in -/// less compression. -// Programmer Binh-Minh Ribler - 2000 +/// The function sets the compression method for this property +/// list to \c H5D_COMPRESS_DEFLATE and the compression level to +/// \a level. Lower compression levels are faster but result in +/// less compression. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setDeflate( int level ) const { @@ -217,76 +217,76 @@ void DSetCreatPropList::setDeflate( int level ) const if( ret_value < 0 ) { throw PropListIException("DSetCreatPropList::setDeflate", - "H5Pset_deflate failed"); + "H5Pset_deflate failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setSzip -///\brief Sets up for the use of the SZIP compression filter. -///\param options_mask - IN: A bit-mask conveying the desired SZIP -/// options. Valid values are H5_SZIP_EC_OPTION_MASK -/// and H5_SZIP_NN_OPTION_MASK. -///\param pixels_per_block - IN: Number of pixels or data elements in -/// each data block. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setSzip +///\brief Sets up for the use of the SZIP compression filter. +///\param options_mask - IN: A bit-mask conveying the desired SZIP +/// options. Valid values are H5_SZIP_EC_OPTION_MASK +/// and H5_SZIP_NN_OPTION_MASK. +///\param pixels_per_block - IN: Number of pixels or data elements in +/// each data block. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an SZIP compression filter, -/// H5Z_FILTER_SZIP, for a dataset. For more information about -/// SZIP and usage, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an SZIP compression filter, +/// H5Z_FILTER_SZIP, for a dataset. For more information about +/// SZIP and usage, please refer to the C layer Reference +/// Manual at: /// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip -// Programmer Binh-Minh Ribler - Jan, 2007 +// Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const { herr_t ret_value = H5Pset_szip(id, options_mask, pixels_per_block); if( ret_value < 0 ) { - throw PropListIException("DSetCreatPropList::setSzip", - "H5Pset_szip failed"); + throw PropListIException("DSetCreatPropList::setSzip", + "H5Pset_szip failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setNbit -///\brief Sets up for the use of the Nbit compression filter. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setNbit +///\brief Sets up for the use of the Nbit compression filter. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an Nbit compression filter, -/// H5Z_FILTER_NBIT, for a dataset. For more information about -/// Nbit compression, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an Nbit compression filter, +/// H5Z_FILTER_NBIT, for a dataset. For more information about +/// Nbit compression, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit -// Programmer Binh-Minh Ribler - Apr, 2016 +// Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const { herr_t ret_value = H5Pset_nbit(id); if( ret_value < 0 ) { - throw PropListIException("DSetCreatPropList::setNbit", - "H5Pset_nbit failed"); + throw PropListIException("DSetCreatPropList::setNbit", + "H5Pset_nbit failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillValue -///\brief Sets a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - IN: Pointer to buffer containing the fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillValue +///\brief Sets a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - IN: Pointer to buffer containing the fill value +///\exception H5::PropListIException ///\par Description -/// The datatype may differ from that of the dataset, but it must -/// be one that the HDF5 library is able to convert \a value to -/// the dataset datatype when the dataset is created. -/// The default fill value is 0 (zero,) which is interpreted -/// according to the actual dataset datatype. +/// The datatype may differ from that of the dataset, but it must +/// be one that the HDF5 library is able to convert \a value to +/// the dataset datatype when the dataset is created. +/// The default fill value is 0 (zero,) which is interpreted +/// according to the actual dataset datatype. ///\par -/// For information on setting fill value, please refer to the -/// C layer Reference Manual at: +/// For information on setting fill value, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const { @@ -299,17 +299,17 @@ void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* v } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillValue -///\brief Retrieves a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - OUT: Pointer to buffer to hold the retrieved fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillValue +///\brief Retrieves a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - OUT: Pointer to buffer to hold the retrieved fill value +///\exception H5::PropListIException ///\par Description -/// The fill value is returned through \a value pointer -/// and the memory is allocated by the caller. The fill -/// value will be converted from its current data type to the -/// specified by \a fvalue_type. -// Programmer Binh-Minh Ribler - 2000 +/// The fill value is returned through \a value pointer +/// and the memory is allocated by the caller. The fill +/// value will be converted from its current data type to the +/// specified by \a fvalue_type. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const { @@ -322,14 +322,14 @@ void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::isFillValueDefined -///\brief Check if fill value has been defined for this property +// Function: DSetCreatPropList::isFillValueDefined +///\brief Check if fill value has been defined for this property ///\return -/// \li \c H5D_FILL_VALUE_UNDEFINED =0, -/// \li \c H5D_FILL_VALUE_DEFAULT =1, -/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +/// \li \c H5D_FILL_VALUE_UNDEFINED =0, +/// \li \c H5D_FILL_VALUE_DEFAULT =1, +/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const { @@ -345,27 +345,27 @@ H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFilter -///\brief Adds a filter to the filter pipeline -///\param filter_id - IN: Filter to add -///\param flags - IN: Specifies general properties of the filter -///\param cd_nelmts - IN: Number of elements in cd_values -///\param cd_values - IN: Auxiliary data for the filter -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFilter +///\brief Adds a filter to the filter pipeline +///\param filter_id - IN: Filter to add +///\param flags - IN: Specifies general properties of the filter +///\param cd_nelmts - IN: Number of elements in cd_values +///\param cd_values - IN: Auxiliary data for the filter +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a \c DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a \c DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 +/// If this bit is set then the filter is optional. If the filter +/// fails during a \c DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a \c DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[] ) const + size_t cd_nelmts, const unsigned int cd_values[] ) const { herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values ); if( ret_value < 0 ) @@ -376,14 +376,14 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::removeFilter -///\brief Removes one or more filters -///\param filter_id - IN: Filter to remove -///\exception H5::PropListIException +// Function: DSetCreatPropList::removeFilter +///\brief Removes one or more filters +///\param filter_id - IN: Filter to remove +///\exception H5::PropListIException ///\par Description -/// Deletes a filter from the dataset creation property list; -/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. -// Programmer Binh-Minh Ribler - 2000 +/// Deletes a filter from the dataset creation property list; +/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const { @@ -396,11 +396,11 @@ void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getNfilters -///\brief Returns the number of filters in the pipeline -///\return Number of filters -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getNfilters +///\brief Returns the number of filters in the pipeline +///\return Number of filters +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getNfilters() const { @@ -415,32 +415,32 @@ int DSetCreatPropList::getNfilters() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilter -///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where -/// N is returned by H5Pget_nfilters() -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\return Filter id -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFilter +///\brief Returns information about a filter in a pipeline +///\param filter_number - IN: Filter to get, range [0..N-1], where +/// N is returned by H5Pget_nfilters() +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\return Filter id +///\exception H5::PropListIException ///\par Description -/// Failure occurs when \a filter_number is out of range. -// Note: the first argument was mistakenly typed as int instead -// of unsigned int, but for backward compatibility, it cannot be -// changed. -BMR (2014/04/15) +/// Failure occurs when \a filter_number is out of range. +// Note: the first argument was mistakenly typed as int instead +// of unsigned int, but for backward compatibility, it cannot be +// changed. -BMR (2014/04/15) //-------------------------------------------------------------------------- H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int& filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int& filter_config) const { H5Z_filter_t filter_id; filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); + cd_values, namelen, name, &filter_config); if( filter_id == H5Z_FILTER_ERROR ) throw PropListIException("DSetCreatPropList::getFilter", "H5Pget_filter2 returned H5Z_FILTER_ERROR"); @@ -449,54 +449,54 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilterById -///\brief Returns information about a filter in a pipeline given the -/// filter id -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getFilterById +///\brief Returns information about a filter in a pipeline given the +/// filter id +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int &filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int &filter_config) const { herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); + cd_values, namelen, name, &filter_config); if (ret_value < 0) throw PropListIException("DSetCreatPropList::getFilterById", "H5Pget_filter_by_id2 failed"); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::modifyFilter -///\brief Modifies the specified filter -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN: Number of elements in \a cd_values -/// \n OUT: Number of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\exception H5::PropListIException +// Function: DSetCreatPropList::modifyFilter +///\brief Modifies the specified filter +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN: Number of elements in \a cd_values +/// \n OUT: Number of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 +/// If this bit is set then the filter is optional. If the filter +/// fails during a DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int - flags, size_t cd_nelmts, const unsigned int cd_values[] ) const + flags, size_t cd_nelmts, const unsigned int cd_values[] ) const { herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); if( ret_value < 0 ) @@ -507,13 +507,13 @@ void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::allFiltersAvail -///\brief Queries whether all the filters set in this property list -/// are available currently. -///\return true if all filters available, and false if one or more -/// filters not currently available -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::allFiltersAvail +///\brief Queries whether all the filters set in this property list +/// are available currently. +///\return true if all filters available, and false if one or more +/// filters not currently available +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetCreatPropList::allFiltersAvail() const { @@ -529,15 +529,15 @@ bool DSetCreatPropList::allFiltersAvail() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setShuffle -///\brief Sets method of the shuffle filter +// Function: DSetCreatPropList::setShuffle +///\brief Sets method of the shuffle filter /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Please refer to the Reference Manual of \c H5Pset_shuffle for -/// details. +/// Please refer to the Reference Manual of \c H5Pset_shuffle for +/// details. /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const { @@ -550,18 +550,18 @@ void DSetCreatPropList::setShuffle() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getAllocTime -///\brief Get space allocation time for this property. -///\return Space allocation time. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getAllocTime +///\brief Get space allocation time for this property. +///\return Space allocation time. +///\exception H5::PropListIException ///\par Description -/// The values of space allocation time can be one of the -/// followings: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// The values of space allocation time can be one of the +/// followings: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_alloc_time_t DSetCreatPropList::getAllocTime() const { @@ -577,15 +577,15 @@ H5D_alloc_time_t DSetCreatPropList::getAllocTime() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillTime -///\brief Gets fill value writing time. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillTime +///\brief Gets fill value writing time. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_time_t DSetCreatPropList::getFillTime() const { @@ -601,17 +601,17 @@ H5D_fill_time_t DSetCreatPropList::getFillTime() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setAllocTime -///\brief Sets space allocation time for dataset during creation. -///\param alloc_time - IN: Allocation time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setAllocTime +///\brief Sets space allocation time for dataset during creation. +///\param alloc_time - IN: Allocation time +///\exception H5::PropListIException ///\par Description -/// Valid values for space allocation time include: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for space allocation time include: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const { @@ -624,15 +624,15 @@ void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillTime -///\brief Sets fill value writing time for dataset. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillTime +///\brief Sets fill value writing time for dataset. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const { @@ -645,11 +645,11 @@ void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFletcher32 -///\brief Sets Fletcher32 checksum of EDC for this property list. +// Function: DSetCreatPropList::setFletcher32 +///\brief Sets Fletcher32 checksum of EDC for this property list. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFletcher32() const { @@ -662,20 +662,20 @@ void DSetCreatPropList::setFletcher32() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setExternal -///\brief Adds an external file to the list of external files -///\param name - IN: Name of the external file -///\param offset - IN: Location where the data starts in the file -///\param size - IN: Number of bytes reserved in the file for the data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setExternal +///\brief Adds an external file to the list of external files +///\param name - IN: Name of the external file +///\param offset - IN: Location where the data starts in the file +///\param size - IN: Number of bytes reserved in the file for the data +///\exception H5::PropListIException ///\par Description -/// If a dataset is splitted across multiple files then the files -/// should be defined in order. The total size of the dataset is -/// the sum of the \a size arguments for all the external files. If -/// the total size is larger than the size of a dataset then the -/// dataset can be extended (provided the data space also allows -/// the extending). -// Programmer Binh-Minh Ribler - 2000 +/// If a dataset is splitted across multiple files then the files +/// should be defined in order. The total size of the dataset is +/// the sum of the \a size arguments for all the external files. If +/// the total size is larger than the size of a dataset then the +/// dataset can be extended (provided the data space also allows +/// the extending). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const { @@ -688,11 +688,11 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternalCount -///\brief Returns the number of external files for a dataset -///\return Number of external files -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getExternalCount +///\brief Returns the number of external files for a dataset +///\return Number of external files +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getExternalCount() const { @@ -707,26 +707,26 @@ int DSetCreatPropList::getExternalCount() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternal -///\brief Returns information about an external file -///\param idx - IN: Index of the external file, ranges [0-(N-1)] and -/// returned by getExternalCount() -///\param name_size - IN: Maximum length of \a name -///\param name - OUT: Name of the external file -///\param offset - OUT: Location to return an offset value -///\param size - OUT: Location to return the size of the external file data -///\exception H5::PropListIException +// Function: DSetCreatPropList::getExternal +///\brief Returns information about an external file +///\param idx - IN: Index of the external file, ranges [0-(N-1)] and +/// returned by getExternalCount() +///\param name_size - IN: Maximum length of \a name +///\param name - OUT: Name of the external file +///\param offset - OUT: Location to return an offset value +///\param size - OUT: Location to return the size of the external file data +///\exception H5::PropListIException ///\par Description -/// The parameter \a idx ranges [0..N-1] where N is returned by -/// getExternalCount(). At most \a name_size characters are copied -/// into the name array. If the external file name is longer than -/// name_size with the null terminator, the return value is not -/// null terminated (similar to strncpy()). -/// If \a name_size is zero or \a name is a null pointer, the -/// external file name will not be returned. If \a offset or -/// \a size are null pointers then the corresponding information -/// will not be returned. -// Programmer Binh-Minh Ribler - 2000 +/// The parameter \a idx ranges [0..N-1] where N is returned by +/// getExternalCount(). At most \a name_size characters are copied +/// into the name array. If the external file name is longer than +/// name_size with the null terminator, the return value is not +/// null terminated (similar to strncpy()). +/// If \a name_size is zero or \a name is a null pointer, the +/// external file name will not be returned. If \a offset or +/// \a size are null pointers then the corresponding information +/// will not be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const { @@ -739,8 +739,8 @@ void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList destructor -///\brief Noop destructor. +// Function: DSetCreatPropList destructor +///\brief Noop destructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::~DSetCreatPropList () {} diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index fec13fd..898fba6 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -28,105 +28,105 @@ namespace H5 { */ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: - ///\brief Default dataset creation property list. - static const DSetCreatPropList& DEFAULT; + ///\brief Default dataset creation property list. + static const DSetCreatPropList& DEFAULT; - // Creates a dataset creation property list. - DSetCreatPropList(); + // Creates a dataset creation property list. + DSetCreatPropList(); - // Queries whether all the filters set in this property list are - // available currently. - bool allFiltersAvail() const; + // Queries whether all the filters set in this property list are + // available currently. + bool allFiltersAvail() const; - // Get space allocation time for this property. - H5D_alloc_time_t getAllocTime() const; + // Get space allocation time for this property. + H5D_alloc_time_t getAllocTime() const; - // Set space allocation time for dataset during creation. - void setAllocTime(H5D_alloc_time_t alloc_time) const; + // Set space allocation time for dataset during creation. + void setAllocTime(H5D_alloc_time_t alloc_time) const; - // Retrieves the size of the chunks used to store a chunked layout dataset. - int getChunk( int max_ndims, hsize_t* dim ) const; + // Retrieves the size of the chunks used to store a chunked layout dataset. + int getChunk( int max_ndims, hsize_t* dim ) const; - // Sets the size of the chunks used to store a chunked layout dataset. - void setChunk( int ndims, const hsize_t* dim ) const; + // Sets the size of the chunks used to store a chunked layout dataset. + void setChunk( int ndims, const hsize_t* dim ) const; - // Returns information about an external file. - void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const; + // Returns information about an external file. + void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const; - // Returns the number of external files for a dataset. - int getExternalCount() const; + // Returns the number of external files for a dataset. + int getExternalCount() const; - // Gets fill value writing time. - H5D_fill_time_t getFillTime() const; + // Gets fill value writing time. + H5D_fill_time_t getFillTime() const; - // Sets fill value writing time for dataset. - void setFillTime(H5D_fill_time_t fill_time) const; + // Sets fill value writing time for dataset. + void setFillTime(H5D_fill_time_t fill_time) const; - // Retrieves a dataset fill value. - void getFillValue( const DataType& fvalue_type, void* value ) const; + // Retrieves a dataset fill value. + void getFillValue( const DataType& fvalue_type, void* value ) const; - // Sets a dataset fill value. - void setFillValue( const DataType& fvalue_type, const void* value ) const; + // Sets a dataset fill value. + void setFillValue( const DataType& fvalue_type, const void* value ) const; - // Returns information about a filter in a pipeline. - H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; + // Returns information about a filter in a pipeline. + H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; - // Returns information about a filter in a pipeline given the filter id. - void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; + // Returns information about a filter in a pipeline given the filter id. + void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; - // Gets the layout of the raw data storage of the data that uses this - // property list. - H5D_layout_t getLayout() const; + // Gets the layout of the raw data storage of the data that uses this + // property list. + H5D_layout_t getLayout() const; - // Sets the type of storage used to store the raw data for the - // dataset that uses this property list. - void setLayout(H5D_layout_t layout) const; + // Sets the type of storage used to store the raw data for the + // dataset that uses this property list. + void setLayout(H5D_layout_t layout) const; - // Returns the number of filters in the pipeline. - int getNfilters() const; + // Returns the number of filters in the pipeline. + int getNfilters() const; - // Checks if fill value has been defined for this property. - H5D_fill_value_t isFillValueDefined() const; + // Checks if fill value has been defined for this property. + H5D_fill_value_t isFillValueDefined() const; - // Modifies the specified filter. - void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; + // Modifies the specified filter. + void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; - // Remove one or all filters from the filter pipeline. - void removeFilter( H5Z_filter_t filter_id) const; + // Remove one or all filters from the filter pipeline. + void removeFilter( H5Z_filter_t filter_id) const; - // Sets compression method and compression level. - void setDeflate( int level ) const; + // Sets compression method and compression level. + void setDeflate( int level ) const; - // Adds an external file to the list of external files. - void setExternal( const char* name, off_t offset, hsize_t size ) const; + // Adds an external file to the list of external files. + void setExternal( const char* name, off_t offset, hsize_t size ) const; - // Adds a filter to the filter pipeline. - void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; + // Adds a filter to the filter pipeline. + void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; - // Sets Fletcher32 checksum of EDC for this property list. - void setFletcher32() const; + // Sets Fletcher32 checksum of EDC for this property list. + void setFletcher32() const; - // Sets method of the shuffle filter. - void setShuffle() const; + // Sets method of the shuffle filter. + void setShuffle() const; - // Sets SZIP compression method. - void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; + // Sets SZIP compression method. + void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; - // Sets N-bit compression method. - void setNbit() const; + // Sets N-bit compression method. + void setNbit() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetCreatPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetCreatPropList"); } - // Copy constructor: creates a copy of a DSetCreatPropList object. - DSetCreatPropList(const DSetCreatPropList& orig); + // Copy constructor: creates a copy of a DSetCreatPropList object. + DSetCreatPropList(const DSetCreatPropList& orig); - // Creates a copy of an existing dataset creation property list - // using the property list id. - DSetCreatPropList(const hid_t plist_id); + // Creates a copy of an existing dataset creation property list + // using the property list id. + DSetCreatPropList(const hid_t plist_id); - // Noop destructor. - virtual ~DSetCreatPropList(); + // Noop destructor. + virtual ~DSetCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -134,7 +134,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { static void deleteConstants(); private: - static DSetCreatPropList* DEFAULT_; + static DSetCreatPropList* DEFAULT_; // Creates the global constant, should only be used by the library static DSetCreatPropList* getConstant(); diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index c4886f0..7d45b24 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -20,7 +20,7 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5DxferProp.h" -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset namespace H5 { @@ -36,7 +36,7 @@ DSetMemXferPropList* DSetMemXferPropList::DEFAULT_ = 0; // Function: DSetMemXferPropList::getConstant // Creates a DSetMemXferPropList object representing the HDF5 // constant H5P_DATASET_XFER, pointed to by -// DSetMemXferPropList::DEFAULT_ +// DSetMemXferPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetMemXferPropList::DEFAULT_ already points to an allocated @@ -76,25 +76,25 @@ void DSetMemXferPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataset memory and transfer property list. +// Purpose Constant for default dataset memory and transfer property list. //-------------------------------------------------------------------------- const DSetMemXferPropList& DSetMemXferPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function DSetMemXferPropList default constructor -///\brief Default constructor: creates a stub dataset memory and -/// transfer property list object. -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList default constructor +///\brief Default constructor: creates a stub dataset memory and +/// transfer property list object. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList constructor -///\brief Creates a dataset transfer property list with transform -/// expression. -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList constructor +///\brief Creates a dataset transfer property list with transform +/// expression. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET_XFER) { @@ -102,33 +102,33 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET } //-------------------------------------------------------------------------- -// Function DSetMemXferPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetMemXferPropList object -///\param original - IN: Original dataset memory and transfer property -/// list object to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetMemXferPropList object +///\param original - IN: Original dataset memory and transfer property +/// list object to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original ) : PropList( original ) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList overloaded constructor -///\brief Creates a DSetMemXferPropList object using the id of an -/// existing DSetMemXferPropList. -///\param plist_id - IN: Id of an existing dataset memory and transfer -/// property list -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList overloaded constructor +///\brief Creates a DSetMemXferPropList object using the id of an +/// existing DSetMemXferPropList. +///\param plist_id - IN: Id of an existing dataset memory and transfer +/// property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBuffer -///\brief Sets type conversion and background buffers. -///\param size - IN: Size, in bytes, of the type conversion and background buffers -///\param tconv - IN: Pointer to application-allocated type conversion buffer -///\param bkg - IN: Pointer to application-allocated background buffer -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBuffer +///\brief Sets type conversion and background buffers. +///\param size - IN: Size, in bytes, of the type conversion and background buffers +///\param tconv - IN: Pointer to application-allocated type conversion buffer +///\param bkg - IN: Pointer to application-allocated background buffer +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const { @@ -136,18 +136,18 @@ void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setBuffer", - "H5Pset_buffer failed"); + "H5Pset_buffer failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBuffer -///\brief Reads buffer settings. -///\param tconv - OUT: Pointer to application-allocated type conversion buf -///\param bkg - OUT: Pointer to application-allocated background buffer -///\return Buffer size, in bytes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBuffer +///\brief Reads buffer settings. +///\param tconv - OUT: Pointer to application-allocated type conversion buf +///\param bkg - OUT: Pointer to application-allocated background buffer +///\return Buffer size, in bytes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const { @@ -155,17 +155,17 @@ size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const if( buffer_size == 0 ) { throw PropListIException("DSetMemXferPropList::getBuffer", - "H5Pget_buffer returned 0 for buffer size - failure"); + "H5Pget_buffer returned 0 for buffer size - failure"); } return( buffer_size ); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setPreserve -///\brief Sets the dataset transfer property list status to true or false. -///\param status - IN: Status to set, true or false -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setPreserve +///\brief Sets the dataset transfer property list status to true or false. +///\param status - IN: Status to set, true or false +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setPreserve( bool status ) const { @@ -173,16 +173,16 @@ void DSetMemXferPropList::setPreserve( bool status ) const if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setPreserve", - "H5Pset_preserve failed"); + "H5Pset_preserve failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getPreserve -///\brief Checks status of the dataset transfer property list. -///\return Status of the dataset transfer property list -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getPreserve +///\brief Checks status of the dataset transfer property list. +///\return Status of the dataset transfer property list +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetMemXferPropList::getPreserve() const { @@ -194,18 +194,18 @@ bool DSetMemXferPropList::getPreserve() const else { throw PropListIException("DSetMemXferPropList::getPreserve", - "H5Pget_preserve returned negative value for status"); + "H5Pget_preserve returned negative value for status"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBtreeRatios -///\brief Sets B-tree split ratios for a dataset transfer property list. -///\param left - IN: B-tree split ratio for left-most nodes -///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes -///\param right - IN: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBtreeRatios +///\brief Sets B-tree split ratios for a dataset transfer property list. +///\param left - IN: B-tree split ratio for left-most nodes +///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes +///\param right - IN: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const { @@ -213,18 +213,18 @@ void DSetMemXferPropList::setBtreeRatios( double left, double middle, double rig if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setBtreeRatios", - "H5Pset_btree_ratios failed"); + "H5Pset_btree_ratios failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBtreeRatios -///\brief Gets B-tree split ratios for a dataset transfer property list. -///\param left - OUT: B-tree split ratio for left-most nodes -///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes -///\param right - OUT: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBtreeRatios +///\brief Gets B-tree split ratios for a dataset transfer property list. +///\param left - OUT: B-tree split ratio for left-most nodes +///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes +///\param right - OUT: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const { @@ -232,16 +232,16 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::getBtreeRatios", - "H5Pget_btree_ratios failed"); + "H5Pget_btree_ratios failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief Sets data transform expression. -///\param expression - IN: null-terminated data transform expression (char*) -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief Sets data transform expression. +///\param expression - IN: null-terminated data transform expression (char*) +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const char* expression) const { @@ -249,17 +249,17 @@ void DSetMemXferPropList::setDataTransform(const char* expression) const if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setDataTransform", - "H5Pset_data_transform failed"); + "H5Pset_data_transform failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the expression. -///\param expression - IN: H5std_string data transform expression -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the expression. +///\param expression - IN: H5std_string data transform expression +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const { @@ -267,13 +267,13 @@ void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief Sets data transform expression. -///\param exp - OUT: buffer for data transform expression (char*) -///\param buf_size - IN: size of buffer for expression, including the -/// null terminator -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::getDataTransform +///\brief Sets data transform expression. +///\param exp - OUT: buffer for data transform expression (char*) +///\param buf_size - IN: size of buffer for expression, including the +/// null terminator +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const { @@ -285,8 +285,8 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const // H5Pget_data_transform returns a negative value, raise an exception if (exp_len < 0) { - throw PropListIException("DSetMemXferPropList::getDataTransform", - "H5Pget_data_transform failed"); + throw PropListIException("DSetMemXferPropList::getDataTransform", + "H5Pget_data_transform failed"); } // H5Pget_data_transform will put a null terminator at the end of the @@ -298,12 +298,12 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns a \c H5std_string for the expression. +// Function: DSetMemXferPropList::getDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes no parameter and returns a \c H5std_string for the expression. /// -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5std_string DSetMemXferPropList::getDataTransform() const { @@ -341,13 +341,13 @@ H5std_string DSetMemXferPropList::getDataTransform() const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Sets an exception handling callback for datatype conversion -/// for a dataset transfer property list. -///\param op - IN: User's function -///\param user_data - IN: User's data -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Sets an exception handling callback for datatype conversion +/// for a dataset transfer property list. +///\param op - IN: User's function +///\param user_data - IN: User's data +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const { @@ -355,17 +355,17 @@ void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_d if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setTypeConvCB", - "H5Pset_type_conv_cb failed"); + "H5Pset_type_conv_cb failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Gets the exception handling callback function and data. -///\param op - IN: Retrieved user function -///\param user_data - IN: Retrieved user data -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Gets the exception handling callback function and data. +///\param op - IN: Retrieved user function +///\param user_data - IN: Retrieved user data +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const { @@ -373,38 +373,38 @@ void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::getTypeConvCB", - "H5Pget_type_conv_cb failed"); + "H5Pget_type_conv_cb failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype allocation. -///\param alloc_func - IN: User's allocate routine -///\param alloc_info - IN: User's allocation parameters -///\param free_func - IN: User's free routine -///\param free_info - IN: User's free parameters -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype allocation. +///\param alloc_func - IN: User's allocate routine +///\param alloc_info - IN: User's allocation parameters +///\param free_func - IN: User's free routine +///\param free_info - IN: User's free parameters +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const { herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, - free_func, free_info ); + free_func, free_info ); if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::setVlenMemManager", - "H5Pset_vlen_mem_manager failed"); + "H5Pset_vlen_mem_manager failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype -/// allocation - system \c malloc and \c free will be used. +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype +/// allocation - system \c malloc and \c free will be used. /// -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager() const { @@ -412,14 +412,14 @@ void DSetMemXferPropList::setVlenMemManager() const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getVlenMemManager -///\brief Gets the memory manager for variable-length datatype allocation -///\param alloc_func - OUT: User's allocate routine -///\param alloc_info - OUT: User's allocation parameters -///\param free_func - OUT: User's free routine -///\param free_info - OUT: User's free parameters -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getVlenMemManager +///\brief Gets the memory manager for variable-length datatype allocation +///\param alloc_func - OUT: User's allocate routine +///\param alloc_info - OUT: User's allocation parameters +///\param free_func - OUT: User's free routine +///\param free_info - OUT: User's free parameters +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const { @@ -427,19 +427,19 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** if( ret_value < 0 ) { throw PropListIException("DSetMemXferPropList::getVlenMemManager", - "H5Pget_vlen_mem_manager failed"); + "H5Pget_vlen_mem_manager failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setSmallDataBlockSize -///\brief Sets the size of a contiguous block reserved for small data. -///\param size - IN: Maximum size, in bytes, of the small data block. -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setSmallDataBlockSize +///\brief Sets the size of a contiguous block reserved for small data. +///\param size - IN: Maximum size, in bytes, of the small data block. +///\exception H5::PropListIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const { @@ -447,16 +447,16 @@ void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const if (ret_value < 0) { throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", - "H5Pset_small_data_block_size failed"); + "H5Pset_small_data_block_size failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getSmallDataBlockSize -///\brief Returns the current small data block size setting. -///\return Size of the small data block, in bytes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getSmallDataBlockSize +///\brief Returns the current small data block size setting. +///\return Size of the small data block, in bytes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t DSetMemXferPropList::getSmallDataBlockSize() const { @@ -465,21 +465,21 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const if (ret_value < 0) { throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", - "H5Pget_small_data_block_size failed"); + "H5Pget_small_data_block_size failed"); } return(size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setHyperVectorSize -///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. +// Function: DSetMemXferPropList::setHyperVectorSize +///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please refer to the C layer Reference -/// Manual at: +/// For information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const { @@ -487,17 +487,17 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const if (ret_value < 0) { throw PropListIException("DSetMemXferPropList::setHyperVectorSize", - "H5Pset_hyper_vector_size failed"); + "H5Pset_hyper_vector_size failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getHyperVectorSize -///\brief Returns the number of I/O vectors to be read/written in -/// hyperslab I/O. -///\return Number of I/O vectors -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getHyperVectorSize +///\brief Returns the number of I/O vectors to be read/written in +/// hyperslab I/O. +///\return Number of I/O vectors +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t DSetMemXferPropList::getHyperVectorSize() const { @@ -506,28 +506,28 @@ size_t DSetMemXferPropList::getHyperVectorSize() const if (ret_value < 0) { throw PropListIException("DSetMemXferPropList::getHyperVectorSize", - "H5Pget_hyper_vector_size failed"); + "H5Pget_hyper_vector_size failed"); } return(vector_size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setEDCCheck -///\brief Enables or disables error-detecting for a dataset reading -/// process. -///\param check - IN: Specifies whether error detection is enabled or -/// disabled -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setEDCCheck +///\brief Enables or disables error-detecting for a dataset reading +/// process. +///\param check - IN: Specifies whether error detection is enabled or +/// disabled +///\exception H5::PropListIException ///\par Description -/// The error detection algorithm used is the algorithm previously -/// specified in the corresponding dataset creation property -/// list. This function does not affect the use of error -/// detection in the writing process. +/// The error detection algorithm used is the algorithm previously +/// specified in the corresponding dataset creation property +/// list. This function does not affect the use of error +/// detection in the writing process. ///\par -/// Valid values are as follows: -/// \li \c H5Z_ENABLE_EDC (default) -/// \li \c H5Z_DISABLE_EDC -// Programmer: Binh-Minh Ribler - April, 2004 +/// Valid values are as follows: +/// \li \c H5Z_ENABLE_EDC (default) +/// \li \c H5Z_DISABLE_EDC +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const { @@ -535,16 +535,16 @@ void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const if (ret_value < 0) { throw PropListIException("DSetMemXferPropList::setEDCCheck", - "H5Pset_edc_check failed"); + "H5Pset_edc_check failed"); } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getEDCCheck -///\brief Determines whether error-detection is enabled for dataset reads. -///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getEDCCheck +///\brief Determines whether error-detection is enabled for dataset reads. +///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const { @@ -552,15 +552,15 @@ H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const if (check < 0) { throw PropListIException("DSetMemXferPropList::getEDCCheck", - "H5Pget_edc_check failed"); + "H5Pget_edc_check failed"); } return(check); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::~DSetMemXferPropList() {} diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 815a67f..ad60020 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -28,93 +28,93 @@ namespace H5 { */ class H5_DLLCPP DSetMemXferPropList : public PropList { public: - ///\brief Default dataset memory and transfer property list. - static const DSetMemXferPropList& DEFAULT; + ///\brief Default dataset memory and transfer property list. + static const DSetMemXferPropList& DEFAULT; - // Creates a dataset memory and transfer property list. - DSetMemXferPropList(); + // Creates a dataset memory and transfer property list. + DSetMemXferPropList(); - // Creates a dataset transform property list. - DSetMemXferPropList(const char* expression); + // Creates a dataset transform property list. + DSetMemXferPropList(const char* expression); - // Sets type conversion and background buffers. - void setBuffer( size_t size, void* tconv, void* bkg ) const; + // Sets type conversion and background buffers. + void setBuffer( size_t size, void* tconv, void* bkg ) const; - // Reads buffer settings. - size_t getBuffer( void** tconv, void** bkg ) const; + // Reads buffer settings. + size_t getBuffer( void** tconv, void** bkg ) const; - // Sets B-tree split ratios for a dataset transfer property list. - void setBtreeRatios( double left, double middle, double right ) const; + // Sets B-tree split ratios for a dataset transfer property list. + void setBtreeRatios( double left, double middle, double right ) const; - // Gets B-tree split ratios for a dataset transfer property list. - void getBtreeRatios( double& left, double& middle, double& right ) const; + // Gets B-tree split ratios for a dataset transfer property list. + void getBtreeRatios( double& left, double& middle, double& right ) const; - // Sets data transform expression. - void setDataTransform(const char* expression) const; - void setDataTransform(const H5std_string& expression) const; + // Sets data transform expression. + void setDataTransform(const char* expression) const; + void setDataTransform(const H5std_string& expression) const; - // Gets data transform expression. - ssize_t getDataTransform(char* exp, size_t buf_size=0) const; - H5std_string getDataTransform() const; + // Gets data transform expression. + ssize_t getDataTransform(char* exp, size_t buf_size=0) const; + H5std_string getDataTransform() const; - // Sets the dataset transfer property list status to TRUE or FALSE. - void setPreserve( bool status ) const; + // Sets the dataset transfer property list status to TRUE or FALSE. + void setPreserve( bool status ) const; - // Checks status of the dataset transfer property list. - bool getPreserve() const; + // Checks status of the dataset transfer property list. + bool getPreserve() const; - // Sets an exception handling callback for datatype conversion. - void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const; + // Sets an exception handling callback for datatype conversion. + void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const; - // Gets the exception handling callback for datatype conversion. - void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; + // Gets the exception handling callback for datatype conversion. + void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; - // Sets the memory manager for variable-length datatype - // allocation in H5Dread and H5Dvlen_reclaim. - void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, - H5MM_free_t free, void* free_info ) const; + // Sets the memory manager for variable-length datatype + // allocation in H5Dread and H5Dvlen_reclaim. + void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, + H5MM_free_t free, void* free_info ) const; - // alloc and free are set to NULL, indicating that system - // malloc and free are to be used. - void setVlenMemManager() const; + // alloc and free are set to NULL, indicating that system + // malloc and free are to be used. + void setVlenMemManager() const; - // Gets the memory manager for variable-length datatype - // allocation in H5Dread and H5Tvlen_reclaim. - void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, - H5MM_free_t& free, void** free_info ) const; + // Gets the memory manager for variable-length datatype + // allocation in H5Dread and H5Tvlen_reclaim. + void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, + H5MM_free_t& free, void** free_info ) const; - // Sets the size of a contiguous block reserved for small data. - void setSmallDataBlockSize(hsize_t size) const; + // Sets the size of a contiguous block reserved for small data. + void setSmallDataBlockSize(hsize_t size) const; - // Returns the current small data block size setting. - hsize_t getSmallDataBlockSize() const; + // Returns the current small data block size setting. + hsize_t getSmallDataBlockSize() const; - // Sets number of I/O vectors to be read/written in hyperslab I/O. - void setHyperVectorSize(size_t vector_size) const; + // Sets number of I/O vectors to be read/written in hyperslab I/O. + void setHyperVectorSize(size_t vector_size) const; - // Returns the number of I/O vectors to be read/written in - // hyperslab I/O. - size_t getHyperVectorSize() const; + // Returns the number of I/O vectors to be read/written in + // hyperslab I/O. + size_t getHyperVectorSize() const; - // Enables or disables error-detecting for a dataset reading - // process. - void setEDCCheck(H5Z_EDC_t check) const; + // Enables or disables error-detecting for a dataset reading + // process. + void setEDCCheck(H5Z_EDC_t check) const; - // Determines whether error-detection is enabled for dataset reads. - H5Z_EDC_t getEDCCheck() const; + // Determines whether error-detection is enabled for dataset reads. + H5Z_EDC_t getEDCCheck() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } - // Copy constructor: makes a copy of a DSetMemXferPropList object. - DSetMemXferPropList(const DSetMemXferPropList& orig); + // Copy constructor: makes a copy of a DSetMemXferPropList object. + DSetMemXferPropList(const DSetMemXferPropList& orig); - // Creates a copy of an existing dataset memory and transfer - // property list using the property list id. - DSetMemXferPropList(const hid_t plist_id); + // Creates a copy of an existing dataset memory and transfer + // property list using the property list id. + DSetMemXferPropList(const hid_t plist_id); - // Noop destructor - virtual ~DSetMemXferPropList(); + // Noop destructor + virtual ~DSetMemXferPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -122,7 +122,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static void deleteConstants(); private: - static DSetMemXferPropList* DEFAULT_; + static DSetMemXferPropList* DEFAULT_; // Creates the global constant, should only be used by the library static DSetMemXferPropList* getConstant(); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 8677b47..8f7e911 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -31,51 +31,51 @@ #include "H5AtomType.h" #include "H5IntType.h" #include "H5EnumType.h" -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset namespace H5 { //-------------------------------------------------------------------------- -// Function: EnumType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType() : DataType() {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: EnumType copy constructor -///\brief Copy constructor: makes a copy of the original EnumType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType copy constructor +///\brief Copy constructor: makes a copy of the original EnumType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType( const EnumType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an empty enumeration datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: EnumType overloaded constructor +///\brief Creates an empty enumeration datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the enum datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the enum datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType( const DataSet& dataset ) : DataType() { @@ -90,11 +90,11 @@ EnumType::EnumType( const DataSet& dataset ) : DataType() } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates a new enum datatype based on an integer datatype. -///\param data_type - IN: Base datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates a new enum datatype based on an integer datatype. +///\param data_type - IN: Base datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType( const IntType& data_type ) : DataType() { @@ -109,12 +109,12 @@ EnumType::EnumType( const IntType& data_type ) : DataType() } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief Inserts a new member to this enumeration datatype. -///\param name - IN: Name of the new member -///\param value - IN: Pointer to the value of the new member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief Inserts a new member to this enumeration datatype. +///\param name - IN: Name of the new member +///\param value - IN: Pointer to the value of the new member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void EnumType::insert( const char* name, void *value ) const { @@ -127,11 +127,11 @@ void EnumType::insert( const char* name, void *value ) const } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void EnumType::insert( const H5std_string& name, void *value ) const { @@ -139,13 +139,13 @@ void EnumType::insert( const H5std_string& name, void *value ) const } //-------------------------------------------------------------------------- -// Function: EnumType::nameOf -///\brief Returns the symbol name corresponding to a specified member -/// of this enumeration datatype. -///\param value - IN: Pointer to the value of the enum datatype -///\param size - IN: Size for the name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::nameOf +///\brief Returns the symbol name corresponding to a specified member +/// of this enumeration datatype. +///\param value - IN: Pointer to the value of the enum datatype +///\param size - IN: Size for the name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string EnumType::nameOf( void *value, size_t size ) const { @@ -168,13 +168,13 @@ H5std_string EnumType::nameOf( void *value, size_t size ) const } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief Retrieves the value corresponding to a member of this -/// enumeration datatype, given the member's name. -///\param name - IN: Name of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief Retrieves the value corresponding to a member of this +/// enumeration datatype, given the member's name. +///\param name - IN: Name of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void EnumType::valueOf( const char* name, void *value ) const { @@ -187,11 +187,11 @@ void EnumType::valueOf( const char* name, void *value ) const } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void EnumType::valueOf( const H5std_string& name, void *value ) const { @@ -199,13 +199,13 @@ void EnumType::valueOf( const H5std_string& name, void *value ) const } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief Returns the index of a member in this enumeration datatype. -///\param name - IN: Name of the queried member -///\return Index of the member if it exists. Index will have the value -/// between 0 and \c N-1, where \c N is the value returned by the -/// member function \c EnumType::getNmembers. -///\exception H5::DataTypeIException +// Function: EnumType::getMemberIndex +///\brief Returns the index of a member in this enumeration datatype. +///\param name - IN: Name of the queried member +///\return Index of the member if it exists. Index will have the value +/// between 0 and \c N-1, where \c N is the value returned by the +/// member function \c EnumType::getNmembers. +///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const char *name) const @@ -220,10 +220,10 @@ int EnumType::getMemberIndex(const char *name) const } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. +// Function: EnumType::getMemberIndex +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const H5std_string& name) const @@ -232,11 +232,11 @@ int EnumType::getMemberIndex(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: EnumType::getNmembers -///\brief Returns the number of members in this enumeration datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: EnumType::getNmembers +///\brief Returns the number of members in this enumeration datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- int EnumType::getNmembers() const { @@ -250,13 +250,13 @@ int EnumType::getNmembers() const } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberValue -///\brief Retrieves the value of a member in this enumeration datatype, -/// given the member's index. -///\param memb_no - IN: Index of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::getMemberValue +///\brief Retrieves the value of a member in this enumeration datatype, +/// given the member's index. +///\param memb_no - IN: Index of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void EnumType::getMemberValue( unsigned memb_no, void *value ) const { @@ -269,9 +269,9 @@ void EnumType::getMemberValue( unsigned memb_no, void *value ) const } //-------------------------------------------------------------------------- -// Function: EnumType destructor -///\brief Properly terminates access to this enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType destructor +///\brief Properly terminates access to this enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::~EnumType() {} diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index d4f42fb..3430e2a 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -23,52 +23,52 @@ namespace H5 { class H5_DLLCPP EnumType : public DataType { public: - // Creates an empty enumeration datatype based on a native signed - // integer type, whose size is given by size. - EnumType( size_t size ); + // Creates an empty enumeration datatype based on a native signed + // integer type, whose size is given by size. + EnumType( size_t size ); - // Gets the enum datatype of the specified dataset - EnumType( const DataSet& dataset ); // H5Dget_type + // Gets the enum datatype of the specified dataset + EnumType( const DataSet& dataset ); // H5Dget_type - // Creates a new enum datatype based on an integer datatype - EnumType( const IntType& data_type ); // H5Tenum_create + // Creates a new enum datatype based on an integer datatype + EnumType( const IntType& data_type ); // H5Tenum_create - // Returns the number of members in this enumeration datatype. - int getNmembers () const; + // Returns the number of members in this enumeration datatype. + int getNmembers () const; - // Returns the index of a member in this enumeration data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this enumeration data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the value of an enumeration datatype member - void getMemberValue( unsigned memb_no, void *value ) const; + // Returns the value of an enumeration datatype member + void getMemberValue( unsigned memb_no, void *value ) const; - // Inserts a new member to this enumeration type. - void insert( const char* name, void *value ) const; - void insert( const H5std_string& name, void *value ) const; + // Inserts a new member to this enumeration type. + void insert( const char* name, void *value ) const; + void insert( const H5std_string& name, void *value ) const; - // Returns the symbol name corresponding to a specified member - // of this enumeration datatype. - H5std_string nameOf( void *value, size_t size ) const; + // Returns the symbol name corresponding to a specified member + // of this enumeration datatype. + H5std_string nameOf( void *value, size_t size ) const; - // Returns the value corresponding to a specified member of this - // enumeration datatype. - void valueOf( const char* name, void *value ) const; - void valueOf( const H5std_string& name, void *value ) const; + // Returns the value corresponding to a specified member of this + // enumeration datatype. + void valueOf( const char* name, void *value ) const; + void valueOf( const H5std_string& name, void *value ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("EnumType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("EnumType"); } - // Default constructor - EnumType(); + // Default constructor + EnumType(); - // Creates an enumeration datatype using an existing id - EnumType( const hid_t existing_id ); + // Creates an enumeration datatype using an existing id + EnumType( const hid_t existing_id ); - // Copy constructor: makes a copy of the original EnumType object. - EnumType( const EnumType& original ); + // Copy constructor: makes a copy of the original EnumType object. + EnumType( const EnumType& original ); - virtual ~EnumType(); + virtual ~EnumType(); }; } #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index da42ca4..ecc50d2 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -23,40 +23,40 @@ namespace H5 { const char Exception::DEFAULT_MSG[] = "No detailed information provided"; //-------------------------------------------------------------------------- -// Function: Exception default constructor -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception default constructor +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- -// Function: Exception overloaded constructor -///\brief Creates an exception with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception overloaded constructor +///\brief Creates an exception with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception(const H5std_string& func, const H5std_string& message) : detail_message(message), func_name(func) {} //-------------------------------------------------------------------------- -// Function: Exception copy constructor -///\brief Copy constructor: makes a copy of the original Exception object. -///\param orig - IN: Exception instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception copy constructor +///\brief Copy constructor: makes a copy of the original Exception object. +///\param orig - IN: Exception instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception( const Exception& orig ) : detail_message(orig.detail_message), func_name(orig.func_name) {} //-------------------------------------------------------------------------- -// Function: Exception::getMajorString -///\brief Returns a text string that describes the error -/// specified by a major error number. -///\param err_major - IN: Major error number -///\return Major error string +// Function: Exception::getMajorString +///\brief Returns a text string that describes the error +/// specified by a major error number. +///\param err_major - IN: Major error number +///\return Major error string ///\par Description -/// In the failure case, the string "Invalid major error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid major error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getMajorString( hid_t err_major ) const { @@ -66,7 +66,7 @@ H5std_string Exception::getMajorString( hid_t err_major ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); + "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API @@ -77,7 +77,7 @@ H5std_string Exception::getMajorString( hid_t err_major ) const { delete []mesg_C; throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); + "H5Eget_msg failed"); } // Convert the C error description and return @@ -87,15 +87,15 @@ H5std_string Exception::getMajorString( hid_t err_major ) const } //-------------------------------------------------------------------------- -// Function: Exception::getMinorString -///\brief Returns a text string that describes the error -/// specified by a minor error number. -///\param err_minor - IN: Minor error number -///\return Minor error string +// Function: Exception::getMinorString +///\brief Returns a text string that describes the error +/// specified by a minor error number. +///\param err_minor - IN: Minor error number +///\return Minor error string ///\par Description -/// In the failure case, the string "Invalid minor error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid minor error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getMinorString( hid_t err_minor ) const { @@ -105,7 +105,7 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); + "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API @@ -116,7 +116,7 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const { delete []mesg_C; throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); + "H5Eget_msg failed"); } // Convert the C error description and return @@ -126,20 +126,20 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const } //-------------------------------------------------------------------------- -// Function: Exception::setAutoPrint -///\brief Turns on the automatic error printing. -///\param func - IN: Function to be called upon an error condition -///\param client_data - IN: Data passed to the error function +// Function: Exception::setAutoPrint +///\brief Turns on the automatic error printing. +///\param func - IN: Function to be called upon an error condition +///\param client_data - IN: Data passed to the error function ///\par Description -/// When the library is first initialized the auto printing -/// function, \a func, is set to the C API \c H5Eprint and -/// \a client_data is the standard error stream pointer, \c stderr. -/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD -/// direction. +/// When the library is first initialized the auto printing +/// function, \a func, is set to the C API \c H5Eprint and +/// \a client_data is the standard error stream pointer, \c stderr. +/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD +/// direction. ///\par -/// Users are encouraged to write their own more specific error -/// handlers -// Programmer Binh-Minh Ribler - 2000 +/// Users are encouraged to write their own more specific error +/// handlers +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) { @@ -151,9 +151,9 @@ void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) } //-------------------------------------------------------------------------- -// Function: Exception::dontPrint -///\brief Turns off the automatic error printing from the C library. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::dontPrint +///\brief Turns off the automatic error printing from the C library. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::dontPrint() { @@ -165,14 +165,14 @@ void Exception::dontPrint() } //-------------------------------------------------------------------------- -// Function: Exception::getAutoPrint -///\brief Retrieves the current settings for the automatic error -/// stack traversal function and its data. -///\param func - OUT: Current setting for the function to be -/// called upon an error condition -///\param client_data - OUT: Current setting for the data passed to -/// the error function -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getAutoPrint +///\brief Retrieves the current settings for the automatic error +/// stack traversal function and its data. +///\param func - OUT: Current setting for the function to be +/// called upon an error condition +///\param client_data - OUT: Current setting for the data passed to +/// the error function +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) { @@ -184,12 +184,12 @@ void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) } //-------------------------------------------------------------------------- -// Function: Exception::clearErrorStack -///\brief Clears the error stack for the current thread. +// Function: Exception::clearErrorStack +///\brief Clears the error stack for the current thread. ///\par Description -/// The stack is also cleared whenever a C API function is -/// called, with certain exceptions (for instance, \c H5Eprint). -// Programmer Binh-Minh Ribler - 2000 +/// The stack is also cleared whenever a C API function is +/// called, with certain exceptions (for instance, \c H5Eprint). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::clearErrorStack() { @@ -200,30 +200,30 @@ void Exception::clearErrorStack() } //-------------------------------------------------------------------------- -// Function: Exception::walkErrorStack -///\brief Walks the error stack for the current thread, calling the -/// specified function. -///\param direction - IN: Direction in which the error stack is to be walked -///\param func - IN: Function to be called for each error encountered -///\param client_data - IN: Data passed to the error function +// Function: Exception::walkErrorStack +///\brief Walks the error stack for the current thread, calling the +/// specified function. +///\param direction - IN: Direction in which the error stack is to be walked +///\param func - IN: Function to be called for each error encountered +///\param client_data - IN: Data passed to the error function ///\par Description -/// Valid values for \a direction include: -/// \li \c H5E_WALK_UPWARD - begin with the most specific error -/// and end at the API -/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the -/// inner-most function where the error was first detected +/// Valid values for \a direction include: +/// \li \c H5E_WALK_UPWARD - begin with the most specific error +/// and end at the API +/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the +/// inner-most function where the error was first detected ///\par -/// The function specified by \a func will be called for each -/// error in the error stack. The \c H5E_walk_t prototype is as -/// follows: +/// The function specified by \a func will be called for each +/// error in the error stack. The \c H5E_walk_t prototype is as +/// follows: ///\code /// typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data) /// int n - Indexed position of the error in the stack; it begins at zero -/// regardless of stack traversal direction +/// regardless of stack traversal direction /// H5E_error_t *err_desc - Pointer to a data structure describing the -/// error. This structure is listed below. +/// error. This structure is listed below. /// void *client_data - Pointer to client data in the format expected by -/// the user-defined function. +/// the user-defined function. ///\endcode ///\par /// Data structure to describe the error: @@ -238,7 +238,7 @@ void Exception::clearErrorStack() /// const char *desc; //optional supplied description /// } H5E_error2_t; ///\endcode -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, void* client_data ) { @@ -249,11 +249,11 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, voi } //-------------------------------------------------------------------------- -// Function: Exception::getDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getDetailMsg() const { @@ -261,11 +261,11 @@ H5std_string Exception::getDetailMsg() const } //-------------------------------------------------------------------------- -// Function: Exception::getCDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCDetailMsg() const { @@ -273,10 +273,10 @@ const char* Exception::getCDetailMsg() const } //-------------------------------------------------------------------------- -// Function: Exception::getFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getFuncName() const { @@ -284,10 +284,10 @@ H5std_string Exception::getFuncName() const } //-------------------------------------------------------------------------- -// Function: Exception::getCFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCFuncName() const { @@ -295,30 +295,30 @@ const char* Exception::getCFuncName() const } //-------------------------------------------------------------------------- -// Function: Exception::printErrorStack (static) -///\brief Prints the error stack in a default manner. -///\param stream - IN: File pointer, default to stderr -///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) -// Programmer Binh-Minh Ribler - Apr, 2014 (1.8.13) +// Function: Exception::printErrorStack (static) +///\brief Prints the error stack in a default manner. +///\param stream - IN: File pointer, default to stderr +///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) +// Programmer Binh-Minh Ribler - Apr, 2014 (1.8.13) //-------------------------------------------------------------------------- void Exception::printErrorStack(FILE* stream, hid_t err_stack) { herr_t ret_value = H5Eprint2(err_stack, stream); if( ret_value < 0 ) - throw Exception( "Printing error stack", "H5Eprint2 failed" ); + throw Exception( "Printing error stack", "H5Eprint2 failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::printError -// Purpose: Prints the error stack in a default manner. This member -// function is replaced by the static function printErrorStack -// and will be removed from the next major release. -// Parameter stream - IN: File pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::printError +// Purpose: Prints the error stack in a default manner. This member +// function is replaced by the static function printErrorStack +// and will be removed from the next major release. +// Parameter stream - IN: File pointer +// Programmer Binh-Minh Ribler - 2000 // Description: -// This function can be removed in next major release. -// -BMR, 2014/04/24 -// Removed from documentation. -BMR, 2016/03/23 +// This function can be removed in next major release. +// -BMR, 2014/04/24 +// Removed from documentation. -BMR, 2016/03/23 //-------------------------------------------------------------------------- void Exception::printError(FILE* stream) const { @@ -326,262 +326,262 @@ void Exception::printError(FILE* stream) const } //-------------------------------------------------------------------------- -// Function: Exception destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::~Exception() throw() {} //-------------------------------------------------------------------------- -// Subclass: FileIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: FileIException default constructor -///\brief Default constructor. +// Function: FileIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- -// Function: FileIException overloaded constructor -///\brief Creates a FileIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: FileIException overloaded constructor +///\brief Creates a FileIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- FileIException::FileIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: FileIException destructor -///\brief Noop destructor. +// Function: FileIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- FileIException::~FileIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: GroupIException default constructor -///\brief Default constructor. +// Function: GroupIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- -// Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: GroupIException overloaded constructor +///\brief Creates a GroupIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- GroupIException::GroupIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: GroupIException destructor -///\brief Noop destructor. +// Function: GroupIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- GroupIException::~GroupIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSpaceIException default constructor -///\brief Default constructor. +// Function: DataSpaceIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSpaceIException overloaded constructor +///\brief Creates a DataSpaceIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSpaceIException destructor -///\brief Noop destructor. +// Function: DataSpaceIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSpaceIException::~DataSpaceIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataTypeIException default constructor -///\brief Default constructor. +// Function: DataTypeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataTypeIException overloaded constructor +///\brief Creates a DataTypeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataTypeIException destructor -///\brief Noop destructor. +// Function: DataTypeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataTypeIException::~DataTypeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: PropListIException default constructor -///\brief Default constructor. +// Function: PropListIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- -// Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: PropListIException overloaded constructor +///\brief Creates a PropListIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- PropListIException::PropListIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: PropListIException destructor -///\brief Noop destructor. +// Function: PropListIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- PropListIException::~PropListIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSetIException default constructor -///\brief Default constructor. +// Function: DataSetIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSetIException overloaded constructor +///\brief Creates a DataSetIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSetIException::DataSetIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSetIException destructor -///\brief Noop destructor. +// Function: DataSetIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSetIException::~DataSetIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: AttributeIException default constructor -///\brief Default constructor. +// Function: AttributeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: AttributeIException overloaded constructor -///\brief Creates an AttributeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: AttributeIException overloaded constructor +///\brief Creates an AttributeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- AttributeIException::AttributeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: AttributeIException destructor -///\brief Noop destructor. +// Function: AttributeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- AttributeIException::~AttributeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: ReferenceException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: ReferenceException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: ReferenceException default constructor -///\brief Default constructor. +// Function: ReferenceException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- -// Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: ReferenceException overloaded constructor +///\brief Creates a ReferenceException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- ReferenceException::ReferenceException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: ReferenceException destructor -///\brief Noop destructor. +// Function: ReferenceException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- ReferenceException::~ReferenceException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LibraryIException default constructor -///\brief Default constructor. +// Function: LibraryIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- -// Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LibraryIException overloaded constructor +///\brief Creates a LibraryIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LibraryIException::LibraryIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LibraryIException destructor -///\brief Noop destructor. +// Function: LibraryIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LibraryIException::~LibraryIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LocationException -// Programmer Binh-Minh Ribler - 2014 +// Subclass: LocationException +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LocationException default constructor -///\brief Default constructor. +// Function: LocationException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LocationException::LocationException():Exception(){} //-------------------------------------------------------------------------- -// Function: LocationException overloaded constructor -///\brief Creates a LocationException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LocationException overloaded constructor +///\brief Creates a LocationException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LocationException::LocationException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LocationException destructor -///\brief Noop destructor. +// Function: LocationException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LocationException::~LocationException() throw() {} //-------------------------------------------------------------------------- -// Subclass: IdComponentException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: IdComponentException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: IdComponentException default constructor -///\brief Default constructor. +// Function: IdComponentException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- -// Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: IdComponentException overloaded constructor +///\brief Creates a IdComponentException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- IdComponentException::IdComponentException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: IdComponentException destructor -///\brief Noop destructor. +// Function: IdComponentException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- IdComponentException::~IdComponentException() throw() {} } // end namespace diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index c64cf2a..d6cc2ae 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -33,140 +33,140 @@ namespace H5 { */ class H5_DLLCPP Exception { public: - // Creates an exception with a function name where the failure occurs - // and an optional detailed message - Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + // Creates an exception with a function name where the failure occurs + // and an optional detailed message + Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - // Returns a character string that describes the error specified by - // a major error number. - H5std_string getMajorString( hid_t err_major_id ) const; + // Returns a character string that describes the error specified by + // a major error number. + H5std_string getMajorString( hid_t err_major_id ) const; - // Returns a character string that describes the error specified by - // a minor error number. - H5std_string getMinorString( hid_t err_minor_id ) const; + // Returns a character string that describes the error specified by + // a minor error number. + H5std_string getMinorString( hid_t err_minor_id ) const; - // Returns the detailed message set at the time the exception is thrown - H5std_string getDetailMsg() const; - const char* getCDetailMsg() const; // C string of detailed message - H5std_string getFuncName() const; // function name as a string object - const char* getCFuncName() const; // function name as a char string + // Returns the detailed message set at the time the exception is thrown + H5std_string getDetailMsg() const; + const char* getCDetailMsg() const; // C string of detailed message + H5std_string getFuncName() const; // function name as a string object + const char* getCFuncName() const; // function name as a char string - // Turns on the automatic error printing. - static void setAutoPrint( H5E_auto2_t& func, void* client_data); + // Turns on the automatic error printing. + static void setAutoPrint( H5E_auto2_t& func, void* client_data); - // Turns off the automatic error printing. - static void dontPrint(); + // Turns off the automatic error printing. + static void dontPrint(); - // Retrieves the current settings for the automatic error stack - // traversal function and its data. - static void getAutoPrint( H5E_auto2_t& func, void** client_data); + // Retrieves the current settings for the automatic error stack + // traversal function and its data. + static void getAutoPrint( H5E_auto2_t& func, void** client_data); - // Clears the error stack for the current thread. - static void clearErrorStack(); + // Clears the error stack for the current thread. + static void clearErrorStack(); - // Walks the error stack for the current thread, calling the - // specified function. - static void walkErrorStack( H5E_direction_t direction, - H5E_walk2_t func, void* client_data); + // Walks the error stack for the current thread, calling the + // specified function. + static void walkErrorStack( H5E_direction_t direction, + H5E_walk2_t func, void* client_data); - // Prints the error stack in a default manner. - static void printErrorStack(FILE* stream = stderr, - hid_t err_stack = H5E_DEFAULT); // Static - virtual void printError(FILE* stream = NULL) const; + // Prints the error stack in a default manner. + static void printErrorStack(FILE* stream = stderr, + hid_t err_stack = H5E_DEFAULT); // Static + virtual void printError(FILE* stream = NULL) const; - // Default constructor - Exception(); + // Default constructor + Exception(); - // copy constructor - Exception( const Exception& orig); + // copy constructor + Exception( const Exception& orig); - // virtual Destructor - virtual ~Exception() throw(); + // virtual Destructor + virtual ~Exception() throw(); protected: - // Default value for detail_message - static const char DEFAULT_MSG[]; + // Default value for detail_message + static const char DEFAULT_MSG[]; private: - H5std_string detail_message; - H5std_string func_name; + H5std_string detail_message; + H5std_string func_name; }; class H5_DLLCPP FileIException : public Exception { public: - FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - FileIException(); - virtual ~FileIException() throw(); + FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + FileIException(); + virtual ~FileIException() throw(); }; class H5_DLLCPP GroupIException : public Exception { public: - GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - GroupIException(); - virtual ~GroupIException() throw(); + GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + GroupIException(); + virtual ~GroupIException() throw(); }; class H5_DLLCPP DataSpaceIException : public Exception { public: - DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSpaceIException(); - virtual ~DataSpaceIException() throw(); + DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSpaceIException(); + virtual ~DataSpaceIException() throw(); }; class H5_DLLCPP DataTypeIException : public Exception { public: - DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataTypeIException(); - virtual ~DataTypeIException() throw(); + DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataTypeIException(); + virtual ~DataTypeIException() throw(); }; class H5_DLLCPP PropListIException : public Exception { public: - PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - PropListIException(); - virtual ~PropListIException() throw(); + PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + PropListIException(); + virtual ~PropListIException() throw(); }; class H5_DLLCPP DataSetIException : public Exception { public: - DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSetIException(); - virtual ~DataSetIException() throw(); + DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSetIException(); + virtual ~DataSetIException() throw(); }; class H5_DLLCPP AttributeIException : public Exception { public: - AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - AttributeIException(); - virtual ~AttributeIException() throw(); + AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + AttributeIException(); + virtual ~AttributeIException() throw(); }; class H5_DLLCPP ReferenceException : public Exception { public: - ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - ReferenceException(); - virtual ~ReferenceException() throw(); + ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + ReferenceException(); + virtual ~ReferenceException() throw(); }; class H5_DLLCPP LibraryIException : public Exception { public: - LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LibraryIException(); - virtual ~LibraryIException() throw(); + LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LibraryIException(); + virtual ~LibraryIException() throw(); }; class H5_DLLCPP LocationException : public Exception { public: - LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LocationException(); - virtual ~LocationException() throw(); + LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LocationException(); + virtual ~LocationException() throw(); }; class H5_DLLCPP IdComponentException : public Exception { public: - IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - IdComponentException(); - virtual ~IdComponentException() throw(); + IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + IdComponentException(); + virtual ~IdComponentException() throw(); }; } diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index a09cf55..548d9d9 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -75,40 +75,40 @@ void FileAccPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const FileAccPropList& FileAccPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer: Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: FileAccPropList instance to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: FileAccPropList instance to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const FileAccPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. +// Function: FileAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList::setStdio -///\brief Modifies this property list to use the \c H5FD_STDIO driver. +// Function: FileAccPropList::setStdio +///\brief Modifies this property list to use the \c H5FD_STDIO driver. /// -///\exception H5::PropListIException +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setStdio() const @@ -121,14 +121,14 @@ void FileAccPropList::setStdio() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getDriver -///\brief Return the ID of the low-level file driver. -///\return A low-level driver ID which is the same ID used when the -/// driver was set for the property list. The driver ID is -/// only valid as long as the file driver remains registered. -/// Valid driver identifiers can be found at: +// Function: FileAccPropList::getDriver +///\brief Return the ID of the low-level file driver. +///\return A low-level driver ID which is the same ID used when the +/// driver was set for the property list. The driver ID is +/// only valid as long as the file driver remains registered. +/// Valid driver identifiers can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver -///\exception H5::PropListIException +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t FileAccPropList::getDriver() const @@ -142,14 +142,14 @@ hid_t FileAccPropList::getDriver() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setDriver -///\brief Set file driver for this property list. -///\param new_driver_id - IN: File driver -///\param new_driver_info - IN: Struct containing the driver-specific properites -///\exception H5::PropListIException +// Function: FileAccPropList::setDriver +///\brief Set file driver for this property list. +///\param new_driver_id - IN: File driver +///\param new_driver_info - IN: Struct containing the driver-specific properites +///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C -/// layer Reference Manual at: +/// For a list of valid driver identifiers, please see the C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -163,10 +163,10 @@ void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamilyOffset -///\brief Sets offset for family driver. -///\param offset - IN: offset value -///\exception H5::PropListIException +// Function: FileAccPropList::setFamilyOffset +///\brief Sets offset for family driver. +///\param offset - IN: offset value +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFamilyOffset(hsize_t offset) const @@ -179,10 +179,10 @@ void FileAccPropList::setFamilyOffset(hsize_t offset) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamilyOffset -///\brief Get offset for family driver. -///\return Offset for family driver -///\exception H5::PropListIException +// Function: FileAccPropList::getFamilyOffset +///\brief Get offset for family driver. +///\return Offset for family driver +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getFamilyOffset() const @@ -197,17 +197,17 @@ hsize_t FileAccPropList::getFamilyOffset() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCore -///\brief Modifies this file access property list to use the \c H5FD_CORE -/// driver. -///\param increment - IN: Specifies how much memory to increase each -/// time more memory is needed, in bytes -///\param backing_store - IN: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException +// Function: FileAccPropList::setCore +///\brief Modifies this file access property list to use the \c H5FD_CORE +/// driver. +///\param increment - IN: Specifies how much memory to increase each +/// time more memory is needed, in bytes +///\param backing_store - IN: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException ///\par Description -/// For more details on the use of \c H5FD_CORE driver, please -/// refer to +/// For more details on the use of \c H5FD_CORE driver, please +/// refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -221,12 +221,12 @@ void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCore -///\brief Queries core file driver properties. -///\param increment - OUT: Size of memory increment, in bytes -///\param backing_store - OUT: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException +// Function: FileAccPropList::getCore +///\brief Queries core file driver properties. +///\param increment - OUT: Size of memory increment, in bytes +///\param backing_store - OUT: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const @@ -239,14 +239,14 @@ void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamily -///\brief Sets this file access property list to use the family driver. -///\param memb_size - IN: Size in bytes of each file member -///\param memb_plist - IN: File access property list to be used for -/// each family member -///\exception H5::PropListIException +// Function: FileAccPropList::setFamily +///\brief Sets this file access property list to use the family driver. +///\param memb_size - IN: Size in bytes of each file member +///\param memb_plist - IN: File access property list to be used for +/// each family member +///\exception H5::PropListIException ///\par Description -/// Note that \a memb_size is used only when creating a new file. +/// Note that \a memb_size is used only when creating a new file. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const @@ -259,13 +259,13 @@ void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_ } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief Returns information about the family file access property -/// list. -///\param memb_size - OUT: Size in bytes of each file member -///\param memb_plist - OUT: Retrieved file access property list for each -/// file member -///\exception H5::PropListIException +// Function: FileAccPropList::getFamily +///\brief Returns information about the family file access property +/// list. +///\param memb_size - OUT: Size in bytes of each file member +///\param memb_plist - OUT: Retrieved file access property list for each +/// file member +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const @@ -280,13 +280,13 @@ void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts and its return value. -///\param memb_size - OUT: Size in bytes of each file member -///\return The file access property list for each file member -///\exception H5::PropListIException +// Function: FileAccPropList::getFamily +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts and its return value. +///\param memb_size - OUT: Size in bytes of each file member +///\return The file access property list for each file member +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const @@ -302,20 +302,20 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief Emulates the old split file driver, which stored meta data -/// in one file and raw data in another file. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c char* -///\param raw_ext - IN: Raw data filename extension as \c char* -///\exception H5::PropListIException +// Function: FileAccPropList::setSplit +///\brief Emulates the old split file driver, which stored meta data +/// in one file and raw data in another file. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c char* +///\param raw_ext - IN: Raw data filename extension as \c char* +///\exception H5::PropListIException ///\par Description -/// Temporary - For information, please refer to: +/// Temporary - For information, please refer to: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit // Programmer: Binh-Minh Ribler - April, 2004 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const { @@ -329,17 +329,17 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief This is an overloaded member function, provided for convenience. -/// It takes character arguments as \c H5std_string. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c H5std_string -///\param raw_ext - IN: Raw data filename extension as \c H5std_string -///\exception H5::PropListIException +// Function: FileAccPropList::setSplit +///\brief This is an overloaded member function, provided for convenience. +/// It takes character arguments as \c H5std_string. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c H5std_string +///\param raw_ext - IN: Raw data filename extension as \c H5std_string +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const { @@ -351,11 +351,11 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP // -BMR, March, 2012 //-------------------------------------------------------------------------- -// Function: FileAccPropList::getSieveBufSize -///\brief Returns the current settings for the data sieve buffer size -/// property from this property list. -///\return Data sieve buffer size, in bytes -///\exception H5::PropListIException +// Function: FileAccPropList::getSieveBufSize +///\brief Returns the current settings for the data sieve buffer size +/// property from this property list. +///\return Data sieve buffer size, in bytes +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t FileAccPropList::getSieveBufSize() const @@ -370,12 +370,12 @@ size_t FileAccPropList::getSieveBufSize() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSieveBufSize -///\brief Sets the maximum size of the data sieve buffer. -///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setSieveBufSize +///\brief Sets the maximum size of the data sieve buffer. +///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer +///\exception H5::PropListIException ///\par Description -/// For detail on data sieving, please refer to +/// For detail on data sieving, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -389,13 +389,13 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMetaBlockSize -///\brief Sets the minimum size of metadata block allocations. -///\param block_size - IN: Minimum size, in bytes, of metadata -/// block allocations -///\exception H5::PropListIException +// Function: FileAccPropList::setMetaBlockSize +///\brief Sets the minimum size of metadata block allocations. +///\param block_size - IN: Minimum size, in bytes, of metadata +/// block allocations +///\exception H5::PropListIException ///\par Description -/// For more detail, please see the C layer Reference Manual at: +/// For more detail, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -409,10 +409,10 @@ void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMetaBlockSize -///\brief Returns the current metadata block size setting. -///\return Metadata block size -///\exception H5::PropListIException +// Function: FileAccPropList::getMetaBlockSize +///\brief Returns the current metadata block size setting. +///\return Metadata block size +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getMetaBlockSize() const @@ -427,15 +427,15 @@ hsize_t FileAccPropList::getMetaBlockSize() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief Modifies this file access property list to use the logging -/// driver. -///\param logfile - IN: Name of the log file -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setLog +///\brief Modifies this file access property list to use the logging +/// driver. +///\param logfile - IN: Name of the log file +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer +///\exception H5::PropListIException ///\par Description -/// For detail on \a flags, please refer to +/// For detail on \a flags, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -449,13 +449,13 @@ void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_siz } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param logfile - IN: Name of the log file - string -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer +// Function: FileAccPropList::setLog +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param logfile - IN: Name of the log file - string +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const @@ -464,11 +464,11 @@ void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSec2 -///\brief Modifies this file access property list to use the sec2 -/// driver. +// Function: FileAccPropList::setSec2 +///\brief Modifies this file access property list to use the sec2 +/// driver. /// -///\exception H5::PropListIException +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSec2() const @@ -481,20 +481,20 @@ void FileAccPropList::setSec2() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setAlignment -///\brief Sets the alignment properties of this property list. -///\param threshold - IN: Threshold value for file object size -///\param alignment - IN: Alignment value -///\exception H5::PropListIException +// Function: FileAccPropList::setAlignment +///\brief Sets the alignment properties of this property list. +///\param threshold - IN: Threshold value for file object size +///\param alignment - IN: Alignment value +///\exception H5::PropListIException ///\par Description -/// The parameter \a threshold must have a non-negative value. -/// Note that setting the threshold value to 0 (zero) has the -/// effect of a special case, forcing everything to be aligned. -/// The parameter \a alignment must have a positive value. +/// The parameter \a threshold must have a non-negative value. +/// Note that setting the threshold value to 0 (zero) has the +/// effect of a special case, forcing everything to be aligned. +/// The parameter \a alignment must have a positive value. /// -/// For detail on \a setting alignment, please refer to +/// For detail on \a setting alignment, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment -// Programmer: Binh-Minh Ribler - 2000 +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const { @@ -506,13 +506,13 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getAlignment -///\brief Returns the current settings for alignment properties from -/// this property list. -///\param threshold - OUT: Retrieved threshold value for file object size -///\param alignment - OUT: Retrieved alignment value -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getAlignment +///\brief Returns the current settings for alignment properties from +/// this property list. +///\param threshold - OUT: Retrieved threshold value for file object size +///\param alignment - OUT: Retrieved alignment value +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const { @@ -524,12 +524,12 @@ void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) con } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMultiType -///\brief Sets data type for \c MULTI driver. -///\param dtype - IN: Type of data -///\exception H5::PropListIException +// Function: FileAccPropList::setMultiType +///\brief Sets data type for \c MULTI driver. +///\param dtype - IN: Type of data +///\exception H5::PropListIException ///\par Description -/// More details and valid values for \a dtype can be found at: +/// More details and valid values for \a dtype can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -543,12 +543,12 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMultiType -///\brief Returns the data type property for \c MULTI driver. -///\return The data type property -///\exception H5::PropListIException +// Function: FileAccPropList::getMultiType +///\brief Returns the data type property for \c MULTI driver. +///\return The data type property +///\exception H5::PropListIException ///\par Description -/// More details and possible returned values can be found at: +/// More details and possible returned values can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -564,21 +564,21 @@ H5FD_mem_t FileAccPropList::getMultiType() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCache -///\brief Sets the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - IN: Number of elements in the meta data cache -///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - IN: Preemption policy -///\exception H5::PropListIException +// Function: FileAccPropList::setCache +///\brief Sets the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - IN: Number of elements in the meta data cache +///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - IN: Preemption policy +///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. -// Programmer: Binh-Minh Ribler - 2000 +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const { @@ -590,14 +590,14 @@ void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_ } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCache -///\brief Queries the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - OUT: Number of elements in the meta data cache -///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - OUT: Preemption policy -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getCache +///\brief Queries the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - OUT: Number of elements in the meta data cache +///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - OUT: Preemption policy +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const { @@ -609,10 +609,10 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFcloseDegree -///\brief Sets the degree for the file close behavior. -///\param degree - IN: -///\exception H5::PropListIException +// Function: FileAccPropList::setFcloseDegree +///\brief Sets the degree for the file close behavior. +///\param degree - IN: +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const @@ -625,10 +625,10 @@ void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFcloseDegree -///\brief Returns the degree for the file close behavior. -///\return The degree for the file close behavior -///\exception H5::PropListIException +// Function: FileAccPropList::getFcloseDegree +///\brief Returns the degree for the file close behavior. +///\return The degree for the file close behavior +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5F_close_degree_t FileAccPropList::getFcloseDegree() const @@ -643,15 +643,15 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setGcReferences -///\brief Sets garbage collecting references flag. -///\param gc_ref - IN: Flag setting reference garbage collection to -/// on (1) or off (0). -///\exception H5::PropListIException +// Function: FileAccPropList::setGcReferences +///\brief Sets garbage collecting references flag. +///\param gc_ref - IN: Flag setting reference garbage collection to +/// on (1) or off (0). +///\exception H5::PropListIException ///\par Description -/// For detail on \a fapl, please refer to +/// For detail on \a fapl, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences -// Programmer: Binh-Minh Ribler - 2000 +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setGcReferences( unsigned gc_ref ) const { @@ -663,11 +663,11 @@ void FileAccPropList::setGcReferences( unsigned gc_ref ) const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getGcReferences -///\brief Returns the garbage collecting references setting. -///\return Garbage collecting references setting, 0 (off) or 1 (on) -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getGcReferences +///\brief Returns the garbage collecting references setting. +///\return Garbage collecting references setting, 0 (off) or 1 (on) +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileAccPropList::getGcReferences() const { @@ -683,24 +683,24 @@ unsigned FileAccPropList::getGcReferences() const } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLibverBounds -///\brief Sets bounds on versions of library format to be used when creating -/// or writing objects. -///\param libver_low - IN: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - IN: Latest version of the library that will be -///\exception H5::PropListIException +// Function: FileAccPropList::setLibverBounds +///\brief Sets bounds on versions of library format to be used when creating +/// or writing objects. +///\param libver_low - IN: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - IN: Latest version of the library that will be +///\exception H5::PropListIException ///\par Description -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_LIBVER_EARLIEST (Default) -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// Valid values of \a libver_low are as follows: +/// \li \c H5F_LIBVER_EARLIEST (Default) +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// Valid values of \a libver_high are as follows: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST (Default) +/// Valid values of \a libver_high are as follows: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST (Default) /// -/// For more details, please refer to +/// For more details, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds // Programmer: Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- @@ -709,29 +709,29 @@ void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libv herr_t ret_value = H5Pset_libver_bounds(id, libver_low, libver_high); if (ret_value < 0) { - throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); + throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getLibverBounds -///\brief Gets the current settings for the library version format bounds -/// from a file access property list. -///\param libver_low - OUT: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - OUT: Latest version of the library that will be -/// used for creating or writing objects -///\exception H5::PropListIException +// Function: FileAccPropList::getLibverBounds +///\brief Gets the current settings for the library version format bounds +/// from a file access property list. +///\param libver_low - OUT: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - OUT: Latest version of the library that will be +/// used for creating or writing objects +///\exception H5::PropListIException ///\par Description -/// On success, the argument \a libver_low can have the following -/// values: -/// \li \c H5F_LIBVER_EARLIEST -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// On success, the argument \a libver_low can have the following +/// values: +/// \li \c H5F_LIBVER_EARLIEST +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// and \a libver_high: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// and \a libver_high: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST // Programmer: Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const @@ -739,14 +739,14 @@ void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& li herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high); if( ret_value < 0 ) { - throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); + throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::~FileAccPropList() {} diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 61dec04..a5fa5f2 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -25,121 +25,121 @@ namespace H5 { //! Class FileAccPropList represents the HDF5 file access property list. class H5_DLLCPP FileAccPropList : public PropList { public: - ///\brief Default file access property list. - static const FileAccPropList& DEFAULT; + ///\brief Default file access property list. + static const FileAccPropList& DEFAULT; - // Creates a file access property list. - FileAccPropList(); + // Creates a file access property list. + FileAccPropList(); - // Modifies this property list to use the H5FD_STDIO driver - void setStdio() const; + // Modifies this property list to use the H5FD_STDIO driver + void setStdio() const; - // Set file driver for this property list - void setDriver(hid_t new_driver_id, const void *new_driver_info) const; + // Set file driver for this property list + void setDriver(hid_t new_driver_id, const void *new_driver_info) const; - // Returns a low-level file driver identifier. - hid_t getDriver() const; + // Returns a low-level file driver identifier. + hid_t getDriver() const; - // Sets offset for family driver. - void setFamilyOffset(hsize_t offset) const; + // Sets offset for family driver. + void setFamilyOffset(hsize_t offset) const; - // Gets offset for family driver. - hsize_t getFamilyOffset() const; + // Gets offset for family driver. + hsize_t getFamilyOffset() const; - // Modifies this file access property list to use the sec2 driver. - void setSec2() const; + // Modifies this file access property list to use the sec2 driver. + void setSec2() const; - // Modifies this file access property list to use the H5FD_CORE - // driver. - void setCore (size_t increment, hbool_t backing_store) const; + // Modifies this file access property list to use the H5FD_CORE + // driver. + void setCore (size_t increment, hbool_t backing_store) const; - // Queries H5FD_CORE driver properties. - void getCore (size_t& increment, hbool_t& backing_store) const; + // Queries H5FD_CORE driver properties. + void getCore (size_t& increment, hbool_t& backing_store) const; - // Sets this file access properties list to the family driver. - void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const; + // Sets this file access properties list to the family driver. + void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const; - // Returns information about the family file access property list. - void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; - FileAccPropList getFamily(hsize_t& memb_size) const; + // Returns information about the family file access property list. + void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; + FileAccPropList getFamily(hsize_t& memb_size) const; - // Emulates the old split file driver, - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const char* meta_ext = ".meta", - const char* raw_ext = ".raw" ) const; - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const H5std_string& meta_ext = ".meta", - const H5std_string& raw_ext = ".raw") const; + // Emulates the old split file driver, + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const char* meta_ext = ".meta", + const char* raw_ext = ".raw" ) const; + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const H5std_string& meta_ext = ".meta", + const H5std_string& raw_ext = ".raw") const; - // Sets the maximum size of the data sieve buffer. - void setSieveBufSize(size_t bufsize) const; + // Sets the maximum size of the data sieve buffer. + void setSieveBufSize(size_t bufsize) const; - // Returns the current settings for the data sieve buffer size - // property - size_t getSieveBufSize() const; + // Returns the current settings for the data sieve buffer size + // property + size_t getSieveBufSize() const; - // Sets the minimum size of metadata block allocations. - void setMetaBlockSize(hsize_t &block_size) const; + // Sets the minimum size of metadata block allocations. + void setMetaBlockSize(hsize_t &block_size) const; - // Returns the current metadata block size setting. - hsize_t getMetaBlockSize() const; + // Returns the current metadata block size setting. + hsize_t getMetaBlockSize() const; - // Modifies this file access property list to use the logging driver. - void setLog(const char *logfile, unsigned flags, size_t buf_size) const; - void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; + // Modifies this file access property list to use the logging driver. + void setLog(const char *logfile, unsigned flags, size_t buf_size) const; + void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; - // Sets alignment properties of this file access property list - void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; + // Sets alignment properties of this file access property list + void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; - // Retrieves the current settings for alignment properties from - // this property list. - void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; + // Retrieves the current settings for alignment properties from + // this property list. + void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; - // Sets data type for multi driver. - void setMultiType(H5FD_mem_t dtype) const; + // Sets data type for multi driver. + void setMultiType(H5FD_mem_t dtype) const; - // Returns the data type property for MULTI driver. - H5FD_mem_t getMultiType() const; + // Returns the data type property for MULTI driver. + H5FD_mem_t getMultiType() const; - // Sets the meta data cache and raw data chunk cache parameters. - void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; + // Sets the meta data cache and raw data chunk cache parameters. + void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; - // Queries the meta data cache and raw data chunk cache parameters. - void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; + // Queries the meta data cache and raw data chunk cache parameters. + void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; - // Sets the degree for the file close behavior. - void setFcloseDegree(H5F_close_degree_t degree) const; + // Sets the degree for the file close behavior. + void setFcloseDegree(H5F_close_degree_t degree) const; - // Returns the degree for the file close behavior. - H5F_close_degree_t getFcloseDegree() const; + // Returns the degree for the file close behavior. + H5F_close_degree_t getFcloseDegree() const; - // Sets garbage collecting references flag. - void setGcReferences( unsigned gc_ref = 0 ) const; + // Sets garbage collecting references flag. + void setGcReferences( unsigned gc_ref = 0 ) const; - // Returns garbage collecting references setting. - unsigned getGcReferences() const; + // Returns garbage collecting references setting. + unsigned getGcReferences() const; - // Sets bounds on versions of library format to be used when creating - // or writing objects. - void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; + // Sets bounds on versions of library format to be used when creating + // or writing objects. + void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; - // Gets the current settings for the library version format bounds. - void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; + // Gets the current settings for the library version format bounds. + void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FileAccPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FileAccPropList"); } - // Copy constructor: creates a copy of a FileAccPropList object. - FileAccPropList( const FileAccPropList& original ); + // Copy constructor: creates a copy of a FileAccPropList object. + FileAccPropList( const FileAccPropList& original ); - // Creates a copy of an existing file access property list - // using the property list id. - FileAccPropList (const hid_t plist_id); + // Creates a copy of an existing file access property list + // using the property list id. + FileAccPropList (const hid_t plist_id); - // Noop destructor - virtual ~FileAccPropList(); + // Noop destructor + virtual ~FileAccPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index cc4e26d..1da3aa8 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -73,48 +73,48 @@ void FileCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property +// Purpose Constant for default property //-------------------------------------------------------------------------- const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: FileCreatPropList default constructor -///\brief Default constructor: Creates a file create property list -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList default constructor +///\brief Default constructor: Creates a file create property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// FileCreatPropList object. -///\param original - IN: FileCreatPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// FileCreatPropList object. +///\param original - IN: FileCreatPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList overloaded constructor -///\brief Creates a file creation property list using the id of an -/// existing one. -///\param plist_id - IN: FileCreatPropList id to use -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList overloaded constructor +///\brief Creates a file creation property list using the id of an +/// existing one. +///\param plist_id - IN: FileCreatPropList id to use +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getVersion -///\brief Retrieves version information for various parts of a file. -///\param super - OUT: The file super block. -///\param freelist - OUT: The global free list. -///\param stab - OUT: The root symbol table entry. -///\param shhdr - OUT: Shared object headers. -///\exception H5::PropListIException +// Function: FileCreatPropList::getVersion +///\brief Retrieves version information for various parts of a file. +///\param super - OUT: The file super block. +///\param freelist - OUT: The global free list. +///\param stab - OUT: The root symbol table entry. +///\param shhdr - OUT: Shared object headers. +///\exception H5::PropListIException ///\par Description -/// Any (or even all) of the output arguments can be null pointers. -// Programmer Binh-Minh Ribler - 2000 +/// Any (or even all) of the output arguments can be null pointers. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const { @@ -122,19 +122,19 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::getVersion", - "H5Pget_version failed"); + "H5Pget_version failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setUserblock -///\brief Sets the user block size field of this file creation property list. -///\param size - IN: User block size to be set, in bytes -///\exception H5::PropListIException +// Function: FileCreatPropList::setUserblock +///\brief Sets the user block size field of this file creation property list. +///\param size - IN: User block size to be set, in bytes +///\exception H5::PropListIException ///\par Description -/// The default user block size is 0; it may be set to any power -/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) -// Programmer Binh-Minh Ribler - 2000 +/// The default user block size is 0; it may be set to any power +/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setUserblock( hsize_t size ) const { @@ -142,16 +142,16 @@ void FileCreatPropList::setUserblock( hsize_t size ) const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::setUserblock", - "H5Pset_userblock failed"); + "H5Pset_userblock failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getUserblock -///\brief Returns the user block size of this file creation property list. -///\return User block size -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList::getUserblock +///\brief Returns the user block size of this file creation property list. +///\return User block size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hsize_t FileCreatPropList::getUserblock() const { @@ -160,23 +160,23 @@ hsize_t FileCreatPropList::getUserblock() const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::getUserblock", - "H5Pget_userblock failed"); + "H5Pget_userblock failed"); } return( userblock_size ); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSizes -///\brief Sets the byte size of the offsets and lengths used to -/// address objects in an HDF5 file. -///\param sizeof_addr - IN: Size of an object offset in bytes -///\param sizeof_size - IN: Size of an object length in bytes. -///\exception H5::PropListIException +// Function: FileCreatPropList::setSizes +///\brief Sets the byte size of the offsets and lengths used to +/// address objects in an HDF5 file. +///\param sizeof_addr - IN: Size of an object offset in bytes +///\param sizeof_size - IN: Size of an object length in bytes. +///\exception H5::PropListIException ///\par Description -/// For information on setting sizes, please refer to the -/// C layer Reference Manual at: +/// For information on setting sizes, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const { @@ -184,17 +184,17 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::setSizes", - "H5Pset_sizes failed"); + "H5Pset_sizes failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSizes -///\brief Retrieves the size of the offsets and lengths used in an -/// HDF5 file. +// Function: FileCreatPropList::getSizes +///\brief Retrieves the size of the offsets and lengths used in an +/// HDF5 file. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const { @@ -202,21 +202,21 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::getSizes", - "H5Pget_sizes failed"); + "H5Pget_sizes failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSymk -///\brief Sets the size of parameters used to control the symbol table -/// nodes. -///\param ik - IN: Symbol table tree rank -///\param lk - IN: Symbol table node size -///\exception H5::PropListIException +// Function: FileCreatPropList::setSymk +///\brief Sets the size of parameters used to control the symbol table +/// nodes. +///\param ik - IN: Symbol table tree rank +///\param lk - IN: Symbol table node size +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const { @@ -224,20 +224,20 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::setSymk", - "H5Pset_sym_k failed"); + "H5Pset_sym_k failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSymk -///\brief Retrieves the size of the symbol table B-tree 1/2 rank and -/// the symbol table leaf node 1/2 size. +// Function: FileCreatPropList::getSymk +///\brief Retrieves the size of the symbol table B-tree 1/2 rank and +/// the symbol table leaf node 1/2 size. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const { @@ -245,20 +245,20 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::getSymk", - "H5Pget_sym_k failed"); + "H5Pget_sym_k failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setIstorek -///\brief Sets the size of the parameter used to control the B-trees -/// for indexing chunked datasets. -///\param ik - IN: 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::setIstorek +///\brief Sets the size of the parameter used to control the B-trees +/// for indexing chunked datasets. +///\param ik - IN: 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek( unsigned ik ) const { @@ -266,19 +266,19 @@ void FileCreatPropList::setIstorek( unsigned ik ) const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::setIstorek", - "H5Pset_istore_k failed"); + "H5Pset_istore_k failed"); } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getIstorek -///\brief Returns the 1/2 rank of an indexed storage B-tree. -///\return 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::getIstorek +///\brief Returns the 1/2 rank of an indexed storage B-tree. +///\return 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const { @@ -287,15 +287,15 @@ unsigned FileCreatPropList::getIstorek() const if( ret_value < 0 ) { throw PropListIException("FileCreatPropList::getIstorek", - "H5Pget_istore_k failed"); + "H5Pget_istore_k failed"); } return( ik ); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::~FileCreatPropList() {} diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index fc43448..598af87 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -22,65 +22,65 @@ namespace H5 { //! Class FileCreatPropList represents the HDF5 file create property list. class H5_DLLCPP FileCreatPropList : public PropList { public: - ///\brief Default file creation property list. - static const FileCreatPropList& DEFAULT; + ///\brief Default file creation property list. + static const FileCreatPropList& DEFAULT; - // Creates a file create property list. - FileCreatPropList(); + // Creates a file create property list. + FileCreatPropList(); - // Retrieves version information for various parts of a file. - void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; + // Retrieves version information for various parts of a file. + void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; - // Sets the userblock size field of a file creation property list. - void setUserblock( hsize_t size ) const; + // Sets the userblock size field of a file creation property list. + void setUserblock( hsize_t size ) const; - // Gets the size of a user block in this file creation property list. - hsize_t getUserblock() const; + // Gets the size of a user block in this file creation property list. + hsize_t getUserblock() const; - // Retrieves the size-of address and size quantities stored in a - // file according to this file creation property list. - void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; + // Retrieves the size-of address and size quantities stored in a + // file according to this file creation property list. + void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; - // Sets file size-of addresses and sizes. - void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const; + // Sets file size-of addresses and sizes. + void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const; - // Retrieves the size of the symbol table B-tree 1/2 rank and the - // symbol table leaf node 1/2 size. - void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const; + // Retrieves the size of the symbol table B-tree 1/2 rank and the + // symbol table leaf node 1/2 size. + void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const; - // Sets the size of parameters used to control the symbol table nodes. - void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const; + // Sets the size of parameters used to control the symbol table nodes. + void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const; - // Returns the 1/2 rank of an indexed storage B-tree. - unsigned getIstorek() const; + // Returns the 1/2 rank of an indexed storage B-tree. + unsigned getIstorek() const; - // Sets the size of parameter used to control the B-trees for - // indexing chunked datasets. - void setIstorek( unsigned ik ) const; + // Sets the size of parameter used to control the B-trees for + // indexing chunked datasets. + void setIstorek( unsigned ik ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FileCreatPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FileCreatPropList"); } - // Copy constructor: creates a copy of a FileCreatPropList object. - FileCreatPropList(const FileCreatPropList& orig); + // Copy constructor: creates a copy of a FileCreatPropList object. + FileCreatPropList(const FileCreatPropList& orig); - // Creates a copy of an existing file create property list - // using the property list id. - FileCreatPropList (const hid_t plist_id); + // Creates a copy of an existing file create property list + // using the property list id. + FileCreatPropList (const hid_t plist_id); - // Noop destructor - virtual ~FileCreatPropList(); + // Noop destructor + virtual ~FileCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the global constant, should only be used by the library - static void deleteConstants(); + // Deletes the global constant, should only be used by the library + static void deleteConstants(); private: - static FileCreatPropList* DEFAULT_; + static FileCreatPropList* DEFAULT_; - // Creates the global constant, should only be used by the library - static FileCreatPropList* getConstant(); + // Creates the global constant, should only be used by the library + static FileCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index d1b7b06..9475da9 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -45,74 +45,74 @@ namespace H5 { #endif // H5_NO_STD //-------------------------------------------------------------------------- -// Function H5File default constructor -///\brief Default constructor: creates a stub H5File object. -// Programmer Binh-Minh Ribler - 2000 +// Function H5File default constructor +///\brief Default constructor: creates a stub H5File object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates or opens an HDF5 file depending on the parameter flags. -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: H5File overloaded constructor +///\brief Creates or opens an HDF5 file depending on the parameter flags. +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. -/// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive -/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise -/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// Valid values of \a flags include: +/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, +/// erasing all data previously stored in +/// the file. +/// \li \c H5F_ACC_EXCL - Fail if file already exists. +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already +/// exists, and fail, otherwise +/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already +/// exists, and fail, otherwise ///\par -/// For info on file creation in the case of an already-open file, -/// please refer to the \b Special \b case section in the C layer -/// Reference Manual at: +/// For info on file creation in the case of an already-open file, +/// please refer to the \b Special \b case section in the C layer +/// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID) { try { - p_get_file(name, flags, create_plist, access_plist); + p_get_file(name, flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief This is another overloaded constructor. It differs from the -/// above constructor only in the type of the \a name argument. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File overloaded constructor +///\brief This is another overloaded constructor. It differs from the +/// above constructor only in the type of the \a name argument. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID) { try { - p_get_file(name.c_str(), flags, create_plist, access_plist); + p_get_file(name.c_str(), flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -120,10 +120,10 @@ H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPro //-------------------------------------------------------------------------- // This function is private and contains common code between the // constructors taking a string or a char* -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// - removed H5F_ACC_CREAT because H5Fcreate will fail with -// H5F_ACC_CREAT. - BMR, Sep 17, 2014 +// - removed H5F_ACC_CREAT because H5Fcreate will fail with +// H5F_ACC_CREAT. - BMR, Sep 17, 2014 //-------------------------------------------------------------------------- void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) { @@ -131,38 +131,38 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // create the file. if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen( name, flags, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen( name, flags, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates an H5File object using an existing file id. -///\param existing_id - IN: Id of an existing file -// Programmer Binh-Minh Ribler - 2015 +// Function: H5File overloaded constructor +///\brief Creates an H5File object using an existing file id. +///\param existing_id - IN: Id of an existing file +// Programmer Binh-Minh Ribler - 2015 // Description -// Mar 29, 2015 -// Added in responding to a request from user Jason Newton. -// However, it is not recommended to use the private member "id" -// in applications. Unlike other situations, where similar -// constructor is needed by the library in order to return -// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) +// Mar 29, 2015 +// Added in responding to a request from user Jason Newton. +// However, it is not recommended to use the private member "id" +// in applications. Unlike other situations, where similar +// constructor is needed by the library in order to return +// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) //-------------------------------------------------------------------------- H5File::H5File(hid_t existing_id) : H5Location(), CommonFG() { @@ -173,11 +173,11 @@ H5File::H5File(hid_t existing_id) : H5Location(), CommonFG() #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File copy constructor -///\brief Copy constructor: makes a copy of the original -/// H5File object. -///\param original - IN: H5File instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File copy constructor +///\brief Copy constructor: makes a copy of the original +/// H5File object. +///\param original - IN: H5File instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5File& original) : H5Location(), CommonFG() { @@ -186,12 +186,12 @@ H5File::H5File(const H5File& original) : H5Location(), CommonFG() } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief Determines whether a file in HDF5 format. (Static) -///\param name - IN: Name of the file -///\return true if the file is in HDF5 format, and false, otherwise -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief Determines whether a file in HDF5 format. (Static) +///\param name - IN: Name of the file +///\return true if the file is in HDF5 format, and false, otherwise +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { @@ -209,11 +209,11 @@ bool H5File::isHdf5(const char* name) } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. (Static) -///\param name - IN: Name of the file - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. (Static) +///\param name - IN: Name of the file - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const H5std_string& name ) { @@ -221,22 +221,22 @@ bool H5File::isHdf5(const H5std_string& name ) } //-------------------------------------------------------------------------- -// Function: openFile -///\brief Opens an HDF5 file -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: openFile +///\brief Opens an HDF5 file +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// Valid values of \a flags include: +/// H5F_ACC_RDWR: Open with read/write access. If the file is +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// -/// H5F_ACC_RDONLY: Open with read only access. - default +/// H5F_ACC_RDONLY: Open with read only access. - default /// -// Programmer Binh-Minh Ribler - Oct, 2005 +// Programmer Binh-Minh Ribler - Oct, 2005 //-------------------------------------------------------------------------- void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist) { @@ -251,19 +251,19 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis id = H5Fopen (name, flags, access_plist_id); if (id < 0) // throw an exception when open fails { - throw FileIException("H5File::openFile", "H5Fopen failed"); + throw FileIException("H5File::openFile", "H5Fopen failed"); } } //-------------------------------------------------------------------------- -// Function: H5File::openFile -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::openFile +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist) { @@ -271,21 +271,21 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc } //-------------------------------------------------------------------------- -// Function: H5File::reOpen -///\brief Reopens this file. +// Function: H5File::reOpen +///\brief Reopens this file. /// -///\exception H5::FileIException +///\exception H5::FileIException // Description -// If this object has represented another HDF5 file, the previous -// HDF5 file need to be closed first. -// Programmer Binh-Minh Ribler - 2000 +// If this object has represented another HDF5 file, the previous +// HDF5 file need to be closed first. +// Programmer Binh-Minh Ribler - 2000 // Note: This wrapper doesn't seem right regarding the 'id' and should // be investigated. BMR - 2/20/2005 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void H5File::reOpen() { @@ -304,11 +304,11 @@ void H5File::reOpen() } //-------------------------------------------------------------------------- -// Function: H5File::getCreatePlist -///\brief Returns the creation property list of this file -///\return FileCreatPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getCreatePlist +///\brief Returns the creation property list of this file +///\return FileCreatPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { @@ -328,11 +328,11 @@ FileCreatPropList H5File::getCreatePlist() const } //-------------------------------------------------------------------------- -// Function: H5File::getAccessPlist -///\brief Returns the access property list of this file -///\return FileAccPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getAccessPlist +///\brief Returns the access property list of this file +///\return FileAccPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { @@ -352,10 +352,10 @@ FileAccPropList H5File::getAccessPlist() const } //-------------------------------------------------------------------------- -// Function: H5File::getFreeSpace -///\brief Returns the amount of free space in the file. -///\return Amount of free space -///\exception H5::FileIException +// Function: H5File::getFreeSpace +///\brief Returns the amount of free space in the file. +///\return Amount of free space +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const @@ -370,22 +370,22 @@ hssize_t H5File::getFreeSpace() const //-------------------------------------------------------------------------- -// Function: H5File::getObjCount -///\brief Returns the number of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\return Number of opened object IDs -///\exception H5::FileIException +// Function: H5File::getObjCount +///\brief Returns the number of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\return Number of opened object IDs +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -401,24 +401,24 @@ ssize_t H5File::getObjCount(unsigned types) const } //-------------------------------------------------------------------------- -// Function: H5File::getObjIDs -///\brief Retrieves a list of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. -///\param oid_list - List of open object identifiers -///\exception H5::FileIException +// Function: H5File::getObjIDs +///\brief Retrieves a list of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\param max_objs - Maximum number of object identifiers to place +/// into obj_id_list. +///\param oid_list - List of open object identifiers +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -435,25 +435,25 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief Returns the pointer to the file handle of the low-level file -/// driver. -///\param fapl - File access property list -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief Returns the pointer to the file handle of the low-level file +/// driver. +///\param fapl - File access property list +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException ///\par Description -/// For the \c FAMILY or \c MULTI drivers, \a fapl should be -/// defined through the property list functions: -/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver -/// and \c FileAccPropList::setMultiType for the \c MULTI driver. +/// For the \c FAMILY or \c MULTI drivers, \a fapl should be +/// defined through the property list functions: +/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver +/// and \c FileAccPropList::setMultiType for the \c MULTI driver. /// -/// The obtained file handle is dynamic and is valid only while -/// the file remains open; it will be invalid if the file is -/// closed and reopened or opened during a subsequent session. +/// The obtained file handle is dynamic and is valid only while +/// the file remains open; it will be invalid if the file is +/// closed and reopened or opened during a subsequent session. // Programmer Binh-Minh Ribler - May 2004 // Modification -// Replaced the version without const parameter - Apr, 2014 +// Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { @@ -466,19 +466,19 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param fapl - File access property list -// Param file_handle - Pointer to the file handle being used by -// the low-level virtual file driver -// Exception H5::FileIException +// Function: H5File::getVFDHandle +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param fapl - File access property list +// Param file_handle - Pointer to the file handle being used by +// the low-level virtual file driver +// Exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const //{ @@ -486,13 +486,13 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const //} //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const @@ -505,13 +505,13 @@ void H5File::getVFDHandle(void **file_handle) const } //-------------------------------------------------------------------------- -// Function: H5File::getFileSize -///\brief Returns the file size of the HDF5 file. -///\return File size -///\exception H5::FileIException +// Function: H5File::getFileSize +///\brief Returns the file size of the HDF5 file. +///\return File size +///\exception H5::FileIException ///\par Description -/// This function is called after an existing file is opened in -/// order to learn the true size of the underlying file. +/// This function is called after an existing file is opened in +/// order to learn the true size of the underlying file. // Programmer Raymond Lu - June 24, 2004 //-------------------------------------------------------------------------- hsize_t H5File::getFileSize() const @@ -526,16 +526,16 @@ hsize_t H5File::getFileSize() const } //-------------------------------------------------------------------------- -// Function: H5File::getId -///\brief Get the id of this file -///\return File identifier +// Function: H5File::getId +///\brief Get the id of this file +///\return File identifier // Modification: -// May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. -// Programmer Binh-Minh Ribler - May, 2008 +// May 2008 - BMR +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. +// Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { @@ -544,12 +544,12 @@ hid_t H5File::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::reopen -// Purpose: Reopens this file. -// Exception H5::FileIException +// Function: H5File::reopen +// Purpose: Reopens this file. +// Exception H5::FileIException // Description -// This function is replaced by the above function reOpen. -// Programmer Binh-Minh Ribler - 2000 +// This function is replaced by the above function reOpen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::reopen() { @@ -557,12 +557,12 @@ void H5File::reopen() } //-------------------------------------------------------------------------- -// Function: H5File::getLocId -// Purpose: Get the id of this file +// Function: H5File::getLocId +// Purpose: Get the id of this file // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. -// Programmer Binh-Minh Ribler - 2000 +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { @@ -570,16 +570,16 @@ hid_t H5File::getLocId() const } //-------------------------------------------------------------------------- -// Function: H5File::p_setId (protected) -///\brief Sets the identifier of this object to a new value. +// Function: H5File::p_setId (protected) +///\brief Sets the identifier of this object to a new value. /// -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. -// Programmer Binh-Minh Ribler - 2000 +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { @@ -596,39 +596,39 @@ void H5File::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::close -///\brief Closes this HDF5 file. +// Function: H5File::close +///\brief Closes this HDF5 file. /// -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose( id ); - if( ret_value < 0 ) - { - throw FileIException("H5File::close", "H5Fclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Fclose( id ); + if( ret_value < 0 ) + { + throw FileIException("H5File::close", "H5Fclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: H5File::throwException -///\brief Throws file exception - initially implemented for CommonFG -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::FileIException +// Function: H5File::throwException +///\brief Throws file exception - initially implemented for CommonFG +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::FileIException // Description -// This function is used in CommonFG implementation so that -// proper exception can be thrown for file or group. The -// argument func_name is a member of CommonFG and "H5File::" -// will be inserted to indicate the function called is an -// implementation of H5File. -// Programmer Binh-Minh Ribler - 2000 +// This function is used in CommonFG implementation so that +// proper exception can be thrown for file or group. The +// argument func_name is a member of CommonFG and "H5File::" +// will be inserted to indicate the function called is an +// implementation of H5File. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { @@ -638,21 +638,21 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m } //-------------------------------------------------------------------------- -// Function: H5File destructor -///\brief Properly terminates access to this file. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File destructor +///\brief Properly terminates access to this file. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- H5File::~H5File() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; + cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 063a94e..1904bdb 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -26,97 +26,97 @@ namespace H5 { */ class H5_DLLCPP H5File : public H5Location, public CommonFG { public: - // Creates or opens an HDF5 file. - H5File( const char* name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - H5File( const H5std_string& name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); + // Creates or opens an HDF5 file. + H5File( const char* name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); + H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - // Open the file - void openFile(const H5std_string& name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - void openFile(const char* name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + // Open the file + void openFile(const H5std_string& name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + void openFile(const char* name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - // Close this file. - virtual void close(); + // Close this file. + virtual void close(); - // Gets the access property list of this file. - FileAccPropList getAccessPlist() const; + // Gets the access property list of this file. + FileAccPropList getAccessPlist() const; - // Gets the creation property list of this file. - FileCreatPropList getCreatePlist() const; + // Gets the creation property list of this file. + FileCreatPropList getCreatePlist() const; - // Retrieves the file size of an opened file. - hsize_t getFileSize() const; + // Retrieves the file size of an opened file. + hsize_t getFileSize() const; - // Returns the amount of free space in the file. - hssize_t getFreeSpace() const; + // Returns the amount of free space in the file. + hssize_t getFreeSpace() const; - // Returns the number of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; + // Returns the number of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; - // Retrieves a list of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; + // Retrieves a list of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; - // Returns the pointer to the file handle of the low-level file driver. - void getVFDHandle(void **file_handle) const; - void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; - //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 + // Returns the pointer to the file handle of the low-level file driver. + void getVFDHandle(void **file_handle) const; + void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; + //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 - // Determines if a file, specified by its name, is in HDF5 format - static bool isHdf5(const char* name ); - static bool isHdf5(const H5std_string& name ); + // Determines if a file, specified by its name, is in HDF5 format + static bool isHdf5(const char* name ); + static bool isHdf5(const H5std_string& name ); - // Reopens this file. - void reOpen(); // added for better name + // Reopens this file. + void reOpen(); // added for better name #ifndef DOXYGEN_SHOULD_SKIP_THIS - void reopen(); // obsolete in favor of reOpen() + void reopen(); // obsolete in favor of reOpen() - // Gets the file id - virtual hid_t getLocId() const; + // Gets the file id + virtual hid_t getLocId() const; - // Creates an H5File using an existing file id. Not recommended - // in applications. - H5File(hid_t existing_id); + // Creates an H5File using an existing file id. Not recommended + // in applications. + H5File(hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("H5File"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("H5File"); } - // Throw file exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw file exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // Default constructor - H5File(); + // Default constructor + H5File(); - // Copy constructor: makes a copy of the original H5File object. - H5File(const H5File& original); + // Copy constructor: makes a copy of the original H5File object. + H5File(const H5File& original); - // Gets the HDF5 file id. - virtual hid_t getId() const; + // Gets the HDF5 file id. + virtual hid_t getId() const; - // H5File destructor. - virtual ~H5File(); + // H5File destructor. + virtual ~H5File(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the HDF5 file id. - virtual void p_setId(const hid_t new_id); + // Sets the HDF5 file id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 file id + hid_t id; // HDF5 file id - // This function is private and contains common code between the - // constructors taking a string or a char* - void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); + // This function is private and contains common code between the + // constructors taking a string or a char* + void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); }; } diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index b1b2ce2..0e2d0c7 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -35,18 +35,18 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: FloatType default constructor -///\brief Default constructor: Creates a stub floating-point datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType default constructor +///\brief Default constructor: Creates a stub floating-point datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType() {} //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates a floating-point datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates a floating-point datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType( const PredType& pred_type ) : AtomType() { @@ -55,29 +55,29 @@ FloatType::FloatType( const PredType& pred_type ) : AtomType() } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType object using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType object using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: FloatType copy constructor -///\brief Copy constructor: makes a copy of the original FloatType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType copy constructor +///\brief Copy constructor: makes a copy of the original FloatType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType( const FloatType& original ) : AtomType( original ){} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the floating-point datatype of the specified dataset -///\param dataset - IN: Dataset that this floating-point datatype -/// associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the floating-point datatype of the specified dataset +///\param dataset - IN: Dataset that this floating-point datatype +/// associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType( const DataSet& dataset ) : AtomType() { @@ -91,15 +91,15 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType() } //-------------------------------------------------------------------------- -// Function: FloatType::getFields -///\brief Retrieves floating point datatype bit field information. -///\param spos - OUT: Retrieved floating-point sign bit -///\param epos - OUT: Retrieved exponent bit-position -///\param esize - OUT: Retrieved size of exponent, in bits -///\param mpos - OUT: Retrieved mantissa bit-position -///\param msize - OUT: Retrieved size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::getFields +///\brief Retrieves floating point datatype bit field information. +///\param spos - OUT: Retrieved floating-point sign bit +///\param epos - OUT: Retrieved exponent bit-position +///\param esize - OUT: Retrieved size of exponent, in bits +///\param mpos - OUT: Retrieved mantissa bit-position +///\param msize - OUT: Retrieved size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const { @@ -111,16 +111,16 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp } //-------------------------------------------------------------------------- -// Function: FloatType::setFields -///\brief Sets locations and sizes of floating point bit fields. -///\param spos - OUT: Sign position, i.e., the bit offset of the -/// floating-point sign bit. -///\param epos - OUT: Exponent bit position -///\param esize - OUT: Size of exponent, in bits -///\param mpos - OUT: Mantissa bit-position -///\param msize - OUT: Size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::setFields +///\brief Sets locations and sizes of floating point bit fields. +///\param spos - OUT: Sign position, i.e., the bit offset of the +/// floating-point sign bit. +///\param epos - OUT: Exponent bit position +///\param esize - OUT: Size of exponent, in bits +///\param mpos - OUT: Mantissa bit-position +///\param msize - OUT: Size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const { @@ -132,11 +132,11 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, } //-------------------------------------------------------------------------- -// Function: FloatType::getEbias -///\brief Retrieves the exponent bias of a floating-point type. -///\return Exponent bias -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::getEbias +///\brief Retrieves the exponent bias of a floating-point type. +///\return Exponent bias +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t FloatType::getEbias() const { @@ -150,11 +150,11 @@ size_t FloatType::getEbias() const } //-------------------------------------------------------------------------- -// Function: FloatType::setEbias -///\brief Sets the exponent bias of a floating-point type. -///\param ebias - Exponent bias value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::setEbias +///\brief Sets the exponent bias of a floating-point type. +///\param ebias - Exponent bias value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setEbias( size_t ebias ) const { @@ -166,19 +166,19 @@ void FloatType::setEbias( size_t ebias ) const } //-------------------------------------------------------------------------- -// Function: FloatType::getNorm -///\brief Retrieves mantissa normalization of a floating-point datatype. -///\param norm_string - OUT: Text string of the normalization type -///\return Valid normalization type, which can be: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -///\exception H5::DataTypeIException +// Function: FloatType::getNorm +///\brief Retrieves mantissa normalization of a floating-point datatype. +///\param norm_string - OUT: Text string of the normalization type +///\return Valid normalization type, which can be: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned normalization type, via parameter -/// \a norm_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned normalization type, via parameter +/// \a norm_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const { @@ -198,16 +198,16 @@ H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const } //-------------------------------------------------------------------------- -// Function: FloatType::setNorm -///\brief Sets the mantissa normalization of a floating-point datatype. -///\param norm - IN: Mantissa normalization type -///\exception H5::DataTypeIException +// Function: FloatType::setNorm +///\brief Sets the mantissa normalization of a floating-point datatype. +///\param norm - IN: Mantissa normalization type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for normalization type include: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setNorm( H5T_norm_t norm ) const { @@ -219,19 +219,19 @@ void FloatType::setNorm( H5T_norm_t norm ) const } //-------------------------------------------------------------------------- -// Function: FloatType::getInpad -///\brief Retrieves the internal padding type for unused bits in -/// this floating-point datatypes. -///\return Internal padding type, which can be: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -///\exception H5::DataTypeIException +// Function: FloatType::getInpad +///\brief Retrieves the internal padding type for unused bits in +/// this floating-point datatypes. +///\return Internal padding type, which can be: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned internal padding type, via parameter -/// \a pad_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned internal padding type, via parameter +/// \a pad_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const { @@ -251,21 +251,21 @@ H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const } //-------------------------------------------------------------------------- -// Function: FloatType::setInpad -///\brief Fills unused internal floating point bits. -///\param inpad - IN: Internal padding type -///\exception H5::DataTypeIException +// Function: FloatType::setInpad +///\brief Fills unused internal floating point bits. +///\param inpad - IN: Internal padding type +///\exception H5::DataTypeIException ///\par Description -/// If any internal bits of a floating point type are unused -/// (that is, those significant bits which are not part of the -/// sign, exponent, or mantissa), then they will be filled -/// according to the padding value provided by \a inpad. +/// If any internal bits of a floating point type are unused +/// (that is, those significant bits which are not part of the +/// sign, exponent, or mantissa), then they will be filled +/// according to the padding value provided by \a inpad. ///\par -/// Valid values for normalization type include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setInpad( H5T_pad_t inpad ) const { @@ -277,9 +277,9 @@ void FloatType::setInpad( H5T_pad_t inpad ) const } //-------------------------------------------------------------------------- -// Function: FloatType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::~FloatType() {} diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 201760b..61c590d 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -22,50 +22,50 @@ namespace H5 { //! Class FloatType operates on HDF5 floating point datatype. class H5_DLLCPP FloatType : public AtomType { public: - // Creates a floating-point type using a predefined type. - FloatType( const PredType& pred_type ); + // Creates a floating-point type using a predefined type. + FloatType( const PredType& pred_type ); - // Gets the floating-point datatype of the specified dataset. - FloatType( const DataSet& dataset ); + // Gets the floating-point datatype of the specified dataset. + FloatType( const DataSet& dataset ); - // Retrieves the exponent bias of a floating-point type. - size_t getEbias() const; + // Retrieves the exponent bias of a floating-point type. + size_t getEbias() const; - // Sets the exponent bias of a floating-point type. - void setEbias( size_t ebias ) const; + // Sets the exponent bias of a floating-point type. + void setEbias( size_t ebias ) const; - // Retrieves floating point datatype bit field information. - void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; + // Retrieves floating point datatype bit field information. + void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; - // Sets locations and sizes of floating point bit fields. - void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; + // Sets locations and sizes of floating point bit fields. + void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; - // Retrieves the internal padding type for unused bits in floating-point datatypes. - H5T_pad_t getInpad( H5std_string& pad_string ) const; + // Retrieves the internal padding type for unused bits in floating-point datatypes. + H5T_pad_t getInpad( H5std_string& pad_string ) const; - // Fills unused internal floating point bits. - void setInpad( H5T_pad_t inpad ) const; + // Fills unused internal floating point bits. + void setInpad( H5T_pad_t inpad ) const; - // Retrieves mantissa normalization of a floating-point datatype. - H5T_norm_t getNorm( H5std_string& norm_string ) const; + // Retrieves mantissa normalization of a floating-point datatype. + H5T_norm_t getNorm( H5std_string& norm_string ) const; - // Sets the mantissa normalization of a floating-point datatype. - void setNorm( H5T_norm_t norm ) const; + // Sets the mantissa normalization of a floating-point datatype. + void setNorm( H5T_norm_t norm ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FloatType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FloatType"); } - // Default constructor - FloatType(); + // Default constructor + FloatType(); - // Creates a floating-point datatype using an existing id. - FloatType( const hid_t existing_id ); + // Creates a floating-point datatype using an existing id. + FloatType( const hid_t existing_id ); - // Copy constructor: makes a copy of the original FloatType object. - FloatType( const FloatType& original ); + // Copy constructor: makes a copy of the original FloatType object. + FloatType( const FloatType& original ); - // Noop destructor. - virtual ~FloatType(); + // Noop destructor. + virtual ~FloatType(); }; } #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 4cf7b98..9e131ca 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -46,17 +46,17 @@ namespace H5 { #endif // H5_NO_STD //-------------------------------------------------------------------------- -// Function: Group default constructor -///\brief Default constructor: creates a stub Group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group default constructor +///\brief Default constructor: creates a stub Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Group copy constructor -///\brief Copy constructor: makes a copy of the original Group object. -///\param original - IN: Original group to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Group copy constructor +///\brief Copy constructor: makes a copy of the original Group object. +///\param original - IN: Original group to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) { @@ -64,10 +64,10 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) } //-------------------------------------------------------------------------- -// Function: Group::getLocId -///\brief Returns the id of this group. -///\return Id of this group -// Programmer Binh-Minh Ribler - 2000 +// Function: Group::getLocId +///\brief Returns the id of this group. +///\return Id of this group +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t Group::getLocId() const { @@ -75,10 +75,10 @@ hid_t Group::getLocId() const } //-------------------------------------------------------------------------- -// Function: Group overloaded constructor -///\brief Creates a Group object using the id of an existing group. -///\param existing_id - IN: Id of an existing group -// Programmer Binh-Minh Ribler - 2000 +// Function: Group overloaded constructor +///\brief Creates a Group object using the id of an existing group. +///\param existing_id - IN: Id of an existing group +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) { @@ -86,16 +86,16 @@ Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param loc - IN: Specifying location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::ReferenceException +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param loc - IN: Specifying location referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::ReferenceException ///\par Description -/// \c obj can be DataSet, Group, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c obj can be DataSet, Group, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) { @@ -103,13 +103,13 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Ob } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) { @@ -118,14 +118,14 @@ Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Ob //-------------------------------------------------------------------------- // Function: Group::getId -///\brief Get the id of this group -///\return Group identifier +///\brief Get the id of this group +///\return Group identifier // Modification: // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t Group::getId() const @@ -139,11 +139,11 @@ hid_t Group::getId() const ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::p_setId(const hid_t new_id) @@ -161,39 +161,39 @@ void Group::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Group::close -///\brief Closes this group. +// Function: Group::close +///\brief Closes this group. /// -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::GroupIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose( id ); - if( ret_value < 0 ) - { - throw GroupIException("Group::close", "H5Gclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Gclose( id ); + if( ret_value < 0 ) + { + throw GroupIException("Group::close", "H5Gclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: Group::throwException -///\brief Throws H5::GroupIException. -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::GroupIException +// Function: Group::throwException +///\brief Throws H5::GroupIException. +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::GroupIException // Description -// This function is used in CommonFG implementation so that -// proper exception can be thrown for file or group. The -// argument func_name is a member of CommonFG and "Group::" -// will be inserted to indicate the function called is an -// implementation of Group. -// Programmer Binh-Minh Ribler - 2000 +// This function is used in CommonFG implementation so that +// proper exception can be thrown for file or group. The +// argument func_name is a member of CommonFG and "Group::" +// will be inserted to indicate the function called is an +// implementation of Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::throwException(const H5std_string& func_name, const H5std_string& msg) const { @@ -203,22 +203,22 @@ void Group::throwException(const H5std_string& func_name, const H5std_string& ms } //-------------------------------------------------------------------------- -// Function: Group destructor -///\brief Properly terminates access to this group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group destructor +///\brief Properly terminates access to this group. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Group::~Group() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; + cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 474f72b..12f364f 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -26,45 +26,45 @@ namespace H5 { */ class H5_DLLCPP Group : public H5Object, public CommonFG { public: - // Close this group. - virtual void close(); + // Close this group. + virtual void close(); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Group"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Group"); } - // Throw group exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw group exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. - virtual hid_t getLocId() const; + // for CommonFG to get the file id. + virtual hid_t getLocId() const; - // Creates a group by way of dereference. - Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + // Creates a group by way of dereference. + Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - // default constructor - Group(); + // default constructor + Group(); - // Copy constructor: makes a copy of the original object - Group(const Group& original); + // Copy constructor: makes a copy of the original object + Group(const Group& original); - // Gets the group id. - virtual hid_t getId() const; + // Gets the group id. + virtual hid_t getId() const; - // Destructor - virtual ~Group(); + // Destructor + virtual ~Group(); - // Creates a copy of an existing group using its id. - Group( const hid_t group_id ); + // Creates a copy of an existing group using its id. + Group( const hid_t group_id ); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the group id. - virtual void p_setId(const hid_t new_id); + // Sets the group id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 group id + hid_t id; // HDF5 group id }; } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index d71c953..67b2e11 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -20,7 +20,7 @@ #include "H5Library.h" #include "H5IdComponent.h" #include "H5DataSpace.h" -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset namespace H5 { @@ -36,21 +36,21 @@ bool IdComponent::H5dontAtexit_called = false; #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- void IdComponent::incRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Iinc_ref(obj_id) < 0) - throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); + if (H5Iinc_ref(obj_id) < 0) + throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); } //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::incRefCount() const { @@ -58,31 +58,31 @@ void IdComponent::incRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 // Modification: -// Added the check for ref counter to give a little more info -// on why H5Idec_ref fails in some cases - BMR 5/19/2005 +// Added the check for ref counter to give a little more info +// on why H5Idec_ref fails in some cases - BMR 5/19/2005 //-------------------------------------------------------------------------- void IdComponent::decRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Idec_ref(obj_id) < 0) - { - if (H5Iget_ref(obj_id) <= 0) - throw IdComponentException(inMemFunc("decRefCount"), - "object ref count is 0 or negative"); - else - throw IdComponentException(inMemFunc("decRefCount"), - "decrementing object ref count failed"); - } + if (H5Idec_ref(obj_id) < 0) + { + if (H5Iget_ref(obj_id) <= 0) + throw IdComponentException(inMemFunc("decRefCount"), + "object ref count is 0 or negative"); + else + throw IdComponentException(inMemFunc("decRefCount"), + "decrementing object ref count failed"); + } } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::decRefCount() const { @@ -90,28 +90,28 @@ void IdComponent::decRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for a given id. -///\return Reference count -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for a given id. +///\return Reference count +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- int IdComponent::getCounter(const hid_t obj_id) const { int counter = 0; if (p_valid_id(obj_id)) { - counter = H5Iget_ref(obj_id); - if (counter < 0) - throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); + counter = H5Iget_ref(obj_id); + if (counter < 0) + throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); } return (counter); } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for the id of this object. -///\return Reference count -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for the id of this object. +///\return Reference count +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int IdComponent::getCounter() const { @@ -119,43 +119,43 @@ int IdComponent::getCounter() const } //-------------------------------------------------------------------------- -// Function: getHDFObjType (static) -///\brief Given an id, returns the type of the object. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType (static) +///\brief Given an id, returns the type of the object. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) { if (obj_id <= 0) - return H5I_BADID; // invalid + return H5I_BADID; // invalid H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return H5I_BADID; // invalid + return H5I_BADID; // invalid else - return id_type; // valid type + return id_type; // valid type } //-------------------------------------------------------------------------- -// Function: getHDFObjType -///\brief Returns the type of the object. It is an overloaded function -/// of the above function. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType +///\brief Returns the type of the object. It is an overloaded function +/// of the above function. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType() const @@ -164,60 +164,60 @@ H5I_type_t IdComponent::getHDFObjType() const } //-------------------------------------------------------------------------- -// Function: IdComponent::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing object -///\return Reference to IdComponent instance -///\exception H5::IdComponentException when attempt to close the HDF5 -/// object fails +// Function: IdComponent::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing object +///\return Reference to IdComponent instance +///\exception H5::IdComponentException when attempt to close the HDF5 +/// object fails // Description -// First, close the current valid id of this object. Then -// copy the id from rhs to this object, and increment the -// reference counter of the id to indicate that another object -// is referencing that id. +// First, close the current valid id of this object. Then +// copy the id from rhs to this object, and increment the +// reference counter of the id to indicate that another object +// is referencing that id. // Modification -// 2010/5/9 - BMR -// Removed close() and incRefCount() because setId/p_setId takes -// care of close() and setId takes care incRefCount(). -// Programmer Binh-Minh Ribler - 2000 +// 2010/5/9 - BMR +// Removed close() and incRefCount() because setId/p_setId takes +// care of close() and setId takes care incRefCount(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent& IdComponent::operator=( const IdComponent& rhs ) { if (this != &rhs) { - // handling references to this id - try { - setId(rhs.getId()); - // Note: a = b, so there are two objects with the same hdf5 id - // that's why incRefCount is needed, and it is called by setId - } - catch (Exception& close_error) { - throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); - } + // handling references to this id + try { + setId(rhs.getId()); + // Note: a = b, so there are two objects with the same hdf5 id + // that's why incRefCount is needed, and it is called by setId + } + catch (Exception& close_error) { + throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); + } } return *this; } //-------------------------------------------------------------------------- -// Function: IdComponent::setId -///\brief Sets the identifier of this object to a new value. -///\param new_id - IN: New identifier to be set to -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +// Function: IdComponent::setId +///\brief Sets the identifier of this object to a new value. +///\param new_id - IN: New identifier to be set to +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails // Description: -// p_setId ensures that the current valid id of this object is -// properly closed before resetting the object's id to the new id. -// Programmer Binh-Minh Ribler - 2000 +// p_setId ensures that the current valid id of this object is +// properly closed before resetting the object's id to the new id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2008/7/23 - BMR -// Changed all subclasses' setId to p_setId and put back setId -// here. p_setId is used in the library where the id provided -// by a C API passed on to user's application in the form of a -// C++ API object, which will be destroyed properly, and so -// p_setId does not call incRefCount. On the other hand, the -// public version setId is used by other applications, in which -// the id passed to setId is that of another C++ API object, so -// setId must call incRefCount. +// 2008/7/23 - BMR +// Changed all subclasses' setId to p_setId and put back setId +// here. p_setId is used in the library where the id provided +// by a C API passed on to user's application in the form of a +// C++ API object, which will be destroyed properly, and so +// p_setId does not call incRefCount. On the other hand, the +// public version setId is used by other applications, in which +// the id passed to setId is that of another C++ API object, so +// setId must call incRefCount. //-------------------------------------------------------------------------- void IdComponent::setId(const hid_t new_id) { @@ -229,9 +229,9 @@ void IdComponent::setId(const hid_t new_id) } //-------------------------------------------------------------------------- -// Function: IdComponent destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::~IdComponent() {} @@ -242,16 +242,16 @@ IdComponent::~IdComponent() {} #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: IdComponent::inMemFunc -///\brief Makes and returns string "::" -///\param func_name - Name of the function where failure occurs +// Function: IdComponent::inMemFunc +///\brief Makes and returns string "::" +///\param func_name - Name of the function where failure occurs // Description -/// Concatenates the class name of this object with the -/// passed-in function name to create a string that indicates -/// where the failure occurs. The class-name is provided by -/// fromClass(). This string will be used by a base class when -/// an exception is thrown. -// Programmer Binh-Minh Ribler - Aug 6, 2005 +/// Concatenates the class name of this object with the +/// passed-in function name to create a string that indicates +/// where the failure occurs. The class-name is provided by +/// fromClass(). This string will be used by a base class when +/// an exception is thrown. +// Programmer Binh-Minh Ribler - Aug 6, 2005 //-------------------------------------------------------------------------- H5std_string IdComponent::inMemFunc(const char* func_name) const { @@ -262,9 +262,9 @@ H5std_string IdComponent::inMemFunc(const char* func_name) const } //-------------------------------------------------------------------------- -// Function: IdComponent default constructor - private -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent default constructor - private +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::IdComponent() { @@ -278,14 +278,14 @@ IdComponent::IdComponent() } //-------------------------------------------------------------------------- -// Function: IdComponent::p_get_file_name (protected) -// Purpose: Gets the name of the file, in which this object belongs. -// Exception: H5::IdComponentException +// Function: IdComponent::p_get_file_name (protected) +// Purpose: Gets the name of the file, in which this object belongs. +// Exception: H5::IdComponentException // Description: -// This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, -// Attribute and H5Location subclasses. -// Programmer Binh-Minh Ribler - Jul, 2004 +// This function is protected so that the user applications can +// only have access to its code via allowable classes, namely, +// Attribute and H5Location subclasses. +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const { @@ -324,22 +324,22 @@ H5std_string IdComponent::p_get_file_name() const // //-------------------------------------------------------------------------- -// Function: p_valid_id -// Purpose: Verifies that the given id is a valid id so it can be passed -// into an H5I C function. -// Return true if id is valid, false, otherwise -// Programmer Binh-Minh Ribler - May, 2005 +// Function: p_valid_id +// Purpose: Verifies that the given id is a valid id so it can be passed +// into an H5I C function. +// Return true if id is valid, false, otherwise +// Programmer Binh-Minh Ribler - May, 2005 //-------------------------------------------------------------------------- bool IdComponent::p_valid_id(const hid_t obj_id) { if (obj_id <= 0) - return false; + return false; H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return false; + return false; else - return true; + return true; } // Notes about IdComponent::id diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index cf19dc6..64684c2 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -32,87 +32,87 @@ class DataSpace; class H5_DLLCPP IdComponent { public: - // Increment reference counter. - void incRefCount(const hid_t obj_id) const; - void incRefCount() const; + // Increment reference counter. + void incRefCount(const hid_t obj_id) const; + void incRefCount() const; - // Decrement reference counter. - void decRefCount(const hid_t obj_id) const; - void decRefCount() const; + // Decrement reference counter. + void decRefCount(const hid_t obj_id) const; + void decRefCount() const; - // Get the reference counter to this identifier. - int getCounter(const hid_t obj_id) const; - int getCounter() const; + // Get the reference counter to this identifier. + int getCounter(const hid_t obj_id) const; + int getCounter() const; - // Returns an HDF5 object type, given the object id. - static H5I_type_t getHDFObjType(const hid_t obj_id); + // Returns an HDF5 object type, given the object id. + static H5I_type_t getHDFObjType(const hid_t obj_id); - // Returns an HDF5 object type of this object. - H5I_type_t getHDFObjType() const; + // Returns an HDF5 object type of this object. + H5I_type_t getHDFObjType() const; - // Assignment operator. - IdComponent& operator=( const IdComponent& rhs ); + // Assignment operator. + IdComponent& operator=( const IdComponent& rhs ); - // Sets the identifier of this object to a new value. - void setId(const hid_t new_id); + // Sets the identifier of this object to a new value. + void setId(const hid_t new_id); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates an object to hold an HDF5 identifier. - IdComponent( const hid_t h5_id ); + // Creates an object to hold an HDF5 identifier. + IdComponent( const hid_t h5_id ); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor: makes copy of the original IdComponent object. - // IdComponent( const IdComponent& original ); - removed from 1.8.15 + // Copy constructor: makes copy of the original IdComponent object. + // IdComponent( const IdComponent& original ); - removed from 1.8.15 - // Gets the identifier of this object. - virtual hid_t getId () const = 0; + // Gets the identifier of this object. + virtual hid_t getId () const = 0; - // Pure virtual function for there are various H5*close for the - // subclasses. - virtual void close() = 0; + // Pure virtual function for there are various H5*close for the + // subclasses. + virtual void close() = 0; - // Makes and returns the string "::"; - // is returned by fromClass(). - H5std_string inMemFunc(const char* func_name) const; + // Makes and returns the string "::"; + // is returned by fromClass(). + H5std_string inMemFunc(const char* func_name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass() const { return("IdComponent");} + ///\brief Returns this class name. + virtual H5std_string fromClass() const { return("IdComponent");} #endif // DOXYGEN_SHOULD_SKIP_THIS - // Destructor - virtual ~IdComponent(); + // Destructor + virtual ~IdComponent(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Default constructor. - IdComponent(); + // Default constructor. + IdComponent(); - // Gets the name of the file, in which an HDF5 object belongs. - H5std_string p_get_file_name() const; + // Gets the name of the file, in which an HDF5 object belongs. + H5std_string p_get_file_name() const; - // Verifies that the given id is valid. - static bool p_valid_id(const hid_t obj_id); + // Verifies that the given id is valid. + static bool p_valid_id(const hid_t obj_id); - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + virtual void p_setId(const hid_t new_id) = 0; - // This flag is used to decide whether H5dont_atexit should be called - static bool H5dontAtexit_called; + // This flag is used to decide whether H5dont_atexit should be called + static bool H5dontAtexit_called; private: - // This flag indicates whether H5Library::initH5cpp has been called - // to register various terminating functions with atexit() + // This flag indicates whether H5Library::initH5cpp has been called + // to register various terminating functions with atexit() static bool H5cppinit; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index 1e0e952..47ee725 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -33,10 +33,10 @@ const bool true = 1; // so re-define them here for now. /* Initial version of the object header format */ -#define H5O_VERSION_1 1 +#define H5O_VERSION_1 1 /* Revised version - leaves out reserved bytes and alignment padding, and adds * magic number as prefix and checksum as suffix for all chunks. */ -#define H5O_VERSION_2 2 +#define H5O_VERSION_2 2 diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index fd35673..446bcc6 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -36,25 +36,25 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: IntType default constructor -///\brief Default constructor: Creates a stub integer datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType default constructor +///\brief Default constructor: Creates a stub integer datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType() {} //-------------------------------------------------------------------------- -// Function: IntType copy constructor -///\brief Copy constructor: makes a copy of the original IntType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType copy constructor +///\brief Copy constructor: makes a copy of the original IntType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const IntType& original ) : AtomType( original ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a integer type using a predefined type -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates a integer type using a predefined type +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const PredType& pred_type ) : AtomType() { @@ -63,21 +63,21 @@ IntType::IntType( const PredType& pred_type ) : AtomType() } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates an integer datatype using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates an integer datatype using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Gets the integer datatype of the specified dataset. -///\param dataset - IN: Dataset that this integer datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Gets the integer datatype of the specified dataset. +///\param dataset - IN: Dataset that this integer datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const DataSet& dataset ) : AtomType() { @@ -91,11 +91,11 @@ IntType::IntType( const DataSet& dataset ) : AtomType() } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Retrieves the sign type for an integer type. -///\return Valid sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Retrieves the sign type for an integer type. +///\return Valid sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_sign_t IntType::getSign() const { @@ -105,17 +105,17 @@ H5T_sign_t IntType::getSign() const if( type_sign == H5T_SGN_ERROR ) { throw DataTypeIException("IntType::getSign", - "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); + "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); } return( type_sign ); } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Sets the sign property for an integer type. -///\param sign - IN: Sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Sets the sign property for an integer type. +///\param sign - IN: Sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IntType::setSign( H5T_sign_t sign ) const { @@ -128,9 +128,9 @@ void IntType::setSign( H5T_sign_t sign ) const } //-------------------------------------------------------------------------- -// Function: IntType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::~IntType() {} diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index afe7a67..48ef1ef 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -22,32 +22,32 @@ namespace H5 { //! Class IntType operates on HDF5 integer datatype. class H5_DLLCPP IntType : public AtomType { public: - // Creates an integer type using a predefined type - IntType(const PredType& pred_type); + // Creates an integer type using a predefined type + IntType(const PredType& pred_type); - // Gets the integer datatype of the specified dataset - IntType(const DataSet& dataset); + // Gets the integer datatype of the specified dataset + IntType(const DataSet& dataset); - // Retrieves the sign type for an integer type - H5T_sign_t getSign() const; + // Retrieves the sign type for an integer type + H5T_sign_t getSign() const; - // Sets the sign proprety for an integer type. - void setSign( H5T_sign_t sign ) const; + // Sets the sign proprety for an integer type. + void setSign( H5T_sign_t sign ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("IntType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("IntType"); } - // Default constructor - IntType(); + // Default constructor + IntType(); - // Creates a integer datatype using an existing id - IntType(const hid_t existing_id); + // Creates a integer datatype using an existing id + IntType(const hid_t existing_id); - // Copy constructor: makes copy of IntType object - IntType(const IntType& original); + // Copy constructor: makes copy of IntType object + IntType(const IntType& original); - // Noop destructor. - virtual ~IntType(); + // Noop destructor. + virtual ~IntType(); }; } #endif // __H5IntType_H diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index c8209e5..a2858a4 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -36,11 +36,11 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: H5Library::open (static) -///\brief Initializes the HDF5 library. +// Function: H5Library::open (static) +///\brief Initializes the HDF5 library. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::open() { @@ -52,11 +52,11 @@ void H5Library::open() } //-------------------------------------------------------------------------- -// Function: H5Library::close (static) -///\brief Flushes all data to disk, closes files, and cleans up memory. +// Function: H5Library::close (static) +///\brief Flushes all data to disk, closes files, and cleans up memory. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::close() { @@ -68,14 +68,14 @@ void H5Library::close() } //-------------------------------------------------------------------------- -// Function: H5Library::dontAtExit (static) -///\brief Instructs library not to install the C \c atexit cleanup routine +// Function: H5Library::dontAtExit (static) +///\brief Instructs library not to install the C \c atexit cleanup routine /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Removed the check for failure returned from H5dont_atexit. -// will be fixed to not fail (HDFFV-9540) +// Removed the check for failure returned from H5dont_atexit. +// will be fixed to not fail (HDFFV-9540) //-------------------------------------------------------------------------- void H5Library::dontAtExit() { @@ -83,13 +83,13 @@ void H5Library::dontAtExit() } //-------------------------------------------------------------------------- -// Function: H5Library::getLibVersion (static) -///\brief Returns the HDF library release number. -///\param majnum - OUT: Major version of the library -///\param minnum - OUT: Minor version of the library -///\param relnum - OUT: Release number of the library -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library::getLibVersion (static) +///\brief Returns the HDF library release number. +///\param majnum - OUT: Major version of the library +///\param minnum - OUT: Minor version of the library +///\param relnum - OUT: Release number of the library +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ) { @@ -101,18 +101,18 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel } //-------------------------------------------------------------------------- -// Function: H5Library::checkVersion (static) -///\brief Verifies that the arguments match the version numbers -/// compiled into the library -///\param majnum - IN: Major version of the library -///\param minnum - IN: Minor version of the library -///\param relnum - IN: Release number of the library -///\exception H5::LibraryIException +// Function: H5Library::checkVersion (static) +///\brief Verifies that the arguments match the version numbers +/// compiled into the library +///\param majnum - IN: Major version of the library +///\param minnum - IN: Minor version of the library +///\param relnum - IN: Release number of the library +///\exception H5::LibraryIException ///\par Description -/// For information about library version, please refer to -/// the C layer Reference Manual at: +/// For information about library version, please refer to +/// the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) { @@ -124,24 +124,24 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) } //-------------------------------------------------------------------------- -// Function: H5Library::garbageCollect (static) -///\brief Walks through all the garbage collection routines for the -/// library, which are supposed to free any unused memory they -/// have allocated. +// Function: H5Library::garbageCollect (static) +///\brief Walks through all the garbage collection routines for the +/// library, which are supposed to free any unused memory they +/// have allocated. /// -///\exception H5::LibraryIException +///\exception H5::LibraryIException ///\par Description -/// It is not required that H5Library::garbageCollect be called -/// at any particular time; it is only necessary in certain -/// situations, such as when the application has performed actions -/// that cause the library to allocate many objects. The -/// application should call H5Library::garbageCollect if it -/// eventually releases those objects and wants to reduce the -/// memory used by the library from the peak usage required. +/// It is not required that H5Library::garbageCollect be called +/// at any particular time; it is only necessary in certain +/// situations, such as when the application has performed actions +/// that cause the library to allocate many objects. The +/// application should call H5Library::garbageCollect if it +/// eventually releases those objects and wants to reduce the +/// memory used by the library from the peak usage required. ///\par -/// The library automatically garbage collects all the free -/// lists when the application ends. -// Programmer Binh-Minh Ribler - May, 2004 +/// The library automatically garbage collects all the free +/// lists when the application ends. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::garbageCollect() { @@ -155,8 +155,8 @@ void H5Library::garbageCollect() //-------------------------------------------------------------------------- // Function: H5Library::initH5cpp (static) ///\brief Initializes C++ library and registers terminating functions at -/// exit. Only for the library functions, not for user-defined -/// functions. +/// exit. Only for the library functions, not for user-defined +/// functions. // Description // initH5cpp registers the following functions with std::atexit(): // termH5cpp() - calls H5close() after all cleanup in @@ -225,25 +225,25 @@ void H5Library::termH5cpp() } //-------------------------------------------------------------------------- -// Function: H5Library::setFreeListLimits (static) -///\brief Sets limits on the different kinds of free lists. -///\param reg_global_lim - IN: Limit on all "regular" free list memory used -///\param reg_list_lim - IN: Limit on memory used in each "regular" free list -///\param arr_global_lim - IN: Limit on all "array" free list memory used -///\param arr_list_lim - IN: Limit on memory used in each "array" free list -///\param blk_global_lim - IN: Limit on all "block" free list memory used -///\param blk_list_lim - IN: Limit on memory used in each "block" free list -///\exception H5::LibraryIException +// Function: H5Library::setFreeListLimits (static) +///\brief Sets limits on the different kinds of free lists. +///\param reg_global_lim - IN: Limit on all "regular" free list memory used +///\param reg_list_lim - IN: Limit on memory used in each "regular" free list +///\param arr_global_lim - IN: Limit on all "array" free list memory used +///\param arr_list_lim - IN: Limit on memory used in each "array" free list +///\param blk_global_lim - IN: Limit on all "block" free list memory used +///\param blk_list_lim - IN: Limit on memory used in each "block" free list +///\exception H5::LibraryIException ///\par Description -/// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C -/// layer Reference Manual at: +/// Setting a value of -1 for a limit means no limit of that type. +/// For more information on free list limits, please refer to C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits -// Programmer Binh-Minh Ribler - May, 2004 +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, - int blk_list_lim) + int arr_global_lim, int arr_list_lim, int blk_global_lim, + int blk_list_lim) { herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); if( ret_value < 0 ) diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 71b7792..0a68d34 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -27,32 +27,32 @@ namespace H5 { */ class H5_DLLCPP H5Library { public: - // Initializes the HDF5 library. - static void open(); + // Initializes the HDF5 library. + static void open(); - // Flushes all data to disk, closes files, and cleans up memory. - static void close(); + // Flushes all data to disk, closes files, and cleans up memory. + static void close(); - // Instructs library not to install atexit cleanup routine - static void dontAtExit(); + // Instructs library not to install atexit cleanup routine + static void dontAtExit(); - // Returns the HDF library release number. - static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); + // Returns the HDF library release number. + static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); - // Verifies that the arguments match the version numbers compiled - // into the library - static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); + // Verifies that the arguments match the version numbers compiled + // into the library + static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); - // Walks through all the garbage collection routines for the library, - // which are supposed to free any unused memory they have allocated. - static void garbageCollect(); + // Walks through all the garbage collection routines for the library, + // which are supposed to free any unused memory they have allocated. + static void garbageCollect(); - // Sets limits on the different kinds of free lists. - static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int - arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); + // Sets limits on the different kinds of free lists. + static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int + arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); // Initializes C++ library and registers terminating functions at exit. - // Only for the library functions, not for user-defined functions. + // Only for the library functions, not for user-defined functions. static void initH5cpp(void); // Sends request for terminating the HDF5 library. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 96c7992..05c3e23 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -33,7 +33,7 @@ #include "H5File.h" #include "H5DataSet.h" #include "H5Attribute.h" -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset namespace H5 { @@ -55,17 +55,17 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, } //-------------------------------------------------------------------------- -// Function: H5Location default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::H5Location() : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location overloaded constructor (protected) -// Purpose Creates an H5Location object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location overloaded constructor (protected) +// Purpose Creates an H5Location object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -77,11 +77,11 @@ H5Location::H5Location() : IdComponent() {} // H5Location::H5Location(const hid_t object_id) : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location copy constructor -// Purpose: This noop copy constructor is removed as a result of the data -// member "id" being moved down to sub-classes. (Mar 2015) -///\param original - IN: H5Location instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location copy constructor +// Purpose: This noop copy constructor is removed as a result of the data +// member "id" being moved down to sub-classes. (Mar 2015) +///\param original - IN: H5Location instance to copy +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -93,25 +93,25 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::createAttribute -///\brief Creates an attribute for a group, dataset, or named datatype. -///\param name - IN: Name of the attribute -///\param data_type - IN: Datatype for the attribute -///\param data_space - IN: Dataspace for the attribute - only simple -/// dataspaces are allowed at this time -///\param create_plist - IN: Creation property list - default to -/// PropList::DEFAULT -///\return Attribute instance -///\exception H5::AttributeIException +// Function: H5Location::createAttribute +///\brief Creates an attribute for a group, dataset, or named datatype. +///\param name - IN: Name of the attribute +///\param data_type - IN: Datatype for the attribute +///\param data_space - IN: Dataspace for the attribute - only simple +/// dataspaces are allowed at this time +///\param create_plist - IN: Creation property list - default to +/// PropList::DEFAULT +///\return Attribute instance +///\exception H5::AttributeIException ///\par Description -/// The attribute name specified in \a name must be unique. -/// Attempting to create an attribute with the same name as an -/// existing attribute will raise an exception, leaving the -/// pre-existing attribute intact. To overwrite an existing -/// attribute with a new attribute of the same name, first -/// delete the existing one with \c H5Location::removeAttr, then -/// recreate it with this function. -// Programmer Binh-Minh Ribler - 2000 +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first +/// delete the existing one with \c H5Location::removeAttr, then +/// recreate it with this function. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const { @@ -123,20 +123,20 @@ Attribute H5Location::createAttribute( const char* name, const DataType& data_ty // If the attribute id is valid, create and return the Attribute object if( attr_id > 0 ) { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return( attr ); + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return( attr ); } else throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::createAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const { @@ -144,21 +144,21 @@ Attribute H5Location::createAttribute( const H5std_string& name, const DataType& } //-------------------------------------------------------------------------- -// Function: H5Location::openAttribute -///\brief Opens an attribute given its name. -///\param name - IN: Name of the attribute -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openAttribute +///\brief Opens an attribute given its name. +///\param name - IN: Name of the attribute +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::openAttribute( const char* name ) const { hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); if( attr_id > 0 ) { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return( attr ); + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return( attr ); } else { @@ -167,11 +167,11 @@ Attribute H5Location::openAttribute( const char* name ) const } //-------------------------------------------------------------------------- -// Function: H5Location::openAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::openAttribute( const H5std_string& name ) const { @@ -179,46 +179,46 @@ Attribute H5Location::openAttribute( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: H5Location::openAttribute -///\brief Opens an attribute given its index. -///\param idx - IN: Index of the attribute, a 0-based, non-negative integer -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openAttribute +///\brief Opens an attribute given its index. +///\param idx - IN: Index of the attribute, a 0-based, non-negative integer +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::openAttribute( const unsigned int idx ) const { hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, - H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); + H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); if( attr_id > 0 ) { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return(attr); + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); } else { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); } } //-------------------------------------------------------------------------- -// Function: H5Location::iterateAttrs -///\brief Iterates a user's function over all the attributes of an H5 -/// object, which may be a group, dataset or named datatype. -///\param user_op - IN: User's function to operate on each attribute -///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices -///\param op_data - IN: User's data to pass to user's operator function -///\return Returned value of the last operator if it was non-zero, or -/// zero if all attributes were processed -///\exception H5::AttributeIException +// Function: H5Location::iterateAttrs +///\brief Iterates a user's function over all the attributes of an H5 +/// object, which may be a group, dataset or named datatype. +///\param user_op - IN: User's function to operate on each attribute +///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices +///\param op_data - IN: User's data to pass to user's operator function +///\return Returned value of the last operator if it was non-zero, or +/// zero if all attributes were processed +///\exception H5::AttributeIException ///\par Description -/// The signature of user_op is -/// void (*)(H5::H5Location&, H5std_string, void*). -/// For information, please refer to the C layer Reference Manual -/// at: +/// The signature of user_op is +/// void (*)(H5::H5Location&, H5std_string, void*). +/// For information, please refer to the C layer Reference Manual +/// at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data ) { @@ -231,7 +231,7 @@ int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_ // call the C library routine H5Aiterate2 to iterate the attributes hsize_t idx = _idx ? static_cast(*_idx) : 0; int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, - userAttrOpWrpr, static_cast(userData)); + userAttrOpWrpr, static_cast(userData)); // release memory delete userData; @@ -239,7 +239,7 @@ int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_ if( ret_value >= 0 ) { /* Pass back update index value to calling code */ if (_idx) - *_idx = static_cast(idx); + *_idx = static_cast(idx); return( ret_value ); } @@ -248,11 +248,11 @@ int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_ } //-------------------------------------------------------------------------- -// Function: H5Location::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. -///\return Number of attributes -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getNumAttrs +///\brief Returns the number of attributes attached to this HDF5 object. +///\return Number of attributes +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Location::getNumAttrs() const { @@ -265,11 +265,11 @@ int H5Location::getNumAttrs() const } //-------------------------------------------------------------------------- -// Function: H5Location::attrExists -///\brief Checks whether the named attribute exists at this location. -///\param name - IN: Name of the attribute to be queried -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2013 +// Function: H5Location::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 //-------------------------------------------------------------------------- bool H5Location::attrExists(const char* name) const { @@ -286,11 +286,11 @@ bool H5Location::attrExists(const char* name) const } //-------------------------------------------------------------------------- -// Function: H5Location::attrExists -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5Location::attrExists(const H5std_string& name) const { @@ -298,11 +298,11 @@ bool H5Location::attrExists(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: H5Location::removeAttr -///\brief Removes the named attribute from this object. -///\param name - IN: Name of the attribute to be removed -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::removeAttr +///\brief Removes the named attribute from this object. +///\param name - IN: Name of the attribute to be removed +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::removeAttr( const char* name ) const { @@ -312,11 +312,11 @@ void H5Location::removeAttr( const char* name ) const } //-------------------------------------------------------------------------- -// Function: H5Location::removeAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::removeAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::removeAttr( const H5std_string& name ) const { @@ -324,12 +324,12 @@ void H5Location::removeAttr( const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: H5Location::renameAttr -///\brief Renames the named attribute from this object. -///\param oldname - IN: Name of the attribute to be renamed -///\param newname - IN: New name ame of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Location::renameAttr +///\brief Renames the named attribute from this object. +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Location::renameAttr(const char* oldname, const char* newname) const { @@ -339,11 +339,11 @@ void H5Location::renameAttr(const char* oldname, const char* newname) const } //-------------------------------------------------------------------------- -// Function: H5Location::renameAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for the names. -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Location::renameAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for the names. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& newname) const { @@ -351,19 +351,19 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new } //-------------------------------------------------------------------------- -// Function: H5Location::flush -///\brief Flushes all buffers associated with a location to disk. -///\param scope - IN: Specifies the scope of the flushing action, -/// which can be either of these values: -/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file -/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file -///\exception H5::Exception +// Function: H5Location::flush +///\brief Flushes all buffers associated with a location to disk. +///\param scope - IN: Specifies the scope of the flushing action, +/// which can be either of these values: +/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file +/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file +///\exception H5::Exception ///\par Description -/// This location is used to identify the file to be flushed. -// Programmer Binh-Minh Ribler - 2012 +/// This location is used to identify the file to be flushed. +// Programmer Binh-Minh Ribler - 2012 // Modification -// Sep 2012 - BMR -// Moved from H5File/H5Object +// Sep 2012 - BMR +// Moved from H5File/H5Object //-------------------------------------------------------------------------- void H5Location::flush(H5F_scope_t scope) const { @@ -375,11 +375,11 @@ void H5Location::flush(H5F_scope_t scope) const } //-------------------------------------------------------------------------- -// Function: H5Location::getFileName -///\brief Gets the name of the file, in which this HDF5 object belongs. -///\return File name -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Jul, 2004 +// Function: H5Location::getFileName +///\brief Gets the name of the file, in which this HDF5 object belongs. +///\return File name +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string H5Location::getFileName() const { @@ -392,24 +392,24 @@ H5std_string H5Location::getFileName() const } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief Sets or resets the comment for an object specified by its name. -///\param name - IN: Name of the object -///\param comment - IN: New comment -///\exception H5::LocationException -///\par Description -/// If \a comment is an empty string or a null pointer, the comment -/// message is removed from the object. -/// Comments should be relatively short, null-terminated, ASCII -/// strings. They can be attached to any object that has an -/// object header, e.g., data sets, groups, named data types, -/// and data spaces, but not symbolic links. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::setComment +///\brief Sets or resets the comment for an object specified by its name. +///\param name - IN: Name of the object +///\param comment - IN: New comment +///\exception H5::LocationException +///\par Description +/// If \a comment is an empty string or a null pointer, the comment +/// message is removed from the object. +/// Comments should be relatively short, null-terminated, ASCII +/// strings. They can be attached to any object that has an +/// object header, e.g., data sets, groups, named data types, +/// and data spaces, but not symbolic links. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) // Modification -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::setComment(const char* name, const char* comment) const { @@ -419,11 +419,11 @@ void H5Location::setComment(const char* name, const char* comment) const } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name and \a comment. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name and \a comment. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const { @@ -431,11 +431,11 @@ void H5Location::setComment(const H5std_string& name, const H5std_string& commen } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it doesn't take -/// an object name. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it doesn't take +/// an object name. +// Programmer Binh-Minh Ribler - Sep 2013 // Modification //-------------------------------------------------------------------------- void H5Location::setComment(const char* comment) const @@ -446,11 +446,11 @@ void H5Location::setComment(const char* comment) const } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a comment. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a comment. +// Programmer Binh-Minh Ribler - Sep 2013 //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& comment) const { @@ -458,15 +458,15 @@ void H5Location::setComment(const H5std_string& comment) const } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief Removes the comment from an object specified by its name. -///\param name - IN: Name of the object -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// Function: H5Location::removeComment +///\brief Removes the comment from an object specified by its name. +///\param name - IN: Name of the object +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::removeComment(const char* name) const { @@ -476,11 +476,11 @@ void H5Location::removeComment(const char* name) const } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// Function: H5Location::removeComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::removeComment(const H5std_string& name) const { @@ -488,19 +488,19 @@ void H5Location::removeComment(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Retrieves the comment for this location, returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve -///\param comment - OUT: Retrieved comment -///\return Actual length of the comment -///\exception H5::LocationException +// Function: H5Location::getComment +///\brief Retrieves the comment for this location, returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve +///\param comment - OUT: Retrieved comment +///\return Actual length of the comment +///\exception H5::LocationException ///\par Description -/// This function retrieves \a buf_size characters of the comment -/// including the null terminator. Thus, if the actual length -/// of the comment is more than buf_size-1, the retrieved comment -/// will be truncated to accommodate the null terminator. -// Programmer Binh-Minh Ribler - Mar 2014 +/// This function retrieves \a buf_size characters of the comment +/// including the null terminator. Thus, if the actual length +/// of the comment is more than buf_size-1, the retrieved comment +/// will be truncated to accommodate the null terminator. +// Programmer Binh-Minh Ribler - Mar 2014 //-------------------------------------------------------------------------- ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) const { @@ -517,21 +517,21 @@ ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) // If the comment is longer than the provided buffer size, the C library // will not null terminate it if (static_cast(comment_len) >= buf_size) - comment[buf_size-1] = '\0'; + comment[buf_size-1] = '\0'; // Return the actual comment length, which might be different from buf_size return(comment_len); } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Returns the comment as \a string for this location, -/// returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve, default to 0 -///\return Comment string -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief Returns the comment as \a string for this location, +/// returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve, default to 0 +///\return Comment string +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const char* name, size_t buf_size) const { @@ -551,29 +551,29 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const // If comment exists, calls C routine again to get it else if (comment_len > 0) { - size_t tmp_len = buf_size; + size_t tmp_len = buf_size; - // If buffer size is not provided, use comment length - if (tmp_len == 0) - tmp_len = comment_len; + // If buffer size is not provided, use comment length + if (tmp_len == 0) + tmp_len = comment_len; - // Temporary buffer for char* comment - char* comment_C = new char[tmp_len+1]; - HDmemset(comment_C, 0, tmp_len+1); // clear buffer + // Temporary buffer for char* comment + char* comment_C = new char[tmp_len+1]; + HDmemset(comment_C, 0, tmp_len+1); // clear buffer - // Used overloaded function - ssize_t temp_len = getComment(name, tmp_len+1, comment_C); - if (temp_len < 0) - { - delete []comment_C; - throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); - } + // Used overloaded function + ssize_t temp_len = getComment(name, tmp_len+1, comment_C); + if (temp_len < 0) + { + delete []comment_C; + throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); + } - // Convert the C comment to return - comment = comment_C; + // Convert the C comment to return + comment = comment_C; - // Clean up resource - delete []comment_C; + // Clean up resource + delete []comment_C; } // Return the string comment @@ -581,11 +581,11 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) const { @@ -594,14 +594,14 @@ H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) c #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_reference (protected) -// Purpose Creates a reference to an HDF5 object or a dataset region. +// Function: H5Location::p_reference (protected) +// Purpose Creates a reference to an HDF5 object or a dataset region. // Parameters -// name - IN: Name of the object to be referenced -// dataspace - IN: Dataspace with selection -// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// name - IN: Name of the object to be referenced +// dataspace - IN: Dataspace with selection +// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const { @@ -615,18 +615,18 @@ void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_ty #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief Creates a reference to an HDF5 object or a dataset region. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief Creates a reference to an HDF5 object or a dataset region. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const { @@ -639,20 +639,20 @@ void H5Location::reference(void* ref, const char* name, const DataSpace& dataspa } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const { @@ -665,18 +665,18 @@ void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it does not take -/// a DataSpace object and the reference type must be specified. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\exception H5::ReferenceException -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it does not take +/// a DataSpace object and the reference type must be specified. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\exception H5::ReferenceException +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const { @@ -689,17 +689,17 @@ void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) con } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for the object's name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced - \c H5std_string -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for the object's name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced - \c H5std_string +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const { @@ -708,18 +708,18 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_dereference (protected) -// Purpose Dereference a ref into an hdf5 object. +// Function: H5Location::p_dereference (protected) +// Purpose Dereference a ref into an hdf5 object. // Parameters -// loc_id - IN: An hdf5 identifier specifying the location of the -// referenced object -// ref - IN: Reference pointer -// ref_type - IN: Reference type -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// loc_id - IN: An hdf5 identifier specifying the location of the +// referenced object +// ref - IN: Reference pointer +// ref_type - IN: Reference type +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May 2008 - BMR -// Moved from IdComponent. +// May 2008 - BMR +// Moved from IdComponent. //-------------------------------------------------------------------------- hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const char* from_func) { @@ -734,16 +734,16 @@ hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_ty #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. -///\param loc - IN: Location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. +///\param loc - IN: Location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type) { @@ -751,16 +751,16 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t } //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an attribute. -///\param attr - IN: Attribute specifying the location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an attribute. +///\param attr - IN: Attribute specifying the location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type) { @@ -769,23 +769,23 @@ void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::getObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\param ref - IN: Reference to query -///\return An object type, which can be one of the following: -/// \li \c H5G_UNKNOWN - A failure occurs. (-1) -/// \li \c H5G_GROUP - Object is a group. -/// \li \c H5G_DATASET - Object is a dataset. -/// \li \c H5G_TYPE Object - is a named datatype -/// \li \c H5G_LINK - Object is a symbolic link. -/// \li \c H5G_UDLINK - Object is a user-defined link. -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\param ref - IN: Reference to query +///\return An object type, which can be one of the following: +/// \li \c H5G_UNKNOWN - A failure occurs. (-1) +/// \li \c H5G_GROUP - Object is a group. +/// \li \c H5G_DATASET - Object is a dataset. +/// \li \c H5G_TYPE Object - is a named datatype +/// \li \c H5G_LINK - Object is a symbolic link. +/// \li \c H5G_UDLINK - Object is a user-defined link. +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Sep 2012: Moved up from H5File, Group, DataSet, and DataType +// Sep 2012: Moved up from H5File, Group, DataSet, and DataType //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const { @@ -799,20 +799,20 @@ H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5G_UNKNOWN \tFailure occurs (-1) -// H5G_GROUP \tObject is a group. -// H5G_DATASET \tObject is a dataset. -// H5G_TYPE Object \tis a named datatype. -// H5G_LINK \tObject is a symbolic link. -// H5G_UDLINK \tObject is a user-defined link. -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5G_UNKNOWN \tFailure occurs (-1) +// H5G_GROUP \tObject is a group. +// H5G_DATASET \tObject is a dataset. +// H5G_TYPE Object \tis a named datatype. +// H5G_LINK \tObject is a symbolic link. +// H5G_UDLINK \tObject is a user-defined link. +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const { @@ -828,20 +828,20 @@ H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getRefObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref - IN: Reference to query -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\return An object type, which can be one of the following: -/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) -/// \li \c H5O_TYPE_GROUP - Object is a group -/// \li \c H5O_TYPE_DATASET - Object is a dataset -/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -/// \li \c H5O_TYPE_NTYPES - Number of different object types -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRefObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref - IN: Reference to query +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\return An object type, which can be one of the following: +/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) +/// \li \c H5O_TYPE_GROUP - Object is a group +/// \li \c H5O_TYPE_DATASET - Object is a dataset +/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +/// \li \c H5O_TYPE_NTYPES - Number of different object types +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const { @@ -855,19 +855,19 @@ H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_ref_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_ref_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5O_TYPE_UNKNOWN - Unknown object type (-1) -// H5O_TYPE_GROUP - Object is a group -// H5O_TYPE_DATASET - Object is a dataset -// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -// H5O_TYPE_NTYPES - Number of object types -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5O_TYPE_UNKNOWN - Unknown object type (-1) +// H5O_TYPE_GROUP - Object is a group +// H5O_TYPE_DATASET - Object is a dataset +// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +// H5O_TYPE_NTYPES - Number of object types +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const { @@ -887,20 +887,20 @@ H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::getRegion -///\brief Retrieves a dataspace with the region pointed to selected. -///\param ref - IN: Reference to get region of -///\param ref_type - IN: Type of reference to get region of - default -// to H5R_DATASET_REGION -///\return DataSpace object -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRegion +///\brief Retrieves a dataspace with the region pointed to selected. +///\param ref - IN: Reference to get region of +///\param ref_type - IN: Type of reference to get region of - default +// to H5R_DATASET_REGION +///\return DataSpace object +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 29, 2015 -// Used friend function to set id for DataSpace instead of the -// existing id constructor or the setId method to avoid incrementing -// ref count, as a work-around for a problem described in the JIRA -// issue HDFFV-7947. -BMR +// Mar 29, 2015 +// Used friend function to set id for DataSpace instead of the +// existing id constructor or the setId method to avoid incrementing +// ref count, as a work-around for a problem described in the JIRA +// issue HDFFV-7947. -BMR //-------------------------------------------------------------------------- DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const { @@ -910,9 +910,9 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); } try { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, space_id); - return(dataspace); + DataSpace dataspace; + f_DataSpace_setId(&dataspace, space_id); + return(dataspace); } catch (DataSpaceIException& E) { throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); @@ -921,21 +921,21 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- -// Function: H5Location destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::~H5Location() {} //-------------------------------------------------------------------------- -// Function: f_Attribute_setId - friend -// Purpose: This function is friend to class H5::Attribute so that it -// can set Attribute::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. -// param attr - IN/OUT: Attribute object to be changed -// param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Function: f_Attribute_setId - friend +// Purpose: This function is friend to class H5::Attribute so that it +// can set Attribute::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. +// param attr - IN/OUT: Attribute object to be changed +// param new_id - IN: New id to set +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_Attribute_setId(Attribute* attr, hid_t new_id) { @@ -943,14 +943,14 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: f_DataSpace_setId - friend -// Purpose: This function is friend to class H5::DataSpace so that it can -// can set DataSpace::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. -// param dspace - IN/OUT: DataSpace object to be changed -// param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Function: f_DataSpace_setId - friend +// Purpose: This function is friend to class H5::DataSpace so that it can +// can set DataSpace::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. +// param dspace - IN/OUT: DataSpace object to be changed +// param new_id - IN: New id to set +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_DataSpace_setId(DataSpace* dspace, hid_t new_id) { diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index a57f7f1..1c0f26f 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -17,7 +17,7 @@ #ifndef __H5Location_H #define __H5Location_H -#include "H5Classes.h" // constains forward class declarations +#include "H5Classes.h" // constains forward class declarations namespace H5 { @@ -30,9 +30,9 @@ typedef void (*attr_operator_t)( H5Location& loc/*in*/, class UserData4Aiterate { // user data for attribute iteration public: - attr_operator_t op; - void* opData; - H5Location* location; + attr_operator_t op; + void* opData; + H5Location* location; }; /*! \class H5Location @@ -46,119 +46,119 @@ class UserData4Aiterate { // user data for attribute iteration // a location can be a file, group, dataset, or named datatype. -BMR, 2013-10-1 class H5_DLLCPP H5Location : public IdComponent { public: - // Creates an attribute for the specified object at this location - // PropList is currently not used, so always be default. - Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + // Creates an attribute for the specified object at this location + // PropList is currently not used, so always be default. + Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - // Given its name, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute( const char* name ) const; - Attribute openAttribute( const H5std_string& name ) const; + // Given its name, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute( const char* name ) const; + Attribute openAttribute( const H5std_string& name ) const; - // Given its index, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute( const unsigned int idx ) const; + // Given its index, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute( const unsigned int idx ) const; - // Flushes all buffers associated with this location to disk. - void flush( H5F_scope_t scope ) const; + // Flushes all buffers associated with this location to disk. + void flush( H5F_scope_t scope ) const; - // Gets the name of the file, specified by this location. - H5std_string getFileName() const; + // Gets the name of the file, specified by this location. + H5std_string getFileName() const; - // Determines the number of attributes at this location. - int getNumAttrs() const; + // Determines the number of attributes at this location. + int getNumAttrs() const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; - // Note: getRefObjType deprecates getObjType, but getObjType's name is - // misleading, so getRefObjType is used in the new function instead. - - // Iterate user's function over the attributes at this location. - int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); - - // Checks whether the named attribute exists at this location. - bool attrExists(const char* name) const; - bool attrExists(const H5std_string& name) const; - - // Renames the named attribute to a new name. - void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; - - // Removes the named attribute from this location. - void removeAttr(const char* name) const; - void removeAttr(const H5std_string& name) const; - - // Sets the comment for an HDF5 object specified by its name. - void setComment(const char* name, const char* comment) const; - void setComment(const H5std_string& name, const H5std_string& comment) const; - void setComment(const char* comment) const; - void setComment(const H5std_string& comment) const; - - // Retrieves comment for the HDF5 object specified by its name. - ssize_t getComment(const char* name, size_t buf_size, char* comment) const; - H5std_string getComment(const char* name, size_t buf_size=0) const; - H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; - - // Removes the comment for the HDF5 object specified by its name. - void removeComment(const char* name) const; - void removeComment(const H5std_string& name) const; - - // Creates a reference to a named object or to a dataset region - // in this object. - void reference(void* ref, const char* name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const H5std_string& name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const char* name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - - // Open a referenced object whose location is specified by either - // a file, an HDF5 object, or an attribute. - void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - - // Retrieves a dataspace with the region pointed to selected. - DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; - - ///\brief Returns an identifier. (pure virtual) - virtual hid_t getId() const = 0; + // Retrieves the type of object that an object reference points to. + H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Note: getRefObjType deprecates getObjType, but getObjType's name is + // misleading, so getRefObjType is used in the new function instead. + + // Iterate user's function over the attributes at this location. + int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + + // Checks whether the named attribute exists at this location. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; + + // Renames the named attribute to a new name. + void renameAttr(const char* oldname, const char* newname) const; + void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + + // Removes the named attribute from this location. + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; + + // Sets the comment for an HDF5 object specified by its name. + void setComment(const char* name, const char* comment) const; + void setComment(const H5std_string& name, const H5std_string& comment) const; + void setComment(const char* comment) const; + void setComment(const H5std_string& comment) const; + + // Retrieves comment for the HDF5 object specified by its name. + ssize_t getComment(const char* name, size_t buf_size, char* comment) const; + H5std_string getComment(const char* name, size_t buf_size=0) const; + H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; + + // Removes the comment for the HDF5 object specified by its name. + void removeComment(const char* name) const; + void removeComment(const H5std_string& name) const; + + // Creates a reference to a named object or to a dataset region + // in this object. + void reference(void* ref, const char* name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const H5std_string& name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const char* name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + + // Open a referenced object whose location is specified by either + // a file, an HDF5 object, or an attribute. + void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + + // Retrieves a dataspace with the region pointed to selected. + DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + + ///\brief Returns an identifier. (pure virtual) + virtual hid_t getId() const = 0; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Default constructor, - H5Location(); + // Default constructor, + H5Location(); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the location id. - H5Location(const hid_t loc_id); + // Creates a copy of an existing object giving the location id. + H5Location(const hid_t loc_id); - // Creates a reference to an HDF5 object or a dataset region. - void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; + // Creates a reference to an HDF5 object or a dataset region. + void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; - // Dereferences a ref into an HDF5 id. - hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const char* from_func); + // Dereferences a ref into an HDF5 id. + hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const char* from_func); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; // Sets the identifier of this object to a new value. - this one // doesn't increment reference count @@ -166,8 +166,8 @@ class H5_DLLCPP H5Location : public IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS - // Noop destructor. - virtual ~H5Location(); + // Noop destructor. + virtual ~H5Location(); }; /* end class H5Location */ diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 6bcc666..3ac149a 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -32,23 +32,23 @@ #include "H5File.h" #include "H5DataSet.h" #include "H5Attribute.h" -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Object default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::H5Object() : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object overloaded constructor (protected) +// Purpose Creates an H5Object object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It will be removed in 1.10 release. If its @@ -59,11 +59,11 @@ H5Object::H5Object() : H5Location() {} //H5Object::H5Object(const hid_t object_id) : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object -/// instance. -///\param original - IN: H5Object instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object copy constructor +///\brief Copy constructor: makes a copy of the original H5Object +/// instance. +///\param original - IN: H5Object instance to copy +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It is removed from 1.8.15 because it is @@ -183,9 +183,9 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const } //-------------------------------------------------------------------------- -// Function: H5Object destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::~H5Object() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index cbeefc3..a30a65f 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -18,22 +18,22 @@ #define __H5Object_H #include "H5Location.h" -#include "H5Classes.h" // constains forward class declarations +#include "H5Classes.h" // constains forward class declarations // H5Object is a baseclass. It has these subclasses: // Group, DataSet, and DataType. // DataType, in turn, has several specific datatypes as subclasses. // Modification: -// Sept 18, 2012: Added class H5Location in between IdComponent and -// H5Object. An H5File now inherits from H5Location. All HDF5 -// wrappers in H5Object are moved up to H5Location. H5Object -// is left mostly empty for future wrappers that are only for -// group, dataset, and named datatype. Note that the reason for -// adding H5Location instead of simply moving H5File to be under -// H5Object is H5File is not an HDF5 object, and renaming H5Object -// to H5Location will risk breaking user applications. -// -BMR -// Apr 2, 2014: Added wrapper getObjName for H5Iget_name +// Sept 18, 2012: Added class H5Location in between IdComponent and +// H5Object. An H5File now inherits from H5Location. All HDF5 +// wrappers in H5Object are moved up to H5Location. H5Object +// is left mostly empty for future wrappers that are only for +// group, dataset, and named datatype. Note that the reason for +// adding H5Location instead of simply moving H5File to be under +// H5Object is H5File is not an HDF5 object, and renaming H5Object +// to H5Location will risk breaking user applications. +// -BMR +// Apr 2, 2014: Added wrapper getObjName for H5Iget_name namespace H5 { /*! \class H5Object @@ -45,18 +45,18 @@ namespace H5 { class H5_DLLCPP H5Object : public H5Location { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. These should have const but are retiring anyway. - ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; - ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; - H5std_string getObjName() const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or + // DataType. These should have const but are retiring anyway. + ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; + ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; + H5std_string getObjName() const; - // Noop destructor. - virtual ~H5Object(); + // Noop destructor. + virtual ~H5Object(); protected: - // Default constructor - H5Object(); + // Default constructor + H5Object(); // *** Deprecation warning *** // The following two constructors are no longer appropriate after the @@ -65,11 +65,11 @@ class H5_DLLCPP H5Object : public H5Location { // other will be removed from 1.10 release, and then from 1.8 if its // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the object id - H5Object( const hid_t object_id ); + // Creates a copy of an existing object giving the object id + H5Object( const hid_t object_id ); - // Copy constructor: makes copy of an H5Object object. - // H5Object(const H5Object& original); + // Copy constructor: makes copy of an H5Object object. + // H5Object(const H5Object& original); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 18aa886..71ed4a9 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -76,47 +76,47 @@ void ObjCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const ObjCreatPropList& ObjCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer: Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: ObjCreatPropList instance to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: ObjCreatPropList instance to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. +// Function: ObjCreatPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrPhaseChange -///\brief Sets attribute storage phase change thresholds. -///\param max_compact - IN: Maximum number of attributes to be stored in -/// compact storage. Default to 8 -///\param min_dense - IN: Minimum number of attributes to be stored in -/// dense storage. Default to 6 -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrPhaseChange +///\brief Sets attribute storage phase change thresholds. +///\param max_compact - IN: Maximum number of attributes to be stored in +/// compact storage. Default to 8 +///\param min_dense - IN: Minimum number of attributes to be stored in +/// dense storage. Default to 6 +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- @@ -130,17 +130,17 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrPhaseChange -///\brief Gets attribute storage phase change thresholds. -///\param max_compact - OUT: Maximum number of attributes to be stored in -/// compact storage. -///\param min_dense - OUT: Minimum number of attributes to be stored in -/// dense storage. -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrPhaseChange +///\brief Gets attribute storage phase change thresholds. +///\param max_compact - OUT: Maximum number of attributes to be stored in +/// compact storage. +///\param min_dense - OUT: Minimum number of attributes to be stored in +/// dense storage. +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- @@ -155,21 +155,21 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrCrtOrder -///\brief Sets tracking and indexing of attribute creation order. -///\param crt_order_flags - IN: Flags specifying whether to track and -/// index attribute creation order. Default: No flag set -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrCrtOrder +///\brief Sets tracking and indexing of attribute creation order. +///\param crt_order_flags - IN: Flags specifying whether to track and +/// index attribute creation order. Default: No flag set +///\exception H5::PropListIException ///\par Description -/// Valid flags are: -/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked -/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is -/// indexed (requires H5P_CRT_ORDER_TRACKED). -/// When no flag is set, attribute creation order is neither -/// tracked not indexed. Note that HDF5 currently provides no -/// mechanism to turn on attribute creation order tracking at object -/// creation time and to build the index later. -/// The C layer Reference Manual at can be found at: +/// Valid flags are: +/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked +/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is +/// indexed (requires H5P_CRT_ORDER_TRACKED). +/// When no flag is set, attribute creation order is neither +/// tracked not indexed. Note that HDF5 currently provides no +/// mechanism to turn on attribute creation order tracking at object +/// creation time and to build the index later. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- @@ -183,15 +183,15 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrCrtOrder -///\brief Gets tracking and indexing settings for attribute -/// creation order. -///\return Attribute creation order -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrCrtOrder +///\brief Gets tracking and indexing settings for attribute +/// creation order. +///\return Attribute creation order +///\exception H5::PropListIException ///\par Description -/// When no flag is set, i.e. crt_order_flags = 0, attribute -/// creation order is neither tracked not indexed. -/// The C layer Reference Manual at can be found at: +/// When no flag is set, i.e. crt_order_flags = 0, attribute +/// creation order is neither tracked not indexed. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- @@ -208,9 +208,9 @@ unsigned ObjCreatPropList::getAttrCrtOrder() const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::~ObjCreatPropList() {} diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 823f747..f0235af 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -22,37 +22,37 @@ namespace H5 { //! Class ObjCreatPropList represents the HDF5 object creation property list. class H5_DLLCPP ObjCreatPropList : public PropList { public: - ///\brief Default object creation property list. - static const ObjCreatPropList& DEFAULT; + ///\brief Default object creation property list. + static const ObjCreatPropList& DEFAULT; - // Creates a object creation property list. - ObjCreatPropList(); + // Creates a object creation property list. + ObjCreatPropList(); - // Sets attribute storage phase change thresholds. - void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; + // Sets attribute storage phase change thresholds. + void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; - // Gets attribute storage phase change thresholds. - void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; + // Gets attribute storage phase change thresholds. + void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; - // Sets tracking and indexing of attribute creation order. - void setAttrCrtOrder(unsigned crt_order_flags) const; + // Sets tracking and indexing of attribute creation order. + void setAttrCrtOrder(unsigned crt_order_flags) const; - // Gets tracking and indexing settings for attribute creation order. - unsigned getAttrCrtOrder() const; + // Gets tracking and indexing settings for attribute creation order. + unsigned getAttrCrtOrder() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ObjCreatPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ObjCreatPropList"); } - // Copy constructor: creates a copy of a ObjCreatPropList object. - ObjCreatPropList( const ObjCreatPropList& original ); + // Copy constructor: creates a copy of a ObjCreatPropList object. + ObjCreatPropList( const ObjCreatPropList& original ); - // Creates a copy of an existing object creation property list - // using the property list id. - ObjCreatPropList (const hid_t plist_id); + // Creates a copy of an existing object creation property list + // using the property list id. + ObjCreatPropList (const hid_t plist_id); - // Noop destructor - virtual ~ObjCreatPropList(); + // Noop destructor + virtual ~ObjCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 2ff2f99..f4aca2e 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -28,14 +28,14 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType overloaded constructor -///\brief Creates a PredType object using the id of an existing -/// predefined datatype. -///\param predtype_id - IN: Id of a predefined datatype +// Function: PredType overloaded constructor +///\brief Creates a PredType object using the id of an existing +/// predefined datatype. +///\param predtype_id - IN: Id of a predefined datatype // Description -// This constructor creates a PredType object by copying -// the provided HDF5 predefined datatype. -// Programmer Binh-Minh Ribler - 2000 +// This constructor creates a PredType object by copying +// the provided HDF5 predefined datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) { @@ -43,36 +43,36 @@ PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) } //-------------------------------------------------------------------------- -// Function: PredType default constructor -///\brief Default constructor: Creates a stub predefined datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType default constructor +///\brief Default constructor: Creates a stub predefined datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType() : AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType copy constructor -///\brief Copy constructor: makes a copy of the original PredType object. -///\param original - IN: PredType instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType copy constructor +///\brief Copy constructor: makes a copy of the original PredType object. +///\param original - IN: PredType instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const PredType& original) : AtomType(original) {} //-------------------------------------------------------------------------- -// Function: PredType::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the predefined datatype -///\return Reference to PredType instance -///\exception H5::DataTypeIException +// Function: PredType::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the predefined datatype +///\return Reference to PredType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType& PredType::operator=( const PredType& rhs ) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } @@ -97,15 +97,15 @@ bool PredType::committed() // Default destructor //-------------------------------------------------------------------------- -// Function: PredType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::~PredType() {} /***************************************************************************** - The following section is regarding the global constants PredType, - DataSpace, and PropList. + The following section is regarding the global constants PredType, + DataSpace, and PropList. *****************************************************************************/ @@ -288,18 +288,18 @@ PredType* PredType::NATIVE_UINT_FAST64_; #endif /* H5_SIZEOF_UINT_FAST64_T */ //-------------------------------------------------------------------------- -// Function: PredType::getPredTypes -// Purpose: Returns the dummy PredType constant object pointer -// Return: PredType object pointer +// Function: PredType::getPredTypes +// Purpose: Returns the dummy PredType constant object pointer +// Return: PredType object pointer // Description -// If the dummy constant PREDTYPE_CONST_ is not allocated yet, -// call makePredTypes() to allocate all of the PredType constants. -// Otherwise, just simply return the object pointer PREDTYPE_CONST_. +// If the dummy constant PREDTYPE_CONST_ is not allocated yet, +// call makePredTypes() to allocate all of the PredType constants. +// Otherwise, just simply return the object pointer PREDTYPE_CONST_. // -// Note that, there is a similar function to getPredTypes() in -// other classes, that have global constants, is called getConstant(). +// Note that, there is a similar function to getPredTypes() in +// other classes, that have global constants, is called getConstant(). // -// Programmer Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- PredType* PredType::getPredTypes() { @@ -314,16 +314,16 @@ PredType* PredType::getPredTypes() // If the dummy constant pointer is not allocated, allocate all PredType // constant pointers. Otherwise, throw because it shouldn't be. if (PREDTYPE_CONST_ == 0) - makePredTypes(); + makePredTypes(); else - throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); + throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); return PREDTYPE_CONST_; } //-------------------------------------------------------------------------- -// Function: PredType::makePredTypes -// Purpose: Allocate all PredType constants. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::makePredTypes +// Purpose: Allocate all PredType constants. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::makePredTypes() { @@ -511,9 +511,9 @@ void PredType::makePredTypes() //-------------------------------------------------------------------------- -// Function: PredType::deleteConstants -// Purpose: Deletes all PredType constant pointers. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::deleteConstants +// Purpose: Deletes all PredType constant pointers. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::deleteConstants() { @@ -887,206 +887,206 @@ const PredType& PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_; } // end namespace /*************************************************************************** - Design Note - =========== + Design Note + =========== September 2015: - The C++ library has several types of global constants from different - classes, such as PropList, PredType, DataSpace, etc... Previously, - these global constants were declared statically and the C++ library used - a constant, called PredType::AtExit, to detect when all the global - contants are destroyed then close the C library (H5close). This method - relied on the order of the constants being created and destroyed and - that PredType constants be the last to be destroyed. In September - 2015, it was recognized that the order in which the global constants were - created and destroyed was actually undefined, thus can be different - between different compilers. This resulted in failure when compilers - destroy PredType constants before others because when PredType::AtExit - was destroyed, the C library was closed, so when the constants of other - classes such as PropList or DataSpace were being deleted, the C library - would not be available. - - These are the classes that have global constants: - + PredType - + DataSpace - + PropList (and its subclasses below) - + FileAccPropList - + FileCreatPropList - + DSetMemXferPropList - + DSetCreatPropList - - - The new method includes these main points: - - - The C++ library uses dynamically allocated constants to have the - control in which order the global constants are created/destroyed. - - - The previous static constants are changed to be the references to - the dynamically allocated constants to avoid impact on applications. - - - The first time an IdComponent default constructor is invoked, it - will call the function H5Library::initH5cpp which registers the - terminating functions from each class that has the global constants - so that these functions can destroy those constants at the exit of the - application. IdComponent is a baseclass of any object class that has - an identifier, such as Group, DataSet, DataType,... The classes which - have the global constants are all derived from IdComponent. - - - At the normal termination of the application, each registered function - for each constant type will delete all the allocated constants in - that type class, then a different terminating function, which was also - registered with atexit() by initH5cpp, will call H5close to close the - C library. - - The following list presents the differences between the old and new - methods and the changes implemented for the new method. - - 1. The following items are added to class H5Library: - // Private instance to be created by H5Library only - static H5Library* instance; - - // Returns a singleton H5Library to initialize the global - // constants, invoked in IdComponent default constructor - static H5Library* getInstance(); // public - - // Registers cleanup and terminating functions with atexit(), - // called in IdComponent default constructor - static void initH5cpp(void); // public - - // Calls H5close to terminate the library, registered with - // atexit(), as the last thing to be done. - static void termH5cpp(void); // public - - 2. The following shows the differences between the old and new methods - for allocating the PredType constants. There are more than 100 - constants, but only one is shown here for examples. - - Old Method: - ---------- - // Declaration of the constant - in "H5PredType.h" - static const PredType NATIVE_INT; - - // Definition of the constant - in "H5PredType.cpp" - const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); - - New Method: - ---------- - // Declare pointer for a constant - in "H5PredType.h" - static PredType* NATIVE_INT_; // "H5PredType.h" - - // Change previous constant to reference - in "H5PredType.h" - static const PredType& NATIVE_INT; - - // The assignment of the first static constant, named - // PREDTYPE_CONST, calls makePredTypes() which allocates the - // dynamic memory for every PredType constant. - - // Creates a dynamic PredType object representing a C constant - // - in makePredTypes() - NATIVE_INT_ = new PredType(H5T_NATIVE_INT); - - // Assign the constant reference to the dynamic object - // - in "H5PredType.cpp" - const PredType& PredType::NATIVE_INT = *NATIVE_INT_; - - Functions added to class PredType: - - // Creates the constants - static void makePredTypes(); // private - - // Calls makePredTypes to create the constants and returns - // the dummy constant PREDTYPE_CONST; - static PredType* getPredTypes(); // private - - // Deletes the constants - static void deleteConstants(); // public - - 3. This section shows the differences between the old and new methods - for allocating the DataSpace constant, DataSpace::ALL. + The C++ library has several types of global constants from different + classes, such as PropList, PredType, DataSpace, etc... Previously, + these global constants were declared statically and the C++ library used + a constant, called PredType::AtExit, to detect when all the global + contants are destroyed then close the C library (H5close). This method + relied on the order of the constants being created and destroyed and + that PredType constants be the last to be destroyed. In September + 2015, it was recognized that the order in which the global constants were + created and destroyed was actually undefined, thus can be different + between different compilers. This resulted in failure when compilers + destroy PredType constants before others because when PredType::AtExit + was destroyed, the C library was closed, so when the constants of other + classes such as PropList or DataSpace were being deleted, the C library + would not be available. + + These are the classes that have global constants: + + PredType + + DataSpace + + PropList (and its subclasses below) + + FileAccPropList + + FileCreatPropList + + DSetMemXferPropList + + DSetCreatPropList + + + The new method includes these main points: + + - The C++ library uses dynamically allocated constants to have the + control in which order the global constants are created/destroyed. + + - The previous static constants are changed to be the references to + the dynamically allocated constants to avoid impact on applications. + + - The first time an IdComponent default constructor is invoked, it + will call the function H5Library::initH5cpp which registers the + terminating functions from each class that has the global constants + so that these functions can destroy those constants at the exit of the + application. IdComponent is a baseclass of any object class that has + an identifier, such as Group, DataSet, DataType,... The classes which + have the global constants are all derived from IdComponent. + + - At the normal termination of the application, each registered function + for each constant type will delete all the allocated constants in + that type class, then a different terminating function, which was also + registered with atexit() by initH5cpp, will call H5close to close the + C library. + + The following list presents the differences between the old and new + methods and the changes implemented for the new method. + + 1. The following items are added to class H5Library: + // Private instance to be created by H5Library only + static H5Library* instance; + + // Returns a singleton H5Library to initialize the global + // constants, invoked in IdComponent default constructor + static H5Library* getInstance(); // public + + // Registers cleanup and terminating functions with atexit(), + // called in IdComponent default constructor + static void initH5cpp(void); // public + + // Calls H5close to terminate the library, registered with + // atexit(), as the last thing to be done. + static void termH5cpp(void); // public + + 2. The following shows the differences between the old and new methods + for allocating the PredType constants. There are more than 100 + constants, but only one is shown here for examples. + + Old Method: + ---------- + // Declaration of the constant - in "H5PredType.h" + static const PredType NATIVE_INT; + + // Definition of the constant - in "H5PredType.cpp" + const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); + + New Method: + ---------- + // Declare pointer for a constant - in "H5PredType.h" + static PredType* NATIVE_INT_; // "H5PredType.h" + + // Change previous constant to reference - in "H5PredType.h" + static const PredType& NATIVE_INT; + + // The assignment of the first static constant, named + // PREDTYPE_CONST, calls makePredTypes() which allocates the + // dynamic memory for every PredType constant. + + // Creates a dynamic PredType object representing a C constant + // - in makePredTypes() + NATIVE_INT_ = new PredType(H5T_NATIVE_INT); + + // Assign the constant reference to the dynamic object + // - in "H5PredType.cpp" + const PredType& PredType::NATIVE_INT = *NATIVE_INT_; + + Functions added to class PredType: + + // Creates the constants + static void makePredTypes(); // private + + // Calls makePredTypes to create the constants and returns + // the dummy constant PREDTYPE_CONST; + static PredType* getPredTypes(); // private + + // Deletes the constants + static void deleteConstants(); // public + + 3. This section shows the differences between the old and new methods + for allocating the DataSpace constant, DataSpace::ALL. - Old Method: - ---------- - // Declaration of the constant - in "H5DataSpace.h" - static const DataSpace ALL; + Old Method: + ---------- + // Declaration of the constant - in "H5DataSpace.h" + static const DataSpace ALL; - // Definition of the constant - in "H5DataSpace.cpp" - const DataSpace DataSpace::ALL(H5S_ALL); + // Definition of the constant - in "H5DataSpace.cpp" + const DataSpace DataSpace::ALL(H5S_ALL); - New Method: - ---------- - // Declare pointer for a constant - in "H5DataSpace.h" - static DataSpace* ALL_; // "H5DataSpace.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5DataSpace.h" + static DataSpace* ALL_; // "H5DataSpace.h" - // Change previous constant to reference - in "H5DataSpace.h" - static const DataSpace& ALL; + // Change previous constant to reference - in "H5DataSpace.h" + static const DataSpace& ALL; - // Creates a dynamic DataSpace object representing the C constant - // - in "H5DataSpace.cpp" - ALL_ = new DataSpace(H5S_ALL); + // Creates a dynamic DataSpace object representing the C constant + // - in "H5DataSpace.cpp" + ALL_ = new DataSpace(H5S_ALL); - // Assign the constant reference to the dynamic object - // - in "H5DataSpace.cpp" - const DataSpace& DataSpace::ALL = *ALL_; + // Assign the constant reference to the dynamic object + // - in "H5DataSpace.cpp" + const DataSpace& DataSpace::ALL = *ALL_; - Functions added to class DataSpace: + Functions added to class DataSpace: - // Creates the constant - static DataSpace* getConstant(); // private + // Creates the constant + static DataSpace* getConstant(); // private - // Deletes the constant - static void deleteConstants(); // public + // Deletes the constant + static void deleteConstants(); // public - 4. This section shows the differences between the old and new methods - for allocating the following constants - - PropList constant, PropList::DEFAULT. - - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. - - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. - - FileCreatPropList constant, FileCreatPropList::DEFAULT. - - FileAccPropList constant, FileAccPropList::DEFAULT. + 4. This section shows the differences between the old and new methods + for allocating the following constants + - PropList constant, PropList::DEFAULT. + - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. + - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. + - FileCreatPropList constant, FileCreatPropList::DEFAULT. + - FileAccPropList constant, FileAccPropList::DEFAULT. - For these constants, the library has the same changes, except the - class names and the HDF5 corresponding constants. Only the items - of PropList are listed, and "PropList" can be replaced by any of - DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, - FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" - can be replaced by any of these respectively: H5P_DATASET_CREATE, - H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. + For these constants, the library has the same changes, except the + class names and the HDF5 corresponding constants. Only the items + of PropList are listed, and "PropList" can be replaced by any of + DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, + FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" + can be replaced by any of these respectively: H5P_DATASET_CREATE, + H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. - Old Method: - ---------- - // Declaration of the constant - in "H5PropList.h" - static const PropList DEFAULT; + Old Method: + ---------- + // Declaration of the constant - in "H5PropList.h" + static const PropList DEFAULT; - // Definition of the constant - in "H5PropList.cpp" - const PropList PropList::DEFAULT(H5P_DEFAULT); + // Definition of the constant - in "H5PropList.cpp" + const PropList PropList::DEFAULT(H5P_DEFAULT); - New Method: - ---------- - // Declare pointer for a constant - in "H5PropList.h" - static PropList* DEFAULT_; // "H5PropList.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5PropList.h" + static PropList* DEFAULT_; // "H5PropList.h" - // Change previous constant to reference - in "H5PropList.h" - static const PropList& DEFAULT; + // Change previous constant to reference - in "H5PropList.h" + static const PropList& DEFAULT; - // Creates a dynamic PropList object representing the C constant - // - in "H5PropList.cpp" - DEFAULT_ = new PropList(H5P_DEFAULT); + // Creates a dynamic PropList object representing the C constant + // - in "H5PropList.cpp" + DEFAULT_ = new PropList(H5P_DEFAULT); - // Assign the constant reference to the dynamic object - // - in "H5PropList.cpp" - const PropList& PropList::DEFAULT = *DEFAULT_; + // Assign the constant reference to the dynamic object + // - in "H5PropList.cpp" + const PropList& PropList::DEFAULT = *DEFAULT_; - Functions added to class PropList: + Functions added to class PropList: - // Creates the constant - static PropList* getConstant(); // private + // Creates the constant + static PropList* getConstant(); // private - // Deletes the constants - static void deleteConstants(); // public + // Deletes the constants + static void deleteConstants(); // public - The same functions are added to the subclasses of PropList instead of - using PropList's because of the class types and in favor of clarity. + The same functions are added to the subclasses of PropList instead of + using PropList's because of the class types and in favor of clarity. ****************************************************************************/ diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index e0777f7..9ba5030 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -28,207 +28,207 @@ namespace H5 { */ class H5_DLLCPP PredType : public AtomType { public: - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PredType"); } - - // Makes a copy of the predefined type and stores the new - // id in the left hand side object. - PredType& operator=( const PredType& rhs ); - - // Copy constructor - makes copy of the original object - PredType( const PredType& original ); - - // Noop destructor - virtual ~PredType(); - - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const H5std_string& name ); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const char* name ); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - bool committed(); - - ///\brief PredType constants - static const PredType& STD_I8BE; - static const PredType& STD_I8LE; - static const PredType& STD_I16BE; - static const PredType& STD_I16LE; - static const PredType& STD_I32BE; - static const PredType& STD_I32LE; - static const PredType& STD_I64BE; - static const PredType& STD_I64LE; - static const PredType& STD_U8BE; - static const PredType& STD_U8LE; - static const PredType& STD_U16BE; - static const PredType& STD_U16LE; - static const PredType& STD_U32BE; - static const PredType& STD_U32LE; - static const PredType& STD_U64BE; - static const PredType& STD_U64LE; - static const PredType& STD_B8BE; - static const PredType& STD_B8LE; - static const PredType& STD_B16BE; - static const PredType& STD_B16LE; - static const PredType& STD_B32BE; - static const PredType& STD_B32LE; - static const PredType& STD_B64BE; - static const PredType& STD_B64LE; - static const PredType& STD_REF_OBJ; - static const PredType& STD_REF_DSETREG; - - static const PredType& C_S1; - static const PredType& FORTRAN_S1; - - static const PredType& IEEE_F32BE; - static const PredType& IEEE_F32LE; - static const PredType& IEEE_F64BE; - static const PredType& IEEE_F64LE; - - static const PredType& UNIX_D32BE; - static const PredType& UNIX_D32LE; - static const PredType& UNIX_D64BE; - static const PredType& UNIX_D64LE; - - static const PredType& INTEL_I8; - static const PredType& INTEL_I16; - static const PredType& INTEL_I32; - static const PredType& INTEL_I64; - static const PredType& INTEL_U8; - static const PredType& INTEL_U16; - static const PredType& INTEL_U32; - static const PredType& INTEL_U64; - static const PredType& INTEL_B8; - static const PredType& INTEL_B16; - static const PredType& INTEL_B32; - static const PredType& INTEL_B64; - static const PredType& INTEL_F32; - static const PredType& INTEL_F64; - - static const PredType& ALPHA_I8; - static const PredType& ALPHA_I16; - static const PredType& ALPHA_I32; - static const PredType& ALPHA_I64; - static const PredType& ALPHA_U8; - static const PredType& ALPHA_U16; - static const PredType& ALPHA_U32; - static const PredType& ALPHA_U64; - static const PredType& ALPHA_B8; - static const PredType& ALPHA_B16; - static const PredType& ALPHA_B32; - static const PredType& ALPHA_B64; - static const PredType& ALPHA_F32; - static const PredType& ALPHA_F64; - - static const PredType& MIPS_I8; - static const PredType& MIPS_I16; - static const PredType& MIPS_I32; - static const PredType& MIPS_I64; - static const PredType& MIPS_U8; - static const PredType& MIPS_U16; - static const PredType& MIPS_U32; - static const PredType& MIPS_U64; - static const PredType& MIPS_B8; - static const PredType& MIPS_B16; - static const PredType& MIPS_B32; - static const PredType& MIPS_B64; - static const PredType& MIPS_F32; - static const PredType& MIPS_F64; - - static const PredType& NATIVE_CHAR; - static const PredType& NATIVE_SCHAR; - static const PredType& NATIVE_UCHAR; - static const PredType& NATIVE_SHORT; - static const PredType& NATIVE_USHORT; - static const PredType& NATIVE_INT; - static const PredType& NATIVE_UINT; - static const PredType& NATIVE_LONG; - static const PredType& NATIVE_ULONG; - static const PredType& NATIVE_LLONG; - static const PredType& NATIVE_ULLONG; - static const PredType& NATIVE_FLOAT; - static const PredType& NATIVE_DOUBLE; - static const PredType& NATIVE_LDOUBLE; - static const PredType& NATIVE_B8; - static const PredType& NATIVE_B16; - static const PredType& NATIVE_B32; - static const PredType& NATIVE_B64; - static const PredType& NATIVE_OPAQUE; - static const PredType& NATIVE_HSIZE; - static const PredType& NATIVE_HSSIZE; - static const PredType& NATIVE_HERR; - static const PredType& NATIVE_HBOOL; - - static const PredType& NATIVE_INT8; - static const PredType& NATIVE_UINT8; - static const PredType& NATIVE_INT16; - static const PredType& NATIVE_UINT16; - static const PredType& NATIVE_INT32; - static const PredType& NATIVE_UINT32; - static const PredType& NATIVE_INT64; - static const PredType& NATIVE_UINT64; + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PredType"); } + + // Makes a copy of the predefined type and stores the new + // id in the left hand side object. + PredType& operator=( const PredType& rhs ); + + // Copy constructor - makes copy of the original object + PredType( const PredType& original ); + + // Noop destructor + virtual ~PredType(); + + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const H5std_string& name ); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const char* name ); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + bool committed(); + + ///\brief PredType constants + static const PredType& STD_I8BE; + static const PredType& STD_I8LE; + static const PredType& STD_I16BE; + static const PredType& STD_I16LE; + static const PredType& STD_I32BE; + static const PredType& STD_I32LE; + static const PredType& STD_I64BE; + static const PredType& STD_I64LE; + static const PredType& STD_U8BE; + static const PredType& STD_U8LE; + static const PredType& STD_U16BE; + static const PredType& STD_U16LE; + static const PredType& STD_U32BE; + static const PredType& STD_U32LE; + static const PredType& STD_U64BE; + static const PredType& STD_U64LE; + static const PredType& STD_B8BE; + static const PredType& STD_B8LE; + static const PredType& STD_B16BE; + static const PredType& STD_B16LE; + static const PredType& STD_B32BE; + static const PredType& STD_B32LE; + static const PredType& STD_B64BE; + static const PredType& STD_B64LE; + static const PredType& STD_REF_OBJ; + static const PredType& STD_REF_DSETREG; + + static const PredType& C_S1; + static const PredType& FORTRAN_S1; + + static const PredType& IEEE_F32BE; + static const PredType& IEEE_F32LE; + static const PredType& IEEE_F64BE; + static const PredType& IEEE_F64LE; + + static const PredType& UNIX_D32BE; + static const PredType& UNIX_D32LE; + static const PredType& UNIX_D64BE; + static const PredType& UNIX_D64LE; + + static const PredType& INTEL_I8; + static const PredType& INTEL_I16; + static const PredType& INTEL_I32; + static const PredType& INTEL_I64; + static const PredType& INTEL_U8; + static const PredType& INTEL_U16; + static const PredType& INTEL_U32; + static const PredType& INTEL_U64; + static const PredType& INTEL_B8; + static const PredType& INTEL_B16; + static const PredType& INTEL_B32; + static const PredType& INTEL_B64; + static const PredType& INTEL_F32; + static const PredType& INTEL_F64; + + static const PredType& ALPHA_I8; + static const PredType& ALPHA_I16; + static const PredType& ALPHA_I32; + static const PredType& ALPHA_I64; + static const PredType& ALPHA_U8; + static const PredType& ALPHA_U16; + static const PredType& ALPHA_U32; + static const PredType& ALPHA_U64; + static const PredType& ALPHA_B8; + static const PredType& ALPHA_B16; + static const PredType& ALPHA_B32; + static const PredType& ALPHA_B64; + static const PredType& ALPHA_F32; + static const PredType& ALPHA_F64; + + static const PredType& MIPS_I8; + static const PredType& MIPS_I16; + static const PredType& MIPS_I32; + static const PredType& MIPS_I64; + static const PredType& MIPS_U8; + static const PredType& MIPS_U16; + static const PredType& MIPS_U32; + static const PredType& MIPS_U64; + static const PredType& MIPS_B8; + static const PredType& MIPS_B16; + static const PredType& MIPS_B32; + static const PredType& MIPS_B64; + static const PredType& MIPS_F32; + static const PredType& MIPS_F64; + + static const PredType& NATIVE_CHAR; + static const PredType& NATIVE_SCHAR; + static const PredType& NATIVE_UCHAR; + static const PredType& NATIVE_SHORT; + static const PredType& NATIVE_USHORT; + static const PredType& NATIVE_INT; + static const PredType& NATIVE_UINT; + static const PredType& NATIVE_LONG; + static const PredType& NATIVE_ULONG; + static const PredType& NATIVE_LLONG; + static const PredType& NATIVE_ULLONG; + static const PredType& NATIVE_FLOAT; + static const PredType& NATIVE_DOUBLE; + static const PredType& NATIVE_LDOUBLE; + static const PredType& NATIVE_B8; + static const PredType& NATIVE_B16; + static const PredType& NATIVE_B32; + static const PredType& NATIVE_B64; + static const PredType& NATIVE_OPAQUE; + static const PredType& NATIVE_HSIZE; + static const PredType& NATIVE_HSSIZE; + static const PredType& NATIVE_HERR; + static const PredType& NATIVE_HBOOL; + + static const PredType& NATIVE_INT8; + static const PredType& NATIVE_UINT8; + static const PredType& NATIVE_INT16; + static const PredType& NATIVE_UINT16; + static const PredType& NATIVE_INT32; + static const PredType& NATIVE_UINT32; + static const PredType& NATIVE_INT64; + static const PredType& NATIVE_UINT64; // LEAST types #if H5_SIZEOF_INT_LEAST8_T != 0 - static const PredType& NATIVE_INT_LEAST8; + static const PredType& NATIVE_INT_LEAST8; #endif /* H5_SIZEOF_INT_LEAST8_T */ #if H5_SIZEOF_UINT_LEAST8_T != 0 - static const PredType& NATIVE_UINT_LEAST8; + static const PredType& NATIVE_UINT_LEAST8; #endif /* H5_SIZEOF_UINT_LEAST8_T */ #if H5_SIZEOF_INT_LEAST16_T != 0 - static const PredType& NATIVE_INT_LEAST16; + static const PredType& NATIVE_INT_LEAST16; #endif /* H5_SIZEOF_INT_LEAST16_T */ #if H5_SIZEOF_UINT_LEAST16_T != 0 - static const PredType& NATIVE_UINT_LEAST16; + static const PredType& NATIVE_UINT_LEAST16; #endif /* H5_SIZEOF_UINT_LEAST16_T */ #if H5_SIZEOF_INT_LEAST32_T != 0 - static const PredType& NATIVE_INT_LEAST32; + static const PredType& NATIVE_INT_LEAST32; #endif /* H5_SIZEOF_INT_LEAST32_T */ #if H5_SIZEOF_UINT_LEAST32_T != 0 - static const PredType& NATIVE_UINT_LEAST32; + static const PredType& NATIVE_UINT_LEAST32; #endif /* H5_SIZEOF_UINT_LEAST32_T */ #if H5_SIZEOF_INT_LEAST64_T != 0 - static const PredType& NATIVE_INT_LEAST64; + static const PredType& NATIVE_INT_LEAST64; #endif /* H5_SIZEOF_INT_LEAST64_T */ #if H5_SIZEOF_UINT_LEAST64_T != 0 - static const PredType& NATIVE_UINT_LEAST64; + static const PredType& NATIVE_UINT_LEAST64; #endif /* H5_SIZEOF_UINT_LEAST64_T */ // FAST types #if H5_SIZEOF_INT_FAST8_T != 0 - static const PredType& NATIVE_INT_FAST8; + static const PredType& NATIVE_INT_FAST8; #endif /* H5_SIZEOF_INT_FAST8_T */ #if H5_SIZEOF_UINT_FAST8_T != 0 - static const PredType& NATIVE_UINT_FAST8; + static const PredType& NATIVE_UINT_FAST8; #endif /* H5_SIZEOF_UINT_FAST8_T */ #if H5_SIZEOF_INT_FAST16_T != 0 - static const PredType& NATIVE_INT_FAST16; + static const PredType& NATIVE_INT_FAST16; #endif /* H5_SIZEOF_INT_FAST16_T */ #if H5_SIZEOF_UINT_FAST16_T != 0 - static const PredType& NATIVE_UINT_FAST16; + static const PredType& NATIVE_UINT_FAST16; #endif /* H5_SIZEOF_UINT_FAST16_T */ #if H5_SIZEOF_INT_FAST32_T != 0 - static const PredType& NATIVE_INT_FAST32; + static const PredType& NATIVE_INT_FAST32; #endif /* H5_SIZEOF_INT_FAST32_T */ #if H5_SIZEOF_UINT_FAST32_T != 0 - static const PredType& NATIVE_UINT_FAST32; + static const PredType& NATIVE_UINT_FAST32; #endif /* H5_SIZEOF_UINT_FAST32_T */ #if H5_SIZEOF_INT_FAST64_T != 0 - static const PredType& NATIVE_INT_FAST64; + static const PredType& NATIVE_INT_FAST64; #endif /* H5_SIZEOF_INT_FAST64_T */ #if H5_SIZEOF_UINT_FAST64_T != 0 - static const PredType& NATIVE_UINT_FAST64; + static const PredType& NATIVE_UINT_FAST64; #endif /* H5_SIZEOF_UINT_FAST64_T */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -240,11 +240,11 @@ class H5_DLLCPP PredType : public AtomType { static const PredType& PREDTYPE_CONST; // dummy constant protected: - // Default constructor - PredType(); + // Default constructor + PredType(); - // Creates a pre-defined type using an HDF5 pre-defined constant - PredType( const hid_t predtype_id ); // used by the library only + // Creates a pre-defined type using an HDF5 pre-defined constant + PredType( const hid_t predtype_id ); // used by the library only private: // Activates the creation of the PredType global constants diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index def5693..fd223b3 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -25,7 +25,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree namespace H5 { @@ -83,24 +83,24 @@ void PropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property. +// Purpose Constant for default property. //-------------------------------------------------------------------------- const PropList& PropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function Default constructor -///\brief Default constructor: creates a stub property list object. -// Programmer Binh-Minh Ribler - 2000 +// Function Default constructor +///\brief Default constructor: creates a stub property list object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- -// Function: PropList copy constructor -///\brief Copy constructor -///\param original - IN: The original property list to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList copy constructor +///\brief Copy constructor +///\param original - IN: The original property list to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList(const PropList& original) : IdComponent(), id(original.id) { @@ -108,100 +108,100 @@ PropList::PropList(const PropList& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: PropList overloaded constructor -///\brief Creates a property list using the id of an existing property. -///\param plist_id - IN: Id of the existing property list -///\exception H5::PropListIException +// Function: PropList overloaded constructor +///\brief Creates a property list using the id of an existing property. +///\param plist_id - IN: Id of the existing property list +///\exception H5::PropListIException // Description -// This function creates a new property list if a property -// class is provided or makes a copy of a property list if one -// is given. If the given id is anything else, then set this -// property's id to H5P_DEFAULT. -// Programmer Binh-Minh Ribler - 2000 +// This function creates a new property list if a property +// class is provided or makes a copy of a property list if one +// is given. If the given id is anything else, then set this +// property's id to H5P_DEFAULT. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList( const hid_t plist_id ) : IdComponent() { if (plist_id <= 0) - id = H5P_DEFAULT; + id = H5P_DEFAULT; H5I_type_t id_type = H5Iget_type(plist_id); switch (id_type) { - case H5I_GENPROP_CLS: - // call C routine to create a new property from the given prop class - id = H5Pcreate(plist_id); - if( id < 0 ) - { - throw PropListIException("PropList constructor", "H5Pcreate failed"); - } - break; - case H5I_GENPROP_LST: - // call C routine to make a copy of the given property list - id = H5Pcopy(plist_id); - if( id < 0 ) - { - throw PropListIException("PropList constructor", "H5Pcopy failed"); - } - break; - default: - id = H5P_DEFAULT; - break; + case H5I_GENPROP_CLS: + // call C routine to create a new property from the given prop class + id = H5Pcreate(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcreate failed"); + } + break; + case H5I_GENPROP_LST: + // call C routine to make a copy of the given property list + id = H5Pcopy(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcopy failed"); + } + break; + default: + id = H5P_DEFAULT; + break; } } //-------------------------------------------------------------------------- -// Function: PropList::copy -///\brief Makes a copy of an existing property list. -///\param like_plist - IN: Reference to the existing property list -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copy +///\brief Makes a copy of an existing property list. +///\param like_plist - IN: Reference to the existing property list +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void PropList::copy( const PropList& like_plist ) { // If this object is representing an hdf5 object, close it before // copying like_plist to it try { - close(); + close(); } catch (Exception& close_error) { - throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the property list id = H5Pcopy( like_plist.getId() ); if( id < 0 ) - throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); + throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); } //-------------------------------------------------------------------------- -// Function: PropList::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing property list -///\return Reference to PropList instance -///\exception H5::PropListIException +// Function: PropList::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing property list +///\return Reference to PropList instance +///\exception H5::PropListIException // Description -// Makes a copy of the property list on the right hand side -// and stores the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the property list on the right hand side +// and stores the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList& PropList::operator=( const PropList& rhs ) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from this property list or class to another -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief Copies a property from this property list or class to another +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- void PropList::copyProp(PropList& dest, const char *name) const { @@ -214,13 +214,13 @@ void PropList::copyProp(PropList& dest, const char *name) const } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- void PropList::copyProp( PropList& dest, const H5std_string& name ) const { @@ -228,14 +228,14 @@ void PropList::copyProp( PropList& dest, const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from one list or class to another - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\note This member function will be removed in the next release -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief Copies a property from one list or class to another - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\note This member function will be removed in the next release +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const { @@ -250,14 +250,14 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name ) const { @@ -266,8 +266,8 @@ void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name //-------------------------------------------------------------------------- // Function: PropList::getId -///\brief Get the id of this property list -///\return Property list identifier +///\brief Get the id of this property list +///\return Property list identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In @@ -309,32 +309,32 @@ void PropList::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PropList::close -///\brief Closes the property list if it is not a default one. +// Function: PropList::close +///\brief Closes the property list if it is not a default one. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void PropList::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Pclose( id ); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("close"), "H5Pclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Pclose( id ); + if( ret_value < 0 ) + { + throw PropListIException(inMemFunc("close"), "H5Pclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: PropList::getClass -///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... -///\return The property list class if it is not equal to \c H5P_ROOT -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: PropList::getClass +///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... +///\return The property list class if it is not equal to \c H5P_ROOT +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t PropList::getClass() const { @@ -342,21 +342,21 @@ hid_t PropList::getClass() const if( plist_class == H5P_ROOT ) { throw PropListIException(inMemFunc("getClass"), - "H5Pget_class failed - returned H5P_ROOT"); + "H5Pget_class failed - returned H5P_ROOT"); } return( plist_class ); } //-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief Query the existance of a property in a property object. -///\param name - IN: Name of property to check for - \c char pointer -///\return true if the property exists in the property object, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::propExist +///\brief Query the existance of a property in a property object. +///\param name - IN: Name of property to check for - \c char pointer +///\return true if the property exists in the property object, and +/// false, otherwise. +///\exception H5::PropListIException ///\par Description -/// This routine checks if a property exists within a property -/// list or class. +/// This routine checks if a property exists within a property +/// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::propExist(const char* name ) const @@ -375,11 +375,11 @@ bool PropList::propExist(const char* name ) const } } //-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to check for - \c H5std_string +// Function: PropList::propExist +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to check for - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::propExist(const H5std_string& name ) const @@ -388,13 +388,13 @@ bool PropList::propExist(const H5std_string& name ) const } //-------------------------------------------------------------------------- -// Function: PropList::closeClass -///\brief Close a property list class. +// Function: PropList::closeClass +///\brief Close a property list class. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Releases memory and detaches a class from the property -/// list class hierarchy. +/// Releases memory and detaches a class from the property +/// list class hierarchy. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::closeClass() const @@ -407,15 +407,15 @@ void PropList::closeClass() const } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief Query the value of a property in a property list. -///\param name - IN: Name of property to query - \c char pointer -///\param value - OUT: Pointer to the buffer for the property value -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief Query the value of a property in a property list. +///\param name - IN: Name of property to query - \c char pointer +///\param value - OUT: Pointer to the buffer for the property value +///\exception H5::PropListIException ///\par Description -/// Retrieves a copy of the value for a property in a property -/// list. The property name must exist or this routine will -/// throw an exception. +/// Retrieves a copy of the value for a property in a property +/// list. The property name must exist or this routine will +/// throw an exception. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const char* name, void* value) const @@ -427,13 +427,13 @@ void PropList::getProperty(const char* name, void* value) const } } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c char pointer -///\return The property that is a \c H5std_string. -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c char pointer +///\return The property that is a \c H5std_string. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const char* name) const @@ -460,12 +460,12 @@ H5std_string PropList::getProperty(const char* name) const return (prop_strg); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\param value - OUT: Pointer to the buffer for the property value +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\param value - OUT: Pointer to the buffer for the property value // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const H5std_string& name, void* value) const @@ -473,12 +473,12 @@ void PropList::getProperty(const H5std_string& name, void* value) const getProperty(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\return The property that is a \c H5std_string. +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\return The property that is a \c H5std_string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const H5std_string& name) const @@ -487,16 +487,16 @@ H5std_string PropList::getProperty(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief Query the size of a property in a property list or class. -///\param name - IN: Name of property to query -///\return Size of the property -///\exception H5::PropListIException +// Function: PropList::getPropSize +///\brief Query the size of a property in a property list or class. +///\param name - IN: Name of property to query +///\return Size of the property +///\exception H5::PropListIException ///\par Description -/// This routine retrieves the size of a property's value -/// in bytes. Zero-sized properties are allowed and the return -/// value will be of 0. This function works for both property -/// lists and classes. +/// This routine retrieves the size of a property's value +/// in bytes. Zero-sized properties are allowed and the return +/// value will be of 0. This function works for both property +/// lists and classes. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getPropSize(const char *name) const @@ -510,11 +510,11 @@ size_t PropList::getPropSize(const char *name) const return(prop_size); } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string +// Function: PropList::getPropSize +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string /// // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -524,17 +524,17 @@ size_t PropList::getPropSize(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: PropList::getClassName -///\brief Return the name of a generic property list class. -///\return A string containing the class name, if success, otherwise, -/// a NULL string. +// Function: PropList::getClassName +///\brief Return the name of a generic property list class. +///\return A string containing the class name, if success, otherwise, +/// a NULL string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getClassName() const { char* temp_str; temp_str = H5Pget_class_name(id); // this API specified that temp_str must - // be freed. + // be freed. if (temp_str != NULL) { @@ -546,10 +546,10 @@ H5std_string PropList::getClassName() const return 0; } //-------------------------------------------------------------------------- -// Function: PropList::getNumProps -///\brief Returns the number of properties in this property list or class. -///\return Size of the property. -///\exception H5::PropListIException +// Function: PropList::getNumProps +///\brief Returns the number of properties in this property list or class. +///\return Size of the property. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getNumProps() const @@ -564,11 +564,11 @@ size_t PropList::getNumProps() const } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief Set a property's value in a property list. -///\param name - IN: Name of property to set - \c char pointer -///\param value - IN: Void pointer to the value for the property -///\exception H5::PropListIException +// Function: PropList::setProperty +///\brief Set a property's value in a property list. +///\param name - IN: Name of property to set - \c char pointer +///\param value - IN: Void pointer to the value for the property +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const @@ -580,12 +580,12 @@ void PropList::setProperty(const char* name, void* value) const } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param charptr - IN: Char pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param charptr - IN: Char pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const @@ -597,12 +597,12 @@ void PropList::setProperty(const char* name, const char* charptr) const } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const @@ -611,12 +611,12 @@ void PropList::setProperty(const char* name, H5std_string& strg) const } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param value - IN: Void pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const @@ -625,12 +625,12 @@ void PropList::setProperty(const H5std_string& name, void* value) const } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const @@ -639,12 +639,12 @@ void PropList::setProperty(const H5std_string& name, H5std_string& strg) const } //-------------------------------------------------------------------------- -// Function: PropList::isAClass -///\brief Determines whether a property list is a certain class. -///\param prop_class - IN: Property class to query -///\return true if the property list is a member of the property list -/// class, and false, otherwise. -///\exception H5::PropListIException +// Function: PropList::isAClass +///\brief Determines whether a property list is a certain class. +///\param prop_class - IN: Property class to query +///\return true if the property list is a member of the property list +/// class, and false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::isAClass(const PropList& prop_class) const @@ -662,10 +662,10 @@ bool PropList::isAClass(const PropList& prop_class) const } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief Removes a property from a property list. -///\param name - IN: Name of property to remove - \c char pointer -///\exception H5::PropListIException +// Function: PropList::removeProp +///\brief Removes a property from a property list. +///\param name - IN: Name of property to remove - \c char pointer +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const char *name) const @@ -678,11 +678,11 @@ void PropList::removeProp(const char *name) const } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to remove - \c H5std_string +// Function: PropList::removeProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to remove - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const H5std_string& name) const @@ -691,12 +691,12 @@ void PropList::removeProp(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: PropList::operator== -///\brief Compares this property list or class against the given list or class. -///\param rhs - IN: Reference to the property list to compare -///\return true if the property lists or classes are equal, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::operator== +///\brief Compares this property list or class against the given list or class. +///\param rhs - IN: Reference to the property list to compare +///\return true if the property lists or classes are equal, and +/// false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::operator==(const PropList& rhs) const @@ -713,10 +713,10 @@ bool PropList::operator==(const PropList& rhs) const } //-------------------------------------------------------------------------- -// Function: PropList::getClassParent -///\brief Returns the parent class of a generic property class -///\return The parent class of a property class -///\exception H5::PropListIException +// Function: PropList::getClassParent +///\brief Returns the parent class of a generic property class +///\return The parent class of a property class +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- PropList PropList::getClassParent() const @@ -731,22 +731,22 @@ PropList PropList::getClassParent() const } //-------------------------------------------------------------------------- -// Function: PropList destructor -///\brief Properly terminates access to this property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList destructor +///\brief Properly terminates access to this property list. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- PropList::~PropList() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; + cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 4161a1f..1544ba7 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -22,111 +22,111 @@ namespace H5 { //! Class PropList provides operations for generic property lists. class H5_DLLCPP PropList : public IdComponent { public: - ///\brief Default property list + ///\brief Default property list static const PropList& DEFAULT; - // Creates a property list of a given type or creates a copy of an - // existing property list giving the property list id. - PropList(const hid_t plist_id); + // Creates a property list of a given type or creates a copy of an + // existing property list giving the property list id. + PropList(const hid_t plist_id); - // Make a copy of the given property list using assignment statement - PropList& operator=( const PropList& rhs ); + // Make a copy of the given property list using assignment statement + PropList& operator=( const PropList& rhs ); - // Compares this property list or class against the given list or class. - bool operator==(const PropList& rhs) const; + // Compares this property list or class against the given list or class. + bool operator==(const PropList& rhs) const; - // Close this property list. - virtual void close(); + // Close this property list. + virtual void close(); - // Close a property list class. - void closeClass() const; + // Close a property list class. + void closeClass() const; - // Makes a copy of the given property list. - void copy( const PropList& like_plist ); + // Makes a copy of the given property list. + void copy( const PropList& like_plist ); - // Copies a property from this property list or class to another - void copyProp( PropList& dest, const char* name) const; - void copyProp( PropList& dest, const H5std_string& name) const; + // Copies a property from this property list or class to another + void copyProp( PropList& dest, const char* name) const; + void copyProp( PropList& dest, const H5std_string& name) const; - // Copies a property from one property list or property class to another - void copyProp( PropList& dest, PropList& src, const char* name) const; - void copyProp( PropList& dest, PropList& src, const H5std_string& name) const; + // Copies a property from one property list or property class to another + void copyProp( PropList& dest, PropList& src, const char* name) const; + void copyProp( PropList& dest, PropList& src, const H5std_string& name) const; - // Gets the class of this property list, i.e. H5P_FILE_CREATE, - // H5P_FILE_ACCESS, ... - hid_t getClass() const; + // Gets the class of this property list, i.e. H5P_FILE_CREATE, + // H5P_FILE_ACCESS, ... + hid_t getClass() const; - // Return the name of a generic property list class. - H5std_string getClassName() const; + // Return the name of a generic property list class. + H5std_string getClassName() const; - // Returns the parent class of a generic property class. - PropList getClassParent() const; + // Returns the parent class of a generic property class. + PropList getClassParent() const; - // Returns the number of properties in this property list or class. - size_t getNumProps() const; + // Returns the number of properties in this property list or class. + size_t getNumProps() const; - // Query the value of a property in a property list. - void getProperty(const char* name, void* value) const; - void getProperty(const H5std_string& name, void* value) const; - H5std_string getProperty(const char* name) const; - H5std_string getProperty(const H5std_string& name) const; + // Query the value of a property in a property list. + void getProperty(const char* name, void* value) const; + void getProperty(const H5std_string& name, void* value) const; + H5std_string getProperty(const char* name) const; + H5std_string getProperty(const H5std_string& name) const; - // Set a property's value in a property list. - void setProperty(const char* name, void* value) const; - void setProperty(const char* name, const char* charptr) const; - void setProperty(const char* name, H5std_string& strg) const; - void setProperty(const H5std_string& name, void* value) const; - void setProperty(const H5std_string& name, H5std_string& strg) const; + // Set a property's value in a property list. + void setProperty(const char* name, void* value) const; + void setProperty(const char* name, const char* charptr) const; + void setProperty(const char* name, H5std_string& strg) const; + void setProperty(const H5std_string& name, void* value) const; + void setProperty(const H5std_string& name, H5std_string& strg) const; - // Query the size of a property in a property list or class. - size_t getPropSize(const char *name) const; - size_t getPropSize(const H5std_string& name) const; + // Query the size of a property in a property list or class. + size_t getPropSize(const char *name) const; + size_t getPropSize(const H5std_string& name) const; - // Determines whether a property list is a certain class. - bool isAClass(const PropList& prop_class) const; + // Determines whether a property list is a certain class. + bool isAClass(const PropList& prop_class) const; - /// Query the existance of a property in a property object. - bool propExist(const char* name) const; - bool propExist(const H5std_string& name) const; + /// Query the existance of a property in a property object. + bool propExist(const char* name) const; + bool propExist(const H5std_string& name) const; - // Removes a property from a property list. - void removeProp(const char *name) const; - void removeProp(const H5std_string& name) const; + // Removes a property from a property list. + void removeProp(const char *name) const; + void removeProp(const H5std_string& name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PropList"); } - // Default constructor: creates a stub PropList object. - PropList(); + // Default constructor: creates a stub PropList object. + PropList(); - // Copy constructor: creates a copy of a PropList object. - PropList(const PropList& original); + // Copy constructor: creates a copy of a PropList object. + PropList(const PropList& original); - // Gets the property list id. - virtual hid_t getId() const; + // Gets the property list id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this property list. - virtual ~PropList(); + // Destructor: properly terminates access to this property list. + virtual ~PropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the PropList global constant - static void deleteConstants(); + // Deletes the PropList global constant + static void deleteConstants(); protected: - hid_t id; // HDF5 property list id + hid_t id; // HDF5 property list id - // Sets the property list id. - virtual void p_setId(const hid_t new_id); + // Sets the property list id. + virtual void p_setId(const hid_t new_id); private: - static PropList* DEFAULT_; + static PropList* DEFAULT_; - // Dynamically allocates the PropList global constant - static PropList* getConstant(); + // Dynamically allocates the PropList global constant + static PropList* getConstant(); - // Friend function to set PropList id. For library use only. - friend void f_PropList_setId(PropList* plist, hid_t new_id); + // Friend function to set PropList id. For library use only. + friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index f18fa1e..3638f99 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -35,18 +35,18 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: StrType default constructor -///\brief Default constructor: Creates a stub string datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType default constructor +///\brief Default constructor: Creates a stub string datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType() : AtomType() {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates a string datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const PredType& pred_type ) : AtomType() { @@ -55,27 +55,27 @@ StrType::StrType( const PredType& pred_type ) : AtomType() } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -// Purpose Creates a string datatype with a specified length -// Param pred_type - IN: String predefined type to replicate. -// Param size - IN: Length of the new string type -// Exception H5::DataTypeIException +// Function: StrType overloaded constructor +// Purpose Creates a string datatype with a specified length +// Param pred_type - IN: String predefined type to replicate. +// Param size - IN: Length of the new string type +// Exception H5::DataTypeIException // Description -// The 1st argument could have been skipped, but this -// constructor will collide with the one that takes an -// existing id. +// The 1st argument could have been skipped, but this +// constructor will collide with the one that takes an +// existing id. // -// Update: replacing the 1st argument with a dummy 0 to -// avoid the clashing problem, that doesn't eliminate the -// the 1st argument but it's simpler for the user to type -// a '0' than PredType::C_S1. - Dec 2, 2005 +// Update: replacing the 1st argument with a dummy 0 to +// avoid the clashing problem, that doesn't eliminate the +// the 1st argument but it's simpler for the user to type +// a '0' than PredType::C_S1. - Dec 2, 2005 // Note -// The use of this constructor can be shortened by using -// its overloaded below as StrType(0, size). -// Programmer Binh-Minh Ribler - 2000 +// The use of this constructor can be shortened by using +// its overloaded below as StrType(0, size). +// Programmer Binh-Minh Ribler - 2000 // Modification -// Planned for removal. -BMR, 2005/12/02 -// Removed from documentation. -BMR, 2016/03/07 +// Planned for removal. -BMR, 2005/12/02 +// Removed from documentation. -BMR, 2016/03/07 //-------------------------------------------------------------------------- StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() { @@ -86,20 +86,20 @@ StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype with a specified length -///\param dummy - IN: To simplify calling the previous constructor -/// and avoid prototype clash with another constructor -///\param size - IN: Length of the new string type -///\exception H5::DataTypeIException +// Function: StrType overloaded constructor +///\brief Creates a string datatype with a specified length +///\param dummy - IN: To simplify calling the previous constructor +/// and avoid prototype clash with another constructor +///\param size - IN: Length of the new string type +///\exception H5::DataTypeIException ///\par Description -/// The 1st argument is just a dummy to simplify calling the -/// previous constructor, such as: -/// StrType atype(0, size) instead of -/// StrType atype(PredType::C_S1, size) +/// The 1st argument is just a dummy to simplify calling the +/// previous constructor, such as: +/// StrType atype(0, size) instead of +/// StrType atype(PredType::C_S1, size) // Note -// This constructor replaced the previous one. -// Programmer Binh-Minh Ribler - Nov 28, 2005 +// This constructor replaced the previous one. +// Programmer Binh-Minh Ribler - Nov 28, 2005 //-------------------------------------------------------------------------- StrType::StrType( const int dummy, const size_t& size ) : AtomType() { @@ -110,27 +110,27 @@ StrType::StrType( const int dummy, const size_t& size ) : AtomType() } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates an StrType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: StrType copy constructor -///\brief Copy constructor: makes a copy of the original StrType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType copy constructor +///\brief Copy constructor: makes a copy of the original StrType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const StrType& original ) : AtomType ( original ) {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Gets the string datatype of the specified dataset -///\param dataset - IN: Dataset that this string datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Gets the string datatype of the specified dataset +///\param dataset - IN: Dataset that this string datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const DataSet& dataset ) : AtomType () { @@ -144,19 +144,19 @@ StrType::StrType( const DataSet& dataset ) : AtomType () } //-------------------------------------------------------------------------- -// Function: StrType::getCset -///\brief Retrieves the character set type of this string datatype. -///\return Character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::getCset +///\brief Retrieves the character set type of this string datatype. +///\return Character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_cset_t StrType::getCset() const { @@ -171,19 +171,19 @@ H5T_cset_t StrType::getCset() const } //-------------------------------------------------------------------------- -// Function: StrType::setCset -///\brief Sets character set to be used. -///\param cset - IN: character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::setCset +///\brief Sets character set to be used. +///\param cset - IN: character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setCset( H5T_cset_t cset ) const { @@ -196,14 +196,14 @@ void StrType::setCset( H5T_cset_t cset ) const } //-------------------------------------------------------------------------- -// Function: StrType::getStrpad -///\brief Retrieves the storage mechanism for of this string datatype. -///\return String storage mechanism, which can be: -/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) -/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros -/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType::getStrpad +///\brief Retrieves the storage mechanism for of this string datatype. +///\return String storage mechanism, which can be: +/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) +/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros +/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_str_t StrType::getStrpad() const { @@ -213,20 +213,20 @@ H5T_str_t StrType::getStrpad() const if( strpad == H5T_STR_ERROR ) { throw DataTypeIException("StrType::getStrpad", - "H5Tget_strpad failed - returned H5T_STR_ERROR"); + "H5Tget_strpad failed - returned H5T_STR_ERROR"); } return( strpad ); } //-------------------------------------------------------------------------- -// Function: StrType::setStrpad -///\brief Defines the storage mechanism for this string datatype. -///\param strpad - IN: String padding type -///\exception H5::DataTypeIException +// Function: StrType::setStrpad +///\brief Defines the storage mechanism for this string datatype. +///\param strpad - IN: String padding type +///\exception H5::DataTypeIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setStrpad( H5T_str_t strpad ) const { @@ -239,9 +239,9 @@ void StrType::setStrpad( H5T_str_t strpad ) const } //-------------------------------------------------------------------------- -// Function: StrType destructor -///\brief Properly terminates access to this string datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType destructor +///\brief Properly terminates access to this string datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::~StrType() {} diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 4015998..ad1df8c 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -22,44 +22,44 @@ namespace H5 { //! Class StrType operates on HDF5 string datatypes. class H5_DLLCPP StrType : public AtomType { public: - // Creates a string type using a predefined type - StrType(const PredType& pred_type); + // Creates a string type using a predefined type + StrType(const PredType& pred_type); - // Creates a string type with specified length - may be obsolete - StrType(const PredType& pred_type, const size_t& size); + // Creates a string type with specified length - may be obsolete + StrType(const PredType& pred_type, const size_t& size); - // Creates a string type with specified length - StrType(const int dummy, const size_t& size); + // Creates a string type with specified length + StrType(const int dummy, const size_t& size); // Gets the string datatype of the specified dataset - StrType(const DataSet& dataset); + StrType(const DataSet& dataset); - // Retrieves the character set type of this string datatype. - H5T_cset_t getCset() const; + // Retrieves the character set type of this string datatype. + H5T_cset_t getCset() const; - // Sets character set to be used. - void setCset(H5T_cset_t cset) const; + // Sets character set to be used. + void setCset(H5T_cset_t cset) const; - // Retrieves the string padding method for this string datatype. - H5T_str_t getStrpad() const; + // Retrieves the string padding method for this string datatype. + H5T_str_t getStrpad() const; - // Defines the storage mechanism for character strings. - void setStrpad(H5T_str_t strpad) const; + // Defines the storage mechanism for character strings. + void setStrpad(H5T_str_t strpad) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("StrType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("StrType"); } - // default constructor - StrType(); + // default constructor + StrType(); - // Creates a string datatype using an existing id - StrType(const hid_t existing_id); + // Creates a string datatype using an existing id + StrType(const hid_t existing_id); - // Copy constructor - makes a copy of the original object - StrType(const StrType& original); + // Copy constructor - makes a copy of the original object + StrType(const StrType& original); - // Noop destructor. - virtual ~StrType(); + // Noop destructor. + virtual ~StrType(); }; } #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index db80a5a..eb11d76 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -30,37 +30,37 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: VarLenType default constructor -///\brief Default constructor: Creates a stub variable-length datatype. +// Function: VarLenType default constructor +///\brief Default constructor: Creates a stub variable-length datatype. //-------------------------------------------------------------------------- VarLenType::VarLenType() : DataType() {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: VarLenType copy constructor -///\brief Copy constructor: makes a copy of the original VarLenType object. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType copy constructor +///\brief Copy constructor: makes a copy of the original VarLenType object. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates a new variable-length datatype based on the specified -/// \a base_type. -///\param base_type - IN: Pointer to existing datatype -///\exception H5::DataTypeIException +// Function: VarLenType overloaded constructor +///\brief Creates a new variable-length datatype based on the specified +/// \a base_type. +///\param base_type - IN: Pointer to existing datatype +///\exception H5::DataTypeIException // Description -// DataType passed by pointer to avoid clashing with copy -// constructor. -// Programmer Binh-Minh Ribler - May, 2004 +// DataType passed by pointer to avoid clashing with copy +// constructor. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() { @@ -73,9 +73,9 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() } //-------------------------------------------------------------------------- -// Function: VarLenType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::~VarLenType() {} diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index ca85f54..bc4573a 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -25,24 +25,24 @@ namespace H5 { //! VarLenType operates on the HDF5 C's Variable-length Datatypes. class H5_DLLCPP VarLenType : public DataType { public: - // Constructor that creates a variable-length datatype based - // on the specified base type. - VarLenType(const DataType* base_type); + // Constructor that creates a variable-length datatype based + // on the specified base type. + VarLenType(const DataType* base_type); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("VarLenType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("VarLenType"); } - // Copy constructor: makes copy of the original object. - VarLenType( const VarLenType& original ); + // Copy constructor: makes copy of the original object. + VarLenType( const VarLenType& original ); - // Constructor that takes an existing id - VarLenType( const hid_t existing_id ); + // Constructor that takes an existing id + VarLenType( const hid_t existing_id ); - // Noop destructor - virtual ~VarLenType(); + // Noop destructor + virtual ~VarLenType(); - // Default constructor - VarLenType(); + // Default constructor + VarLenType(); }; } #endif // __H5VarLenType_H diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index a9191d1..2711de9 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -16,12 +16,12 @@ /***************************************************************************** FILE dsets.cpp - HDF5 C++ testing the functionalities associated with the - C dataset interface (H5D) + C dataset interface (H5D) EXTERNAL ROUTINES/VARIABLES: These routines are in the test directory of the C library: - h5_reset() -- in h5test.c, resets the library by closing it - h5_fileaccess() -- in h5test.c, returns a file access template + h5_reset() -- in h5test.c, resets the library by closing it + h5_fileaccess() -- in h5test.c, returns a file access template ***************************************************************************/ @@ -37,20 +37,20 @@ using std::endl; #endif // H5_NO_STD -#include "H5Cpp.h" // C++ API header file +#include "H5Cpp.h" // C++ API header file using namespace H5; -#include "h5cpputil.h" // C++ utilility header file +#include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE1("dataset.h5"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_DEFAULT_NAME_PATH("/default"); -const H5std_string DSET_CHUNKED_NAME("chunked"); -const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); -const H5std_string DSET_TCONV_NAME ("tconv"); -const H5std_string DSET_COMPRESS_NAME("compressed"); -const H5std_string DSET_BOGUS_NAME ("bogus"); +const H5std_string FILE1("dataset.h5"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_DEFAULT_NAME_PATH("/default"); +const H5std_string DSET_CHUNKED_NAME("chunked"); +const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); +const H5std_string DSET_TCONV_NAME ("tconv"); +const H5std_string DSET_COMPRESS_NAME("compressed"); +const H5std_string DSET_BOGUS_NAME ("bogus"); /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; @@ -61,16 +61,16 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Attempts to create a dataset. + * Purpose: Attempts to create a dataset. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -84,125 +84,125 @@ test_create( H5File& file) // Setting this to NULL for cleaning up in failure situations DataSet *dataset = NULL; try { - // Create a data space - hsize_t dims[2]; - dims[0] = 256; - dims[1] = 512; - DataSpace space (2, dims, NULL); - - // Create a dataset using the default dataset creation properties. - // We're not sure what they are, so we won't check. - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - - // Add a comment to the dataset - file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); - - // Close the dataset - delete dataset; - dataset = NULL; - - // Try creating a dataset that already exists. This should fail since a - // dataset can only be created once. If an exception is not thrown for - // this action by createDataSet, then throw an invalid action exception. - try { - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); - } - catch (FileIException& E) // catching invalid creating dataset - {} // do nothing, exception expected - - // Open the dataset we created above and then close it. This is one - // way to open an existing dataset for accessing. - dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); - - // Get and verify the name of this dataset, using - // H5std_string getObjName() - H5std_string ds_name = dataset->getObjName(); - verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); - - // Get and verify the comment from this dataset, using - // H5std_string getComment(const H5std_string& name, ) - H5std_string comment = file.getComment(DSET_DEFAULT_NAME); - verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); - - // Close the dataset when accessing is completed - delete dataset; - - // This is another way to open an existing dataset for accessing. - DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); - - // Try opening a non-existent dataset. This should fail so if an - // exception is not thrown for this action by openDataSet, then - // display failure information and throw an exception. - try { - dataset = new DataSet (file.openDataSet( "does_not_exist" )); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); - } - catch (FileIException& E ) // catching creating non-existent dataset - {} // do nothing, exception expected - - // Create a new dataset that uses chunked storage instead of the default - // layout. - DSetCreatPropList create_parms; - hsize_t csize[2]; - csize[0] = 5; - csize[1] = 100; - create_parms.setChunk( 2, csize ); - - dataset = new DataSet (file.createDataSet - (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); - // Note: this one has no error message in C when failure occurs? - - // clean up and return with success - delete dataset; - - PASSED(); - return 0; - } // outer most try block + // Create a data space + hsize_t dims[2]; + dims[0] = 256; + dims[1] = 512; + DataSpace space (2, dims, NULL); + + // Create a dataset using the default dataset creation properties. + // We're not sure what they are, so we won't check. + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + + // Add a comment to the dataset + file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); + + // Close the dataset + delete dataset; + dataset = NULL; + + // Try creating a dataset that already exists. This should fail since a + // dataset can only be created once. If an exception is not thrown for + // this action by createDataSet, then throw an invalid action exception. + try { + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); + } + catch (FileIException& E) // catching invalid creating dataset + {} // do nothing, exception expected + + // Open the dataset we created above and then close it. This is one + // way to open an existing dataset for accessing. + dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); + + // Get and verify the name of this dataset, using + // H5std_string getObjName() + H5std_string ds_name = dataset->getObjName(); + verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); + + // Get and verify the comment from this dataset, using + // H5std_string getComment(const H5std_string& name, ) + H5std_string comment = file.getComment(DSET_DEFAULT_NAME); + verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); + + // Close the dataset when accessing is completed + delete dataset; + + // This is another way to open an existing dataset for accessing. + DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); + + // Try opening a non-existent dataset. This should fail so if an + // exception is not thrown for this action by openDataSet, then + // display failure information and throw an exception. + try { + dataset = new DataSet (file.openDataSet( "does_not_exist" )); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); + } + catch (FileIException& E ) // catching creating non-existent dataset + {} // do nothing, exception expected + + // Create a new dataset that uses chunked storage instead of the default + // layout. + DSetCreatPropList create_parms; + hsize_t csize[2]; + csize[0] = 5; + csize[1] = 100; + create_parms.setChunk( 2, csize ); + + dataset = new DataSet (file.createDataSet + (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); + // Note: this one has no error message in C when failure occurs? + + // clean up and return with success + delete dataset; + + PASSED(); + return 0; + } // outer most try block catch (InvalidActionException& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_create", __LINE__, __FILE__); + issue_fail_msg("test_create", __LINE__, __FILE__); - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } } // test_create /*------------------------------------------------------------------------- - * Function: test_simple_io + * Function: test_simple_io * - * Purpose: Tests simple I/O. That is, reading and writing a complete - * multi-dimensional array without data type or data space - * conversions, without compression, and stored contiguously. + * Purpose: Tests simple I/O. That is, reading and writing a complete + * multi-dimensional array without data type or data space + * conversions, without compression, and stored contiguously. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -214,81 +214,81 @@ test_simple_io( H5File& file) SUBTEST("Simple I/O"); - int points[100][200]; - int check[100][200]; - int i, j, n; + int points[100][200]; + int check[100][200]; + int i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = n++; - } + for (j = 0; j < 200; j++) { + points[i][j] = n++; + } } char* tconv_buf = new char [1000]; try { - // Create the data space - hsize_t dims[2]; - dims[0] = 100; - dims[1] = 200; - DataSpace space (2, dims, NULL); - - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; - - xfer.setBuffer (1000, tconv_buf, NULL); - - // Create the dataset - DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); - - // Write the data to the dataset - dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back - dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < 100; i++) - for (j = 0; j < 200; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("DataSet::read"); - } - - // clean up and return with success - delete [] tconv_buf; - PASSED(); - return 0; + // Create the data space + hsize_t dims[2]; + dims[0] = 100; + dims[1] = 200; + DataSpace space (2, dims, NULL); + + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; + + xfer.setBuffer (1000, tconv_buf, NULL); + + // Create the dataset + DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); + + // Write the data to the dataset + dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back + dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < 100; i++) + for (j = 0; j < 200; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("DataSet::read"); + } + + // clean up and return with success + delete [] tconv_buf; + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (tconv_buf) - delete [] tconv_buf; - return -1; + // clean up and return with failure + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_simple_io /*------------------------------------------------------------------------- - * Function: test_datasize + * Function: test_datasize * - * Purpose: Tests DataSet::getInMemDataSize(). + * Purpose: Tests DataSet::getInMemDataSize(). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Thursday, March 22, 2012 + * Programmer: Binh-Minh Ribler + * Thursday, March 22, 2012 * * Modifications: * @@ -300,65 +300,65 @@ test_datasize(FileAccPropList &fapl) SUBTEST("DataSet::getInMemDataSize()"); try { - // Open FILE1. - H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - - // Open dataset DSET_SIMPLE_IO_NAME. - DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); - - // Get the dataset's dataspace to calculate the size for verification. - DataSpace space(dset.getSpace()); - - // Get the dimension sizes. - hsize_t dims[2]; - int n_dims = space.getSimpleExtentDims(dims); - if (n_dims < 0) - { - throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); - } - - // Calculate the supposed size. Size of each value is int (4), from - // test_simple_io. - size_t expected_size = 4 * dims[0] * dims[1]; - - // getInMemDataSize() returns the in memory size of the data. - size_t ds_size = dset.getInMemDataSize(); - - // Verify the data size. - if (ds_size != expected_size) - { - H5_FAILED(); - cerr << " Expected data size = " << expected_size; - cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; - throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); - } - - PASSED(); - return 0; + // Open FILE1. + H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + + // Open dataset DSET_SIMPLE_IO_NAME. + DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); + + // Get the dataset's dataspace to calculate the size for verification. + DataSpace space(dset.getSpace()); + + // Get the dimension sizes. + hsize_t dims[2]; + int n_dims = space.getSimpleExtentDims(dims); + if (n_dims < 0) + { + throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); + } + + // Calculate the supposed size. Size of each value is int (4), from + // test_simple_io. + size_t expected_size = 4 * dims[0] * dims[1]; + + // getInMemDataSize() returns the in memory size of the data. + size_t ds_size = dset.getInMemDataSize(); + + // Verify the data size. + if (ds_size != expected_size) + { + H5_FAILED(); + cerr << " Expected data size = " << expected_size; + cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; + throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); + } + + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_datasize /*------------------------------------------------------------------------- - * Function: test_tconv + * Function: test_tconv * - * Purpose: Test some simple data type conversion stuff. + * Purpose: Test some simple data type conversion stuff. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -368,7 +368,7 @@ static herr_t test_tconv(H5File& file) { // Prepare buffers for input/output - char *out=NULL, *in=NULL; + char *out=NULL, *in=NULL; out = new char [4*1000000]; // assert (out); - should use exception handler for new - BMR in = new char [4*1000000]; @@ -378,81 +378,81 @@ test_tconv(H5File& file) // Initialize the dataset for (int i = 0; i < 1000000; i++) { - out[i*4+0] = 0x11; - out[i*4+1] = 0x22; - out[i*4+2] = 0x33; - out[i*4+3] = 0x44; + out[i*4+0] = 0x11; + out[i*4+1] = 0x22; + out[i*4+2] = 0x33; + out[i*4+3] = 0x44; } try { - // Create the data space - hsize_t dims[1]; - dims[0] = 1000000; - DataSpace space (1, dims, NULL); - - // Create the data set - DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); - - // Write the data to the dataset - dataset.write (static_cast(out), PredType::STD_I32LE); - - // Read data with byte order conversion - dataset.read (static_cast(in), PredType::STD_I32BE); - - // Check - for (int i = 0; i < 1000000; i++) { - if (in[4*i+0]!=out[4*i+3] || - in[4*i+1]!=out[4*i+2] || - in[4*i+2]!=out[4*i+1] || - in[4*i+3]!=out[4*i+0]) - { - throw Exception("DataSet::read", "Read with byte order conversion failed"); - } - } - - // clean up and return with success - delete [] out; - delete [] in; - PASSED(); - return 0; + // Create the data space + hsize_t dims[1]; + dims[0] = 1000000; + DataSpace space (1, dims, NULL); + + // Create the data set + DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); + + // Write the data to the dataset + dataset.write (static_cast(out), PredType::STD_I32LE); + + // Read data with byte order conversion + dataset.read (static_cast(in), PredType::STD_I32BE); + + // Check + for (int i = 0; i < 1000000; i++) { + if (in[4*i+0]!=out[4*i+3] || + in[4*i+1]!=out[4*i+2] || + in[4*i+2]!=out[4*i+1] || + in[4*i+3]!=out[4*i+0]) + { + throw Exception("DataSet::read", "Read with byte order conversion failed"); + } + } + + // clean up and return with success + delete [] out; + delete [] in; + PASSED(); + return 0; } // end try // catch all dataset and space exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - delete [] out; - delete [] in; - return -1; + // clean up and return with failure + delete [] out; + delete [] in; + return -1; } } // test_tconv /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: bogus + * Function: bogus * - * Purpose: A bogus compression method that doesn't do anything. + * Purpose: A bogus compression method that doesn't do anything. * - * Return: Success: Data chunk size + * Return: Success: Data chunk size * - * Failure: 0 + * Failure: 0 * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 + * Programmer: Robb Matzke + * Tuesday, April 21, 1998 * * Modifications: * @@ -469,19 +469,19 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_compression + * Function: test_compression * - * Purpose: Tests dataset compression. If compression is requested when - * it hasn't been compiled into the library (such as when - * updating an existing compressed dataset) then data is sent to - * the file uncompressed but no errors are returned. + * Purpose: Tests dataset compression. If compression is requested when + * it hasn't been compiled into the library (such as when + * updating an existing compressed dataset) then data is sent to + * the file uncompressed but no errors are returned. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -491,266 +491,266 @@ static herr_t test_compression(H5File& file) { #ifndef H5_HAVE_FILTER_DEFLATE - const char *not_supported; + const char *not_supported; not_supported = " Deflate compression is not enabled."; #endif /* H5_HAVE_FILTER_DEFLATE */ - int points[100][200]; - int check[100][200]; - hsize_t i, j, n; + int points[100][200]; + int check[100][200]; + hsize_t i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = (int)n++; - } + for (j = 0; j < 200; j++) { + points[i][j] = (int)n++; + } } char* tconv_buf = new char [1000]; DataSet* dataset = NULL; try { - const hsize_t size[2] = {100, 200}; - // Create the data space - DataSpace space1(2, size, NULL); + const hsize_t size[2] = {100, 200}; + // Create the data space + DataSpace space1(2, size, NULL); - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; - xfer.setBuffer (1000, tconv_buf, NULL); + xfer.setBuffer (1000, tconv_buf, NULL); - // Use chunked storage with compression - DSetCreatPropList dscreatplist; + // Use chunked storage with compression + DSetCreatPropList dscreatplist; - const hsize_t chunk_size[2] = {2, 25}; - dscreatplist.setChunk (2, chunk_size); - dscreatplist.setDeflate (6); + const hsize_t chunk_size[2] = {2, 25}; + dscreatplist.setChunk (2, chunk_size); + dscreatplist.setDeflate (6); #ifdef H5_HAVE_FILTER_DEFLATE - SUBTEST("Compression (setup)"); - - // Create the dataset - dataset = new DataSet (file.createDataSet - (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (uninitialized read)"); - - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 3: Try to read the data we just wrote. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (read)"); - - // Read the dataset back - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in read"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 4: Write new data over the top of the old data. The new data is - * random thus not very compressible, and will cause the chunks to move - * around as they grow. We only change values for the left half of the - * dataset although we rewrite the whole thing. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (modify)"); - - for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back and check it - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in modify"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 5: Close the dataset and then open it and read it again. This - * insures that the compression message is picked up properly from the - * object header. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (re-open)"); - - // close this dataset to reuse the var - delete dataset; - - dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in re-open"); - } - - PASSED(); - - - /*---------------------------------------------------------------------- - * STEP 6: Test partial I/O by writing to and then reading from a - * hyperslab of the dataset. The hyperslab does not line up on chunk - * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (partial I/O)"); - - const hsize_t hs_size[2] = {4, 50}; - const hsize_t hs_offset[2] = {7, 30}; - for (i = 0; i < hs_size[0]; i++) { - for (j = 0; j < hs_size[1]; j++) { - points[hs_offset[0]+i][hs_offset[1]+j] = rand (); - } - } - space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); - dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); - - // Check that the values read are the same as the values written - for (i=0; iread (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 3: Try to read the data we just wrote. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (read)"); + + // Read the dataset back + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in read"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 4: Write new data over the top of the old data. The new data is + * random thus not very compressible, and will cause the chunks to move + * around as they grow. We only change values for the left half of the + * dataset although we rewrite the whole thing. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (modify)"); + + for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back and check it + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in modify"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 5: Close the dataset and then open it and read it again. This + * insures that the compression message is picked up properly from the + * object header. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (re-open)"); + + // close this dataset to reuse the var + delete dataset; + + dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in re-open"); + } + + PASSED(); + + + /*---------------------------------------------------------------------- + * STEP 6: Test partial I/O by writing to and then reading from a + * hyperslab of the dataset. The hyperslab does not line up on chunk + * boundaries (we know that case already works from above tests). + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (partial I/O)"); + + const hsize_t hs_size[2] = {4, 50}; + const hsize_t hs_offset[2] = {7, 30}; + for (i = 0; i < hs_size[0]; i++) { + for (j = 0; j < hs_size[1]; j++) { + points[hs_offset[0]+i][hs_offset[1]+j] = rand (); + } + } + space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); + dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); + + // Check that the values read are the same as the values written + for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in app-defined method"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * Cleanup - *---------------------------------------------------------------------- - */ - delete dataset; - delete [] tconv_buf; - return 0; + throw Exception("test_compression", "Failed in app-defined method"); + if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0) + throw Exception("test_compression", "Failed in app-defined method"); + dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL); + + DataSpace space2 (2, size, NULL); + dataset = new DataSet (file.createDataSet (DSET_BOGUS_NAME, PredType::NATIVE_INT, space2, dscreatplist)); + + dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in app-defined method"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * Cleanup + *---------------------------------------------------------------------- + */ + delete dataset; + delete [] tconv_buf; + return 0; } // end try // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - - // clean up and return with failure - if (dataset != NULL) - delete dataset; - if (tconv_buf) - delete [] tconv_buf; - return -1; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + + // clean up and return with failure + if (dataset != NULL) + delete dataset; + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_compression @@ -764,12 +764,12 @@ test_compression(H5File& file) * * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, April 22, 2016 + * Programmer: Binh-Minh Ribler + * Friday, April 22, 2016 * *------------------------------------------------------------------------- */ -const H5std_string DSET_NBIT_NAME("nbit_dataset"); +const H5std_string DSET_NBIT_NAME("nbit_dataset"); const hsize_t DIM1 = 2; const hsize_t DIM2 = 5; static herr_t test_nbit_compression(H5File& file) @@ -790,101 +790,101 @@ static herr_t test_nbit_compression(H5File& file) try { - // Define datatypes of members of compound datatype - IntType i_type(PredType::NATIVE_INT); - IntType c_type(PredType::NATIVE_CHAR); - IntType s_type(PredType::NATIVE_SHORT); - - // Create a dataset compound datatype - CompType cmpd(sizeof(s1_t)); - cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Create a memory compound datatype - CompType mem_cmpd(sizeof(s1_t)); - mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Set order of dataset compound datatype - //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? - - // Create the data space - DataSpace space(2, size); - - // Use nbit filter - DSetCreatPropList dscreat; - dscreat.setChunk(2, chunk_size); - dscreat.setNbit(); - - // Create the dataset - DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); - - // Initialize data, assuming size of long long >= size of member datatypes - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - orig_data[i][j].i = static_cast(i * j); - orig_data[i][j].c = static_cast('a' + i); - orig_data[i][j].s = static_cast(i + j); - - // Some even-numbered integer values are negative - if ((i*size[1]+j+1)%2 == 0) { - orig_data[i][j].i = -orig_data[i][j].i; - orig_data[i][j].s = static_cast(-orig_data[i][j].s); - } - } - - // Write to the dataset - dataset.write(static_cast(orig_data), mem_cmpd); - - // Read the dataset back */ - dataset.read(static_cast(new_data), mem_cmpd); - - // Check that the values read are the same as the values written. - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - if((new_data[i][j].i != orig_data[i][j].i) || - (new_data[i][j].c != orig_data[i][j].c) || - (new_data[i][j].s != orig_data[i][j].s)) - { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); - } + // Define datatypes of members of compound datatype + IntType i_type(PredType::NATIVE_INT); + IntType c_type(PredType::NATIVE_CHAR); + IntType s_type(PredType::NATIVE_SHORT); + + // Create a dataset compound datatype + CompType cmpd(sizeof(s1_t)); + cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Create a memory compound datatype + CompType mem_cmpd(sizeof(s1_t)); + mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Set order of dataset compound datatype + //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? + + // Create the data space + DataSpace space(2, size); + + // Use nbit filter + DSetCreatPropList dscreat; + dscreat.setChunk(2, chunk_size); + dscreat.setNbit(); + + // Create the dataset + DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); + + // Initialize data, assuming size of long long >= size of member datatypes + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + orig_data[i][j].i = static_cast(i * j); + orig_data[i][j].c = static_cast('a' + i); + orig_data[i][j].s = static_cast(i + j); + + // Some even-numbered integer values are negative + if ((i*size[1]+j+1)%2 == 0) { + orig_data[i][j].i = -orig_data[i][j].i; + orig_data[i][j].s = static_cast(-orig_data[i][j].s); + } + } + + // Write to the dataset + dataset.write(static_cast(orig_data), mem_cmpd); + + // Read the dataset back */ + dataset.read(static_cast(new_data), mem_cmpd); + + // Check that the values read are the same as the values written. + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + if((new_data[i][j].i != orig_data[i][j].i) || + (new_data[i][j].c != orig_data[i][j].c) || + (new_data[i][j].s != orig_data[i][j].s)) + { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); + } } - PASSED(); - return 0; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_nbit_compression /*------------------------------------------------------------------------- - * Function: test_multiopen + * Function: test_multiopen * - * Purpose: Tests that a bug no longer exists. If a dataset is opened - * twice and one of the handles is used to extend the dataset, - * then the other handle should return the new size when - * queried. + * Purpose: Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Saturday, February 17, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Saturday, February 17, 2001 * * Modifications: * @@ -899,74 +899,74 @@ test_multiopen (H5File& file) DataSpace* space = NULL; try { - // Create a dataset creation property list - DSetCreatPropList dcpl; + // Create a dataset creation property list + DSetCreatPropList dcpl; - // Set chunk size to given size - hsize_t cur_size[1] = {10}; - dcpl.setChunk (1, cur_size); + // Set chunk size to given size + hsize_t cur_size[1] = {10}; + dcpl.setChunk (1, cur_size); - // Create a simple data space with unlimited size - hsize_t max_size[1] = {H5S_UNLIMITED}; - space = new DataSpace (1, cur_size, max_size); + // Create a simple data space with unlimited size + hsize_t max_size[1] = {H5S_UNLIMITED}; + space = new DataSpace (1, cur_size, max_size); - // Create first dataset - DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); + // Create first dataset + DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); - // Open again the first dataset from the file to another DataSet object. - DataSet dset2 = file.openDataSet ("multiopen"); + // Open again the first dataset from the file to another DataSet object. + DataSet dset2 = file.openDataSet ("multiopen"); - // Relieve the dataspace - delete space; - space = NULL; + // Relieve the dataspace + delete space; + space = NULL; - // Extend the dimensionality of the first dataset - cur_size[0] = 20; - dset1.extend (cur_size); + // Extend the dimensionality of the first dataset + cur_size[0] = 20; + dset1.extend (cur_size); - // Get the size from the second handle - space = new DataSpace (dset2.getSpace()); + // Get the size from the second handle + space = new DataSpace (dset2.getSpace()); - hsize_t tmp_size[1]; - space->getSimpleExtentDims (tmp_size); - if (cur_size[0]!=tmp_size[0]) - { - cerr << " Got " << (int)tmp_size[0] << " instead of " - << (int)cur_size[0] << "!" << endl; - throw Exception("test_multiopen", "Failed in multi-open with extending"); - } + hsize_t tmp_size[1]; + space->getSimpleExtentDims (tmp_size); + if (cur_size[0]!=tmp_size[0]) + { + cerr << " Got " << (int)tmp_size[0] << " instead of " + << (int)cur_size[0] << "!" << endl; + throw Exception("test_multiopen", "Failed in multi-open with extending"); + } - // clean up and return with success - delete space; - PASSED(); - return 0; + // clean up and return with success + delete space; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (space != NULL) - delete space; - return -1; + // clean up and return with failure + if (space != NULL) + delete space; + return -1; } } // test_multiopen /*------------------------------------------------------------------------- - * Function: test_types + * Function: test_types * - * Purpose: Test various types - should be moved to dtypes.cpp + * Purpose: Test various types - should be moved to dtypes.cpp * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Binh-Minh Ribler (using C version) - * February 17, 2001 + * February 17, 2001 * * Modifications: * @@ -977,239 +977,239 @@ test_types(H5File& file) { SUBTEST("Various datatypes"); - size_t i; + size_t i; DataSet* dset = NULL; try { - // Create a group in the file that was passed in from the caller - Group grp = file.createGroup ("typetests"); - - /* bitfield_1 */ - unsigned char buf[32]; - hsize_t nelmts = sizeof(buf); - DataType type; - try { // block of bitfield_1 - // test copying a predefined type - type.copy (PredType::STD_B8LE); - - // Test copying a user-defined type using DataType::copy - DataType copied_type; - copied_type.copy(type); - - // Test copying a user-defined type using DataType::operator= - DataType another_copied_type; - another_copied_type = type; - - // Test copying a user-defined int type using DataType::operator= - IntType orig_int(PredType::STD_B8LE); - DataType generic_type; - generic_type = orig_int; - - // Test copying an integer predefined type - IntType new_int_type(PredType::STD_B8LE); - - // Test copying an int predefined type using DataType::operator= - IntType another_int_type; - another_int_type = new_int_type; - - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); - - // Fill buffer - for (i=0; iwrite (buf, type); - - // no failure in bitfield_1, close this dataset - delete dset; - } // end try block of bitfield_1 - - // catch exceptions thrown in try block of bitfield_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - return -1; - } - - /* bitfield_2 */ - nelmts = sizeof(buf)/2; - try { // bitfield_2 block - type.copy (PredType::STD_B16LE); - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); - - // Fill buffer - for (i=0; iwrite (buf, type); - - // no failure in bitfield_2, close this dataset and reset for - // variable reuse - delete dset; - dset = NULL; - } // end try block of bitfield_2 - - // catch exceptions thrown in try block of bitfield_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - throw E; // propagate the exception - } - - /* opaque_1 */ - DataType* optype = NULL; - try { // opaque_1 block - optype = new DataType(H5T_OPAQUE, 1); - nelmts = sizeof(buf); - DataSpace space (1, &nelmts); - optype->setTag ("testing 1-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); - - // Fill buffer - for (i=0; iwrite (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } // end try block of opaque_1 - - // catch exceptions thrown in try block of opaque_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - /* opaque_2 */ - try { // block opaque_2 - nelmts = sizeof(buf)/4; - DataSpace space (1, &nelmts); - optype = new DataType(H5T_OPAQUE, 4); - optype->setTag ("testing 4-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); - - // Fill buffer - for (i=0; iwrite (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } //end try block of opaque_2 - - // catch exceptions thrown in try block of opaque_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - PASSED(); - return 0; + // Create a group in the file that was passed in from the caller + Group grp = file.createGroup ("typetests"); + + /* bitfield_1 */ + unsigned char buf[32]; + hsize_t nelmts = sizeof(buf); + DataType type; + try { // block of bitfield_1 + // test copying a predefined type + type.copy (PredType::STD_B8LE); + + // Test copying a user-defined type using DataType::copy + DataType copied_type; + copied_type.copy(type); + + // Test copying a user-defined type using DataType::operator= + DataType another_copied_type; + another_copied_type = type; + + // Test copying a user-defined int type using DataType::operator= + IntType orig_int(PredType::STD_B8LE); + DataType generic_type; + generic_type = orig_int; + + // Test copying an integer predefined type + IntType new_int_type(PredType::STD_B8LE); + + // Test copying an int predefined type using DataType::operator= + IntType another_int_type; + another_int_type = new_int_type; + + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); + + // Fill buffer + for (i=0; iwrite (buf, type); + + // no failure in bitfield_1, close this dataset + delete dset; + } // end try block of bitfield_1 + + // catch exceptions thrown in try block of bitfield_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + return -1; + } + + /* bitfield_2 */ + nelmts = sizeof(buf)/2; + try { // bitfield_2 block + type.copy (PredType::STD_B16LE); + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); + + // Fill buffer + for (i=0; iwrite (buf, type); + + // no failure in bitfield_2, close this dataset and reset for + // variable reuse + delete dset; + dset = NULL; + } // end try block of bitfield_2 + + // catch exceptions thrown in try block of bitfield_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + throw E; // propagate the exception + } + + /* opaque_1 */ + DataType* optype = NULL; + try { // opaque_1 block + optype = new DataType(H5T_OPAQUE, 1); + nelmts = sizeof(buf); + DataSpace space (1, &nelmts); + optype->setTag ("testing 1-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); + + // Fill buffer + for (i=0; iwrite (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } // end try block of opaque_1 + + // catch exceptions thrown in try block of opaque_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + /* opaque_2 */ + try { // block opaque_2 + nelmts = sizeof(buf)/4; + DataSpace space (1, &nelmts); + optype = new DataType(H5T_OPAQUE, 4); + optype->setTag ("testing 4-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); + + // Fill buffer + for (i=0; iwrite (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } //end try block of opaque_2 + + // catch exceptions thrown in try block of opaque_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + PASSED(); + return 0; } // end top try block catch (Exception& E) { - return -1; + return -1; } } // test_types /*------------------------------------------------------------------------- - * Function: test_dset + * Function: test_dset * - * Purpose: Tests the dataset interface (H5D) + * Purpose: Tests the dataset interface (H5D) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: - * Nov 12, 01: - * - moved h5_cleanup to outside of try block because - * dataset.h5 cannot be removed until "file" is out of - * scope and dataset.h5 is closed. - * Feb 20, 05: - * - cleanup_dsets took care of the cleanup now. + * Nov 12, 01: + * - moved h5_cleanup to outside of try block because + * dataset.h5 cannot be removed until "file" is out of + * scope and dataset.h5 is closed. + * Feb 20, 05: + * - cleanup_dsets took care of the cleanup now. * *------------------------------------------------------------------------- */ extern "C" void test_dset() { - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template - int nerrors=0; // keep track of number of failures occurr + int nerrors=0; // keep track of number of failures occurr try { - // Use the file access template id to create a file access prop. - // list object to pass in H5File::H5File - FileAccPropList fapl(fapl_id); + // Use the file access template id to create a file access prop. + // list object to pass in H5File::H5File + FileAccPropList fapl(fapl_id); - H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Cause the library to emit initial messages - Group grp = file.createGroup( "emit diagnostics", 0); - grp.setComment("Causes diagnostic messages to be emitted"); + // Cause the library to emit initial messages + Group grp = file.createGroup( "emit diagnostics", 0); + grp.setComment("Causes diagnostic messages to be emitted"); - nerrors += test_create(file) < 0 ? 1:0; - nerrors += test_simple_io(file) < 0 ? 1:0; - nerrors += test_tconv(file) < 0 ? 1:0; - nerrors += test_compression(file) < 0 ? 1:0; - nerrors += test_nbit_compression(file) < 0 ? 1:0; - nerrors += test_multiopen (file) < 0 ? 1:0; - nerrors += test_types(file) < 0 ? 1:0; + nerrors += test_create(file) < 0 ? 1:0; + nerrors += test_simple_io(file) < 0 ? 1:0; + nerrors += test_tconv(file) < 0 ? 1:0; + nerrors += test_compression(file) < 0 ? 1:0; + nerrors += test_nbit_compression(file) < 0 ? 1:0; + nerrors += test_multiopen (file) < 0 ? 1:0; + nerrors += test_types(file) < 0 ? 1:0; - // Close group "emit diagnostics". - grp.close(); + // Close group "emit diagnostics". + grp.close(); - // Close the file before testing data size. - file.close(); + // Close the file before testing data size. + file.close(); - nerrors += test_datasize(fapl) <0 ? 1:0; + nerrors += test_datasize(fapl) <0 ? 1:0; } catch (Exception& E) { - test_report(nerrors, H5std_string(" Dataset")); + test_report(nerrors, H5std_string(" Dataset")); } // Clean up data file diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index 60dbf6c..0a79d75 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -41,18 +41,18 @@ using namespace H5; /*------------------------------------------------------------------------- - * Function: test_report + * Function: test_report * - * Purpose: Prints out the number of errors for the tests indicated - * by 'testname,' if there were any failures occurred. If - * no failure, test_report prints out the tests passed message. + * Purpose: Prints out the number of errors for the tests indicated + * by 'testname,' if there were any failures occurred. If + * no failure, test_report prints out the tests passed message. * - * Return: if any failure has occurred: 1 + * Return: if any failure has occurred: 1 * - * if no failure occurs: 0 + * if no failure occurs: 0 * - * Programmer: Binh-Minh Ribler (using C code segment for reporting tests) - * Friday, February 6, 2001 + * Programmer: Binh-Minh Ribler (using C code segment for reporting tests) + * Friday, February 6, 2001 * * Modifications: * @@ -63,12 +63,12 @@ int test_report( int nerrors, const H5std_string& testname ) if (nerrors) { nerrors = MAX(1, nerrors); - if (1 == nerrors) - cerr << "***** " << nerrors << testname - << " TEST FAILED! *****" << endl; - else - cerr << "***** " << nerrors << testname - << " TESTS FAILED! *****" << endl; + if (1 == nerrors) + cerr << "***** " << nerrors << testname + << " TEST FAILED! *****" << endl; + else + cerr << "***** " << nerrors << testname + << " TESTS FAILED! *****" << endl; return 1; } else @@ -79,68 +79,68 @@ int test_report( int nerrors, const H5std_string& testname ) } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose: Displays that a function has failed with its location. + * Purpose: Displays that a function has failed with its location. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message) + const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << " at line " << line << " in " << file_name << " - " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose: Displays that a function has failed with its location. + * Purpose: Displays that a function has failed with its location. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message) + const char* func_name, const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << ": " << func_name << endl << - " at line " << line << " in " << file_name << endl << - " C library detail: " << message << endl << endl; + " at line " << line << " in " << file_name << endl << + " C library detail: " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: check_values + * Function: check_values * - * Purpose: Checks a read value against the written value. If they are - * different, the function will print out a message and the - * different values. This function is made to reuse the code - * segment that is used in various places throughout - * the test code. Where the C version of this code segment - * "goto error," this function will return -1. + * Purpose: Checks a read value against the written value. If they are + * different, the function will print out a message and the + * different values. This function is made to reuse the code + * segment that is used in various places throughout + * the test code. Where the C version of this code segment + * "goto error," this function will return -1. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C code segment for checking values) - * Friday, February 6, 2001 + * Programmer: Binh-Minh Ribler (using C code segment for checking values) + * Friday, February 6, 2001 * * Modifications: * @@ -150,27 +150,27 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) { if (apoint != acheck) { - cerr << " Read different values than written.\n" << endl; - cerr << " At index " << static_cast(i) << "," << - static_cast(j) << endl; - return -1; + cerr << " Read different values than written.\n" << endl; + cerr << " At index " << static_cast(i) << "," << + static_cast(j) << endl; + return -1; } return 0; } // check_values /*------------------------------------------------------------------------- - * Function: verify_val (const char*, const char*,...) + * Function: verify_val (const char*, const char*,...) * - * Purpose: Compares two character strings. If they are - * different, the function will print out a message and the - * different values. + * Purpose: Compares two character strings. If they are + * different, the function will print out a message and the + * different values. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * May 2, 2010 + * Programmer: Binh-Minh Ribler + * May 2, 2010 * * Modifications: * @@ -203,12 +203,12 @@ InvalidActionException::InvalidActionException():Exception(){} //-------------------------------------------------------------------------- // Function: InvalidActionException overloaded constructor // -// Purpose: Creates an InvalidActionException with the name of the function, +// Purpose: Creates an InvalidActionException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) : Exception(func, message) {} @@ -225,12 +225,12 @@ TestFailedException::TestFailedException():Exception(){} //-------------------------------------------------------------------------- // Function: TestFailedException overloaded constructor // -// Purpose: Creates an TestFailedException with the name of the function, +// Purpose: Creates an TestFailedException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) : Exception(func, message) {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index ede6850..9aee050 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -39,22 +39,22 @@ using std::endl; int check_values (hsize_t i, hsize_t j, int apoint, int acheck); int test_report (int, const H5std_string&); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message=""); + const char* message=""); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message); + const char* func_name, const char* message); class InvalidActionException : public Exception { public: - InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - InvalidActionException(); - virtual ~InvalidActionException() throw(); + InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + InvalidActionException(); + virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: - TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - TestFailedException(); - virtual ~TestFailedException() throw(); + TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + TestFailedException(); + virtual ~TestFailedException() throw(); }; // Overloaded/Template functions to verify values and display proper info @@ -65,18 +65,18 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should be " - << value << ", but is " << x << " at line " << line - << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << ", but is " << x << " at line " << line + << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -85,12 +85,12 @@ template { if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line - << ":" << msg << " different: " << x << ", should be " << value - << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + << ":" << msg << " different: " << x << ", should be " << value + << endl; + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } @@ -99,17 +99,17 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should not be " - << value << " at line " << line << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << " at line " << line << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -118,10 +118,10 @@ template { if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** Function " << msg << " FAILED at line " << line << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 1da9e0c..166ee34 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -60,7 +60,7 @@ typedef enum int_t { * Return: None. * * Programmer: Binh-Minh Ribler (using C version) - * January, 2016 + * January, 2016 * * Modifications: * @@ -78,7 +78,7 @@ static void test_array_compound_array() hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int nmemb; // Number of compound members - int ii; // counting variables + int ii; // counting variables hsize_t idxi, idxj, idxk; // dimension indicing variables H5T_class_t mclass; // Datatype class for field @@ -87,180 +87,180 @@ static void test_array_compound_array() for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { wdata[idxi][idxj].i = idxi * 10 + idxj; for(idxk = 0; idxk < ARRAY1_DIM1; idxk++) - { + { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; - } + } } // end for try { - // Create File - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create File + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets - DataSpace space(SPACE1_RANK, sdims1, NULL); + // Create dataspace for datasets + DataSpace space(SPACE1_RANK, sdims1, NULL); - /* - * Create an array datatype of compounds, arrtype. Each compound - * datatype, comptype, contains an integer and an array of floats, - * arrfltype. - */ + /* + * Create an array datatype of compounds, arrtype. Each compound + * datatype, comptype, contains an integer and an array of floats, + * arrfltype. + */ - // Create a compound datatype - CompType comptype(sizeof(s1_t)); + // Create a compound datatype + CompType comptype(sizeof(s1_t)); - // Insert integer field - comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); + // Insert integer field + comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); - // Create an array of floats datatype - ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); + // Create an array of floats datatype + ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); - // Insert float array field - comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); + // Insert float array field + comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); - // Close array of floats field datatype - arrfltype.close(); + // Close array of floats field datatype + arrfltype.close(); - // Create an array datatype of the compound datatype - ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); + // Create an array datatype of the compound datatype + ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); - // Close compound datatype comptype - comptype.close(); + // Close compound datatype comptype + comptype.close(); - // Create a dataset - DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); + // Create a dataset + DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); - // Write dataset to disk - dataset.write(wdata, arrtype); + // Write dataset to disk + dataset.write(wdata, arrtype); - // Close all - dataset.close(); - arrtype.close(); - space.close(); - file1.close(); + // Close all + dataset.close(); + arrtype.close(); + space.close(); + file1.close(); - // Re-open file - file1.openFile(FILENAME, H5F_ACC_RDONLY); + // Re-open file + file1.openFile(FILENAME, H5F_ACC_RDONLY); - // Open the dataset - dataset = file1.openDataSet("Dataset1"); + // Open the dataset + dataset = file1.openDataSet("Dataset1"); - /* - * Check the datatype array of compounds - */ + /* + * Check the datatype array of compounds + */ - // Verify that it is an array of compounds - DataType dstype = dataset.getDataType(); - mclass = dstype.getClass(); - verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); + // Verify that it is an array of compounds + DataType dstype = dataset.getDataType(); + mclass = dstype.getClass(); + verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); - dstype.close(); + dstype.close(); - // Get the array datatype to check - ArrayType atype_check = dataset.getArrayType(); + // Get the array datatype to check + ArrayType atype_check = dataset.getArrayType(); - // Check the array rank - int ndims = atype_check.getArrayNDims(); - verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); + // Check the array rank + int ndims = atype_check.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); - // Get the array dimensions - hsize_t rdims1[H5S_MAX_RANK]; - atype_check.getArrayDims(rdims1); + // Get the array dimensions + hsize_t rdims1[H5S_MAX_RANK]; + atype_check.getArrayDims(rdims1); - // Check the array dimensions - for (ii =0; ii openAttribute(ATTR1_NAME)); + // Open attribute + Attribute *attr2 = new Attribute (dset2->openAttribute(ATTR1_NAME)); - // Read data from the attribute - attr2->read(PredType::NATIVE_INT, &rdata); - verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); + // Read data from the attribute + attr2->read(PredType::NATIVE_INT, &rdata); + verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); - // Close attribute and dataset - delete attr2; - delete dset2; + // Close attribute and dataset + delete attr2; + delete dset2; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } // end of second enclosing + } // end of second enclosing - // Unlink the dataset - fid1.unlink(DSET1_NAME); + // Unlink the dataset + fid1.unlink(DSET1_NAME); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Unlink the named datatype - fid1.unlink(TYPE1_NAME); + // Unlink the named datatype + fid1.unlink(TYPE1_NAME); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Check size of file - filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); - verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); + // Check size of file + filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); + verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dtype_shared() @@ -1424,116 +1424,116 @@ static void test_string_attr() SUBTEST("I/O on FL and VL String Attributes"); try { - // Create file - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - - // - // Fixed-lenth string attributes - // - // Create a fixed-length string datatype to refer to. - StrType fls_type(0, ATTR_LEN); - - // Open the root group. - Group root = fid1.openGroup("/"); - - // Create dataspace for the attribute. - DataSpace att_space (H5S_SCALAR); - - /* Test Attribute::write(...,const void *buf) with Fixed len string */ - - // Create an attribute for the root group. - Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); - - /* Test Attribute::write(...,const H5std_string& strg) with FL string */ - - // Create an attribute for the root group. - Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr2.write(fls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with FL string */ - - // Read and verify the attribute string as a string of chars. - char flstring_att_check[ATTR_LEN]; - gr_flattr1.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - // Read and verify the attribute string as a string of chars; buffer - // is dynamically allocated. - size_t attr_size = gr_flattr1.getInMemDataSize(); - char *fl_dyn_string_att_check; - fl_dyn_string_att_check = new char[attr_size+1]; - gr_flattr1.read(fls_type, fl_dyn_string_att_check); - if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); - delete []fl_dyn_string_att_check; - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr1; - gr_flattr1.read(fls_type, read_flstr1); - if (read_flstr1 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); - - // Read and verify the attribute string as a string of chars. - HDstrcpy(flstring_att_check, ""); - gr_flattr2.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr2; - gr_flattr2.read(fls_type, read_flstr2); - if (read_flstr2 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); - - // - // Variable-lenth string attributes - // - // Create a variable length string datatype to refer to. - StrType vls_type(0, H5T_VARIABLE); - - // Create an attribute for the root group. - Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); - - // Write data to the attribute. - gr_vlattr.write(vls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with Variable len string */ - // Read and verify the attribute string as a string of chars. - char *string_att_check; - gr_vlattr.read(vls_type, &string_att_check); - if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); - HDfree(string_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with VL string */ - // Read and verify the attribute string as an std::string. - H5std_string read_str; - gr_vlattr.read(vls_type, read_str); - if (read_str != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); - PASSED(); + // Create file + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + + // + // Fixed-lenth string attributes + // + // Create a fixed-length string datatype to refer to. + StrType fls_type(0, ATTR_LEN); + + // Open the root group. + Group root = fid1.openGroup("/"); + + // Create dataspace for the attribute. + DataSpace att_space (H5S_SCALAR); + + /* Test Attribute::write(...,const void *buf) with Fixed len string */ + + // Create an attribute for the root group. + Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); + + /* Test Attribute::write(...,const H5std_string& strg) with FL string */ + + // Create an attribute for the root group. + Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr2.write(fls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with FL string */ + + // Read and verify the attribute string as a string of chars. + char flstring_att_check[ATTR_LEN]; + gr_flattr1.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + // Read and verify the attribute string as a string of chars; buffer + // is dynamically allocated. + size_t attr_size = gr_flattr1.getInMemDataSize(); + char *fl_dyn_string_att_check; + fl_dyn_string_att_check = new char[attr_size+1]; + gr_flattr1.read(fls_type, fl_dyn_string_att_check); + if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); + delete []fl_dyn_string_att_check; + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr1; + gr_flattr1.read(fls_type, read_flstr1); + if (read_flstr1 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); + + // Read and verify the attribute string as a string of chars. + HDstrcpy(flstring_att_check, ""); + gr_flattr2.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr2; + gr_flattr2.read(fls_type, read_flstr2); + if (read_flstr2 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); + + // + // Variable-lenth string attributes + // + // Create a variable length string datatype to refer to. + StrType vls_type(0, H5T_VARIABLE); + + // Create an attribute for the root group. + Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); + + // Write data to the attribute. + gr_vlattr.write(vls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with Variable len string */ + // Read and verify the attribute string as a string of chars. + char *string_att_check; + gr_vlattr.read(vls_type, &string_att_check); + if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); + HDfree(string_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with VL string */ + // Read and verify the attribute string as an std::string. + H5std_string read_str; + gr_vlattr.read(vls_type, read_str); + if (read_str != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_string_attr() /**************************************************************** ** ** test_attr_exists(): Test checking for attribute existence. -** (additional attrExists tests are in test_attr_rename()) +** (additional attrExists tests are in test_attr_rename()) ** ****************************************************************/ static void test_attr_exists() @@ -1542,40 +1542,40 @@ static void test_attr_exists() SUBTEST("Check Attribute Existence"); try { - // Open file. - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + // Open file. + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - // Open the root group. - Group root = fid1.openGroup("/"); + // Open the root group. + Group root = fid1.openGroup("/"); - // Check for existence of attribute - bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); + // Check for existence of attribute + bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); - // Check for existence of attribute - attr_exists = fid1.attrExists(FATTR1_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); - // Open a group. - Group group = fid1.openGroup(GROUP1_NAME); + // Open a group. + Group group = fid1.openGroup(GROUP1_NAME); - // Check for existence of attribute - attr_exists = group.attrExists(ATTR2_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = group.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); - PASSED(); + PASSED(); } // end try block catch (InvalidActionException& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } catch (Exception& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_exists() @@ -1591,100 +1591,100 @@ const unsigned MAX_COMPACT_DEF = 8; const unsigned MIN_DENSE_DEF = 6; static void test_attr_dense_create(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Dense Attribute Storage Creation"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Get size of file - h5_stat_size_t empty_filesize; // Size of empty file - empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); - if (empty_filesize < 0) + // Get size of file + h5_stat_size_t empty_filesize; // Size of empty file + empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); + if (empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create dataset creation property list. - DSetCreatPropList dcpl; + // Create dataset creation property list. + DSetCreatPropList dcpl; - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - unsigned max_compact = 0, min_dense = 0; + unsigned max_compact = 0, min_dense = 0; - // Retrieve limits for compact/dense attribute storage - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Set new compact/dense attribute storage limits to some random numbers - dcpl.setAttrPhaseChange(7, 5); + // Set new compact/dense attribute storage limits to some random numbers + dcpl.setAttrPhaseChange(7, 5); - // Retrieve limits for compact/dense attribute storage and verify them - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage and verify them + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - // Add attributes, until just before converting to dense storage - char attr_name[NAME_BUF_SIZE]; - unsigned attr_num; - for (attr_num = 0; attr_num < max_compact; attr_num++) - { - // Create attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Add attributes, until just before converting to dense storage + char attr_name[NAME_BUF_SIZE]; + unsigned attr_num; + for (attr_num = 0; attr_num < max_compact; attr_num++) + { + // Create attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } // end for + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } // end for - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - { // Add one more attribute, to push into "dense" storage + { // Add one more attribute, to push into "dense" storage - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } - // Attempt to add attribute again, which should fail - try - { - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Attempt to add attribute again, which should fail + try + { + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // continuation here, that means no exception has been thrown - throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); - } - catch (AttributeIException& E) // catching invalid action + // continuation here, that means no exception has been thrown + throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); + } + catch (AttributeIException& E) // catching invalid action {} // do nothing, exception expected - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dense_create() @@ -1695,81 +1695,81 @@ static void test_attr_dense_create(FileCreatPropList& fcpl, ** ****************************************************************/ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Basic Code for Attributes with Creation Order Info"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - - // Create dataset creation property list. - DSetCreatPropList dcpl; - - // Get creation order indexing on object - unsigned crt_order_flags = 0; - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, 0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - - // Setting invalid combination of a attribute order creation order - // indexing on should fail - try { - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); - } - catch (PropListIException& E) // catching invalid action + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + + // Create dataset creation property list. + DSetCreatPropList dcpl; + + // Get creation order indexing on object + unsigned crt_order_flags = 0; + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, 0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + + // Setting invalid combination of a attribute order creation order + // indexing on should fail + try { + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); + } + catch (PropListIException& E) // catching invalid action {} // do nothing, exception expected - // Set attribute creation order tracking & indexing for object then - // verify them - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Set attribute creation order tracking & indexing for object then + // verify them + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - // Close dataspace - ds_space.close(); + // Close dataspace + ds_space.close(); - // Check on dataset's attribute storage status. - // NOTE: Wrappers not available yet (H5O_is_attr_empty_test - // and H5O_is_attr_dense_test) + // Check on dataset's attribute storage status. + // NOTE: Wrappers not available yet (H5O_is_attr_empty_test + // and H5O_is_attr_dense_test) - // Close dataset - dataset.close(); + // Close dataset + dataset.close(); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Open dataset created previously - dataset = fid1.openDataSet(DSET1_NAME); + // Open dataset created previously + dataset = fid1.openDataSet(DSET1_NAME); - // Retrieve dataset creation property list for the dataset - dcpl = dataset.getCreatePlist(); + // Retrieve dataset creation property list for the dataset + dcpl = dataset.getCreatePlist(); - // Query the attribute creation properties - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Query the attribute creation properties + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_corder_create_basic() @@ -1815,42 +1815,42 @@ void test_attr() // Set the file access proplist for the type of format if (new_format) { - MESSAGE(7, ("testing with new file format\n")); - curr_fapl = fapl_new; + MESSAGE(7, ("testing with new file format\n")); + curr_fapl = fapl_new; } else { - MESSAGE(7, ("testing with old file format\n")); - curr_fapl = fapl; + MESSAGE(7, ("testing with old file format\n")); + curr_fapl = fapl; } - test_attr_basic_write(); // Test basic H5A writing code - test_attr_getname(); // Test overloads of Attribute::getName - test_attr_rename(); // Test renaming attribute - test_attr_basic_read(); // Test basic H5A reading code + test_attr_basic_write(); // Test basic H5A writing code + test_attr_getname(); // Test overloads of Attribute::getName + test_attr_rename(); // Test renaming attribute + test_attr_basic_read(); // Test basic H5A reading code - test_attr_compound_write(); // Test complex datatype H5A writing code - test_attr_compound_read(); // Test complex datatype H5A reading code + test_attr_compound_write(); // Test complex datatype H5A writing code + test_attr_compound_read(); // Test complex datatype H5A reading code - test_attr_scalar_write(); // Test scalar dataspace H5A writing code - test_attr_scalar_read(); // Test scalar dataspace H5A reading code + test_attr_scalar_write(); // Test scalar dataspace H5A writing code + test_attr_scalar_read(); // Test scalar dataspace H5A reading code - test_attr_mult_write(); // Test writing multiple attributes - test_attr_mult_read(); // Test reading multiple attributes - test_attr_delete(); // Test deleting attributes + test_attr_mult_write(); // Test writing multiple attributes + test_attr_mult_read(); // Test reading multiple attributes + test_attr_delete(); // Test deleting attributes - test_attr_dtype_shared(); // Test using shared datatypes in attributes + test_attr_dtype_shared(); // Test using shared datatypes in attributes - test_string_attr(); // Test read/write string attribute - test_attr_exists(); // Test H5Location::attrExists + test_string_attr(); // Test read/write string attribute + test_attr_exists(); // Test H5Location::attrExists // Test with new format if (new_format) { - // Test dense attribute storage creation + // Test dense attribute storage creation test_attr_dense_create(fcpl, curr_fapl); - // Test create objects with attribute creation info + // Test create objects with attribute creation info test_attr_corder_create_basic(fcpl, curr_fapl); } } // end for @@ -1858,18 +1858,18 @@ void test_attr() catch (Exception& E) { - issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr() /*------------------------------------------------------------------------- - * Function: cleanup_attr + * Function: cleanup_attr * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index c334e28..6c52caa 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -37,7 +37,7 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file /* Number of elements in each test */ -#define NTESTELEM 100000 +#define NTESTELEM 100000 typedef struct complex_t { double re; @@ -64,13 +64,13 @@ static void test_compound_1() // Output message about test being performed SUBTEST("Compound Data Types"); try { - // Create an empty compound datatype - CompType complex_type(sizeof(complex_t)); + // Create an empty compound datatype + CompType complex_type(sizeof(complex_t)); - // Add a couple of fields - complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); - complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); - PASSED(); + // Add a couple of fields + complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); + complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); + PASSED(); } // end of try block catch (Exception& E) @@ -81,15 +81,15 @@ static void test_compound_1() /*------------------------------------------------------------------------- - * Function: test_compound_2 + * Function: test_compound_2 * - * Purpose: Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. + * Purpose: Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -99,100 +99,100 @@ static void test_compound_1() static void test_compound_2() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + const int nelmts = NTESTELEM; const hsize_t four = 4; - int i; + int i; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType *array_dt = NULL; // Output message about test being performed SUBTEST("Compound Element Reordering"); try { - // Sizes should be the same, but be careful just in case - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - // Build hdf5 datatypes - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + // Sizes should be the same, but be careful just in case + buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + // Build hdf5 datatypes + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - // Perform the conversion - st.convert(dt, (size_t)nelmts, buf, bkg); - - // Compare results - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - } - } - // Release resources - free(buf); - free(bkg); - free(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + // Perform the conversion + st.convert(dt, (size_t)nelmts, buf, bkg); + + // Compare results + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + } + } + // Release resources + free(buf); + free(bkg); + free(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -206,15 +206,15 @@ static void test_compound_2() /*------------------------------------------------------------------------- - * Function: test_compound_3 + * Function: test_compound_3 * - * Purpose: Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose: Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -224,16 +224,16 @@ static void test_compound_2() static void test_compound_3() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int a, c[4], e; + int a, c[4], e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -241,85 +241,85 @@ static void test_compound_3() // Output message about test being performed SUBTEST("Compound Datatype Subset Conversions"); try { - /* Initialize */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Initialize */ + buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a - << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" - << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - free(buf); - free(bkg); - free(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a + << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" + << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + free(buf); + free(bkg); + free(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } if(array_dt) @@ -328,16 +328,16 @@ static void test_compound_3() /*------------------------------------------------------------------------- - * Function: test_compound_4 + * Function: test_compound_4 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -347,20 +347,20 @@ static void test_compound_4() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -368,85 +368,85 @@ static void test_compound_4() // Output message about test being performed SUBTEST("Compound Element Shrinking & Reordering"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = (i*8+1) & 0x7fff; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = (i*8+6) & 0x7fff; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = (i*8+1) & 0x7fff; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = (i*8+6) & 0x7fff; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b - << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" - << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - free(buf); - free(bkg); - free(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b + << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" + << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + free(buf); + free(bkg); + free(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -460,17 +460,17 @@ static void test_compound_4() /*------------------------------------------------------------------------- - * Function: test_compound_5 + * Function: test_compound_5 * - * Purpose: Many versions of HDF5 have a bug in the optimized compound + * Purpose: Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -502,55 +502,55 @@ static void test_compound_5() SUBTEST("Optimized Struct Converter"); try { - /* Build datatypes */ - array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); - CompType short_array(4*sizeof(short)); - short_array.insertMember("_", 0, *array_dt); - array_dt->close(); + /* Build datatypes */ + array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); + CompType short_array(4*sizeof(short)); + short_array.insertMember("_", 0, *array_dt); + array_dt->close(); delete array_dt; - CompType int_array(4*sizeof(int)); - array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); - int_array.insertMember("_", 0, *array_dt); - array_dt->close(); - - StrType strg(PredType::C_S1, 16); - CompType src_type(sizeof(src_typ_t)); - src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); - src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); - src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); - - CompType dst_type(sizeof(dst_typ_t)); - dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); - dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); - dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); - - /* Convert data */ - memcpy(buf, src, sizeof(src)); - src_type.convert(dst_type, (size_t)2, buf, bkg); - dst = (dst_typ_t*)buf; - - /* Cleanup */ - src_type.close(); - dst_type.close(); - strg.close(); - short_array.close(); - int_array.close(); - - /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || - src[1].tdim!=dst[1].tdim || - src[1].coll_ids[0]!=dst[1].coll_ids[0] || - src[1].coll_ids[1]!=dst[1].coll_ids[1] || - src[1].coll_ids[2]!=dst[1].coll_ids[2] || - src[1].coll_ids[3]!=dst[1].coll_ids[3]) - { H5_FAILED(); } - - /* Free memory buffers */ - free(buf); - free(bkg); - dst = NULL; - PASSED(); + CompType int_array(4*sizeof(int)); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); + int_array.insertMember("_", 0, *array_dt); + array_dt->close(); + + StrType strg(PredType::C_S1, 16); + CompType src_type(sizeof(src_typ_t)); + src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); + src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); + src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); + + CompType dst_type(sizeof(dst_typ_t)); + dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); + dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); + dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); + + /* Convert data */ + memcpy(buf, src, sizeof(src)); + src_type.convert(dst_type, (size_t)2, buf, bkg); + dst = (dst_typ_t*)buf; + + /* Cleanup */ + src_type.close(); + dst_type.close(); + strg.close(); + short_array.close(); + int_array.close(); + + /* Check results */ + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || + src[1].tdim!=dst[1].tdim || + src[1].coll_ids[0]!=dst[1].coll_ids[0] || + src[1].coll_ids[1]!=dst[1].coll_ids[1] || + src[1].coll_ids[2]!=dst[1].coll_ids[2] || + src[1].coll_ids[3]!=dst[1].coll_ids[3]) + { H5_FAILED(); } + + /* Free memory buffers */ + free(buf); + free(bkg); + dst = NULL; + PASSED(); } // end of try block catch (Exception& E) @@ -564,16 +564,16 @@ static void test_compound_5() /*------------------------------------------------------------------------- - * Function: test_compound_6 + * Function: test_compound_6 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -582,72 +582,72 @@ static void test_compound_5() static void test_compound_6() { typedef struct { - short b; - short d; + short b; + short d; } src_typ_t; typedef struct { - long b; - long d; + long b; + long d; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; // Output message about test being performed SUBTEST("Compound Element Growing"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); - for (i=0; ib = (i*8+1) & 0x7fff; - s_ptr->d = (i*8+6) & 0x7fff; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - CompType st(sizeof(src_typ_t)); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); - - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ib != d_ptr->b || - s_ptr->d != d_ptr->d) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d - << "}" << endl; - cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d - << "}" << endl; - } // if - } // for - - /* Release resources */ - free(buf); - free(bkg); - free(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + for (i=0; ib = (i*8+1) & 0x7fff; + s_ptr->d = (i*8+6) & 0x7fff; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + CompType st(sizeof(src_typ_t)); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); + + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ib != d_ptr->b || + s_ptr->d != d_ptr->d) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d + << "}" << endl; + cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d + << "}" << endl; + } // if + } // for + + /* Release resources */ + free(buf); + free(bkg); + free(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -657,15 +657,15 @@ static void test_compound_6() } // test_compound_6() /*------------------------------------------------------------------------- - * Function: test_compound_7 + * Function: test_compound_7 * - * Purpose: Tests inserting fields into compound datatypes when the field - * overlaps the end of the compound datatype. + * Purpose: Tests inserting fields into compound datatypes when the field + * overlaps the end of the compound datatype. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -674,47 +674,47 @@ static void test_compound_6() static void test_compound_7() { typedef struct { - int a; - float b; - long c; + int a; + float b; + long c; } s1_typ_t; typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } s2_typ_t; // Output message about test being performed SUBTEST("Compound Element Insertion"); try { - CompType tid1(sizeof(s1_typ_t)); + CompType tid1(sizeof(s1_typ_t)); - tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); + tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); - size_t type_size = tid1.getSize(); - verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); + size_t type_size = tid1.getSize(); + verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); - CompType tid2; - tid2.copy(tid1); + CompType tid2; + tid2.copy(tid1); - type_size = tid2.getSize(); - verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); + type_size = tid2.getSize(); + verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); - /* Should not be able to insert field past end of compound datatype */ - try { - tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); - } catch (DataTypeIException& err) {} + /* Should not be able to insert field past end of compound datatype */ + try { + tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); + } catch (DataTypeIException& err) {} - /* Release resources */ - tid1.close(); - tid2.close(); - PASSED(); + /* Release resources */ + tid1.close(); + tid2.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -724,13 +724,13 @@ static void test_compound_7() } // test_compound_7() /*------------------------------------------------------------------------- - * Function: test_compound_set_size + * Function: test_compound_set_size * - * Purpose: Tests member function setSize() on compound datatype + * Purpose: Tests member function setSize() on compound datatype * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use partial C version test_ooo_order) + * Programmer: Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 * * Modifications: @@ -741,7 +741,7 @@ const H5std_string COMPFILE("tcompound_types.h5"); static void test_compound_set_size() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; // Output message about test being performed @@ -758,53 +758,53 @@ static void test_compound_set_size() dtype.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); dtype.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - // Verify that the compound is not packed - // bool packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // bool packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - dtype.commit(file, "dtype"); + dtype.commit(file, "dtype"); - // Close the type and file - dtype.close(); - file.close(); + // Close the type and file + dtype.close(); + file.close(); - // Open the file for read/write - file.openFile(COMPFILE, H5F_ACC_RDWR); + // Open the file for read/write + file.openFile(COMPFILE, H5F_ACC_RDWR); - // Open the data type "dtype" - CompType dtype_tmp = file.openCompType("dtype"); + // Open the data type "dtype" + CompType dtype_tmp = file.openCompType("dtype"); - // Make a copy of the data type - dtype.copy(dtype_tmp); + // Make a copy of the data type + dtype.copy(dtype_tmp); - // Verify that the compound is not packed - // packed = dtype_tmp.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // packed = dtype_tmp.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Expand the type, and verify that it became unpacked - dtype.setSize((size_t)33); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Expand the type, and verify that it became unpacked + dtype.setSize((size_t)33); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size - size_t new_size = dtype.getSize(); - verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size + size_t new_size = dtype.getSize(); + verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); - // Shrink the type, and verify that it became packed - dtype.setSize((size_t)32); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); + // Shrink the type, and verify that it became packed + dtype.setSize((size_t)32); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size again - new_size = dtype.getSize(); - verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size again + new_size = dtype.getSize(); + verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); - /* Close types and file */ - dtype_tmp.close(); - dtype.close(); - file.close(); + /* Close types and file */ + dtype_tmp.close(); + dtype.close(); + file.close(); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -814,14 +814,14 @@ static void test_compound_set_size() } // test_compound_set_size() /*------------------------------------------------------------------------- - * Function: test_compound + * Function: test_compound * - * Purpose: Main compound datatype testing routine + * Purpose: Main compound datatype testing routine * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler - * January 2007 + * Programmer: Binh-Minh Ribler + * January 2007 * * Modifications: * @@ -834,23 +834,23 @@ void test_compound() //MESSAGE("Testing Compound Data Type operations\n"); MESSAGE(5, ("Testing Compound Data Type operations\n")); - test_compound_1(); // various things about compound data types - test_compound_2(); // compound element reordering - test_compound_3(); // compound datatype subset conversions - test_compound_4(); // compound element shrinking & reordering - test_compound_5(); // optimized struct converter - test_compound_6(); // compound element growing - test_compound_7(); // compound element insertion - test_compound_set_size(); // set size on compound data types + test_compound_1(); // various things about compound data types + test_compound_2(); // compound element reordering + test_compound_3(); // compound datatype subset conversions + test_compound_4(); // compound element shrinking & reordering + test_compound_5(); // optimized struct converter + test_compound_6(); // compound element growing + test_compound_7(); // compound element insertion + test_compound_set_size(); // set size on compound data types } // test_compound() /*------------------------------------------------------------------------- - * Function: cleanup_compound + * Function: cleanup_compound * - * Purpose: Cleanup temporary test files - nothing at this time. + * Purpose: Cleanup temporary test files - nothing at this time. * - * Return: none + * Return: none * * Modifications: * diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 3c04b67..8c2cf3e 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE tdspl.cpp - HDF5 C++ testing the dataset memory and transfer property - list functionality + list functionality ***************************************************************************/ @@ -48,70 +48,70 @@ static void test_transfplist() SUBTEST("DSetMemXferPropList::set/getDataTransform()"); try { - // Create various data set prop lists and set data transform expression. - DSetMemXferPropList dxpl_c_to_f(c_to_f); - - DSetMemXferPropList dxpl_simple; - dxpl_simple.setDataTransform(simple); - - DSetMemXferPropList dxpl_utrans_inv; - dxpl_utrans_inv.setDataTransform(utrans_inv); - - // - // Make a copy of one of those prop lists then read the data transform - // expression and verify that it's the same as the original. - // - - // Copy the prop list. - DSetMemXferPropList dxpl_c_to_f_copy; - dxpl_c_to_f_copy.copy(dxpl_c_to_f); - - // Find out the length of the transform expression, allocate the buffer - // for it, then read and verify the expression from the copied plist - ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); - char *c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // - // Read the expression of each of the prop lists and verify the read - // expression - // - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) - tran_len = dxpl_c_to_f.getDataTransform(NULL); - c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // Get and verify the expression with: - // H5std_string DSetMemXferPropList::getDataTransform() - H5std_string simple_read = dxpl_simple.getDataTransform(); - verify_val((const char*)simple_read.c_str(), (const char*)simple, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size) - tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); - char *utrans_inv_read = (char *)HDmalloc(tran_len+1); - HDmemset(utrans_inv_read, 0, tran_len+1); - dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); - verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(utrans_inv_read); - - PASSED(); + // Create various data set prop lists and set data transform expression. + DSetMemXferPropList dxpl_c_to_f(c_to_f); + + DSetMemXferPropList dxpl_simple; + dxpl_simple.setDataTransform(simple); + + DSetMemXferPropList dxpl_utrans_inv; + dxpl_utrans_inv.setDataTransform(utrans_inv); + + // + // Make a copy of one of those prop lists then read the data transform + // expression and verify that it's the same as the original. + // + + // Copy the prop list. + DSetMemXferPropList dxpl_c_to_f_copy; + dxpl_c_to_f_copy.copy(dxpl_c_to_f); + + // Find out the length of the transform expression, allocate the buffer + // for it, then read and verify the expression from the copied plist + ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); + char *c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // + // Read the expression of each of the prop lists and verify the read + // expression + // + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) + tran_len = dxpl_c_to_f.getDataTransform(NULL); + c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // Get and verify the expression with: + // H5std_string DSetMemXferPropList::getDataTransform() + H5std_string simple_read = dxpl_simple.getDataTransform(); + verify_val((const char*)simple_read.c_str(), (const char*)simple, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size) + tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); + char *utrans_inv_read = (char *)HDmalloc(tran_len+1); + HDmemset(utrans_inv_read, 0, tran_len+1); + dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); + verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(utrans_inv_read); + + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); } } diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 21a5a7d..4a5336e 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -28,16 +28,16 @@ base functionality testing. EXTERNAL ROUTINES/VARIABLES: - TestInit(...) -- Initialize testing framework - TestInfo(...) -- Print test info - AddTest(...) -- Setup a test function and add it to the list of tests - TestParseCmdLine(...) -- Parse command line arguments - PerformTests() -- Perform requested testing - GetTestSummary() -- Retrieve Summary request value - TestSummary() -- Display test summary - GetTestCleanup() -- Retrieve Cleanup request value - TestCleanup() -- Clean up files from testing - GetTestNumErrs() -- Retrieve the number of testing errors + TestInit(...) -- Initialize testing framework + TestInfo(...) -- Print test info + AddTest(...) -- Setup a test function and add it to the list of tests + TestParseCmdLine(...) -- Parse command line arguments + PerformTests() -- Perform requested testing + GetTestSummary() -- Retrieve Summary request value + TestSummary() -- Display test summary + GetTestCleanup() -- Retrieve Cleanup request value + TestCleanup() -- Clean up files from testing + GetTestNumErrs() -- Retrieve the number of testing errors ***************************************************************************/ @@ -53,8 +53,8 @@ using std::endl; #endif // H5_NO_STD -#include "h5test.h" // C test header file -#include "H5Cpp.h" // C++ API header file +#include "h5test.h" // C test header file +#include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5cpputil.h" // C++ utilility header file @@ -64,45 +64,45 @@ main(int argc, char *argv[]) { try { - // Turn of the auto-printing when failure occurs so that we can - // handle the errors appropriately since sometime failures are - // caused deliberately and expected. - Exception::dontPrint(); - /* Initialize testing framework */ - TestInit(argv[0], NULL, NULL); - - // testing file creation and opening in tfile.cpp - AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); - // testing dataset functionalities in dset.cpp - AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); - // testing dataspace functionalities in th5s.cpp - AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); - // testing attribute functionalities in tattr.cpp - AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); - // testing object functionalities in tobject.cpp - AddTest("tobject", test_object, cleanup_object, "Objects", NULL); - // testing reference functionalities in trefer.cpp - AddTest("trefer", test_reference, cleanup_reference, "References", NULL); - // testing variable-length strings in tvlstr.cpp - AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); - AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); - AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); - AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); - AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); - AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); - AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); + // Turn of the auto-printing when failure occurs so that we can + // handle the errors appropriately since sometime failures are + // caused deliberately and expected. + Exception::dontPrint(); + /* Initialize testing framework */ + TestInit(argv[0], NULL, NULL); + + // testing file creation and opening in tfile.cpp + AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); + // testing dataset functionalities in dset.cpp + AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); + // testing dataspace functionalities in th5s.cpp + AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); + // testing attribute functionalities in tattr.cpp + AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); + // testing object functionalities in tobject.cpp + AddTest("tobject", test_object, cleanup_object, "Objects", NULL); + // testing reference functionalities in trefer.cpp + AddTest("trefer", test_reference, cleanup_reference, "References", NULL); + // testing variable-length strings in tvlstr.cpp + AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); + AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); + AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); + AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); + AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); + AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); + AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); /* Comment out tests that are not done yet. - BMR, Feb 2001 - AddTest("select", test_select, cleanup_select, "Selections", NULL); - AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); - AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); - AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); - AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); - AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); + AddTest("select", test_select, cleanup_select, "Selections", NULL); + AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); + AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); + AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); + AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); + AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); Comment out tests that are not done yet */ /* Tentative - BMR 2007/1/12 - AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); + AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); */ } catch (Exception& E) diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 11cc33e..bd229d7 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -35,10 +35,10 @@ using std::endl; #endif // H5_NO_STD -#include "H5Cpp.h" // C++ API header file +#include "H5Cpp.h" // C++ API header file using namespace H5; -#include "h5cpputil.h" // C++ utilility header file +#include "h5cpputil.h" // C++ utilility header file const hsize_t F1_USERBLOCK_SIZE = (hsize_t)0; const size_t F1_OFFSET_SIZE = sizeof(haddr_t); @@ -76,12 +76,12 @@ const H5std_string FILE4("tfile4.h5"); * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -100,81 +100,81 @@ static void test_file_create() // Setting this to NULL for cleaning up in failure situations H5File* file1 = NULL; try { - // Create file FILE1 - file1 = new H5File (FILE1, H5F_ACC_EXCL); - - // try to create the same file with H5F_ACC_TRUNC. This should fail - // because file1 is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); - } - catch (FileIException& E) // catch truncating existing file - {} // do nothing, FAIL expected - - // Close file1 - delete file1; - file1 = NULL; - - // Try again with H5F_ACC_EXCL. This should fail because the file - // already exists from the previous steps. - try { - H5File file2(FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "File already exists."); - } - catch (FileIException& E) // catching creating existing file - {} // do nothing, FAIL expected - - // Test create with H5F_ACC_TRUNC. This will truncate the existing file. - file1 = new H5File (FILE1, H5F_ACC_TRUNC); - - // Try to create first file again. This should fail because file1 - // is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); - } - catch (FileIException& E) // catching truncating opened file - {} // do nothing, FAIL expected - - // Try with H5F_ACC_EXCL. This should fail too because the file already - // exists. - try { - H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); - } - catch (FileIException& E) // catching H5F_ACC_EXCL on existing file - {} // do nothing, FAIL expected - - // Get the file-creation template - FileCreatPropList tmpl1 = file1->getCreatePlist(); - - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + // Create file FILE1 + file1 = new H5File (FILE1, H5F_ACC_EXCL); + + // try to create the same file with H5F_ACC_TRUNC. This should fail + // because file1 is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); + } + catch (FileIException& E) // catch truncating existing file + {} // do nothing, FAIL expected + + // Close file1 + delete file1; + file1 = NULL; + + // Try again with H5F_ACC_EXCL. This should fail because the file + // already exists from the previous steps. + try { + H5File file2(FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "File already exists."); + } + catch (FileIException& E) // catching creating existing file + {} // do nothing, FAIL expected + + // Test create with H5F_ACC_TRUNC. This will truncate the existing file. + file1 = new H5File (FILE1, H5F_ACC_TRUNC); + + // Try to create first file again. This should fail because file1 + // is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); + } + catch (FileIException& E) // catching truncating opened file + {} // do nothing, FAIL expected + + // Try with H5F_ACC_EXCL. This should fail too because the file already + // exists. + try { + H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); + } + catch (FileIException& E) // catching H5F_ACC_EXCL on existing file + {} // do nothing, FAIL expected + + // Get the file-creation template + FileCreatPropList tmpl1 = file1->getCreatePlist(); + + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // tmpl1 is automatically closed; if error occurs, it'll be - // caught in the catch block + // tmpl1 is automatically closed; if error occurs, it'll be + // caught in the catch block - // Close first file - delete file1; + // Close first file + delete file1; } catch (InvalidActionException& E) { @@ -186,7 +186,7 @@ static void test_file_create() // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); if (file1 != NULL) // clean up delete file1; } @@ -195,79 +195,79 @@ static void test_file_create() FileCreatPropList* tmpl1 = NULL; try { - // Create a new file with a non-standard file-creation template - tmpl1 = new FileCreatPropList; + // Create a new file with a non-standard file-creation template + tmpl1 = new FileCreatPropList; - // Set the new file-creation parameters - tmpl1->setUserblock (F2_USERBLOCK_SIZE); - tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); - tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); + // Set the new file-creation parameters + tmpl1->setUserblock (F2_USERBLOCK_SIZE); + tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); + tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); - // Try to create second file, with non-standard file-creation template - // params. - H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); + // Try to create second file, with non-standard file-creation template + // params. + H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Get the file-creation template - tmpl1 = new FileCreatPropList (file2.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file2.getCreatePlist()); - // Get the file-creation parameters - hsize_t ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters + unsigned iparm1,iparm2; // file-creation parameters tmpl1->getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Clone the file-creation template - FileCreatPropList tmpl2; - tmpl2.copy (*tmpl1); + // Clone the file-creation template + FileCreatPropList tmpl2; + tmpl2.copy (*tmpl1); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Set the new file-creation parameter - tmpl2.setUserblock( F3_USERBLOCK_SIZE ); + // Set the new file-creation parameter + tmpl2.setUserblock( F3_USERBLOCK_SIZE ); - // Try to create second file, with non-standard file-creation template - // params - H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); + // Try to create second file, with non-standard file-creation template + // params + H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); - // Get the file-creation template - tmpl1 = new FileCreatPropList (file3.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file3.getCreatePlist()); - // Get the file-creation parameters - ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - tmpl1->getSymk( iparm1, iparm2); - verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + tmpl1->getSymk( iparm1, iparm2); + verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Release file-creation template - delete tmpl1; - PASSED(); + // Release file-creation template + delete tmpl1; + PASSED(); } // catch all exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); - if (tmpl1 != NULL) // clean up - delete tmpl1; + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + if (tmpl1 != NULL) // clean up + delete tmpl1; } } // test_file_create() @@ -283,12 +283,12 @@ static void test_file_create() * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -299,53 +299,53 @@ static void test_file_open() try { - // Open first file - H5File file1 (FILE2, H5F_ACC_RDWR ); + // Open first file + H5File file1 (FILE2, H5F_ACC_RDWR ); - // Get the file-creation template - FileCreatPropList tmpl1 = file1.getCreatePlist(); + // Get the file-creation template + FileCreatPropList tmpl1 = file1.getCreatePlist(); - // Get the file-creation parameters - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Test H5File constructor with existing file id - H5File file2(file1.getId()); - file1.close(); + // Test H5File constructor with existing file id + H5File file2(file1.getId()); + file1.close(); - // Try truncating the file, and it should fail because the file is - // still opened with file2. - try { - H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E + // Try truncating the file, and it should fail because the file is + // still opened with file2. + try { + H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); - } - catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file - {} // do nothing, FAIL expected + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); + } + catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file + {} // do nothing, FAIL expected - // Now, really close the file. - file2.close(); + // Now, really close the file. + file2.close(); - // Truncating should succeed now. - H5File file3(FILE2, H5F_ACC_TRUNC); + // Truncating should succeed now. + H5File file3(FILE2, H5F_ACC_TRUNC); - // Opening another file to file3 object, FILE2 should be closed, so - // the next attempt to truncate FILE2 should succeed. - file3.openFile(FILE1, H5F_ACC_RDONLY); - H5File file4(FILE2, H5F_ACC_TRUNC); + // Opening another file to file3 object, FILE2 should be closed, so + // the next attempt to truncate FILE2 should succeed. + file3.openFile(FILE1, H5F_ACC_RDONLY); + H5File file4(FILE2, H5F_ACC_TRUNC); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -374,7 +374,7 @@ static void test_file_size() // Output message about test being performed SUBTEST("File Size"); - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template try { @@ -382,13 +382,13 @@ static void test_file_size() // list object to pass in H5File::H5File FileAccPropList fapl(fapl_id); - // Set to sec2 driver. Do we want to test other file drivers? + // Set to sec2 driver. Do we want to test other file drivers? // They're not tested in C++. // File drivers seem not implemented. - // fapl.setSec2(); + // fapl.setSec2(); // Create a file - H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Get file size hsize_t file_size = file4.getFileSize(); @@ -397,14 +397,14 @@ static void test_file_size() if (file_size < 1*KB || file_size > 4*KB) issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFileSize() returned unreasonable value"); - // Get the amount of free space in the file - hssize_t free_space = file4.getFreeSpace(); + // Get the amount of free space in the file + hssize_t free_space = file4.getFreeSpace(); - // Check if it's reasonable. It's 0 now. - if (free_space < 0 || free_space > 4*KB) - issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); + // Check if it's reasonable. It's 0 now. + if (free_space < 0 || free_space > 4*KB) + issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -432,14 +432,14 @@ static void test_file_size() * *------------------------------------------------------------------------- */ -const int RANK = 2; -const int NX = 4; -const int NY = 5; -const H5std_string GROUPNAME ("group"); -const H5std_string DSETNAME ("dataset"); -const H5std_string DATTRNAME ("dataset attribute"); -const H5std_string FATTRNAME ("file attribute"); -const H5std_string DTYPENAME ("compound"); +const int RANK = 2; +const int NX = 4; +const int NY = 5; +const H5std_string GROUPNAME ("group"); +const H5std_string DSETNAME ("dataset"); +const H5std_string DATTRNAME ("dataset attribute"); +const H5std_string FATTRNAME ("file attribute"); +const H5std_string DTYPENAME ("compound"); // Compound datatype typedef struct s1_t { @@ -455,51 +455,51 @@ static void test_file_name() H5std_string file_name; try { // Create a file using default properties. - H5File file4(FILE4, H5F_ACC_TRUNC); + H5File file4(FILE4, H5F_ACC_TRUNC); // Get file name from the file instance. file_name = file4.getFileName(); - verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); + verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); - // Create a group in the root group. - Group group(file4.createGroup(GROUPNAME, 0)); + // Create a group in the root group. + Group group(file4.createGroup(GROUPNAME, 0)); - // Get and verify file name via a group. - file_name = group.getFileName(); - verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); + // Get and verify file name via a group. + file_name = group.getFileName(); + verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); - // Create the data space. - hsize_t dims[RANK] = {NX, NY}; - DataSpace space(RANK, dims); + // Create the data space. + hsize_t dims[RANK] = {NX, NY}; + DataSpace space(RANK, dims); - // Create a new dataset. - DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset. + DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via a dataset. - file_name = dataset.getFileName(); - verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); + // Get and verify file name via a dataset. + file_name = dataset.getFileName(); + verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); - // Create an attribute for the dataset. - Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset. + Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - // Create a compound datatype. - CompType comp_type (sizeof(s1_t)); + // Create a compound datatype. + CompType comp_type (sizeof(s1_t)); - // Insert fields. - comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); - comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); + // Insert fields. + comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); + comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); - // Save it on file. - comp_type.commit(file4, DTYPENAME); + // Save it on file. + comp_type.commit(file4, DTYPENAME); - // Get and verify file name via a committed datatype. - comp_type.getFileName(); - verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); - PASSED(); + // Get and verify file name via a committed datatype. + comp_type.getFileName(); + verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); + PASSED(); } // end of try block catch (Exception& E) @@ -510,13 +510,13 @@ static void test_file_name() } // test_file_name() -#define NUM_OBJS 4 -#define NUM_ATTRS 3 -const int RANK1 = 1; -const int ATTR1_DIM1 = 3; -const H5std_string FILE5("tfattrs.h5"); -const H5std_string FATTR1_NAME ("file attribute 1"); -const H5std_string FATTR2_NAME ("file attribute 2"); +#define NUM_OBJS 4 +#define NUM_ATTRS 3 +const int RANK1 = 1; +const int ATTR1_DIM1 = 3; +const H5std_string FILE5("tfattrs.h5"); +const H5std_string FATTR1_NAME ("file attribute 1"); +const H5std_string FATTR2_NAME ("file attribute 2"); int fattr_data[ATTR1_DIM1]={512,-234,98123}; /* Test data for file attribute */ int dattr_data[ATTR1_DIM1]={256,-123,1000}; /* Test data for dataset attribute */ @@ -531,89 +531,89 @@ static void test_file_attribute() H5std_string file_name; try { // Create a file using default properties. - H5File file5(FILE5, H5F_ACC_TRUNC); + H5File file5(FILE5, H5F_ACC_TRUNC); - // Create the data space - hsize_t dims[RANK1] = {ATTR1_DIM1}; - DataSpace space(RANK1, dims); + // Create the data space + hsize_t dims[RANK1] = {ATTR1_DIM1}; + DataSpace space(RANK1, dims); - // Create two attributes for the file - Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); - Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Create two attributes for the file + Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); + Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - fattr2.write(PredType::NATIVE_INT, fattr_data); + fattr2.write(PredType::NATIVE_INT, fattr_data); - try { - // Try to create the same attribute again (should fail) - Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); - } - catch (AttributeIException& E) // catch creating existing attribute - {} // do nothing, FAIL expected + try { + // Try to create the same attribute again (should fail) + Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); + } + catch (AttributeIException& E) // catch creating existing attribute + {} // do nothing, FAIL expected - // Create a new dataset - DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset + DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Create an attribute for the dataset - Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset + Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Write data to the second file attribute - dattr.write(PredType::NATIVE_INT, dattr_data); + // Write data to the second file attribute + dattr.write(PredType::NATIVE_INT, dattr_data); - // Test flushing out the data from the attribute object + // Test flushing out the data from the attribute object dattr.flush(H5F_SCOPE_GLOBAL); - // Get and verify the number of all objects in the file - // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. - ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); - verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); - - num_objs = file5.getObjCount(H5F_OBJ_GROUP); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATASET); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_ATTR); - verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_FILE); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); - - // Get the file name using the attributes - H5std_string fname = fattr1.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - fname.clear(); - fname = dattr.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - // Get the class of a file attribute's datatype - H5T_class_t atclass = fattr1.getTypeClass(); - verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a file - int n_attrs = file5.getNumAttrs(); - verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a dataset - n_attrs = 0; - n_attrs = dataset.getNumAttrs(); - verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); - - // Read back attribute's data - HDmemset(rdata, 0, sizeof(rdata)); + // Get and verify the number of all objects in the file + // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. + ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); + verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); + + num_objs = file5.getObjCount(H5F_OBJ_GROUP); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATASET); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_ATTR); + verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_FILE); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); + + // Get the file name using the attributes + H5std_string fname = fattr1.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + fname.clear(); + fname = dattr.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + // Get the class of a file attribute's datatype + H5T_class_t atclass = fattr1.getTypeClass(); + verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a file + int n_attrs = file5.getNumAttrs(); + verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a dataset + n_attrs = 0; + n_attrs = dataset.getNumAttrs(); + verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); + + // Read back attribute's data + HDmemset(rdata, 0, sizeof(rdata)); dattr.read(PredType::NATIVE_INT, rdata); /* Check results */ for (i = 0; i < ATTR1_DIM1; i++) { if (rdata[i] != dattr_data[i]) { H5_FAILED(); - cerr << endl; + cerr << endl; cerr << "element [" << i << "] is " << rdata[i] << - "but should have been " << dattr_data[i] << endl; + "but should have been " << dattr_data[i] << endl; } } - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -622,28 +622,28 @@ static void test_file_attribute() } } // test_file_attribute() -const H5std_string FILE6("tfile5.h5"); -const H5std_string ROOTGROUP("/"); -const H5std_string GROUP1("/G1"); -const H5std_string SUBGROUP3("/G1/G3"); +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); /*------------------------------------------------------------------------- - * Function: test_libver_bounds_real + * Function: test_libver_bounds_real * - * Purpose: Verify that a file created and modified with the - * specified libver bounds has the specified object header - * versions for the right objects. + * Purpose: Verify that a file created and modified with the + * specified libver bounds has the specified object header + * versions for the right objects. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * March, 2015 + * Programmer: Binh-Minh Ribler (use C version) + * March, 2015 * *------------------------------------------------------------------------- */ static void test_libver_bounds_real( - H5F_libver_t libver_create, unsigned oh_vers_create, - H5F_libver_t libver_mod, unsigned oh_vers_mod) + H5F_libver_t libver_create, unsigned oh_vers_create, + H5F_libver_t libver_mod, unsigned oh_vers_mod) { try { @@ -716,7 +716,7 @@ static void test_libver_bounds_real( * Function: test_libver_bounds * * Purpose: Verify that a file created and modified with various - * libver bounds is handled correctly. + * libver bounds is handled correctly. * * Return: None * @@ -756,21 +756,21 @@ void test_file() // Output message about test being performed MESSAGE(5, ("Testing File I/O Operations\n")); - test_file_create(); // Test file creation (also creation templates) - test_file_open(); // Test file opening - test_file_size(); // Test file size - test_file_name(); // Test getting file's name - test_file_attribute(); // Test file attribute feature - test_libver_bounds(); // Test format version + test_file_create(); // Test file creation (also creation templates) + test_file_open(); // Test file opening + test_file_size(); // Test file size + test_file_name(); // Test getting file's name + test_file_attribute(); // Test file attribute feature + test_libver_bounds(); // Test format version } // test_file() /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * * Programmer: (use C version) * diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 101ec07..a60403f 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -36,15 +36,15 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file -#define DSET_DIM1 100 -#define DSET_DIM2 200 +#define DSET_DIM1 100 +#define DSET_DIM2 200 #define FILTER_CHUNK_DIM1 2 #define FILTER_CHUNK_DIM2 25 // will do this function later or use it as guideline - BMR - 2007/01/26 #if 0 static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, - int if_fletcher32, int corrupted, hsize_t *dset_size) + int if_fletcher32, int corrupted, hsize_t *dset_size) { cerr << "do nothing right now" << endl; return(0); @@ -98,17 +98,17 @@ filter_bogus(size_t nbytes) } /*------------------------------------------------------------------------- - * Function: test_null_filter + * Function: test_null_filter * - * Purpose: Test null I/O filter by itself. + * Purpose: Test null I/O filter by itself. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version, from dsets.c/test_filters) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version, from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -121,25 +121,25 @@ static void test_null_filter() // Output message about test being performed SUBTEST("'Null' filter"); try { - //hsize_t null_size; // Size of dataset with null filter + //hsize_t null_size; // Size of dataset with null filter - // Prepare dataset create property list - DSetCreatPropList dsplist; - dsplist.setChunk(2, chunk_size); + // Prepare dataset create property list + DSetCreatPropList dsplist; + dsplist.setChunk(2, chunk_size); - if (H5Zregister (H5Z_BOGUS)<0) + if (H5Zregister (H5Z_BOGUS)<0) throw Exception("test_null_filter", "H5Zregister failed"); - // Set some pretent filter - dsplist.setFilter(H5Z_FILTER_BOGUS); + // Set some pretent filter + dsplist.setFilter(H5Z_FILTER_BOGUS); - // this function is just a stub right now; will work on it later - BMR - //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) + // this function is just a stub right now; will work on it later - BMR + //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) // throw Exception("test_null_filter", "test_filter_internal failed"); - // Close objects. - dsplist.close(); - PASSED(); + // Close objects. + dsplist.close(); + PASSED(); } // end of try // catch all other exceptions @@ -150,17 +150,17 @@ static void test_null_filter() } // test_null_filter /*------------------------------------------------------------------------- - * Function: test_szip_filter + * Function: test_szip_filter * - * Purpose: Test SZIP filter by itself. + * Purpose: Test SZIP filter by itself. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (partly from dsets.c/test_filters) - * January, 2007 + * Programmer: Binh-Minh Ribler (partly from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -235,7 +235,7 @@ static void test_szip_filter(H5File& file1) delete[] tconv_buf; } // if szip presents else { - SKIPPED(); + SKIPPED(); } #else /* H5_HAVE_FILTER_SZIP */ @@ -269,9 +269,9 @@ void test_filters() H5File file1(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Test basic VL string datatype - test_null_filter(); - test_szip_filter(file1); + // Test basic VL string datatype + test_null_filter(); + test_szip_filter(file1); } catch (Exception& E) { @@ -280,13 +280,13 @@ void test_filters() } // test_filters() /*------------------------------------------------------------------------- - * Function: cleanup_filters + * Function: cleanup_filters * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 10, 1999 * * Modifications: diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 16d1c57..5b517ff 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -34,11 +34,11 @@ using std::endl; #endif // H5_NO_STD -#include "H5Cpp.h" // C++ API header file +#include "H5Cpp.h" // C++ API header file using namespace H5; -#include "h5cpputil.h" // C++ utilility header file -#include "H5srcdir.h" // srcdir querying header file +#include "h5cpputil.h" // C++ utilility header file +#include "H5srcdir.h" // srcdir querying header file const H5std_string TESTFILE("th5s.h5"); const H5std_string DATAFILE("th5s1.h5"); @@ -89,22 +89,22 @@ int space5_data = 7; /*------------------------------------------------------------------------- * - * Function: test_h5s_basic + * Function: test_h5s_basic * - * Purpose: Test basic H5S (dataspace) code + * Purpose: Test basic H5S (dataspace) code * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * April 12, 2011: Raymond Lu * Starting from the 1.8.7 release, we allow dimension * size to be zero. So I took out the test against it. @@ -112,101 +112,101 @@ int space5_data = 7; */ static void test_h5s_basic() { - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, - SPACE2_DIM4}; - hsize_t dims3[H5S_MAX_RANK+1]; - hsize_t tmax[4]; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, + SPACE2_DIM4}; + hsize_t dims3[H5S_MAX_RANK+1]; + hsize_t tmax[4]; // Output message about test being performed SUBTEST("Dataspace Manipulation"); try { - // Create simple dataspace sid1 - DataSpace sid1 (SPACE1_RANK, dims1 ); - - // Get simple extent npoints of the dataspace sid1 and verify it - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid1 and verify it - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create simple dataspace sid2 - hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; - DataSpace sid2 (SPACE2_RANK, dims2, max2); - - // Get simple extent npoints of dataspace sid2 and verify it - n = sid2.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid2 and verify it - rank = sid2.getSimpleExtentNdims(); - verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size and max size of dataspace sid2 and - // verify them - ndims = sid2.getSimpleExtentDims( tdims, tmax ); - verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Check to be sure we can't create a simple data space that has too - // many dimensions. - try { - DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); - } - catch (DataSpaceIException& E) // Simple data space with too many dims - {} // do nothing, exception expected + // Create simple dataspace sid1 + DataSpace sid1 (SPACE1_RANK, dims1 ); + + // Get simple extent npoints of the dataspace sid1 and verify it + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid1 and verify it + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create simple dataspace sid2 + hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; + DataSpace sid2 (SPACE2_RANK, dims2, max2); + + // Get simple extent npoints of dataspace sid2 and verify it + n = sid2.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid2 and verify it + rank = sid2.getSimpleExtentNdims(); + verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size and max size of dataspace sid2 and + // verify them + ndims = sid2.getSimpleExtentDims( tdims, tmax ); + verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Check to be sure we can't create a simple data space that has too + // many dimensions. + try { + DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); + } + catch (DataSpaceIException& E) // Simple data space with too many dims + {} // do nothing, exception expected /* - * Try reading a file that has been prepared that has a dataset with a - * higher dimensionality than what the library can handle. - * - * If this test fails and the H5S_MAX_RANK variable has changed, follow - * the instructions in space_overflow.c for regenating the th5s.h5 file. - */ - char *tmp_str = new char[TESTFILE.length()+1]; - strcpy(tmp_str, TESTFILE.c_str()); - const char *testfile = H5_get_srcdir_filename(tmp_str); - delete []tmp_str; - - // Create file - H5File fid1(testfile, H5F_ACC_RDONLY); - - // Try to open the dataset that has higher dimensionality than - // what the library can handle and this operation should fail. - try { - DataSet dset1 = fid1.openDataSet( "dset" ); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); - } - catch (FileIException& E) // catching higher dimensionality dataset - {} // do nothing, exception expected + * Try reading a file that has been prepared that has a dataset with a + * higher dimensionality than what the library can handle. + * + * If this test fails and the H5S_MAX_RANK variable has changed, follow + * the instructions in space_overflow.c for regenating the th5s.h5 file. + */ + char *tmp_str = new char[TESTFILE.length()+1]; + strcpy(tmp_str, TESTFILE.c_str()); + const char *testfile = H5_get_srcdir_filename(tmp_str); + delete []tmp_str; + + // Create file + H5File fid1(testfile, H5F_ACC_RDONLY); + + // Try to open the dataset that has higher dimensionality than + // what the library can handle and this operation should fail. + try { + DataSet dset1 = fid1.openDataSet( "dset" ); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); + } + catch (FileIException& E) // catching higher dimensionality dataset + {} // do nothing, exception expected // CHECK_I(ret, "H5Fclose"); // leave this here, later, fake a failure - // in the p_close see how this will handle it. - BMR + // in the p_close see how this will handle it. - BMR - PASSED(); - } // end of try block + PASSED(); + } // end of try block catch (InvalidActionException& E) { @@ -222,22 +222,22 @@ static void test_h5s_basic() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_write + * Function: test_h5s_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing code + * Purpose: Test scalar H5S (dataspace) writing code * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_write() @@ -246,124 +246,124 @@ static void test_h5s_scalar_write() SUBTEST("Scalar Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); - //n = H5Sget_simple_extent_npoints(sid1); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + //n = H5Sget_simple_extent_npoints(sid1); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Verify extent type - H5S_class_t ext_type; // Extent type - ext_type = sid1.getSimpleExtentType(); - verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); + // Verify extent type + H5S_class_t ext_type; // Extent type + ext_type = sid1.getSimpleExtentType(); + verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); - dataset.write(&space3_data, PredType::NATIVE_UINT); + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + dataset.write(&space3_data, PredType::NATIVE_UINT); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_read + * Function: test_h5s_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading code + * Purpose: Test scalar H5S (dataspace) reading code * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Scalar Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Read data back and verify it - unsigned rdata; // Scalar data read in - dataset.read(&rdata, PredType::NATIVE_UINT); - verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); + // Read data back and verify it + unsigned rdata; // Scalar data read in + dataset.read(&rdata, PredType::NATIVE_UINT); + verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s_null + * Function: test_h5s_null * - * Purpose: Test null H5S (dataspace) code + * Purpose: Test null H5S (dataspace) code * - * Return: none + * Return: none * - * Programmer: Raymond Lu (using C version) + * Programmer: Raymond Lu (using C version) * May 18, 2004 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_null() @@ -372,53 +372,53 @@ static void test_h5s_null() SUBTEST("Null Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(H5S_NULL); + // Create scalar dataspace + DataSpace sid1(H5S_NULL); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Create a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + // Create a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); // Try to write nothing to the dataset - dataset.write(&space5_data, PredType::NATIVE_INT); + dataset.write(&space5_data, PredType::NATIVE_INT); // Read the data. Make sure no change to the buffer - dataset.read(&space5_data, PredType::NATIVE_INT); - verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); + dataset.read(&space5_data, PredType::NATIVE_INT); + verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_null() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_write + * Function: test_h5s_compound_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing for compound - * datatypes + * Purpose: Test scalar H5S (dataspace) writing for compound + * datatypes * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_write() @@ -427,135 +427,135 @@ static void test_h5s_compound_scalar_write() SUBTEST("Compound Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); - - // Create the compound datatype. - CompType tid1(sizeof(struct space4_struct)); - space4_field1_off=HOFFSET(struct space4_struct, c1); - tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, - PredType::NATIVE_SCHAR); - space4_field2_off=HOFFSET(struct space4_struct, u); - tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, - PredType::NATIVE_UINT); - space4_field3_off=HOFFSET(struct space4_struct, f); - tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, - PredType::NATIVE_FLOAT); - space4_field4_off=HOFFSET(struct space4_struct, c2); - tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, - PredType::NATIVE_SCHAR); - - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); - - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); - dataset.write(&space4_data, tid1); - - PASSED(); - } // end of try block + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); + + // Create the compound datatype. + CompType tid1(sizeof(struct space4_struct)); + space4_field1_off=HOFFSET(struct space4_struct, c1); + tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, + PredType::NATIVE_SCHAR); + space4_field2_off=HOFFSET(struct space4_struct, u); + tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, + PredType::NATIVE_UINT); + space4_field3_off=HOFFSET(struct space4_struct, f); + tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, + PredType::NATIVE_FLOAT); + space4_field4_off=HOFFSET(struct space4_struct, c2); + tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, + PredType::NATIVE_SCHAR); + + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); + + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); + dataset.write(&space4_data, tid1); + + PASSED(); + } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_read + * Function: test_h5s_compound_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading for compound - * datatypes + * Purpose: Test scalar H5S (dataspace) reading for compound + * datatypes * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Compound Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Get the datatype of this dataset. - CompType type(dataset); + // Get the datatype of this dataset. + CompType type(dataset); - struct space4_struct rdata; // Scalar data read in - dataset.read(&rdata, type); + struct space4_struct rdata; // Scalar data read in + dataset.read(&rdata, type); - // Verify read data - if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) - { + // Verify read data + if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) + { cerr << "scalar data different: space4_data.c1=" - << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; + << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" - << space4_data.u << ", read_data4.u=" << rdata.u << endl; + << space4_data.u << ", read_data4.u=" << rdata.u << endl; cerr << "scalar data different: space4_data.f=" - << space4_data.f << ", read_data4.f=" << rdata.f << endl; + << space4_data.f << ", read_data4.f=" << rdata.f << endl; TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n", - space4_data.c1, rdata.c2); - } // end if - PASSED(); + space4_data.c1, rdata.c2); + } // end if + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s + * Function: test_h5s * - * Purpose: Main dataspace testing routine + * Purpose: Main dataspace testing routine * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: @@ -567,23 +567,23 @@ void test_h5s() // Output message about test being performed MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); // Test basic H5S code - test_h5s_scalar_write(); // Test scalar H5S writing code - test_h5s_scalar_read(); // Test scalar H5S reading code - test_h5s_null(); // Test null H5S code - test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code - test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code + test_h5s_basic(); // Test basic H5S code + test_h5s_scalar_write(); // Test scalar H5S writing code + test_h5s_scalar_read(); // Test scalar H5S reading code + test_h5s_null(); // Test null H5S code + test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code + test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code } // test_h5s() /*------------------------------------------------------------------------- - * Function: cleanup_h5s + * Function: cleanup_h5s * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 03fe02e..bb1ea17 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -46,8 +46,8 @@ using namespace H5; //#define H5G_TESTING //#include "h5test.h" -//#include "H5Gpkg.h" /* Groups */ -//#include "H5Iprivate.h" /* IDs */ +//#include "H5Gpkg.h" /* Groups */ +//#include "H5Iprivate.h" /* IDs */ //#include "H5Lprivate.h" /* Links */ /* File for external link test. Created with gen_udlinks.c */ @@ -67,39 +67,39 @@ const char *FILENAME[] = { "links6", /* 9 */ "links7", /* 10 */ "links8", /* 11 */ - "extlinks0", /* 12: main files */ - "tmp/extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - "tmp/extlinks1", /* 15: */ - "extlinks2", /* 16: */ - "tmp/extlinks2", /* 17: */ - "extlinks3", /* 18: */ - "tmp/extlinks3", /* 19: */ - "extlinks4", /* 20: */ - "tmp/extlinks4", /* 21: */ - "extlinks5", /* 22: */ - "tmp/extlinks6", /* 23: */ - "extlinks7", /* 24: */ - "tmp/extlinks7", /* 25: */ - "tmp/extlinks8", /* 26: */ - "extlinks9", /* 27: */ - "tmp/extlinks9", /* 28: */ - "extlinks10", /* 29: */ /* TESTS for windows */ - "tmp/extlinks10", /* 30: */ - "tmp/extlinks11", /* 31: */ - "tmp/extlinks12", /* 32: */ - "extlinks13", /* 33: */ - "tmp/extlinks13", /* 34: */ - "tmp/extlinks14", /* 35: */ - "tmp/extlinks15", /* 36: */ - "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ + "extlinks0", /* 12: main files */ + "tmp/extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + "tmp/extlinks1", /* 15: */ + "extlinks2", /* 16: */ + "tmp/extlinks2", /* 17: */ + "extlinks3", /* 18: */ + "tmp/extlinks3", /* 19: */ + "extlinks4", /* 20: */ + "tmp/extlinks4", /* 21: */ + "extlinks5", /* 22: */ + "tmp/extlinks6", /* 23: */ + "extlinks7", /* 24: */ + "tmp/extlinks7", /* 25: */ + "tmp/extlinks8", /* 26: */ + "extlinks9", /* 27: */ + "tmp/extlinks9", /* 28: */ + "extlinks10", /* 29: */ /* TESTS for windows */ + "tmp/extlinks10", /* 30: */ + "tmp/extlinks11", /* 31: */ + "tmp/extlinks12", /* 32: */ + "extlinks13", /* 33: */ + "tmp/extlinks13", /* 34: */ + "tmp/extlinks14", /* 35: */ + "tmp/extlinks15", /* 36: */ + "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + "extlinks18A", /* 40: */ + "extlinks18B", /* 41: */ + "extlinks19A", /* 42: */ + "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ NULL }; @@ -107,12 +107,12 @@ const char *FILENAME[] = { #define TMPDIR "tmp" -#define FAMILY_SIZE 1024 +#define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 -#define NUM400 400 +#define NUM400 400 /* do not do check_all_closed() for "ext*" files and "tmp/ext*" */ -#define EXTSTOP 12 +#define EXTSTOP 12 #define LINK_BUF_SIZE 1024 #define NAME_BUF_SIZE 1024 @@ -326,16 +326,16 @@ static const char *FILENAME[] = { /*------------------------------------------------------------------------- - * Function: test_basic_links + * Function: test_basic_links * - * Purpose: Test building a file with assorted links. + * Purpose: Test building a file with assorted links. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * October 16, 2009 + * Programmer: Binh-Minh Ribler + * October 16, 2009 * * Modifications: * @@ -343,114 +343,114 @@ static const char *FILENAME[] = { */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { - hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + hsize_t size[1] = {1}; + char filename[NAME_BUF_SIZE]; // Use the file access template id to create a file access prop. list. FileAccPropList fapl(fapl_id); try { - if(new_format) - SUBTEST("Link creation (w/new group format)") - else - SUBTEST("Link creation") + if(new_format) + SUBTEST("Link creation (w/new group format)") + else + SUBTEST("Link creation") - h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Create simple dataspace - DataSpace scalar (1, size, size); + // Create simple dataspace + DataSpace scalar (1, size, size); - // Create a group then close it by letting the object go out of scope - { - Group group(file.createGroup("grp1", 0)); - } + // Create a group then close it by letting the object go out of scope + { + Group group(file.createGroup("grp1", 0)); + } - // Create a dataset then close it by letting the object go out of scope - { - DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); - } + // Create a dataset then close it by letting the object go out of scope + { + DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); + } - hid_t file_id = file.getId(); + hid_t file_id = file.getId(); - // Because these are not implemented in the C++ API yet, they are - // used so CommonFG::getLinkval can be tested. - // Create a hard link - if(H5Lcreate_hard( - file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_hard failed"); + // Because these are not implemented in the C++ API yet, they are + // used so CommonFG::getLinkval can be tested. + // Create a hard link + if(H5Lcreate_hard( + file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_hard failed"); - // Create a symbolic link - if(H5Lcreate_soft( - "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link + if(H5Lcreate_soft( + "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a symbolic link to something that doesn't exist - if(H5Lcreate_soft( - "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link to something that doesn't exist + if(H5Lcreate_soft( + "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a recursive symbolic link - if(H5Lcreate_soft( - "/grp1/recursive", file_id, "/grp1/recursive", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a recursive symbolic link + if(H5Lcreate_soft( + "/grp1/recursive", file_id, "/grp1/recursive", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Verify link values before closing the file + // Verify link values before closing the file - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string dngllink_val = file.getLinkval("grp1/dangle"); - verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); + H5std_string dngllink_val = file.getLinkval("grp1/dangle"); + verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } // Open the file and check on the links in it try { - // Open the file above - H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + // Open the file above + H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - // Verify link existence - if(H5Lexists(file.getId(), "dset1", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "dset1 doesn't exist"); - if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "grp1/soft doesn't exist"); + // Verify link existence + if(H5Lexists(file.getId(), "dset1", H5P_DEFAULT) != TRUE) + throw InvalidActionException("H5Lexists", "dset1 doesn't exist"); + if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE) + throw InvalidActionException("H5Lexists", "grp1/soft doesn't exist"); - // Verify link values - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + // Verify link values + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_links + * Function: test_links * - * Purpose: Test links + * Purpose: Test links * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler + * Programmer: Binh-Minh Ribler * October 16, 2009 * *------------------------------------------------------------------------- @@ -458,7 +458,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) extern "C" void test_links() { - hid_t fapl_id, fapl2_id; /* File access property lists */ + hid_t fapl_id, fapl2_id; /* File access property lists */ hbool_t new_format; /* Whether to use the new format or not */ const char *envval; @@ -472,40 +472,40 @@ void test_links() MESSAGE(5, ("Testing Various Links\n")); try { - /* Copy the file access property list */ - if((fapl2_id = H5Pcopy(fapl_id)) < 0) - throw Exception("test_links", "H5Pcopy failed"); - - /* Set the "use the latest version of the format" bounds for creating objects in the file */ - if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - throw Exception("test_links", "H5Pset_libver_bounds failed"); - - /* Loop over using new group format */ - for(new_format = FALSE; new_format <= TRUE; new_format++) - { - hid_t my_fapl_id; - - /* Check for FAPL to use */ - if(new_format) - my_fapl_id = fapl2_id; - else - my_fapl_id = fapl_id; - - /* General tests... (on both old & new format groups */ - // FileAccPropList may be passed in instead of fapl id - test_basic_links(my_fapl_id, new_format); + /* Copy the file access property list */ + if((fapl2_id = H5Pcopy(fapl_id)) < 0) + throw Exception("test_links", "H5Pcopy failed"); + + /* Set the "use the latest version of the format" bounds for creating objects in the file */ + if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + throw Exception("test_links", "H5Pset_libver_bounds failed"); + + /* Loop over using new group format */ + for(new_format = FALSE; new_format <= TRUE; new_format++) + { + hid_t my_fapl_id; + + /* Check for FAPL to use */ + if(new_format) + my_fapl_id = fapl2_id; + else + my_fapl_id = fapl_id; + + /* General tests... (on both old & new format groups */ + // FileAccPropList may be passed in instead of fapl id + test_basic_links(my_fapl_id, new_format); #if 0 // these tests are from the C test links.c and left here for future // implementation of H5L API - nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; - nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; - - /* Test new H5L link creation routine */ - nerrors += test_lcpl(my_fapl, new_format); + nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; + nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; + + /* Test new H5L link creation routine */ + nerrors += test_lcpl(my_fapl, new_format); nerrors += test_move(my_fapl, new_format); nerrors += test_copy(my_fapl, new_format); nerrors += test_move_preserves(my_fapl, new_format); @@ -582,7 +582,7 @@ void test_links() /* do not do this for files used by external link tests */ nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0; #endif // 0 - } /* end for */ + } /* end for */ #if 0 /* New group revision feature tests */ @@ -612,33 +612,33 @@ void test_links() nerrors += group_info_old(fapl) < 0 ? 1 : 0; #endif - /* Close 2nd FAPL */ - H5Pclose(fapl2_id); + /* Close 2nd FAPL */ + H5Pclose(fapl2_id); h5_clean_files(FILENAME, fapl_id); - /* Test that external links can be used after a library reset. MUST be - * called last so the reset doesn't interfere with the property lists. This - * routine will delete its own file. */ - /* nerrors += external_reset_register() < 0 ? 1 : 0; + /* Test that external links can be used after a library reset. MUST be + * called last so the reset doesn't interfere with the property lists. This + * routine will delete its own file. */ + /* nerrors += external_reset_register() < 0 ? 1 : 0; */ } catch (Exception& E) { - issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: cleanup_links + * Function: cleanup_links * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Binh-Minh Ribler - * October 16, 2009 + * Programmer: Binh-Minh Ribler + * October 16, 2009 * * Modifications: * diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index aa6baf3..2639092 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -36,31 +36,31 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE_OBJECTS("tobjects.h5"); -const H5std_string GROUP1("Top Group"); -const H5std_string GROUP1_PATH("/Top Group"); -const H5std_string GROUP1_1("Sub-Group 1.1"); -const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); -const H5std_string GROUP1_2("Sub-Group 1.2"); -const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_IN_FILE("Dataset in File"); -const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); -const H5std_string DSET_IN_GRP1("Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); -const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); +const H5std_string FILE_OBJECTS("tobjects.h5"); +const H5std_string GROUP1("Top Group"); +const H5std_string GROUP1_PATH("/Top Group"); +const H5std_string GROUP1_1("Sub-Group 1.1"); +const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); +const H5std_string GROUP1_2("Sub-Group 1.2"); +const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_IN_FILE("Dataset in File"); +const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); +const H5std_string DSET_IN_GRP1("Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); +const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); /*------------------------------------------------------------------------- - * Function: test_get_objname + * Function: test_get_objname * - * Purpose: Tests getting object name of groups and datasets. + * Purpose: Tests getting object name of groups and datasets. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -71,94 +71,94 @@ static void test_get_objname() SUBTEST("H5Object::getObjName on Groups and Datasets"); try { - // Create file - H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); + // Create file + H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); - // Create a top group and 2 subgroups - Group grp1 = file.createGroup(GROUP1, 0); - Group grp1_1 = grp1.createGroup(GROUP1_1, 0); - Group grp1_2 = grp1.createGroup(GROUP1_2, 0); + // Create a top group and 2 subgroups + Group grp1 = file.createGroup(GROUP1, 0); + Group grp1_1 = grp1.createGroup(GROUP1_1, 0); + Group grp1_2 = grp1.createGroup(GROUP1_2, 0); - // Get part of the group's name, random length using - // ssize_t getObjName(char* comment, size_t buf_size) + // Get part of the group's name, random length using + // ssize_t getObjName(char* comment, size_t buf_size) - // Get the length of the group's name first - ssize_t name_len = grp1.getObjName(NULL); + // Get the length of the group's name first + ssize_t name_len = grp1.getObjName(NULL); - // Random length is 4 - if (name_len > 4) - { - char* grp1_name = new char[5]; - name_len = grp1.getObjName(grp1_name, 5); - verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); - delete []grp1_name; - } + // Random length is 4 + if (name_len > 4) + { + char* grp1_name = new char[5]; + name_len = grp1.getObjName(grp1_name, 5); + verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); + delete []grp1_name; + } - // Create a data space - hsize_t dims[2]; - dims[0] = 2; - dims[1] = 5; - DataSpace space (2, dims, NULL); + // Create a data space + hsize_t dims[2]; + dims[0] = 2; + dims[1] = 5; + DataSpace space (2, dims, NULL); - // Create a dataset in the file - DataSet dsinfile = file.createDataSet(DSET_IN_FILE, - PredType::NATIVE_DOUBLE, space); + // Create a dataset in the file + DataSet dsinfile = file.createDataSet(DSET_IN_FILE, + PredType::NATIVE_DOUBLE, space); - // Create a dataset in the group - DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, - PredType::NATIVE_INT, space); + // Create a dataset in the group + DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, + PredType::NATIVE_INT, space); - // Get and verify the name of each dataset, using - // H5std_string getObjName() and - // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - H5std_string ds_name = dsinfile.getObjName(); - verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of each dataset, using + // H5std_string getObjName() and + // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + H5std_string ds_name = dsinfile.getObjName(); + verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); - name_len = dsingrp.getObjName(ds_name); // default len - verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); + name_len = dsingrp.getObjName(ds_name); // default len + verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Create a dataset in sub-group 1.2 - dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); + // Create a dataset in sub-group 1.2 + dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); - // Get and verify the name of the dataset that belongs to subgroup - // 1.2, using H5std_string getObjName() - ds_name = dsingrp.getObjName(); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of the dataset that belongs to subgroup + // 1.2, using H5std_string getObjName() + ds_name = dsingrp.getObjName(); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Reopen that same dataset then check the name again with another - // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); - name_len = dsingrp.getObjName(ds_name); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Reopen that same dataset then check the name again with another + // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); + name_len = dsingrp.getObjName(ds_name); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objname", __LINE__, __FILE__); + issue_fail_msg("test_get_objname", __LINE__, __FILE__); } } // test_get_objname /*------------------------------------------------------------------------- - * Function: test_get_objname_ontypes + * Function: test_get_objname_ontypes * - * Purpose: Test getting object name from various committed types. + * Purpose: Test getting object name from various committed types. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Binh-Minh Ribler - * March 4, 2014 + * March 4, 2014 * * Modifications: * @@ -169,81 +169,81 @@ static void test_get_objname_ontypes() SUBTEST("H5Object::getObjName on Committed Datatypes"); try { - // Create a file with default prop lists - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - - // Create a group - Group grp = file.createGroup ("typetests"); - - // Create a datatype and save it - IntType inttype(PredType::STD_B8LE); - inttype.commit(file, "INT type of STD_B8LE"); - - // Close the type then open it again to test getting its name - inttype.close(); - inttype = file.openIntType("INT type of STD_B8LE"); - - // Get and verify its name - H5std_string inttype_name = inttype.getObjName(); - verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Make copy of a predefined type and save it - DataType dtype(PredType::STD_B8LE); - dtype.commit(file, "STD_B8LE"); - - // Close the data type and file - dtype.close(); - file.close(); - - // Re-open the file and the data type to test getting its name - file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); - dtype = file.openDataType("STD_B8LE"); - - // Get and verify its name - H5std_string type_name = dtype.getObjName(); - verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test getting type's name from copied type - DataType copied_type; - copied_type.copy(dtype); - copied_type.commit(file, "copy of STD_B8LE"); - type_name = copied_type.getObjName(); - verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test copying an integer predefined type - IntType new_int_type(PredType::NATIVE_INT); - - // Name this datatype - new_int_type.commit(grp, "IntType NATIVE_INT"); - ssize_t name_len = new_int_type.getObjName(type_name); // default len - verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); - verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); - - // Close everything or they can be closed when objects go out of scope - dtype.close(); - copied_type.close(); - new_int_type.close(); - grp.close(); - - PASSED(); + // Create a file with default prop lists + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + + // Create a group + Group grp = file.createGroup ("typetests"); + + // Create a datatype and save it + IntType inttype(PredType::STD_B8LE); + inttype.commit(file, "INT type of STD_B8LE"); + + // Close the type then open it again to test getting its name + inttype.close(); + inttype = file.openIntType("INT type of STD_B8LE"); + + // Get and verify its name + H5std_string inttype_name = inttype.getObjName(); + verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Make copy of a predefined type and save it + DataType dtype(PredType::STD_B8LE); + dtype.commit(file, "STD_B8LE"); + + // Close the data type and file + dtype.close(); + file.close(); + + // Re-open the file and the data type to test getting its name + file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); + dtype = file.openDataType("STD_B8LE"); + + // Get and verify its name + H5std_string type_name = dtype.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test getting type's name from copied type + DataType copied_type; + copied_type.copy(dtype); + copied_type.commit(file, "copy of STD_B8LE"); + type_name = copied_type.getObjName(); + verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test copying an integer predefined type + IntType new_int_type(PredType::NATIVE_INT); + + // Name this datatype + new_int_type.commit(grp, "IntType NATIVE_INT"); + ssize_t name_len = new_int_type.getObjName(type_name); // default len + verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); + verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); + + // Close everything or they can be closed when objects go out of scope + dtype.close(); + copied_type.close(); + new_int_type.close(); + grp.close(); + + PASSED(); } // end top try block catch (Exception& E) { - issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); + issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); } } // test_get_objname_ontypes /*------------------------------------------------------------------------- - * Function: test_get_objtype + * Function: test_get_objtype * - * Purpose: Tests getting object type + * Purpose: Tests getting object type * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -254,61 +254,61 @@ static void test_get_objtype() SUBTEST("H5File::childObjType and H5Group::childObjType"); try { - // Open file - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + // Open file + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - // Open the top group - Group grp1 = file.openGroup(GROUP1); + // Open the top group + Group grp1 = file.openGroup(GROUP1); - // Create a datatype and save it - DataType dtype(PredType::STD_I32LE); - dtype.commit(grp1, "STD_I32LE"); + // Create a datatype and save it + DataType dtype(PredType::STD_I32LE); + dtype.commit(grp1, "STD_I32LE"); - // Get and verify object type with - // H5O_type_t childObjType(const H5std_string& objname) - H5O_type_t objtype = file.childObjType(DSET_IN_FILE); - verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const H5std_string& objname) + H5O_type_t objtype = file.childObjType(DSET_IN_FILE); + verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(const char* objname) - objtype = grp1.childObjType(GROUP1_1.c_str()); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const char* objname) + objtype = grp1.childObjType(GROUP1_1.c_str()); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, - // H5_iter_order_t order, const char* objname=".") - objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); - verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, + // H5_iter_order_t order, const char* objname=".") + objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); + verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, - // H5_index_t index_type=H5_INDEX_NAME, - // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") - objtype = grp1.childObjType((hsize_t)2); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, + // H5_index_t index_type=H5_INDEX_NAME, + // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") + objtype = grp1.childObjType((hsize_t)2); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objtype", __LINE__, __FILE__); + issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype /*------------------------------------------------------------------------- - * Function: test_objects + * Function: test_objects * - * Purpose: Tests HDF5 object related functionality + * Purpose: Tests HDF5 object related functionality * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, Mar 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, Mar 4, 2014 * * Modifications: * @@ -321,7 +321,7 @@ void test_object() MESSAGE(5, ("Testing Object Functions\n")); test_get_objname(); // Test get object name from groups/datasets - test_get_objname_ontypes(); // Test get object name from types + test_get_objname_ontypes(); // Test get object name from types test_get_objtype(); // Test get object type } // test_objects diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index e3499aa..b4efe40 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ @@ -81,100 +81,100 @@ test_reference_params(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); - - // Create a group - Group group = file1->createGroup("Group1"); - - // Set group's comment - group.setComment(".", write_comment); - - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - - unsigned *tu32; // Temporary pointer to uint32 data - int i; - for (tu32=(unsigned *)wbuf, i=0; icreateDataSet(DSET3_NAME, PredType::STD_REF_OBJ, sid1); - - /* Test parameters to H5Location::reference */ - try { - file1->reference(NULL, "/Group1/Dataset1"); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], NULL); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], ""); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); - } catch (ReferenceException& E) {} // We expect this to fail - - // Close resources - dataset.close(); - file1->close(); - // Let sid1 go out of scope - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); - - PASSED(); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); + + // Create a group + Group group = file1->createGroup("Group1"); + + // Set group's comment + group.setComment(".", write_comment); + + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + + unsigned *tu32; // Temporary pointer to uint32 data + int i; + for (tu32=(unsigned *)wbuf, i=0; icreateDataSet(DSET3_NAME, PredType::STD_REF_OBJ, sid1); + + /* Test parameters to H5Location::reference */ + try { + file1->reference(NULL, "/Group1/Dataset1"); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], NULL); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], ""); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); + } catch (ReferenceException& E) {} // We expect this to fail + + // Close resources + dataset.close(); + file1->close(); + // Let sid1 go out of scope + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_param()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -184,7 +184,7 @@ test_reference_params(void) /**************************************************************** ** ** test_reference_obj(): Test basic object reference functions -** to various kinds of objects +** to various kinds of objects ** ****************************************************************/ static void test_reference_obj(void) @@ -197,173 +197,173 @@ static void test_reference_obj(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create a group - Group group = file1->createGroup("Group1"); + // Create a group + Group group = file1->createGroup("Group1"); - // Set group's comment - group.setComment(".", write_comment); + // Set group's comment + group.setComment(".", write_comment); - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - unsigned *tu32; // Temporary pointer to uint32 data - for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) - *tu32++=i*3; // from C test + unsigned *tu32; // Temporary pointer to uint32 data + for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) + *tu32++=i*3; // from C test - // Write selection to disk - dataset.write(wbuf, PredType::NATIVE_UINT); + // Write selection to disk + dataset.write(wbuf, PredType::NATIVE_UINT); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create another dataset (inside /Group1) - dataset = group.createDataSet(DSET2_NAME, PredType::NATIVE_UCHAR, sid1); + // Create another dataset (inside /Group1) + dataset = group.createDataSet(DSET2_NAME, PredType::NATIVE_UCHAR, sid1); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create a datatype to refer to - CompType dtype1(sizeof(s1_t)); + // Create a datatype to refer to + CompType dtype1(sizeof(s1_t)); - // Insert fields - dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); + // Insert fields + dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); - // Save datatype for later - dtype1.commit(group, DTYPE_NAME); + // Save datatype for later + dtype1.commit(group, DTYPE_NAME); - // Close datatype and group - dtype1.close(); - group.close(); + // Close datatype and group + dtype1.close(); + group.close(); - // Create a dataset - dataset = file1->createDataSet(DSET3_NAME, PredType::STD_REF_OBJ, sid1); + // Create a dataset + dataset = file1->createDataSet(DSET3_NAME, PredType::STD_REF_OBJ, sid1); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[0], "/Group1/Dataset1"); - H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[0], "/Group1/Dataset1"); + H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[1], "/Group1/Dataset2"); - refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[1], "/Group1/Dataset2"); + refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to group - file1->reference(&wbuf[2], "/Group1"); - refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to group + file1->reference(&wbuf[2], "/Group1"); + refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to named datatype - file1->reference(&wbuf[3], "/Group1/Datatype1"); - refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to named datatype + file1->reference(&wbuf[3], "/Group1/Datatype1"); + refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); - // Write selection to disk - dataset.write(wbuf, PredType::STD_REF_OBJ); + // Write selection to disk + dataset.write(wbuf, PredType::STD_REF_OBJ); - // Close disk dataspace, dataset, and file - sid1.close(); - dataset.close(); - delete file1; + // Close disk dataspace, dataset, and file + sid1.close(); + dataset.close(); + delete file1; - // Re-open the file - file1 = new H5File(FILE1, H5F_ACC_RDWR); + // Re-open the file + file1 = new H5File(FILE1, H5F_ACC_RDWR); - // Open the dataset - dataset = file1->openDataSet(DSET3_NAME); + // Open the dataset + dataset = file1->openDataSet(DSET3_NAME); - // Read selection from disk - dataset.read(rbuf, PredType::STD_REF_OBJ); + // Read selection from disk + dataset.read(rbuf, PredType::STD_REF_OBJ); - // Dereference dataset object by ctor, from the location where - // 'dataset' is located - DataSet dset2(dataset, &rbuf[0], H5R_OBJECT); + // Dereference dataset object by ctor, from the location where + // 'dataset' is located + DataSet dset2(dataset, &rbuf[0], H5R_OBJECT); - // Check information in the referenced dataset - sid1 = dset2.getSpace(); - hssize_t n_elements = sid1.getSimpleExtentNpoints(); - verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + // Check information in the referenced dataset + sid1 = dset2.getSpace(); + hssize_t n_elements = sid1.getSimpleExtentNpoints(); + verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Read from disk - dset2.read(tbuf, PredType::NATIVE_UINT); + // Read from disk + dset2.read(tbuf, PredType::NATIVE_UINT); - for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) - verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) + verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Close dereferenced dataset - dset2.close(); + // Close dereferenced dataset + dset2.close(); - // Dereference group object from the location where 'dataset' is located - group.dereference(dataset, &rbuf[2]); + // Dereference group object from the location where 'dataset' is located + group.dereference(dataset, &rbuf[2]); - // Get group's comment using - // H5std_string getComment(const char* name, ) - H5std_string read_comment1 = group.getComment(".", 10); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Get group's comment using + // H5std_string getComment(const char* name, ) + H5std_string read_comment1 = group.getComment(".", 10); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test with the old default value - read_comment1 = group.getComment(".", 256); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Test with the old default value + read_comment1 = group.getComment(".", 256); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test that getComment handles failures gracefully, using - // H5std_string getComment(const char* name, ) - try { - H5std_string read_comment_tmp = group.getComment(NULL); - } - catch (Exception& E) {} // We expect this to fail + // Test that getComment handles failures gracefully, using + // H5std_string getComment(const char* name, ) + try { + H5std_string read_comment_tmp = group.getComment(NULL); + } + catch (Exception& E) {} // We expect this to fail - // Close group - group.close(); + // Close group + group.close(); - /* - * Verify correct referenced datatype - */ - // Open datatype object - dtype1.dereference(dataset, &rbuf[3]); + /* + * Verify correct referenced datatype + */ + // Open datatype object + dtype1.dereference(dataset, &rbuf[3]); - // Verify correct datatype + // Verify correct datatype H5T_class_t tclass; tclass = dtype1.getClass(); - verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); - int n_members = dtype1.getNmembers(); + verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); + int n_members = dtype1.getNmembers(); verify_val(n_members, 3, "CompType::getNmembers",__LINE__,__FILE__); - // Close all objects and file - dtype1.close(); - dataset.close(); - file1->close(); + // Close all objects and file + dtype1.close(); + dataset.close(); + file1->close(); - // Free allocated buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + // Free allocated buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); - PASSED(); + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -375,7 +375,7 @@ static void test_reference_obj(void) ** ** test_reference_group(): Test object reference functionality ** Tests for correct behavior of various routines on -** dereferenced group +** dereferenced group ** ****************************************************************/ #define GROUPNAME "/group" @@ -388,8 +388,8 @@ static void test_reference_obj(void) static void test_reference_group(void) { - hobj_ref_t wref; /* Reference to write */ - hobj_ref_t rref; /* Reference to read */ + hobj_ref_t wref; /* Reference to write */ + hobj_ref_t rref; /* Reference to read */ const H5std_string write_comment="Foo!"; // Comments for group // Output message about test being performed @@ -397,102 +397,102 @@ test_reference_group(void) H5File* file1 = NULL; try { - /* - * Create file with a group and a dataset containing an object - * reference to the group - */ + /* + * Create file with a group and a dataset containing an object + * reference to the group + */ // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1; + // Create scalar dataspace + DataSpace sid1; - // Create a group - Group group = file1->createGroup(GROUPNAME); + // Create a group + Group group = file1->createGroup(GROUPNAME); - /* Create nested groups */ - Group group2 = group.createGroup(GROUPNAME2); - group2.close(); - group2 = group.createGroup(GROUPNAME3); - group2.close(); + /* Create nested groups */ + Group group2 = group.createGroup(GROUPNAME2); + group2.close(); + group2 = group.createGroup(GROUPNAME3); + group2.close(); - // Create bottom dataset - DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); - dset1.close(); + // Create bottom dataset + DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); + dset1.close(); - // Close group 1 - group.close(); + // Close group 1 + group.close(); - // Create dataset - DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); + // Create dataset + DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); - file1->reference(&wref, GROUPNAME); + file1->reference(&wref, GROUPNAME); - // Write selection to disk - dset2.write(&wref, PredType::STD_REF_OBJ); + // Write selection to disk + dset2.write(&wref, PredType::STD_REF_OBJ); - // Close resources - dset2.close(); - sid1.close(); - file1->close(); + // Close resources + dset2.close(); + sid1.close(); + file1->close(); - /* - * Re-open the file and test deferencing group - */ + /* + * Re-open the file and test deferencing group + */ - // Re-open file + // Re-open file file1->openFile(FILE1, H5F_ACC_RDWR); - // Re-open dataset - dset1 = file1->openDataSet(DSETNAME); + // Re-open dataset + dset1 = file1->openDataSet(DSETNAME); - // Read in the reference - dset1.read(&rref, PredType::STD_REF_OBJ); + // Read in the reference + dset1.read(&rref, PredType::STD_REF_OBJ); - // Dereference to get the group - Group refgroup(dset1, &rref); + // Dereference to get the group + Group refgroup(dset1, &rref); - // Dereference group object the other way - group.dereference(dset1, &rref); + // Dereference group object the other way + group.dereference(dset1, &rref); - /* - * Various queries on the group opened - */ + /* + * Various queries on the group opened + */ - // Check number of objects in the group dereferenced by constructor - hsize_t nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by constructor + hsize_t nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check number of objects in the group dereferenced by ::reference - nobjs = group.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by ::reference + nobjs = group.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check getting file name given the group dereferenced via constructor - H5std_string fname = refgroup.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + // Check getting file name given the group dereferenced via constructor + H5std_string fname = refgroup.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - // Check getting file name given the group dereferenced by ::reference - fname = group.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - - // Unlink one of the objects in the dereferenced group, and re-check - refgroup.unlink(GROUPNAME2); - nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); - - // Close resources - group.close(); - refgroup.close(); - dset1.close(); - file1->close(); - - PASSED(); + // Check getting file name given the group dereferenced by ::reference + fname = group.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + + // Unlink one of the objects in the dereferenced group, and re-check + refgroup.unlink(GROUPNAME2); + nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); + + // Close resources + group.close(); + refgroup.close(); + dset1.close(); + file1->close(); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_group()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -508,280 +508,280 @@ test_reference_group(void) static void test_reference_region_1D(void) { - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ int i; /* counting variables */ // Output message about test being performed SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk - *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + hdset_reg_ref_t *wbuf, // buffer to write to disk + *rbuf; // buffer read from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk - // Allocate write & read buffers - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + // Allocate write & read buffers + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); // Create file FILE1 H5File file1(FILE2, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; - DataSpace sid3(SPACE3_RANK, dims3); + // Create dataspace for datasets + hsize_t dims3[] = {SPACE3_DIM1}; + DataSpace sid3(SPACE3_RANK, dims3); - // Create a dataset - DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); + // Create a dataset + DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); - uint8_t *tu8; // Temporary pointer to uint8 data - for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) - *tu8++ = i * 3; // from C test + uint8_t *tu8; // Temporary pointer to uint8 data + for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) + *tu8++ = i * 3; // from C test - // Write selection to disk - dset3.write(dwbuf, PredType::STD_U8LE); + // Write selection to disk + dset3.write(dwbuf, PredType::STD_U8LE); - // Close Dataset - dset3.close(); + // Close Dataset + dset3.close(); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create a dataset - DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); + // Create a dataset + DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); - /* - * Create references and prepare for testing - */ + /* + * Create references and prepare for testing + */ - /* Select 15 2x1 hyperslabs for first reference */ - start[0] = 2; - stride[0] = 5; - count[0] = 15; - block[0] = 2; + /* Select 15 2x1 hyperslabs for first reference */ + start[0] = 2; + stride[0] = 5; + count[0] = 15; + block[0] = 2; - // Select a hyperslab region to add to the current selected region - sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); + // Select a hyperslab region to add to the current selected region + sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); - // Get and verify the number of elements in a dataspace selection - hssize_t nelms = sid3.getSelectNpoints(); - verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify the number of elements in a dataspace selection + hssize_t nelms = sid3.getSelectNpoints(); + verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); - // Store first dataset region - file1.reference(&wbuf[0], "/Dataset2", sid3); + // Store first dataset region + file1.reference(&wbuf[0], "/Dataset2", sid3); - // Get and verify object type - H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify object type + H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - /* Select sequence of ten points for second reference */ - coord1[0][0] = 16; - coord1[1][0] = 22; - coord1[2][0] = 38; - coord1[3][0] = 41; - coord1[4][0] = 52; - coord1[5][0] = 63; - coord1[6][0] = 70; - coord1[7][0] = 89; - coord1[8][0] = 97; - coord1[9][0] = 3; - - // Selects array elements to be included in the selection for sid3 - sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); - - // Get and verify the number of elements in a dataspace selection - nelms = sid3.getSelectNpoints(); - verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Store first dataset region - file1.reference(&wbuf[1], "/Dataset2", sid3); - - // Write selection to disk - dset1.write(wbuf, PredType::STD_REF_DSETREG); - - // Close disk dataspace, dataset, and file - sid1.close(); - dset1.close(); - sid3.close(); - file1.close(); - - /* - * Testing various dereference functions - */ - - // Re-open the file - file1.openFile(FILE2, H5F_ACC_RDWR); - - // Open the dataset - dset1 = file1.openDataSet("/Dataset1"); - - // Read selection from disk - dset1.read(rbuf, PredType::STD_REF_DSETREG); - - { // Test DataSet::dereference - dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION); - - // Get and verify object type - obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Get dataspace of dset3 the verify number of elements - sid1 = dset3.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - } // End of test DataSet::dereference - - { // Test DataSet constructor -by dereference - // Dereference dataset object by ctor, from the location where - // 'dset1' is located - DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION); - - // Get dataspace of newds then verify number of elements - sid1 = newds.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - // Close objects for this mini test - newds.close(); - sid1.close(); - } // End of test DataSet constructor -by dereference - - // Read from disk - dset3.read(drbuf, PredType::STD_U8LE); - - for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) - verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - /* - * Test getting the referenced region - */ - - // Get region - DataSpace reg_sp = dset1.getRegion(&rbuf[0]); - - // Get and verify number of elements in a dataspace selection - nelms = reg_sp.getSelectNpoints(); - verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - // Get and verify number of hyperslab blocks - nelms = reg_sp.getSelectHyperNblocks(); - verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); - - // Get the list of hyperslab blocks currently selected - reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); - - // Verify values in the list - verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - reg_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - /* Close region space */ - reg_sp.close(); - - /* - * Another test on getting the referenced region - */ - - // Get region - DataSpace elm_sp = dset1.getRegion(&rbuf[1]); - - // Get and verify number of element points in the current selection - hssize_t nelmspts = elm_sp.getSelectElemNpoints(); - verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); - - // Get the list of element points currently selected - elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); - - // Verify points - verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - elm_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - // Close element space - elm_sp.close(); - - // Close resources - sid1.close(); - dset3.close(); - dset1.close(); - file1.close(); - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - - PASSED(); + /* Select sequence of ten points for second reference */ + coord1[0][0] = 16; + coord1[1][0] = 22; + coord1[2][0] = 38; + coord1[3][0] = 41; + coord1[4][0] = 52; + coord1[5][0] = 63; + coord1[6][0] = 70; + coord1[7][0] = 89; + coord1[8][0] = 97; + coord1[9][0] = 3; + + // Selects array elements to be included in the selection for sid3 + sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + + // Get and verify the number of elements in a dataspace selection + nelms = sid3.getSelectNpoints(); + verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Store first dataset region + file1.reference(&wbuf[1], "/Dataset2", sid3); + + // Write selection to disk + dset1.write(wbuf, PredType::STD_REF_DSETREG); + + // Close disk dataspace, dataset, and file + sid1.close(); + dset1.close(); + sid3.close(); + file1.close(); + + /* + * Testing various dereference functions + */ + + // Re-open the file + file1.openFile(FILE2, H5F_ACC_RDWR); + + // Open the dataset + dset1 = file1.openDataSet("/Dataset1"); + + // Read selection from disk + dset1.read(rbuf, PredType::STD_REF_DSETREG); + + { // Test DataSet::dereference + dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION); + + // Get and verify object type + obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Get dataspace of dset3 the verify number of elements + sid1 = dset3.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + } // End of test DataSet::dereference + + { // Test DataSet constructor -by dereference + // Dereference dataset object by ctor, from the location where + // 'dset1' is located + DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION); + + // Get dataspace of newds then verify number of elements + sid1 = newds.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + // Close objects for this mini test + newds.close(); + sid1.close(); + } // End of test DataSet constructor -by dereference + + // Read from disk + dset3.read(drbuf, PredType::STD_U8LE); + + for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) + verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + /* + * Test getting the referenced region + */ + + // Get region + DataSpace reg_sp = dset1.getRegion(&rbuf[0]); + + // Get and verify number of elements in a dataspace selection + nelms = reg_sp.getSelectNpoints(); + verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + // Get and verify number of hyperslab blocks + nelms = reg_sp.getSelectHyperNblocks(); + verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); + + // Get the list of hyperslab blocks currently selected + reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); + + // Verify values in the list + verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + reg_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + /* Close region space */ + reg_sp.close(); + + /* + * Another test on getting the referenced region + */ + + // Get region + DataSpace elm_sp = dset1.getRegion(&rbuf[1]); + + // Get and verify number of element points in the current selection + hssize_t nelmspts = elm_sp.getSelectElemNpoints(); + verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); + + // Get the list of element points currently selected + elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); + + // Verify points + verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + elm_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + // Close element space + elm_sp.close(); + + // Close resources + sid1.close(); + dset3.close(); + dset1.close(); + file1.close(); + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ @@ -820,9 +820,9 @@ void test_reference(void) /**************************************************************** -** Function: cleanup_reference -** Purpose: Cleanup temporary test files -** Return: none +** Function: cleanup_reference +** Purpose: Cleanup temporary test files +** Return: none ****************************************************************/ extern "C" void cleanup_reference(void) diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index b77abf2..9da05e6 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -40,7 +40,7 @@ using namespace H5; * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -71,7 +71,7 @@ const char *FILENAME[] = { * endian. If local variable `endian' is H5T_ORDER_BE then the result will * be I, otherwise the result will be Z-(I+1). */ -#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) +#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) typedef enum flt_t { @@ -92,7 +92,7 @@ typedef enum int_t { * Return: None. * * Programmer: Binh-Minh Ribler (using C version) - * January, 2007 + * January, 2007 * * Modifications: * @@ -102,24 +102,24 @@ static void test_classes() { SUBTEST("PredType::getClass()"); try { - // maybe later, int curr_nerrors = GetTestNumErrs(); - - // PredType::NATIVE_INT should be in H5T_INTEGER class - H5T_class_t tcls = PredType::NATIVE_INT.getClass(); - if (H5T_INTEGER!=tcls) { - puts(" Invalid type class for H5T_NATIVE_INT"); - } - - // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class - tcls = PredType::NATIVE_DOUBLE.getClass(); - if (H5T_FLOAT!=tcls) { - verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); - } - PASSED(); + // maybe later, int curr_nerrors = GetTestNumErrs(); + + // PredType::NATIVE_INT should be in H5T_INTEGER class + H5T_class_t tcls = PredType::NATIVE_INT.getClass(); + if (H5T_INTEGER!=tcls) { + puts(" Invalid type class for H5T_NATIVE_INT"); + } + + // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class + tcls = PredType::NATIVE_DOUBLE.getClass(); + if (H5T_FLOAT!=tcls) { + verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); + } + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); } } @@ -133,7 +133,7 @@ static void test_classes() * Failure: number of errors * * Programmer: Binh-Minh Ribler (using C version) - * January, 2007 + * January, 2007 * * Modifications: * @@ -143,21 +143,21 @@ static void test_copy() { SUBTEST("DataType::copy() and DataType::operator="); try { - // Test copying from a predefined datatype using DataType::operator= - DataType assigned_type; - assigned_type = PredType::NATIVE_SHORT; + // Test copying from a predefined datatype using DataType::operator= + DataType assigned_type; + assigned_type = PredType::NATIVE_SHORT; // Test copying a predefined type using DataType::copy - DataType copied_type; + DataType copied_type; copied_type.copy (PredType::STD_B8LE); - // Test copying a user-defined type using DataType::operator= - DataType assigned_usertype; - assigned_usertype = copied_type; + // Test copying a user-defined type using DataType::operator= + DataType assigned_usertype; + assigned_usertype = copied_type; - // Test copying from a user-defined datatype using DataType::copy - DataType copied_usertype; - copied_usertype.copy(copied_type); + // Test copying from a user-defined datatype using DataType::copy + DataType copied_usertype; + copied_usertype.copy(copied_type); // Test copying a user-defined int type using DataType::operator= IntType orig_int(PredType::STD_B8LE); @@ -171,26 +171,26 @@ static void test_copy() IntType another_int_type; another_int_type = new_int_type; - PASSED(); + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_query + * Function: test_query * - * Purpose: Tests query functions of compound and enumeration types. + * Purpose: Tests query functions of compound and enumeration types. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -203,106 +203,106 @@ const H5std_string EnumT_NAME("Enum_type"); static void test_query() { typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } src_typ_t; - short enum_val; + short enum_val; // Output message about test being performed SUBTEST("Query functions of compound and enumeration types"); try { - // Create File - H5File file(FILENAME[2], H5F_ACC_TRUNC); - - // Create a compound datatype - CompType tid1(sizeof(src_typ_t)); - - tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); - tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - - // Create a enumerate datatype - EnumType tid2(sizeof(short)); - - tid2.insert("RED", (enum_val=0,&enum_val)); - tid2.insert("GREEN", (enum_val=1,&enum_val)); - tid2.insert("BLUE", (enum_val=2,&enum_val)); - tid2.insert("ORANGE", (enum_val=3,&enum_val)); - tid2.insert("YELLOW", (enum_val=4,&enum_val)); - - // Query member number and member index by name, for compound type - int nmembs = tid1.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - - int index = tid1.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type. - nmembs = tid2.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - - index = tid2.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Commit compound datatype and close it - tid1.commit(file, CompT_NAME); - tid1.close(); - - // Commit enumeration datatype and close it - tid2.commit(file, EnumT_NAME); - tid2.close(); - - // Open the datatypes for query - tid1 = file.openCompType(CompT_NAME); - tid2 = file.openEnumType(EnumT_NAME); - - // Query member number and member index by name, for compound type - nmembs = tid1.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - index = tid1.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type - nmembs = tid2.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - index = tid2.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Close datatypes and file - tid1.close(); - tid2.close(); - file.close(); - - // Try truncating the file to make sure reference counting is good. - // If any references to ids of tid1 and tid2 are left unterminated, - // the truncating will fail, because the file will not be closed in - // the file.close() above. - H5File file1(FILENAME[2], H5F_ACC_TRUNC); - - PASSED(); + // Create File + H5File file(FILENAME[2], H5F_ACC_TRUNC); + + // Create a compound datatype + CompType tid1(sizeof(src_typ_t)); + + tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); + tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); + + // Create a enumerate datatype + EnumType tid2(sizeof(short)); + + tid2.insert("RED", (enum_val=0,&enum_val)); + tid2.insert("GREEN", (enum_val=1,&enum_val)); + tid2.insert("BLUE", (enum_val=2,&enum_val)); + tid2.insert("ORANGE", (enum_val=3,&enum_val)); + tid2.insert("YELLOW", (enum_val=4,&enum_val)); + + // Query member number and member index by name, for compound type + int nmembs = tid1.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + + int index = tid1.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type. + nmembs = tid2.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + + index = tid2.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Commit compound datatype and close it + tid1.commit(file, CompT_NAME); + tid1.close(); + + // Commit enumeration datatype and close it + tid2.commit(file, EnumT_NAME); + tid2.close(); + + // Open the datatypes for query + tid1 = file.openCompType(CompT_NAME); + tid2 = file.openEnumType(EnumT_NAME); + + // Query member number and member index by name, for compound type + nmembs = tid1.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + index = tid1.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type + nmembs = tid2.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + index = tid2.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Close datatypes and file + tid1.close(); + tid2.close(); + file.close(); + + // Try truncating the file to make sure reference counting is good. + // If any references to ids of tid1 and tid2 are left unterminated, + // the truncating will fail, because the file will not be closed in + // the file.close() above. + H5File file1(FILENAME[2], H5F_ACC_TRUNC); + + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_query /*------------------------------------------------------------------------- - * Function: test_transient + * Function: test_transient * - * Purpose: Tests transient datatypes. + * Purpose: Tests transient datatypes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -311,58 +311,58 @@ static void test_query() const char* filename1 = "dtypes1.h5"; static void test_transient () { - static hsize_t ds_size[2] = {10, 20}; + static hsize_t ds_size[2] = {10, 20}; SUBTEST("Transient datatypes"); try { - // Create the file and the dataspace. - H5File file(filename1, H5F_ACC_TRUNC); - DataSpace space(2, ds_size, ds_size); - - // Copying a predefined type results in a modifiable copy - IntType type(PredType::NATIVE_INT); - type.setPrecision(256); - - // It should not be possible to create an attribute for a transient type - try { - Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); - } catch (AttributeIException& err) {} // do nothing, failure expected - - // Create a dataset from a transient datatype - // type.close(); - put trace in H5Tclose to make sure it's closed - type.copy(PredType::NATIVE_INT); - DataSet dset(file.createDataSet("dset1", type, space)); - - // The type returned from a dataset should not be modifiable - IntType itype(dset); - try { - itype.setPrecision(256); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); - } catch (DataTypeIException& err) {} - itype.close(); - - // Get a copy of the dataset's datatype by applying DataType::copy() - // to the dataset. The resulted datatype should be modifiable. - itype.copy(dset); - itype.setPrecision(256); - itype.close(); - - // Close the dataset and reopen it, testing that its type is still - // read-only. (Note that a copy of it is modifiable.) - dset.close(); - dset = file.openDataSet("dset1"); - - // Close objects and file. - dset.close(); - file.close(); - type.close(); - space.close(); - PASSED(); + // Create the file and the dataspace. + H5File file(filename1, H5F_ACC_TRUNC); + DataSpace space(2, ds_size, ds_size); + + // Copying a predefined type results in a modifiable copy + IntType type(PredType::NATIVE_INT); + type.setPrecision(256); + + // It should not be possible to create an attribute for a transient type + try { + Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); + } catch (AttributeIException& err) {} // do nothing, failure expected + + // Create a dataset from a transient datatype + // type.close(); - put trace in H5Tclose to make sure it's closed + type.copy(PredType::NATIVE_INT); + DataSet dset(file.createDataSet("dset1", type, space)); + + // The type returned from a dataset should not be modifiable + IntType itype(dset); + try { + itype.setPrecision(256); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); + } catch (DataTypeIException& err) {} + itype.close(); + + // Get a copy of the dataset's datatype by applying DataType::copy() + // to the dataset. The resulted datatype should be modifiable. + itype.copy(dset); + itype.setPrecision(256); + itype.close(); + + // Close the dataset and reopen it, testing that its type is still + // read-only. (Note that a copy of it is modifiable.) + dset.close(); + dset = file.openDataSet("dset1"); + + // Close objects and file. + dset.close(); + file.close(); + type.close(); + space.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -372,16 +372,16 @@ static void test_transient () /*------------------------------------------------------------------------- - * Function: test_named + * Function: test_named * - * Purpose: Tests named datatypes. + * Purpose: Tests named datatypes. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -390,141 +390,141 @@ static void test_transient () const H5std_string filename2("dtypes2.h5"); static void test_named () { - static hsize_t ds_size[2] = {10, 20}; - hsize_t i; - unsigned attr_data[10][20]; + static hsize_t ds_size[2] = {10, 20}; + hsize_t i; + unsigned attr_data[10][20]; DataType *ds_type = NULL; SUBTEST("Named datatypes"); try { - // Create the file. - H5File file(filename2, H5F_ACC_TRUNC); + // Create the file. + H5File file(filename2, H5F_ACC_TRUNC); - // Create a simple dataspace. - DataSpace space(2, ds_size, ds_size); + // Create a simple dataspace. + DataSpace space(2, ds_size, ds_size); - // Predefined types cannot be committed. - try { - PredType nativeint(PredType::NATIVE_INT); - nativeint.commit(file, "test_named_1 (should not exist)"); + // Predefined types cannot be committed. + try { + PredType nativeint(PredType::NATIVE_INT); + nativeint.commit(file, "test_named_1 (should not exist)"); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); - } catch (DataTypeIException& err) {} + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); + } catch (DataTypeIException& err) {} - // Copy a predefined datatype and commit the copy. + // Copy a predefined datatype and commit the copy. IntType itype(PredType::NATIVE_INT); itype.commit(file, "native-int"); - // Test commit passing in const H5File& for prototype with const - try - { - // Create random char type - IntType atype(PredType::NATIVE_UCHAR); + // Test commit passing in const H5File& for prototype with const + try + { + // Create random char type + IntType atype(PredType::NATIVE_UCHAR); - // Creating group, declared as const - const Group const_grp = file.createGroup("GR as loc"); + // Creating group, declared as const + const Group const_grp = file.createGroup("GR as loc"); - // Commit type passing in const group; compilation would fail if - // no matching prototype - atype.commit(const_grp, "random uchar"); - } // end of try block - catch (Exception& E) + // Commit type passing in const group; compilation would fail if + // no matching prototype + atype.commit(const_grp, "random uchar"); + } // end of try block + catch (Exception& E) { - issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); - } - - // Check that it is committed. - if (itype.committed() == false) - cerr << "IntType::committed() returned false" << endl; - - // We should not be able to modify a type after it has been committed. - try { - itype.setPrecision(256); // attempt an invalid action... - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); - } catch (DataTypeIException& err) {} - - // We should not be able to re-commit a committed type - try { - itype.commit(file, "test_named_2 (should not exist)"); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); - } catch (DataTypeIException& err) {} // do nothing, failure expected - - // It should be possible to define an attribute for the named type - Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); - for (i=0; icommitted(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - dset.close(); - ds_type->close(); + issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); + } + + // Check that it is committed. + if (itype.committed() == false) + cerr << "IntType::committed() returned false" << endl; + + // We should not be able to modify a type after it has been committed. + try { + itype.setPrecision(256); // attempt an invalid action... + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); + } catch (DataTypeIException& err) {} + + // We should not be able to re-commit a committed type + try { + itype.commit(file, "test_named_2 (should not exist)"); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); + } catch (DataTypeIException& err) {} // do nothing, failure expected + + // It should be possible to define an attribute for the named type + Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); + for (i=0; icommitted(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + dset.close(); + ds_type->close(); delete ds_type; - // Reopen the dataset and its type, then make sure the type is - // a named type. - dset = file.openDataSet("dset1"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - - // Close the dataset and create another with the type returned from - // the first dataset. - dset.close(); - dset = file.createDataSet("dset2", *ds_type, space); - ds_type->close(); - dset.close(); + // Reopen the dataset and its type, then make sure the type is + // a named type. + dset = file.openDataSet("dset1"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + + // Close the dataset and create another with the type returned from + // the first dataset. + dset.close(); + dset = file.createDataSet("dset2", *ds_type, space); + ds_type->close(); + dset.close(); delete ds_type; - // Reopen the second dataset and make sure the type is shared - dset = file.openDataSet("dset2"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); - ds_type->close(); - - // Get the dataset datatype by applying DataType::copy() to the - // dataset. The resulted datatype should be modifiable. - IntType copied_type; - copied_type.copy(dset); - copied_type.setPrecision(256); - copied_type.close(); - - // Clean up - dset.close(); - itype.close(); - space.close(); - file.close(); - PASSED(); + // Reopen the second dataset and make sure the type is shared + dset = file.openDataSet("dset2"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); + ds_type->close(); + + // Get the dataset datatype by applying DataType::copy() to the + // dataset. The resulted datatype should be modifiable. + IntType copied_type; + copied_type.copy(dset); + copied_type.setPrecision(256); + copied_type.close(); + + // Clean up + dset.close(); + itype.close(); + space.close(); + file.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -558,14 +558,14 @@ void test_types() /*------------------------------------------------------------------------- - * Function: cleanup_types + * Function: cleanup_types * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol - * September 10, 1999 + * Programmer: Quincey Koziol + * September 10, 1999 * * Modifications: * @@ -575,5 +575,5 @@ extern "C" void cleanup_types() { for (int i = 0; i < 3; i++) - HDremove(FILENAME[i]); + HDremove(FILENAME[i]); } // cleanup_types diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index a3e54c2..ed923eb 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -48,9 +48,9 @@ const hsize_t SPACE1_DIM1 = 4; /**************************************************************** ** ** test_vlstr_alloc_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses malloc to -** allocate the memory and increments the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses malloc to +** allocate the memory and increments the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -58,9 +58,9 @@ const hsize_t SPACE1_DIM1 = 4; #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { - void *ret_value=NULL; // Pointer to return + void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -70,8 +70,8 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) extra=MAX(sizeof(void *),sizeof(size_t)); if((ret_value=HDmalloc(extra+size))!=NULL) { - *(size_t *)ret_value=size; - *mem_used+=size; + *(size_t *)ret_value=size; + *mem_used+=size; } // end if ret_value = ((unsigned char *)ret_value) + extra; @@ -82,9 +82,9 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) /**************************************************************** ** ** test_vlstr_free_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses free to -** release the memory and decrements the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses free to +** release the memory and decrements the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -94,7 +94,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -112,14 +112,14 @@ static void test_vlstr_free_custom(void *_mem, void *info) #endif /*------------------------------------------------------------------------- - * Function: test_vlstring_dataset + * Function: test_vlstring_dataset * - * Purpose: Test writing/reading VL strings on datasets. + * Purpose: Test writing/reading VL strings on datasets. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -139,89 +139,89 @@ static void test_vlstring_dataset() SUBTEST("VL String on Datasets"); try { - // Open the file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Open the file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); - // Open the root group. - Group root = file1.openGroup("/"); + // Open the root group. + Group root = file1.openGroup("/"); - // Create dataspace for the dataset. - DataSpace ds_space (H5S_SCALAR); + // Create dataspace for the dataset. + DataSpace ds_space (H5S_SCALAR); - // Create an dataset in the root group. - DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); + // Create an dataset in the root group. + DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); - // Write data to the dataset. - dset1.write(DSET1_DATA, vlst); + // Write data to the dataset. + dset1.write(DSET1_DATA, vlst); - // Read and verify the dataset string as a string of chars. - dset1.read(&string_ds_check, vlst); - if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); + // Read and verify the dataset string as a string of chars. + dset1.read(&string_ds_check, vlst); + if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); - HDfree(string_ds_check); // note: no need for std::string test + HDfree(string_ds_check); // note: no need for std::string test string_ds_check = NULL; - // Read and verify the dataset string as an std::string. - H5std_string read_str; - dset1.read(read_str, vlst); - if (read_str != DSET1_DATA) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); + // Read and verify the dataset string as an std::string. + H5std_string read_str; + dset1.read(read_str, vlst); + if (read_str != DSET1_DATA) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); - // Close the dataset. - dset1.close(); + // Close the dataset. + dset1.close(); - // Test scalar type dataset with 1 value. - dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); + // Test scalar type dataset with 1 value. + dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); - dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); - HDmemset(dynstring_ds_write, 'A', 1); + dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); + HDmemset(dynstring_ds_write, 'A', 1); - // Write data to the dataset, then read it back. - dset1.write(&dynstring_ds_write, vlst); - dset1.read(&string_ds_check, vlst); + // Write data to the dataset, then read it back. + dset1.write(&dynstring_ds_write, vlst); + dset1.read(&string_ds_check, vlst); - // Verify data read. - if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) - TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); - HDfree(string_ds_check); + // Verify data read. + if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) + TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); + HDfree(string_ds_check); string_ds_check = NULL; - dset1.close(); + dset1.close(); - // Open dataset DSET1_NAME again. - dset1 = root.openDataSet(DSET1_NAME); + // Open dataset DSET1_NAME again. + dset1 = root.openDataSet(DSET1_NAME); - // Close dataset and file - dset1.close(); - file1.close(); + // Close dataset and file + dset1.close(); + file1.close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(dynstring_ds_write) HDfree(dynstring_ds_write); if(string_ds_check) - HDfree(string_ds_check); + HDfree(string_ds_check); } // test_vlstring_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstring_array_dataset + * Function: test_vlstring_array_dataset * - * Purpose: Test writing/reading VL string array to/from datasets. + * Purpose: Test writing/reading VL string array to/from datasets. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler - * July, 2009 + * Programmer: Binh-Minh Ribler + * July, 2009 * *------------------------------------------------------------------------- */ @@ -238,89 +238,89 @@ static void test_vlstring_array_dataset() H5File* file1 = NULL; try { // Create file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + file1 = new H5File(FILENAME, H5F_ACC_RDWR); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace ds_space(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create and write a dataset. - DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); - dataset.write(string_ds_array, vlst); - - // Read and verify the dataset using strings of chars as buffer. - // Note: reading by array of H5std_string doesn't work yet. - char *string_ds_check[SPACE1_DIM1]; - dataset.read(string_ds_check, vlst); - - hsize_t ii; - for (ii = 0; ii < SPACE1_DIM1; ii++) - { - if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); - - HDfree(string_ds_check[ii]); - } - - // Close objects that are no longer needed. - dataset.close(); - ds_space.close(); - - // - // Test with scalar data space. - // - - // Create H5S_SCALAR data space. - DataSpace scalar_space; - - // Create and write another dataset. - DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); - char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); - HDmemset(wdata2, 'A', 65533); - dataset2.write(&wdata2, vlst); - - char *rdata2; - dataset2.read(&rdata2, vlst); - if (HDstrcmp(wdata2, rdata2)!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); - - // Release resources from second dataset operation. - scalar_space.close(); - dataset2.close(); - HDfree(wdata2); - HDfree(rdata2); - - // Close objects and file. - dataset2.close(); - vlst.close(); - file1->close(); - - PASSED(); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); + + // Create and write a dataset. + DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); + dataset.write(string_ds_array, vlst); + + // Read and verify the dataset using strings of chars as buffer. + // Note: reading by array of H5std_string doesn't work yet. + char *string_ds_check[SPACE1_DIM1]; + dataset.read(string_ds_check, vlst); + + hsize_t ii; + for (ii = 0; ii < SPACE1_DIM1; ii++) + { + if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + + HDfree(string_ds_check[ii]); + } + + // Close objects that are no longer needed. + dataset.close(); + ds_space.close(); + + // + // Test with scalar data space. + // + + // Create H5S_SCALAR data space. + DataSpace scalar_space; + + // Create and write another dataset. + DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); + char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); + HDmemset(wdata2, 'A', 65533); + dataset2.write(&wdata2, vlst); + + char *rdata2; + dataset2.read(&rdata2, vlst); + if (HDstrcmp(wdata2, rdata2)!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); + + // Release resources from second dataset operation. + scalar_space.close(); + dataset2.close(); + HDfree(wdata2); + HDfree(rdata2); + + // Close objects and file. + dataset2.close(); + vlst.close(); + file1->close(); + + PASSED(); } // end try // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(file1) - delete file1; + delete file1; } // end test_vlstring_array_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstrings_special + * Function: test_vlstrings_special * - * Purpose: Test VL string code for special string cases, nil and - * zero-sized. + * Purpose: Test VL string code for special string cases, nil and + * zero-sized. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -334,110 +334,110 @@ static void test_vlstrings_special() SUBTEST("Special VL Strings"); try { - // Create file. - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file. + H5File file1(FILENAME, H5F_ACC_TRUNC); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create a dataset. - DataSet dataset(file1.createDataSet("Dataset3", vlst, sid1)); - - // Read from the dataset before writing data. - dataset.read(rdata, vlst); - - // Check data read in. - hsize_t ii; // counting variable - for (ii=0; iiopenStrType(VLSTR_TYPE); + // Try opening datatype again. + vlst = file1->openStrType(VLSTR_TYPE); - // Close datatype and file. - vlst.close(); - file1->close(); + // Close datatype and file. + vlst.close(); + file1->close(); delete file1; - // Open file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + // Open file. + file1 = new H5File(FILENAME, H5F_ACC_RDWR); - // Open the variable-length string datatype just created - vlst = file1->openStrType(VLSTR_TYPE); + // Open the variable-length string datatype just created + vlst = file1->openStrType(VLSTR_TYPE); - // Verify character set and padding - cset = vlst.getCset(); - verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); - pad = vlst.getStrpad(); - verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); + // Verify character set and padding + cset = vlst.getCset(); + verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); + pad = vlst.getStrpad(); + verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); - // Close datatype and file - vlst.close(); - file1->close(); + // Close datatype and file + vlst.close(); + file1->close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. @@ -515,18 +515,18 @@ static void test_vlstring_type() } if(file1) - delete file1; + delete file1; } // end test_vlstring_type() /*------------------------------------------------------------------------- - * Function: test_compact_vlstring + * Function: test_compact_vlstring * - * Purpose: Test storing VL strings in compact datasets. + * Purpose: Test storing VL strings in compact datasets. * - * Return: None + * Return: None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -536,55 +536,55 @@ static void test_compact_vlstring() SUBTEST("VL Strings on Compact Dataset"); try { - // Create file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets + // Create dataspace for datasets hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to - StrType vlst(0, H5T_VARIABLE); - - // Create dataset create property list and set layout - DSetCreatPropList plist; - plist.setLayout(H5D_COMPACT); - - // Create a dataset - DataSet dataset(file1.createDataSet("Dataset5", vlst, sid1, plist)); - - // Write dataset to disk - const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; - dataset.write(wdata, vlst); - - // Read dataset from disk - char *rdata[SPACE1_DIM1]; // Information read in - dataset.read(rdata, vlst); - - // Compare data read in - hsize_t i; - for (i=0; i Date: Thu, 13 Apr 2017 00:41:57 -0500 Subject: Miscellaneous clean-up: format and comments Platforms tested: Linux/64 (jelly) - very minor --- c++/src/H5AbstractDs.h | 8 +++++--- c++/src/H5ArrayType.h | 9 ++++++--- c++/src/H5AtomType.h | 9 ++++++--- c++/src/H5Attribute.h | 8 +++++--- c++/src/H5Classes.h | 1 - c++/src/H5CommonFG.cpp | 3 +-- c++/src/H5CommonFG.h | 5 ++--- c++/src/H5CompType.h | 9 ++++++--- c++/src/H5DataSet.h | 8 +++++--- c++/src/H5DataSpace.h | 12 +++++++++--- c++/src/H5DataType.h | 12 ++++++------ c++/src/H5DcreatProp.h | 16 ++++++++-------- c++/src/H5DxferProp.h | 16 ++++++++-------- c++/src/H5EnumType.h | 12 +++++++++--- c++/src/H5Exception.h | 5 +++-- c++/src/H5FaccProp.h | 14 ++++++++------ c++/src/H5FcreatProp.h | 11 ++++++++--- c++/src/H5File.h | 8 ++++---- c++/src/H5FloatType.h | 12 +++++++++--- c++/src/H5Group.h | 8 ++++---- c++/src/H5IdComponent.h | 4 +--- c++/src/H5IntType.h | 12 +++++++++--- c++/src/H5Library.h | 6 +++--- c++/src/H5Location.h | 13 +++++++++++-- c++/src/H5Object.h | 33 +++++++++++++++------------------ c++/src/H5OcreatProp.h | 11 ++++++++--- c++/src/H5PredType.h | 8 +++++--- c++/src/H5PropList.h | 12 +++++++++--- c++/src/H5StrType.h | 12 +++++++++--- c++/src/H5VarLenType.h | 15 +++++++++------ 30 files changed, 191 insertions(+), 121 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index eaa9d14..547485c 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -33,7 +33,7 @@ class DataSpace; and DataSet. It provides a collection of services that are common to both Attribute - and DataSet. AbstractDs inherits from H5Object. + and DataSet. */ class H5_DLLCPP AbstractDs { public: @@ -91,6 +91,8 @@ class H5_DLLCPP AbstractDs { private: // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; -}; -} + +}; // end of AbstractDs +} // namespace H5 + #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 82a4e7f..1ba0e5c 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -18,10 +18,11 @@ #define __H5ArrayType_H namespace H5 { - /*! \class ArrayType \brief Class ArrayType inherits from DataType and provides wrappers for the HDF5's Array Datatypes. + + Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ class H5_DLLCPP ArrayType : public DataType { public: @@ -54,6 +55,8 @@ class H5_DLLCPP ArrayType : public DataType { // Default constructor ArrayType(); -}; -} + +}; // end of ArrayType +} // namespace H5 + #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 1851a57..ca48b92 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -18,13 +18,14 @@ #define __H5AtomType_H namespace H5 { - /*! \class AtomType \brief AtomType is a base class, inherited by IntType, FloatType, StrType, and PredType. AtomType provides operations on HDF5 atomic datatypes. It also inherits from DataType. + + Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ class H5_DLLCPP AtomType : public DataType { public: @@ -76,6 +77,8 @@ class H5_DLLCPP AtomType : public DataType { // Constructor that takes an existing id AtomType( const hid_t existing_id ); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of AtomType +} // namespace H5 + #endif // __H5AtomType_H diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 1a45154..4f933e9 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -18,7 +18,6 @@ #define __H5Attribute_H namespace H5 { - /*! \class Attribute \brief Class Attribute operates on HDF5 attributes. @@ -26,6 +25,8 @@ namespace H5 { Attribute and DataSet are derivatives of AbstractDs. Attribute also inherits from IdComponent because an attribute is an HDF5 component that is identified by an identifier. + + Inheritance: multiple IdComponent/AbstractDs */ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { public: @@ -112,6 +113,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { // Friend function to set Attribute id. For library use only. friend void f_Attribute_setId(Attribute* attr, hid_t new_id); -}; -} +}; // end of Attribute +} // namespace H5 + #endif // __H5Attribute_H diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 23004b1..6dc24f4 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -37,7 +37,6 @@ namespace H5 { class FloatType; class StrType; class CompType; - //class RefType; class AbstractDs; class DataSet; class Group; diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 725ab83..e1c4818 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -1300,5 +1300,4 @@ void f_DataSet_setId(DataSet* dset, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS -} - +} // end namespace diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 62c333d..f1a8886 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -169,8 +169,7 @@ class H5_DLLCPP CommonFG { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; // end of CommonFG declaration +}; // end of CommonFG +} // namespace H5 -} #endif // __CommonFG_H - diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 581ec79..bc7e114 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -18,10 +18,11 @@ #define __H5CompType_H namespace H5 { - /*! \class CompType \brief CompType is a derivative of a DataType and operates on HDF5 compound datatypes. + + Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ class H5_DLLCPP CompType : public DataType { public: @@ -109,6 +110,8 @@ class H5_DLLCPP CompType : public DataType { // Contains common code that is used by the member functions // getMemberXxxType hid_t p_get_member_type(unsigned member_num) const; -}; -} + +}; // end of CompType +} // namespace H5 + #endif // __H5CompType_H diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index a424b21..049ca48 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -18,13 +18,14 @@ #define __H5DataSet_H namespace H5 { - /*! \class DataSet \brief Class DataSet operates on HDF5 datasets. An datasets has many characteristics similar to an attribute, thus both Attribute and DataSet are derivatives of AbstractDs. DataSet also inherits from H5Object because a dataset is an HDF5 object. + + Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent */ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: @@ -128,6 +129,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Friend function to set DataSet id. For library use only. friend void f_DataSet_setId(DataSet* dset, hid_t new_id); -}; -} +}; // end of DataSet +} // namespace H5 + #endif // __H5DataSet_H diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index a51266b..fc9c54e 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -18,8 +18,12 @@ #define __H5DataSpace_H namespace H5 { +/*! \class DataSpace + \brief Class DataSpace inherits from IdComponent and provides wrappers for + the HDF5's dataspaces. -//! Class DataSpace operates on HDF5 dataspaces. + Inheritance: IdComponent +*/ class H5_DLLCPP DataSpace : public IdComponent { public: ///\brief Default DataSpace objects @@ -144,6 +148,8 @@ class H5_DLLCPP DataSpace : public IdComponent { friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DataSpace +} // namespace H5 + #endif // __H5DataSpace_H diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 69e5c6d..3ae97dc 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -14,20 +14,18 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// Class DataType inherits from H5Object and has several subclasses for -// specific HDF5 data types. - #ifndef __H5DataType_H #define __H5DataType_H namespace H5 { - /*! \class DataType \brief Class DataType provides generic operations on HDF5 datatypes. DataType inherits from H5Object because a named datatype is an HDF5 object and is a base class of ArrayType, AtomType, CompType, EnumType, and VarLenType. + + Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ class H5_DLLCPP DataType : public H5Object { public: @@ -141,6 +139,8 @@ class H5_DLLCPP DataType : public H5Object { friend void f_DataType_setId(DataType* dtype, hid_t new_id); void p_commit(hid_t loc_id, const char* name); -}; -} + +}; // end of DataType +} // namespace H5 + #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 898fba6..ca99ca4 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -14,17 +14,15 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// Class DSetCreatPropList represents the HDF5 dataset creation property list -// and inherits from PropList. - #ifndef __H5DSCreatPropList_H #define __H5DSCreatPropList_H namespace H5 { - /*! \class DSetCreatPropList - \brief Class DSetCreatPropList represents the dataset creation property - list. + \brief Class DSetCreatPropList inherits from ObjCreatPropList and provides + wrappers for the HDF5 dataset creation property functions. + + Inheritance: ObjCreatPropList -> PropList -> IdComponent */ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: @@ -140,6 +138,8 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { static DSetCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetCreatPropList +} // namespace H5 + #endif // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index ad60020..72b64a16 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -14,17 +14,15 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// Class DSetMemXferPropList represents the HDF5 dataset transfer property list -// and inherits from PropList. - #ifndef __H5DSetMemXferPropList_H #define __H5DSetMemXferPropList_H namespace H5 { - /*! \class DSetMemXferPropList - \brief Class DSetMemXferPropList represents the dataset memory and - transfer property list. + \brief Class DSetCreatPropList inherits from PropList and provides + wrappers for the HDF5 dataset memory and transfer property list. + + Inheritance: ObjCreatPropList -> PropList -> IdComponent */ class H5_DLLCPP DSetMemXferPropList : public PropList { public: @@ -128,6 +126,8 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static DSetMemXferPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetMemXferPropList +} // namespace H5 + #endif // __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 3430e2a..7f10d15 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -18,8 +18,12 @@ #define __H5EnumType_H namespace H5 { +/*! \class EnumType + \brief EnumType is a derivative of a DataType and operates on HDF5 + enum datatypes. -//! Class EnumType operates on HDF5 enum datatypes. + Inheritance: DataType -> H5Object -> H5Location -> IdComponent +*/ class H5_DLLCPP EnumType : public DataType { public: @@ -69,6 +73,8 @@ class H5_DLLCPP EnumType : public DataType { EnumType( const EnumType& original ); virtual ~EnumType(); -}; -} + +}; // end of EnumType +} // namespace H5 + #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index d6cc2ae..e5f4eab 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -167,7 +167,8 @@ class H5_DLLCPP IdComponentException : public Exception { IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); IdComponentException(); virtual ~IdComponentException() throw(); -}; -} + +}; // end of IdComponentException +} // namespace H5 #endif // __H5Exception_H diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index a5fa5f2..272bf39 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -14,15 +14,16 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// Class FileAccPropList represents the HDF5 file access property list and -// inherits from DataType. - #ifndef __H5FileAccPropList_H #define __H5FileAccPropList_H namespace H5 { +/*! \class FileAccPropList + \brief Class FileAccPropList inherits from PropList and provides + wrappers for the HDF5 file access property list. -//! Class FileAccPropList represents the HDF5 file access property list. + Inheritance: PropList -> IdComponent +*/ class H5_DLLCPP FileAccPropList : public PropList { public: ///\brief Default file access property list. @@ -154,6 +155,7 @@ class H5_DLLCPP FileAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileAccPropList +} // namespace H5 + #endif // __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 598af87..02eacbc 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -18,8 +18,12 @@ #define __H5FileCreatPropList_H namespace H5 { +/*! \class FileCreatPropList + \brief Class FileCreatPropList inherits from PropList and provides + wrappers for the HDF5 file create property list. -//! Class FileCreatPropList represents the HDF5 file create property list. + Inheritance: PropList -> IdComponent +*/ class H5_DLLCPP FileCreatPropList : public PropList { public: ///\brief Default file creation property list. @@ -84,6 +88,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileCreatPropList +} // namespace H5 + #endif // __H5FileCreatPropList_H diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 1904bdb..22bb6c5 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -18,11 +18,10 @@ #define __H5File_H namespace H5 { - /*! \class H5File \brief Class H5File represents an HDF5 file. - It inherits from H5Location and CommonFG. + Inheritance: CommonFG/H5Location -> IdComponent */ class H5_DLLCPP H5File : public H5Location, public CommonFG { public: @@ -118,6 +117,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG { // constructors taking a string or a char* void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); -}; -} +}; // end of H5File +} // namespace H5 + #endif // __H5File_H diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 61c590d..a784105 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -18,8 +18,12 @@ #define __H5FloatType_H namespace H5 { +/*! \class FloatType + \brief FloatType is a derivative of a DataType and operates on HDF5 + floating point datatype. -//! Class FloatType operates on HDF5 floating point datatype. + Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent +*/ class H5_DLLCPP FloatType : public AtomType { public: // Creates a floating-point type using a predefined type. @@ -66,6 +70,8 @@ class H5_DLLCPP FloatType : public AtomType { // Noop destructor. virtual ~FloatType(); -}; -} + +}; // end of FloatType +} // namespace H5 + #endif // __H5FloatType_H diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 12f364f..9f789f1 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -18,11 +18,10 @@ #define __H5Group_H namespace H5 { - /*! \class Group \brief Class Group represents an HDF5 group. - It inherits many operations from H5Location and CommonFG. + Inheritance: CommonFG/H5Object -> H5Location -> IdComponent */ class H5_DLLCPP Group : public H5Object, public CommonFG { public: @@ -66,6 +65,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { private: hid_t id; // HDF5 group id -}; -} +}; // end of Group +} // namespace H5 + #endif // __H5Group_H diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 64684c2..7874af5 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -17,8 +17,6 @@ #ifndef __IdComponent_H #define __IdComponent_H -// IdComponent represents an HDF5 object that has an identifier. - namespace H5 { class DataSpace; @@ -118,6 +116,6 @@ class H5_DLLCPP IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent +} // namespace H5 -} #endif // __IdComponent_H diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 48ef1ef..355a51b 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -18,8 +18,12 @@ #define __H5IntType_H namespace H5 { +/*! \class IntType + \brief IntType is a derivative of a DataType and operates on HDF5 + integer datatype. -//! Class IntType operates on HDF5 integer datatype. + Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent +*/ class H5_DLLCPP IntType : public AtomType { public: // Creates an integer type using a predefined type @@ -48,6 +52,8 @@ class H5_DLLCPP IntType : public AtomType { // Noop destructor. virtual ~IntType(); -}; -} + +}; // end of IntType +} // namespace H5 + #endif // __H5IntType_H diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 0a68d34..a93a68b 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -18,7 +18,6 @@ #define __H5Library_H namespace H5 { - /*! \class H5Library \brief Class H5Library operates the HDF5 library globably. @@ -67,6 +66,7 @@ class H5_DLLCPP H5Library { ~H5Library(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of H5Library +} // namespace H5 + #endif // __H5Library_H diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 1c0f26f..b93c71e 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -20,7 +20,16 @@ #include "H5Classes.h" // constains forward class declarations namespace H5 { +/*! \class H5Location + \brief H5Location is an abstract base class, added in version 1.8.12. + + It provides a collection of wrappers for the C functions that take a + location identifier to specify the HDF5 object. The location identifier + can be either file, group, dataset, attribute, or named datatype. + Wrappers for H5A functions stay in H5Object. + Inheritance: IdComponent +*/ class H5_DLLCPP H5Location; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). @@ -169,7 +178,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Noop destructor. virtual ~H5Location(); -}; /* end class H5Location */ +}; // end of H5Location +} // namespace H5 -} #endif // __H5Location_H diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index a30a65f..016f5a2 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -20,27 +20,24 @@ #include "H5Location.h" #include "H5Classes.h" // constains forward class declarations -// H5Object is a baseclass. It has these subclasses: -// Group, DataSet, and DataType. -// DataType, in turn, has several specific datatypes as subclasses. -// Modification: -// Sept 18, 2012: Added class H5Location in between IdComponent and -// H5Object. An H5File now inherits from H5Location. All HDF5 -// wrappers in H5Object are moved up to H5Location. H5Object -// is left mostly empty for future wrappers that are only for -// group, dataset, and named datatype. Note that the reason for -// adding H5Location instead of simply moving H5File to be under -// H5Object is H5File is not an HDF5 object, and renaming H5Object -// to H5Location will risk breaking user applications. -// -BMR -// Apr 2, 2014: Added wrapper getObjName for H5Iget_name namespace H5 { - /*! \class H5Object \brief Class H5Object is a bridge between H5Location and DataSet, DataType, and Group. - All the wrappers in H5Object were moved to H5Location. + Modification: + Sept 18, 2012: Added class H5Location in between IdComponent and + H5Object. An H5File now inherits from H5Location. All HDF5 + wrappers in H5Object are moved up to H5Location. H5Object + is left mostly empty for future wrappers that are only for + group, dataset, and named datatype. Note that the reason for + adding H5Location instead of simply moving H5File to be under + H5Object is H5File is not an HDF5 object, and renaming H5Object + to H5Location will risk breaking user applications. + -BMR + Apr 2, 2014: Added wrapper getObjName for H5Iget_name + + Inheritance: H5Location -> IdComponent */ class H5_DLLCPP H5Object : public H5Location { public: @@ -73,7 +70,7 @@ class H5_DLLCPP H5Object : public H5Location { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; /* end class H5Object */ +}; // end of H5Object +} // namespace H5 -} #endif // __H5Object_H diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index f0235af..c14bb57 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -18,8 +18,12 @@ #define __H5ObjCreatPropList_H namespace H5 { +/*! \class ObjCreatPropList + \brief Class ObjCreatPropList inherits from PropList and provides + wrappers for the HDF5 file create property list. -//! Class ObjCreatPropList represents the HDF5 object creation property list. + Inheritance: PropList -> IdComponent +*/ class H5_DLLCPP ObjCreatPropList : public PropList { public: ///\brief Default object creation property list. @@ -67,6 +71,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of ObjCreatPropList +} // namespace H5 + #endif // __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 9ba5030..447c2b5 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -18,13 +18,14 @@ #define __H5PredType_H namespace H5 { - /*! \class PredType \brief Class PredType holds the definition of all the HDF5 predefined datatypes. These types can only be made copy of, not created by H5Tcreate or closed by H5Tclose. They are treated as constants. + + Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ class H5_DLLCPP PredType : public AtomType { public: @@ -436,6 +437,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PredType +} // namespace H5 + #endif // __H5PredType_H diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 1544ba7..6ef43cf 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -18,8 +18,13 @@ #define __H5PropList_H namespace H5 { - //! Class PropList provides operations for generic property lists. +/*! \class PropList + \brief Class PropList inherits from IdComponent and provides wrappers for + the HDF5 generic property list. + + Inheritance: IdComponent +*/ class H5_DLLCPP PropList : public IdComponent { public: ///\brief Default property list @@ -129,7 +134,8 @@ class H5_DLLCPP PropList : public IdComponent { friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PropList +} // namespace H5 + #endif // __H5PropList_H diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index ad1df8c..4479223 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -18,8 +18,12 @@ #define __H5StrType_H namespace H5 { +/*! \class StrType + \brief StrType is a derivative of a DataType and operates on HDF5 + string datatype. -//! Class StrType operates on HDF5 string datatypes. + Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent +*/ class H5_DLLCPP StrType : public AtomType { public: // Creates a string type using a predefined type @@ -60,6 +64,8 @@ class H5_DLLCPP StrType : public AtomType { // Noop destructor. virtual ~StrType(); -}; -} + +}; // end of StrType +} // namespace H5 + #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index bc4573a..7a2cfc1 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -14,15 +14,16 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// Class VarLenType inherits from DataType and provides wrappers for -// the HDF5 C's Variable-length Datatypes. - #ifndef __H5VarLenType_H #define __H5VarLenType_H namespace H5 { +/*! \class VarLenType + \brief VarLenType is a derivative of a DataType and operates on HDF5 + C's Variable-length Datatypes. -//! VarLenType operates on the HDF5 C's Variable-length Datatypes. + Inheritance: DataType -> H5Object -> H5Location -> IdComponent +*/ class H5_DLLCPP VarLenType : public DataType { public: // Constructor that creates a variable-length datatype based @@ -43,6 +44,8 @@ class H5_DLLCPP VarLenType : public DataType { // Default constructor VarLenType(); -}; -} + +}; // end of VarLenType +} // namespace H5 + #endif // __H5VarLenType_H -- cgit v0.12 From bb101f47746a522d9db2161cf02cb2d8f4108d25 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 13:44:19 -0500 Subject: HDFFV-10173 fix cygwin noinst libs --- test/Makefile.am | 5 +- test/Makefile.in | 155 ++++++++++++++++----------------------------- tools/h5repack/Makefile.am | 4 +- tools/h5repack/Makefile.in | 139 ++++++++++++++++------------------------ 4 files changed, 110 insertions(+), 193 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index f3c2ca5..1f397f3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -81,15 +81,12 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* - else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la diff --git a/test/Makefile.in b/test/Makefile.in index c5f95cd..2a69e10 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -118,7 +118,10 @@ TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ - $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -127,35 +130,7 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) libdynlib1_la_LIBADD = am__libdynlib1_la_SOURCES_DIST = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo @@ -164,26 +139,22 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = libdynlib2_la_LIBADD = am__libdynlib2_la_SOURCES_DIST = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = libdynlib3_la_LIBADD = am__libdynlib3_la_SOURCES_DIST = dynlib3.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo libdynlib3_la_OBJECTS = $(am_libdynlib3_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = libdynlib4_la_LIBADD = am__libdynlib4_la_SOURCES_DIST = dynlib4.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_OBJECTS = dynlib4.lo libdynlib4_la_OBJECTS = $(am_libdynlib4_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) @@ -614,6 +585,33 @@ am__tty_colors = { \ std=''; \ fi; \ } +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -1112,8 +1110,9 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_i gen_file_image @HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la +@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la \ +@HAVE_SHARED_CONDITIONAL_TRUE@ libdynlib1.la libdynlib2.la \ +@HAVE_SHARED_CONDITIONAL_TRUE@ libdynlib3.la libdynlib4.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c @@ -1206,41 +1205,6 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ @@ -2254,9 +2218,6 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -2291,12 +2252,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -2322,9 +2281,8 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: + install-html: install-html-am install-html-am: @@ -2363,26 +2321,24 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-libLTLIBRARIES + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile @@ -2403,9 +2359,6 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* - @HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. # Additional target for running timing test diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 5f32d73..636dbde 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -63,12 +63,10 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 31ff2e1..36dfda4 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -114,7 +114,10 @@ TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = tools/h5repack ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ - $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -122,35 +125,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = h5repack.sh h5repack_plugin.sh CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) libdynlibadd_la_LIBADD = am__libdynlibadd_la_SOURCES_DIST = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_OBJECTS = \ @@ -160,15 +135,14 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = libdynlibvers_la_LIBADD = am__libdynlibvers_la_SOURCES_DIST = dynlib_vrpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_OBJECTS = \ @HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_vrpk.lo libdynlibvers_la_OBJECTS = $(am_libdynlibvers_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = +am__installdirs = "$(DESTDIR)$(bindir)" am__EXEEXT_1 = h5repacktst$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = h5repack.$(OBJEXT) h5repack_copy.$(OBJEXT) \ @@ -279,6 +253,33 @@ am__tty_colors = { \ std=''; \ fi; \ } +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -732,7 +733,7 @@ COMMON_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \ h5repack_SOURCES = $(COMMON_SOURCES) h5repack_main.c h5repacktst_SOURCES = $(COMMON_SOURCES) h5repacktst.c testh5repack_detect_szip_SOURCES = testh5repack_detect_szip.c -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la libdynlibvers.la +@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libdynlibadd.la libdynlibvers.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_SOURCES = dynlib_vrpk.c DISTCLEANFILES = h5repack.sh h5repack_plugin.sh @@ -795,33 +796,9 @@ h5repack.sh: $(top_builddir)/config.status $(srcdir)/h5repack.sh.in h5repack_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5repack_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -1200,10 +1177,8 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local -install-binPROGRAMS: install-libLTLIBRARIES - installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1240,11 +1215,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -1271,9 +1245,8 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-binPROGRAMS + install-html: install-html-am install-html-am: @@ -1312,27 +1285,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES +uninstall-am: uninstall-binPROGRAMS -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-exec-hook install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS .PRECIOUS: Makefile @@ -1353,9 +1325,6 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* - # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) -- cgit v0.12 From 0558a12ef8515d11e629ccb815f6bc8632a98285 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 14:22:47 -0500 Subject: HDFFV-10170 undo patch and fix dyn lib build --- test/Makefile.am | 17 ++++++++++------- tools/h5diff/Makefile.am | 1 + tools/h5dump/Makefile.am | 1 + tools/h5repack/Makefile.am | 6 +++++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 1f397f3..fb611b3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -75,21 +75,24 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -if HAVE_SHARED_CONDITIONAL - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +# The libh5test library provides common support code for the tests. +noinst_LTLIBRARIES=libh5test.la +if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c + libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -else - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c diff --git a/tools/h5diff/Makefile.am b/tools/h5diff/Makefile.am index 0d01f14..00fc9b0 100644 --- a/tools/h5diff/Makefile.am +++ b/tools/h5diff/Makefile.am @@ -62,6 +62,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. lib_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c + libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 6d95bb2..4b54960 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -52,6 +52,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. lib_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c + libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 636dbde..83e94f6 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -63,10 +63,14 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c + libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 6f2813dca722be761f45ca06eb03d96acae3a219 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 09:34:10 -0500 Subject: Reformat char * args --- src/H5PL.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 9570289..e52a939 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -408,7 +408,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(const char* plugin_path) +H5PLappend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -441,7 +441,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(const char* plugin_path) +H5PLprepend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -477,7 +477,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char* plugin_path, unsigned int index) +H5PLreplace(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -511,7 +511,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char* plugin_path, unsigned int index) +H5PLinsert(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; -- cgit v0.12 From 780d0653f8c9cf61a648ad672bd31832a62785b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 15:31:41 -0500 Subject: HDFFV-10170 fix reconfigure --- configure | 12 +++ hl/src/H5LTparse.c | 144 +++++++++++++++++----------------- hl/src/H5LTparse.h | 4 +- src/H5D.c | 2 +- src/H5PL.c | 6 ++ src/H5config.h.in | 6 ++ test/Makefile.in | 188 +++++++++++++++++++++++++++++---------------- tools/h5diff/Makefile.in | 7 +- tools/h5dump/Makefile.in | 7 +- tools/h5repack/Makefile.in | 153 ++++++++++++++++++++++-------------- 10 files changed, 331 insertions(+), 198 deletions(-) diff --git a/configure b/configure index 90b46a0..69a2b42 100755 --- a/configure +++ b/configure @@ -26577,6 +26577,18 @@ _ACEOF fi done +for ac_func in strtoll strtoull +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + for ac_func in tmpfile asprintf vasprintf vsnprintf waitpid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 6ca95c54..36591d3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 621dacd..1461830 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/src/H5D.c b/src/H5D.c index 7f2a96d..fe29f96 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1022,7 +1022,7 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE1("h", "i", dset_id); + H5TRACE3("e", "i*h*h", dset_id, offset, chunk_nbytes); /* Check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) diff --git a/src/H5PL.c b/src/H5PL.c index e52a939..e786742 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -414,6 +414,7 @@ H5PLappend(const char *plugin_path) char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*s", plugin_path); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -448,6 +449,7 @@ H5PLprepend(const char *plugin_path) unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*s", plugin_path); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -483,6 +485,7 @@ H5PLreplace(const char *plugin_path, unsigned int index) char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE2("e", "*sIu", plugin_path, index); if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") if(index >= H5PL_MAX_PATH_NUM) @@ -518,6 +521,7 @@ H5PLinsert(const char *plugin_path, unsigned int index) unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE2("e", "*sIu", plugin_path, index); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -555,6 +559,7 @@ H5PLremove(unsigned int index) unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "Iu", index); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) @@ -599,6 +604,7 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "Iuxz", index, pathname, size); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) diff --git a/src/H5config.h.in b/src/H5config.h.in index 27b962a..a1a02bb 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -236,6 +236,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + /* Define if `struct text_info' is defined */ #undef HAVE_STRUCT_TEXT_INFO diff --git a/test/Makefile.in b/test/Makefile.in index 2a69e10..1e481bc 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -118,10 +118,7 @@ TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ - $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -130,7 +127,35 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libdynlib1_la_LIBADD = am__libdynlib1_la_SOURCES_DIST = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo @@ -139,27 +164,41 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = +libdynlib1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib1_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libdynlib2_la_LIBADD = am__libdynlib2_la_SOURCES_DIST = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = +libdynlib2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib2_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libdynlib3_la_LIBADD = am__libdynlib3_la_SOURCES_DIST = dynlib3.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo libdynlib3_la_OBJECTS = $(am_libdynlib3_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = +libdynlib3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib3_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libdynlib4_la_LIBADD = am__libdynlib4_la_SOURCES_DIST = dynlib4.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_OBJECTS = dynlib4.lo libdynlib4_la_OBJECTS = $(am_libdynlib4_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = +libdynlib4_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib4_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_FALSE@am_libh5test_la_rpath = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libh5test_la_rpath = am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \ pool$(EXEEXT) accum$(EXEEXT) hyperslab$(EXEEXT) \ @@ -585,33 +624,6 @@ am__tty_colors = { \ std=''; \ fi; \ } -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -1109,14 +1121,18 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_i gen_noencoder gen_nullspace gen_udlinks space_overflow gen_sizes_lheap \ gen_file_image -@HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la \ -@HAVE_SHARED_CONDITIONAL_TRUE@ libdynlib1.la libdynlib2.la \ -@HAVE_SHARED_CONDITIONAL_TRUE@ libdynlib3.la libdynlib4.la + +# The libh5test library provides common support code for the tests. +noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib4_la_SOURCES = dynlib4.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -1205,6 +1221,41 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ @@ -1217,19 +1268,19 @@ clean-noinstLTLIBRARIES: } libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -2218,6 +2269,9 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -2252,10 +2306,12 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -2281,8 +2337,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: - +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -2321,24 +2378,26 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ + check-am clean clean-checkPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ + uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -2354,12 +2413,11 @@ uninstall-am: help: @$(top_srcdir)/bin/makehelp -@HAVE_SHARED_CONDITIONAL_TRUE@ # The libh5test library provides common support code for the tests. - @HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* # Additional target for running timing test timings _timings: testmeta diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index a6bb1d1..1ac145d 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -159,6 +159,10 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libdynlibdiff_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdynlibdiff_la_LDFLAGS) $(LDFLAGS) \ + -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdiff_la_rpath = -rpath \ @HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) @BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = ph5diff$(EXEEXT) @@ -720,6 +724,7 @@ h5diffgentest_SOURCES = h5diffgentest.c LDADD = $(LIBH5TOOLS) $(LIBHDF5) @HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdiff.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff_la_SOURCES = dynlib_diff.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = h5diff_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -818,7 +823,7 @@ clean-libLTLIBRARIES: } libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index cc6b465..7909889 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -160,6 +160,10 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libdynlibdump_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdynlibdump_la_LDFLAGS) $(LDFLAGS) \ + -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdump_la_rpath = -rpath \ @HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) am__EXEEXT_1 = h5dumpgentest$(EXEEXT) @@ -714,6 +718,7 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c @HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdump.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump_la_SOURCES = dynlib_dump.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -814,7 +819,7 @@ clean-libLTLIBRARIES: } libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 36dfda4..2045631 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -114,10 +114,7 @@ TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = tools/h5repack ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ - $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -125,7 +122,35 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = h5repack.sh h5repack_plugin.sh CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(lib_LTLIBRARIES) libdynlibadd_la_LIBADD = am__libdynlibadd_la_SOURCES_DIST = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_OBJECTS = \ @@ -135,14 +160,23 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = +libdynlibadd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdynlibadd_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libdynlibvers_la_LIBADD = am__libdynlibvers_la_SOURCES_DIST = dynlib_vrpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_OBJECTS = \ @HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_vrpk.lo libdynlibvers_la_OBJECTS = $(am_libdynlibvers_la_OBJECTS) -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = -am__installdirs = "$(DESTDIR)$(bindir)" +libdynlibvers_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdynlibvers_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) am__EXEEXT_1 = h5repacktst$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = h5repack.$(OBJEXT) h5repack_copy.$(OBJEXT) \ @@ -253,33 +287,6 @@ am__tty_colors = { \ std=''; \ fi; \ } -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* @@ -733,9 +740,11 @@ COMMON_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \ h5repack_SOURCES = $(COMMON_SOURCES) h5repack_main.c h5repacktst_SOURCES = $(COMMON_SOURCES) h5repacktst.c testh5repack_detect_szip_SOURCES = testh5repack_detect_szip.c -@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libdynlibadd.la libdynlibvers.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la libdynlibvers.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_SOURCES = dynlib_vrpk.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = h5repack.sh h5repack_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -796,9 +805,33 @@ h5repack.sh: $(top_builddir)/config.status $(srcdir)/h5repack.sh.in h5repack_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5repack_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -808,10 +841,10 @@ clean-noinstLTLIBRARIES: } libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) $(LIBS) libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1177,8 +1210,10 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1215,10 +1250,11 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -1245,8 +1281,9 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS - +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1285,26 +1322,27 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -1325,6 +1363,9 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) -- cgit v0.12 From 0b7812b6fef61e1ab31a852bc1c92d49ef12aa53 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 12:27:00 -0500 Subject: Correct typo of file name --- config/cmake/HDF518_Examples.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 5732786..196c3d7 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -87,6 +87,6 @@ if (WIN32) include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else () - include (${CTEST_SCRIPT_DIRECTORY}/HDF_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif () -- cgit v0.12 From 326030c665c53dfb04491a92ec88e38749bfbeb0 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 23 Apr 2017 16:40:27 -0500 Subject: Format changes only. Platforms tested: Linux/32 2.6 (jam) - very minor --- c++/src/H5AbstractDs.cpp | 256 ++++++++++----------- c++/src/H5AbstractDs.h | 2 +- c++/src/H5ArrayType.cpp | 2 +- c++/src/H5ArrayType.h | 4 +- c++/src/H5AtomType.cpp | 148 ++++++------ c++/src/H5AtomType.h | 18 +- c++/src/H5Attribute.cpp | 102 ++++----- c++/src/H5Attribute.h | 16 +- c++/src/H5CommonFG.cpp | 566 +++++++++++++++++++++++----------------------- c++/src/H5CompType.cpp | 254 ++++++++++----------- c++/src/H5CompType.h | 32 +-- c++/src/H5DataSet.cpp | 274 +++++++++++----------- c++/src/H5DataSet.h | 18 +- c++/src/H5DataSpace.cpp | 320 +++++++++++++------------- c++/src/H5DataSpace.h | 18 +- c++/src/H5DataType.cpp | 292 ++++++++++++------------ c++/src/H5DataType.h | 26 +-- c++/src/H5DcreatProp.cpp | 302 ++++++++++++------------- c++/src/H5DcreatProp.h | 20 +- c++/src/H5DxferProp.cpp | 214 +++++++++--------- c++/src/H5DxferProp.h | 22 +- c++/src/H5EnumType.cpp | 138 +++++------ c++/src/H5EnumType.h | 22 +- c++/src/H5Exception.cpp | 142 ++++++------ c++/src/H5Exception.h | 16 +- c++/src/H5FaccProp.cpp | 330 +++++++++++++-------------- c++/src/H5FaccProp.h | 16 +- c++/src/H5FcreatProp.cpp | 114 +++++----- c++/src/H5FcreatProp.h | 14 +- c++/src/H5File.cpp | 192 ++++++++-------- c++/src/H5File.h | 14 +- c++/src/H5FloatType.cpp | 154 ++++++------- c++/src/H5FloatType.h | 22 +- c++/src/H5Group.cpp | 18 +- c++/src/H5Group.h | 2 +- c++/src/H5IdComponent.cpp | 60 ++--- c++/src/H5IdComponent.h | 6 +- c++/src/H5IntType.cpp | 52 ++--- c++/src/H5IntType.h | 2 +- c++/src/H5Library.cpp | 74 +++--- c++/src/H5Library.h | 4 +- c++/src/H5Location.cpp | 346 ++++++++++++++-------------- c++/src/H5Location.h | 14 +- c++/src/H5Object.h | 2 +- c++/src/H5OcreatProp.h | 2 +- c++/src/H5PredType.cpp | 12 +- c++/src/H5PredType.h | 10 +- c++/src/H5PropList.cpp | 296 ++++++++++++------------ c++/src/H5PropList.h | 12 +- c++/src/H5StrType.cpp | 98 ++++---- c++/src/H5VarLenType.cpp | 10 +- c++/src/H5VarLenType.h | 4 +- 52 files changed, 2552 insertions(+), 2552 deletions(-) diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 7568404..7642be6 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -59,42 +59,42 @@ AbstractDs::AbstractDs(){} //-------------------------------------------------------------------------- H5T_class_t AbstractDs::getTypeClass() const { - // Gets the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on - // which object invokes getTypeClass - hid_t datatype_id; - try { + // Gets the datatype used by this dataset or attribute. + // p_get_type calls either H5Dget_type or H5Aget_type depending on + // which object invokes getTypeClass + hid_t datatype_id; + try { datatype_id = p_get_type(); // returned value is already validated - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); + } - // Gets the class of the datatype and validate it before returning - H5T_class_t type_class = H5Tget_class(datatype_id); + // Gets the class of the datatype and validate it before returning + H5T_class_t type_class = H5Tget_class(datatype_id); - // Close temporary datatype_id - herr_t ret_value = H5Tclose(datatype_id); - if (ret_value < 0) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); - } + // Close temporary datatype_id + herr_t ret_value = H5Tclose(datatype_id); + if (ret_value < 0) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); + } - // Check on the returned type_class - if (type_class == H5T_NO_CLASS) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - } - return(type_class); + // Check on the returned type_class + if (type_class == H5T_NO_CLASS) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + } + return(type_class); } //-------------------------------------------------------------------------- @@ -107,21 +107,21 @@ H5T_class_t AbstractDs::getTypeClass() const //-------------------------------------------------------------------------- DataType AbstractDs::getDataType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getDataType. Then, create and - // return the DataType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getDataType. Then, create and + // return the DataType object + try { DataType datatype; f_DataType_setId(&datatype, p_get_type()); return(datatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -134,23 +134,23 @@ DataType AbstractDs::getDataType() const //-------------------------------------------------------------------------- ArrayType AbstractDs::getArrayType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getArrayType. Then, create and - // return the ArrayType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getArrayType. Then, create and + // return the ArrayType object + try { // Create ArrayType and set values this way to work around the // problem described in the JIRA issue HDFFV-7947 ArrayType arraytype; f_DataType_setId(&arraytype, p_get_type()); return(arraytype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -163,21 +163,21 @@ ArrayType AbstractDs::getArrayType() const //-------------------------------------------------------------------------- CompType AbstractDs::getCompType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getCompType. Then, create and - // return the CompType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getCompType. Then, create and + // return the CompType object + try { CompType comptype; f_DataType_setId(&comptype, p_get_type()); return(comptype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -190,21 +190,21 @@ CompType AbstractDs::getCompType() const //-------------------------------------------------------------------------- EnumType AbstractDs::getEnumType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getEnumType. Then, create and - // return the EnumType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getEnumType. Then, create and + // return the EnumType object + try { EnumType enumtype; f_DataType_setId(&enumtype, p_get_type()); return(enumtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -217,21 +217,21 @@ EnumType AbstractDs::getEnumType() const //-------------------------------------------------------------------------- IntType AbstractDs::getIntType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getIntType. Then, create and - // return the IntType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getIntType. Then, create and + // return the IntType object + try { IntType inttype; f_DataType_setId(&inttype, p_get_type()); return(inttype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -244,21 +244,21 @@ IntType AbstractDs::getIntType() const //-------------------------------------------------------------------------- FloatType AbstractDs::getFloatType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getFloatType. Then, create and - // return the FloatType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getFloatType. Then, create and + // return the FloatType object + try { FloatType floatype; f_DataType_setId(&floatype, p_get_type()); return(floatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -271,21 +271,21 @@ FloatType AbstractDs::getFloatType() const //-------------------------------------------------------------------------- StrType AbstractDs::getStrType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getStrType. Then, create and - // return the StrType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getStrType. Then, create and + // return the StrType object + try { StrType strtype; f_DataType_setId(&strtype, p_get_type()); return(strtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -298,21 +298,21 @@ StrType AbstractDs::getStrType() const //-------------------------------------------------------------------------- VarLenType AbstractDs::getVarLenType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getVarLenType. Then, create and - // return the VarLenType object - try { + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getVarLenType. Then, create and + // return the VarLenType object + try { VarLenType varlentype; f_DataType_setId(&varlentype, p_get_type()); return(varlentype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); - } + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 547485c..516188a 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -86,7 +86,7 @@ class H5_DLLCPP AbstractDs { // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); // Copy constructor - // AbstractDs( const AbstractDs& original ); + // AbstractDs(const AbstractDs& original); private: // This member function is implemented by DataSet and Attribute - pure virtual. diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 658946b..c99e880 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -42,7 +42,7 @@ ArrayType::ArrayType() : DataType() {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) {} +ArrayType::ArrayType(const hid_t existing_id) : DataType( existing_id ) {} //-------------------------------------------------------------------------- // Function: ArrayType copy constructor diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 1ba0e5c..d55a767 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -45,10 +45,10 @@ class H5_DLLCPP ArrayType : public DataType { virtual H5std_string fromClass () const { return("ArrayType"); } // Copy constructor: makes copy of the original object. - ArrayType( const ArrayType& original ); + ArrayType(const ArrayType& original); // Constructor that takes an existing id - ArrayType( const hid_t existing_id ); + ArrayType(const hid_t existing_id); // Noop destructor virtual ~ArrayType(); diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 172f625..3b801ba 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -43,14 +43,14 @@ AtomType::AtomType() : DataType() {} // Exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {} +AtomType::AtomType(const hid_t existing_id) : DataType( existing_id ) {} //-------------------------------------------------------------------------- // Function: AtomType copy constructor ///\brief Copy constructor: makes a copy of the original AtomType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType( const AtomType& original ) : DataType( original ) {} +AtomType::AtomType(const AtomType& original) : DataType( original ) {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -60,14 +60,14 @@ AtomType::AtomType( const AtomType& original ) : DataType( original ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setSize( size_t size ) const +void AtomType::setSize(size_t size) const { - // Call C routine H5Tset_size to set the total size - herr_t ret_value = H5Tset_size( id, size ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); - } + // Call C routine H5Tset_size to set the total size + herr_t ret_value = H5Tset_size(id, size); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); + } } //-------------------------------------------------------------------------- @@ -82,16 +82,16 @@ void AtomType::setSize( size_t size ) const //-------------------------------------------------------------------------- H5T_order_t AtomType::getOrder() const { - // Call C routine to get the byte ordering - H5T_order_t type_order = H5Tget_order( id ); + // Call C routine to get the byte ordering + H5T_order_t type_order = H5Tget_order(id); - // return a byte order constant if successful - if( type_order == H5T_ORDER_ERROR ) - { - throw DataTypeIException(inMemFunc("getOrder"), + // return a byte order constant if successful + if(type_order == H5T_ORDER_ERROR) + { + throw DataTypeIException(inMemFunc("getOrder"), "H5Tget_order returns H5T_ORDER_ERROR"); - } - return( type_order ); + } + return(type_order); } //-------------------------------------------------------------------------- @@ -111,19 +111,19 @@ H5T_order_t AtomType::getOrder() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_order_t AtomType::getOrder( H5std_string& order_string ) const +H5T_order_t AtomType::getOrder(H5std_string& order_string) const { - // Call the overloaded to get the type order without text - H5T_order_t type_order = getOrder(); + // Call the overloaded to get the type order without text + H5T_order_t type_order = getOrder(); - // Then provide the text and return the type order - if( type_order == H5T_ORDER_LE ) + // Then provide the text and return the type order + if(type_order == H5T_ORDER_LE) order_string = "Little endian byte ordering (0)"; - else if( type_order == H5T_ORDER_BE ) + else if(type_order == H5T_ORDER_BE) order_string = "Big endian byte ordering (1)"; - else if( type_order == H5T_ORDER_VAX ) + else if(type_order == H5T_ORDER_VAX) order_string = "VAX mixed byte ordering (2)"; - return( type_order ); + return(type_order); } //-------------------------------------------------------------------------- @@ -136,14 +136,14 @@ H5T_order_t AtomType::getOrder( H5std_string& order_string ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOrder( H5T_order_t order ) const +void AtomType::setOrder(H5T_order_t order) const { - // Call C routine to set the byte ordering - herr_t ret_value = H5Tset_order( id, order ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); - } + // Call C routine to set the byte ordering + herr_t ret_value = H5Tset_order(id, order); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); + } } //-------------------------------------------------------------------------- @@ -159,15 +159,15 @@ void AtomType::setOrder( H5T_order_t order ) const //-------------------------------------------------------------------------- size_t AtomType::getPrecision() const { - size_t num_signi_bits = H5Tget_precision( id ); // C routine + size_t num_signi_bits = H5Tget_precision(id); // C routine - // returns number of significant bits if successful - if( num_signi_bits == 0 ) - { - throw DataTypeIException(inMemFunc("getPrecision"), + // returns number of significant bits if successful + if(num_signi_bits == 0) + { + throw DataTypeIException(inMemFunc("getPrecision"), "H5Tget_precision returns invalid number of significant bits"); - } - return( num_signi_bits ); + } + return(num_signi_bits); } //-------------------------------------------------------------------------- @@ -180,14 +180,14 @@ size_t AtomType::getPrecision() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPrecision( size_t precision ) const +void AtomType::setPrecision(size_t precision) const { - // Call C routine to set the datatype precision - herr_t ret_value = H5Tset_precision( id, precision ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); - } + // Call C routine to set the datatype precision + herr_t ret_value = H5Tset_precision(id, precision); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); + } } //-------------------------------------------------------------------------- @@ -206,15 +206,15 @@ void AtomType::setPrecision( size_t precision ) const //-------------------------------------------------------------------------- int AtomType::getOffset() const { - int offset = H5Tget_offset( id ); // C routine + int offset = H5Tget_offset(id); // C routine - // returns a non-negative offset value if successful - if( offset == -1 ) - { - throw DataTypeIException(inMemFunc("getOffset"), + // returns a non-negative offset value if successful + if(offset == -1) + { + throw DataTypeIException(inMemFunc("getOffset"), "H5Tget_offset returns a negative offset value"); - } - return( offset ); + } + return(offset); } //-------------------------------------------------------------------------- @@ -227,14 +227,14 @@ int AtomType::getOffset() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOffset( size_t offset ) const +void AtomType::setOffset(size_t offset) const { - // Call C routine to set the bit offset - herr_t ret_value = H5Tset_offset( id, offset ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); - } + // Call C routine to set the bit offset + herr_t ret_value = H5Tset_offset(id, offset); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); + } } //-------------------------------------------------------------------------- @@ -251,14 +251,14 @@ void AtomType::setOffset( size_t offset ) const /// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const +void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const { - // Call C routine to get the padding type - herr_t ret_value = H5Tget_pad( id, &lsb, &msb ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); - } + // Call C routine to get the padding type + herr_t ret_value = H5Tget_pad(id, &lsb, &msb); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); + } } //-------------------------------------------------------------------------- @@ -274,14 +274,14 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const /// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const +void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const { - // Call C routine to set the padding type - herr_t ret_value = H5Tset_pad( id, lsb, msb ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); - } + // Call C routine to set the padding type + herr_t ret_value = H5Tset_pad(id, lsb, msb); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index ca48b92..c588f38 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -31,39 +31,39 @@ class H5_DLLCPP AtomType : public DataType { public: // Returns the byte order of an atomic datatype. H5T_order_t getOrder() const; - H5T_order_t getOrder( H5std_string& order_string ) const; + H5T_order_t getOrder(H5std_string& order_string) const; // Sets the byte ordering of an atomic datatype. - void setOrder( H5T_order_t order ) const; + void setOrder(H5T_order_t order) const; // Retrieves the bit offset of the first significant bit. // 12/05/00 - changed return type to int from size_t - C API int getOffset() const; // Sets the bit offset of the first significant bit. - void setOffset( size_t offset ) const; + void setOffset(size_t offset) const; // Retrieves the padding type of the least and most-significant bit padding. - void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; + void getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const; // Sets the least and most-significant bits padding types - void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; + void setPad(H5T_pad_t lsb, H5T_pad_t msb) const; // Returns the precision of an atomic datatype. size_t getPrecision() const; // Sets the precision of an atomic datatype. - void setPrecision( size_t precision ) const; + void setPrecision(size_t precision) const; // Sets the total size for an atomic datatype. - void setSize( size_t size ) const; + void setSize(size_t size) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS // Copy constructor - makes copy of the original object - AtomType( const AtomType& original ); + AtomType(const AtomType& original); // Noop destructor virtual ~AtomType(); @@ -75,7 +75,7 @@ class H5_DLLCPP AtomType : public DataType { AtomType(); // Constructor that takes an existing id - AtomType( const hid_t existing_id ); + AtomType(const hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of AtomType diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 3162151..00407bc 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -84,13 +84,13 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent(), id( ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::write( const DataType& mem_type, const void *buf ) const +void Attribute::write(const DataType& mem_type, const void *buf) const { - herr_t ret_value = H5Awrite( id, mem_type.getId(), buf ); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::write", "H5Awrite failed"); - } + herr_t ret_value = H5Awrite(id, mem_type.getId(), buf); + if(ret_value < 0) + { + throw AttributeIException("Attribute::write", "H5Awrite failed"); + } } //-------------------------------------------------------------------------- @@ -140,13 +140,13 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::read( const DataType& mem_type, void *buf ) const +void Attribute::read(const DataType& mem_type, void *buf) const { - herr_t ret_value = H5Aread( id, mem_type.getId(), buf ); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::read", "H5Aread failed"); - } + herr_t ret_value = H5Aread(id, mem_type.getId(), buf); + if(ret_value < 0) + { + throw AttributeIException("Attribute::read", "H5Aread failed"); + } } //-------------------------------------------------------------------------- @@ -202,7 +202,7 @@ size_t Attribute::getInMemDataSize() const // Get the data type of this attribute hid_t mem_type_id = H5Aget_type(id); - if( mem_type_id < 0 ) + if(mem_type_id < 0) { throw AttributeIException(func, "H5Aget_type failed"); } @@ -263,20 +263,20 @@ size_t Attribute::getInMemDataSize() const //-------------------------------------------------------------------------- DataSpace Attribute::getSpace() const { - // Calls C function H5Aget_space to get the id of the dataspace - hid_t dataspace_id = H5Aget_space( id ); + // Calls C function H5Aget_space to get the id of the dataspace + hid_t dataspace_id = H5Aget_space(id); - // If the dataspace id is valid, create and return the DataSpace object - if( dataspace_id > 0 ) - { + // If the dataspace id is valid, create and return the DataSpace object + if(dataspace_id > 0) + { DataSpace dataspace; f_DataSpace_setId(&dataspace, dataspace_id); return(dataspace); - } - else - { - throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); - } + } + else + { + throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); + } } //-------------------------------------------------------------------------- @@ -288,12 +288,12 @@ DataSpace Attribute::getSpace() const //-------------------------------------------------------------------------- H5std_string Attribute::getFileName() const { - try { - return(p_get_file_name()); - } - catch (IdComponentException& E) { - throw FileIException("Attribute::getFileName", E.getDetailMsg()); - } + try { + return(p_get_file_name()); + } + catch (IdComponentException& E) { + throw FileIException("Attribute::getFileName", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -463,9 +463,9 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const // Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 // Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const +//ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const //{ -// return (getName(attr_name, len)); +// return (getName(attr_name, len)); //} //-------------------------------------------------------------------------- @@ -479,8 +479,8 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const //-------------------------------------------------------------------------- hsize_t Attribute::getStorageSize() const { - hsize_t storage_size = H5Aget_storage_size(id); - return (storage_size); + hsize_t storage_size = H5Aget_storage_size(id); + return (storage_size); } //-------------------------------------------------------------------------- @@ -501,11 +501,11 @@ hsize_t Attribute::getStorageSize() const //-------------------------------------------------------------------------- void Attribute::flush(H5F_scope_t scope) const { - herr_t ret_value = H5Fflush(getId(), scope); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::flush", "H5Fflush failed"); - } + herr_t ret_value = H5Fflush(getId(), scope); + if(ret_value < 0) + { + throw AttributeIException("Attribute::flush", "H5Fflush failed"); + } } //-------------------------------------------------------------------------- @@ -521,7 +521,7 @@ void Attribute::flush(H5F_scope_t scope) const //-------------------------------------------------------------------------- hid_t Attribute::getId() const { - return(id); + return(id); } //-------------------------------------------------------------------------- @@ -535,13 +535,13 @@ hid_t Attribute::getId() const //-------------------------------------------------------------------------- hid_t Attribute::p_get_type() const { - hid_t type_id = H5Aget_type( id ); - if( type_id > 0 ) - return( type_id ); - else - { - throw AttributeIException("", "H5Aget_type failed"); - } + hid_t type_id = H5Aget_type(id); + if(type_id > 0) + return(type_id); + else + { + throw AttributeIException("", "H5Aget_type failed"); + } } //-------------------------------------------------------------------------- @@ -568,7 +568,7 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c { char *strg_C = new char[attr_size+1]; herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); - if( ret_value < 0 ) + if(ret_value < 0) { delete []strg_C; // de-allocate for fixed-len string throw AttributeIException("Attribute::read", "H5Aread failed"); @@ -600,7 +600,7 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg // Read attribute, no allocation for variable-len string; C library will herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C); - if( ret_value < 0 ) + if(ret_value < 0) { throw AttributeIException("Attribute::read", "H5Aread failed"); } @@ -632,8 +632,8 @@ void Attribute::p_setId(const hid_t new_id) catch (Exception& close_error) { throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -649,7 +649,7 @@ void Attribute::close() if (p_valid_id(id)) { herr_t ret_value = H5Aclose(id); - if( ret_value < 0 ) + if(ret_value < 0) { throw AttributeIException("Attribute::close", "H5Aclose failed"); } diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 4f933e9..e61da01 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -32,13 +32,13 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { public: // Copy constructor: makes a copy of an existing Attribute object. - Attribute( const Attribute& original ); + Attribute(const Attribute& original); // Default constructor Attribute(); // Creates a copy of an existing attribute using the attribute id - Attribute( const hid_t attr_id ); + Attribute(const hid_t attr_id); // Closes this attribute. virtual void close(); @@ -53,7 +53,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { ssize_t getName(H5std_string& attr_name, size_t len = 0) const; // The overloaded function below is replaced by the one above and it // is kept for backward compatibility purpose. - ssize_t getName( size_t buf_size, H5std_string& attr_name ) const; + ssize_t getName(size_t buf_size, H5std_string& attr_name) const; // Gets a copy of the dataspace for this attribute. virtual DataSpace getSpace() const; @@ -65,16 +65,16 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { virtual size_t getInMemDataSize() const; // Reads data from this attribute. - void read( const DataType& mem_type, void *buf ) const; - void read( const DataType& mem_type, H5std_string& strg ) const; + void read(const DataType& mem_type, void *buf) const; + void read(const DataType& mem_type, H5std_string& strg) const; // Writes data to this attribute. - void write(const DataType& mem_type, const void *buf ) const; - void write(const DataType& mem_type, const H5std_string& strg ) const; + void write(const DataType& mem_type, const void *buf) const; + void write(const DataType& mem_type, const H5std_string& strg) const; // Flushes all buffers associated with the file specified by this // attribute to disk. - void flush( H5F_scope_t scope ) const; + void flush(H5F_scope_t scope) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("Attribute"); } diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index e1c4818..10f6c58 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -65,7 +65,7 @@ namespace H5 { /// then a default size is chosen. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- - Group CommonFG::createGroup( const char* name, size_t size_hint ) const +Group CommonFG::createGroup(const char* name, size_t size_hint) const { // Group creation property list for size hint hid_t gcpl_id = 0; @@ -73,33 +73,33 @@ namespace H5 { // Set the local heap size hint if (size_hint > 0) { - // If the creation of the property list failed, throw an exception - if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - throwException("createGroup", "H5Pcreate failed"); - - if (H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) { - H5Pclose(gcpl_id); - throwException("createGroup", "H5Pset_local_heap_size_hint failed"); - } + // If the creation of the property list failed, throw an exception + if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) + throwException("createGroup", "H5Pcreate failed"); + + if (H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) { + H5Pclose(gcpl_id); + throwException("createGroup", "H5Pset_local_heap_size_hint failed"); + } } - // Call C routine H5Gcreate2 to create the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gcreate2( getLocId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT ); + // Call C routine H5Gcreate2 to create the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gcreate2(getLocId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT); - // Close the group creation property list, if necessary - if(gcpl_id > 0) - H5Pclose(gcpl_id); + // Close the group creation property list, if necessary + if(gcpl_id > 0) + H5Pclose(gcpl_id); - // If the creation of the group failed, throw an exception - if( group_id < 0 ) - throwException("createGroup", "H5Gcreate2 failed"); + // If the creation of the group failed, throw an exception + if(group_id < 0) + throwException("createGroup", "H5Gcreate2 failed"); - // No failure, create and return the Group object - Group group; + // No failure, create and return the Group object + Group group; CommonFG *ptr = &group; ptr->p_setId(group_id); - return( group ); + return(group); } //-------------------------------------------------------------------------- @@ -109,9 +109,9 @@ namespace H5 { /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const +Group CommonFG::createGroup(const H5std_string& name, size_t size_hint) const { - return( createGroup( name.c_str(), size_hint )); + return(createGroup(name.c_str(), size_hint)); } //-------------------------------------------------------------------------- @@ -123,21 +123,21 @@ Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group CommonFG::openGroup( const char* name ) const +Group CommonFG::openGroup(const char* name) const { - // Call C routine H5Gopen2 to open the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gopen2( getLocId(), name, H5P_DEFAULT ); + // Call C routine H5Gopen2 to open the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gopen2(getLocId(), name, H5P_DEFAULT); - // If the opening of the group failed, throw an exception - if( group_id < 0 ) - throwException("openGroup", "H5Gopen2 failed"); + // If the opening of the group failed, throw an exception + if(group_id < 0) + throwException("openGroup", "H5Gopen2 failed"); - // No failure, create and return the Group object - Group group; + // No failure, create and return the Group object + Group group; CommonFG *ptr = &group; ptr->p_setId(group_id); - return( group ); + return(group); } //-------------------------------------------------------------------------- @@ -147,9 +147,9 @@ Group CommonFG::openGroup( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group CommonFG::openGroup( const H5std_string& name ) const +Group CommonFG::openGroup(const H5std_string& name) const { - return( openGroup( name.c_str() )); + return(openGroup(name.c_str())); } //-------------------------------------------------------------------------- @@ -163,24 +163,24 @@ Group CommonFG::openGroup( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const +DataSet CommonFG::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { - // Obtain identifiers for C API - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t create_plist_id = create_plist.getId(); - - // Call C routine H5Dcreate2 to create the named dataset - hid_t dataset_id = H5Dcreate2( getLocId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT ); - - // If the creation of the dataset failed, throw an exception - if( dataset_id < 0 ) - throwException("createDataSet", "H5Dcreate2 failed"); - - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return( dataset ); + // Obtain identifiers for C API + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t create_plist_id = create_plist.getId(); + + // Call C routine H5Dcreate2 to create the named dataset + hid_t dataset_id = H5Dcreate2(getLocId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT); + + // If the creation of the dataset failed, throw an exception + if(dataset_id < 0) + throwException("createDataSet", "H5Dcreate2 failed"); + + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return(dataset); } //-------------------------------------------------------------------------- @@ -190,9 +190,9 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const +DataSet CommonFG::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { - return( createDataSet( name.c_str(), data_type, data_space, create_plist )); + return(createDataSet(name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- @@ -203,20 +203,20 @@ DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_ ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::openDataSet( const char* name ) const +DataSet CommonFG::openDataSet(const char* name) const { - // Call C function H5Dopen2 to open the specified dataset, giving - // the location id and the dataset's name - hid_t dataset_id = H5Dopen2( getLocId(), name, H5P_DEFAULT ); - - // If the dataset's opening failed, throw an exception - if(dataset_id < 0) - throwException("openDataSet", "H5Dopen2 failed"); - - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return( dataset ); + // Call C function H5Dopen2 to open the specified dataset, giving + // the location id and the dataset's name + hid_t dataset_id = H5Dopen2(getLocId(), name, H5P_DEFAULT); + + // If the dataset's opening failed, throw an exception + if(dataset_id < 0) + throwException("openDataSet", "H5Dopen2 failed"); + + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return(dataset); } //-------------------------------------------------------------------------- @@ -226,9 +226,9 @@ DataSet CommonFG::openDataSet( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::openDataSet( const H5std_string& name ) const +DataSet CommonFG::openDataSet(const H5std_string& name) const { - return( openDataSet( name.c_str() )); + return(openDataSet(name.c_str())); } //-------------------------------------------------------------------------- @@ -253,17 +253,17 @@ DataSet CommonFG::openDataSet( const H5std_string& name ) const // Modification // 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const +void CommonFG::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { herr_t ret_value = -1; switch(link_type) { case H5L_TYPE_HARD: - ret_value = H5Lcreate_hard( getLocId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT ); + ret_value = H5Lcreate_hard(getLocId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT); break; case H5L_TYPE_SOFT: - ret_value = H5Lcreate_soft( curr_name, getLocId(), new_name, H5P_DEFAULT, H5P_DEFAULT ); + ret_value = H5Lcreate_soft(curr_name, getLocId(), new_name, H5P_DEFAULT, H5P_DEFAULT); break; case H5L_TYPE_ERROR: @@ -274,8 +274,8 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne break; } /* end switch */ - if( ret_value < 0 ) - throwException("link", "creating link failed"); + if(ret_value < 0) + throwException("link", "creating link failed"); } //-------------------------------------------------------------------------- @@ -285,9 +285,9 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne /// \c H5std_string for \a curr_name and \a new_name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const +void CommonFG::link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const { - link( link_type, curr_name.c_str(), new_name.c_str() ); + link(link_type, curr_name.c_str(), new_name.c_str()); } //-------------------------------------------------------------------------- @@ -299,11 +299,11 @@ void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const // Modification // 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void CommonFG::unlink( const char* name ) const +void CommonFG::unlink(const char* name) const { - herr_t ret_value = H5Ldelete( getLocId(), name, H5P_DEFAULT ); - if( ret_value < 0 ) - throwException("unlink", "H5Ldelete failed"); + herr_t ret_value = H5Ldelete(getLocId(), name, H5P_DEFAULT); + if(ret_value < 0) + throwException("unlink", "H5Ldelete failed"); } //-------------------------------------------------------------------------- @@ -313,9 +313,9 @@ void CommonFG::unlink( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::unlink( const H5std_string& name ) const +void CommonFG::unlink(const H5std_string& name) const { - unlink( name.c_str() ); + unlink(name.c_str()); } //-------------------------------------------------------------------------- @@ -333,11 +333,11 @@ void CommonFG::unlink( const H5std_string& name ) const // Modification // 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void CommonFG::move( const char* src, const char* dst ) const +void CommonFG::move(const char* src, const char* dst) const { - herr_t ret_value = H5Lmove( getLocId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT ); - if( ret_value < 0 ) - throwException("move", "H5Lmove failed"); + herr_t ret_value = H5Lmove(getLocId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT); + if(ret_value < 0) + throwException("move", "H5Lmove failed"); } //-------------------------------------------------------------------------- @@ -347,9 +347,9 @@ void CommonFG::move( const char* src, const char* dst ) const /// \c H5std_string for \a src and \a dst. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const +void CommonFG::move(const H5std_string& src, const H5std_string& dst) const { - move( src.c_str(), dst.c_str() ); + move(src.c_str(), dst.c_str()); } #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -366,11 +366,11 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const { - herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf ); - if( ret_value < 0 ) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getLocId(), name, follow_link, &statbuf); + if(ret_value < 0) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- @@ -380,9 +380,9 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const { - getObjinfo( name.c_str(), follow_link, statbuf ); + getObjinfo(name.c_str(), follow_link, statbuf); } //-------------------------------------------------------------------------- @@ -393,11 +393,11 @@ void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_st // Programmer Binh-Minh Ribler - Nov, 2005 // Note: need to modify to use H5Oget_info and H5Lget_info - BMR //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo(const char* name, H5G_stat_t& statbuf) const { - herr_t ret_value = H5Gget_objinfo( getLocId(), name, 0, &statbuf ); - if( ret_value < 0 ) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getLocId(), name, 0, &statbuf); + if(ret_value < 0) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- @@ -407,9 +407,9 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const { - getObjinfo( name.c_str(), statbuf ); + getObjinfo(name.c_str(), statbuf); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -422,7 +422,7 @@ void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string CommonFG::getLinkval( const char* name, size_t size ) const +H5std_string CommonFG::getLinkval(const char* name, size_t size) const { H5L_info_t linkinfo; char *value_C; // value in C string @@ -434,7 +434,7 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const if (size == 0) { ret_value = H5Lget_info(getLocId(), name, &linkinfo, H5P_DEFAULT); - if( ret_value < 0 ) + if(ret_value < 0) throwException("getLinkval", "H5Lget_info to find buffer size failed"); val_size = linkinfo.u.val_size; @@ -447,7 +447,7 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const HDmemset(value_C, 0, val_size+1); // clear buffer ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); - if( ret_value < 0 ) + if(ret_value < 0) { delete []value_C; throwException("getLinkval", "H5Lget_val failed"); @@ -466,9 +466,9 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const +H5std_string CommonFG::getLinkval(const H5std_string& name, size_t size) const { - return( getLinkval( name.c_str(), size )); + return(getLinkval(name.c_str(), size)); } //-------------------------------------------------------------------------- @@ -482,18 +482,18 @@ H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const // Modification // Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- -void CommonFG::mount(const char* name, const H5File& child, const PropList& plist ) const +void CommonFG::mount(const char* name, const H5File& child, const PropList& plist) const { - // Obtain identifiers for C API - hid_t plist_id = plist.getId(); - hid_t child_id = child.getId(); + // Obtain identifiers for C API + hid_t plist_id = plist.getId(); + hid_t child_id = child.getId(); - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Fmount( getLocId(), name, child_id, plist_id ); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Fmount(getLocId(), name, child_id, plist_id); - // Raise exception if H5Fmount returns negative value - if( ret_value < 0 ) - throwException("mount", "H5Fmount failed"); + // Raise exception if H5Fmount returns negative value + if(ret_value < 0) + throwException("mount", "H5Fmount failed"); } //-------------------------------------------------------------------------- @@ -526,7 +526,7 @@ void CommonFG::mount(const char* name, const H5File& child, const PropList& plis //-------------------------------------------------------------------------- void CommonFG::mount(const H5std_string& name, const H5File& child, const PropList& plist) const { - mount(name.c_str(), child, plist); + mount(name.c_str(), child, plist); } //-------------------------------------------------------------------------- @@ -552,14 +552,14 @@ void CommonFG::mount(const H5std_string& name, const H5File& child, const PropLi ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::unmount( const char* name ) const +void CommonFG::unmount(const char* name) const { - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Funmount( getLocId(), name ); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Funmount(getLocId(), name); - // Raise exception if H5Funmount returns negative value - if( ret_value < 0 ) - throwException("unmount", "H5Funmount failed"); + // Raise exception if H5Funmount returns negative value + if(ret_value < 0) + throwException("unmount", "H5Funmount failed"); } //-------------------------------------------------------------------------- @@ -569,9 +569,9 @@ void CommonFG::unmount( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::unmount( const H5std_string& name ) const +void CommonFG::unmount(const H5std_string& name) const { - unmount( name.c_str() ); + unmount(name.c_str()); } //-------------------------------------------------------------------------- @@ -582,20 +582,20 @@ void CommonFG::unmount( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType( const char* name ) const +DataType CommonFG::openDataType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openDataType", "H5Topen2 failed"); - - // No failure, create and return the DataType object - DataType data_type; - f_DataType_setId(&data_type, type_id); - return(data_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openDataType", "H5Topen2 failed"); + + // No failure, create and return the DataType object + DataType data_type; + f_DataType_setId(&data_type, type_id); + return(data_type); } //-------------------------------------------------------------------------- @@ -605,9 +605,9 @@ DataType CommonFG::openDataType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType( const H5std_string& name ) const +DataType CommonFG::openDataType(const H5std_string& name) const { - return( openDataType( name.c_str()) ); + return(openDataType(name.c_str())); } //-------------------------------------------------------------------------- @@ -618,20 +618,20 @@ DataType CommonFG::openDataType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType( const char* name ) const +ArrayType CommonFG::openArrayType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openArrayType", "H5Topen2 failed"); - - // No failure, create and return the ArrayType object - ArrayType array_type; - f_DataType_setId(&array_type, type_id); - return(array_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openArrayType", "H5Topen2 failed"); + + // No failure, create and return the ArrayType object + ArrayType array_type; + f_DataType_setId(&array_type, type_id); + return(array_type); } //-------------------------------------------------------------------------- @@ -641,9 +641,9 @@ ArrayType CommonFG::openArrayType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType( const H5std_string& name ) const +ArrayType CommonFG::openArrayType(const H5std_string& name) const { - return( openArrayType( name.c_str()) ); + return(openArrayType(name.c_str())); } //-------------------------------------------------------------------------- @@ -654,20 +654,20 @@ ArrayType CommonFG::openArrayType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType( const char* name ) const +CompType CommonFG::openCompType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openCompType", "H5Topen2 failed"); - - // No failure, create and return the CompType object - CompType comp_type; - f_DataType_setId(&comp_type, type_id); - return(comp_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openCompType", "H5Topen2 failed"); + + // No failure, create and return the CompType object + CompType comp_type; + f_DataType_setId(&comp_type, type_id); + return(comp_type); } //-------------------------------------------------------------------------- @@ -677,9 +677,9 @@ CompType CommonFG::openCompType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType( const H5std_string& name ) const +CompType CommonFG::openCompType(const H5std_string& name) const { - return( openCompType( name.c_str()) ); + return(openCompType(name.c_str())); } //-------------------------------------------------------------------------- @@ -690,20 +690,20 @@ CompType CommonFG::openCompType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType( const char* name ) const +EnumType CommonFG::openEnumType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openEnumType", "H5Topen2 failed"); - - // No failure, create and return the EnumType object - EnumType enum_type; - f_DataType_setId(&enum_type, type_id); - return(enum_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openEnumType", "H5Topen2 failed"); + + // No failure, create and return the EnumType object + EnumType enum_type; + f_DataType_setId(&enum_type, type_id); + return(enum_type); } //-------------------------------------------------------------------------- @@ -713,9 +713,9 @@ EnumType CommonFG::openEnumType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType( const H5std_string& name ) const +EnumType CommonFG::openEnumType(const H5std_string& name) const { - return( openEnumType( name.c_str()) ); + return(openEnumType(name.c_str())); } //-------------------------------------------------------------------------- @@ -726,20 +726,20 @@ EnumType CommonFG::openEnumType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType( const char* name ) const +IntType CommonFG::openIntType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openIntType", "H5Topen2 failed"); - - // No failure, create and return the IntType object - IntType int_type; - f_DataType_setId(&int_type, type_id); - return(int_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openIntType", "H5Topen2 failed"); + + // No failure, create and return the IntType object + IntType int_type; + f_DataType_setId(&int_type, type_id); + return(int_type); } //-------------------------------------------------------------------------- @@ -749,9 +749,9 @@ IntType CommonFG::openIntType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType( const H5std_string& name ) const +IntType CommonFG::openIntType(const H5std_string& name) const { - return( openIntType( name.c_str()) ); + return(openIntType(name.c_str())); } //-------------------------------------------------------------------------- @@ -762,20 +762,20 @@ IntType CommonFG::openIntType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType( const char* name ) const +FloatType CommonFG::openFloatType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openFloatType", "H5Topen2 failed"); - - // No failure, create and return the FloatType object - FloatType float_type; - f_DataType_setId(&float_type, type_id); - return(float_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openFloatType", "H5Topen2 failed"); + + // No failure, create and return the FloatType object + FloatType float_type; + f_DataType_setId(&float_type, type_id); + return(float_type); } //-------------------------------------------------------------------------- @@ -785,9 +785,9 @@ FloatType CommonFG::openFloatType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType( const H5std_string& name ) const +FloatType CommonFG::openFloatType(const H5std_string& name) const { - return( openFloatType( name.c_str()) ); + return(openFloatType(name.c_str())); } //-------------------------------------------------------------------------- @@ -798,20 +798,20 @@ FloatType CommonFG::openFloatType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType( const char* name ) const +StrType CommonFG::openStrType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openStrType", "H5Topen2 failed"); - - // No failure, create and return the StrType object - StrType str_type; - f_DataType_setId(&str_type, type_id); - return(str_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openStrType", "H5Topen2 failed"); + + // No failure, create and return the StrType object + StrType str_type; + f_DataType_setId(&str_type, type_id); + return(str_type); } //-------------------------------------------------------------------------- @@ -821,9 +821,9 @@ StrType CommonFG::openStrType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType( const H5std_string& name ) const +StrType CommonFG::openStrType(const H5std_string& name) const { - return( openStrType( name.c_str()) ); + return(openStrType(name.c_str())); } //-------------------------------------------------------------------------- @@ -834,20 +834,20 @@ StrType CommonFG::openStrType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType( const char* name ) const +VarLenType CommonFG::openVarLenType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openVarLenType", "H5Topen2 failed"); - - // No failure, create and return the VarLenType object - VarLenType varlen_type; - f_DataType_setId(&varlen_type, type_id); - return(varlen_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if(type_id < 0) + throwException("openVarLenType", "H5Topen2 failed"); + + // No failure, create and return the VarLenType object + VarLenType varlen_type; + f_DataType_setId(&varlen_type, type_id); + return(varlen_type); } //-------------------------------------------------------------------------- @@ -857,9 +857,9 @@ VarLenType CommonFG::openVarLenType( const char* name ) const /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType( const H5std_string& name ) const +VarLenType CommonFG::openVarLenType(const H5std_string& name) const { - return( openVarLenType( name.c_str()) ); + return(openVarLenType(name.c_str())); } #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -876,14 +876,14 @@ VarLenType CommonFG::openVarLenType( const H5std_string& name ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data ) +int CommonFG::iterateElems(const char* name, int *idx, H5G_iterate_t op , void* op_data) { - int ret_value = H5Giterate( getLocId(), name, idx, op, op_data ); - if( ret_value < 0 ) - { - throwException("iterateElems", "H5Giterate failed"); - } - return( ret_value ); + int ret_value = H5Giterate(getLocId(), name, idx, op, op_data); + if(ret_value < 0) + { + throwException("iterateElems", "H5Giterate failed"); + } + return(ret_value); } //-------------------------------------------------------------------------- @@ -893,9 +893,9 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* /// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data ) +int CommonFG::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data) { - return( iterateElems( name.c_str(), idx, op, op_data )); + return(iterateElems(name.c_str(), idx, op, op_data)); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -908,12 +908,12 @@ int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op //-------------------------------------------------------------------------- hsize_t CommonFG::getNumObjs() const { - H5G_info_t ginfo; /* Group information */ + H5G_info_t ginfo; /* Group information */ - herr_t ret_value = H5Gget_info(getLocId(), &ginfo); - if(ret_value < 0) - throwException("getNumObjs", "H5Gget_info failed"); - return (ginfo.nlinks); + herr_t ret_value = H5Gget_info(getLocId(), &ginfo); + if(ret_value < 0) + throwException("getNumObjs", "H5Gget_info failed"); + return (ginfo.nlinks); } //-------------------------------------------------------------------------- @@ -936,7 +936,7 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const // call H5Lget_name_by_idx with name as NULL to get its length ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT); if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); // now, allocate C buffer to get the name char* name_C = new char[name_len+1]; @@ -975,11 +975,11 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const //-------------------------------------------------------------------------- ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const { - ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); - if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); + if(name_len < 0) + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - return (name_len); + return (name_len); } //-------------------------------------------------------------------------- @@ -991,21 +991,21 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const //-------------------------------------------------------------------------- ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const { - char* name_C = new char[size+1]; // temporary C-string for object name - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for object name + HDmemset(name_C, 0, size+1); // clear buffer - // call overloaded function to get the name - ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); - if(name_len < 0) - { + // call overloaded function to get the name + ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); + if(name_len < 0) + { delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } - // clean up and return the string - name = H5std_string(name_C); - delete []name_C; - return (name_len); + // clean up and return the string + name = H5std_string(name_C); + delete []name_C; + return (name_len); } //-------------------------------------------------------------------------- @@ -1040,7 +1040,7 @@ H5O_type_t CommonFG::childObjType(const char* objname) const // Return a valid type or throw an exception for unknown type else switch (objinfo.type) - { + { case H5O_TYPE_GROUP: case H5O_TYPE_DATASET: case H5O_TYPE_NAMED_DATATYPE: @@ -1050,7 +1050,7 @@ H5O_type_t CommonFG::childObjType(const char* objname) const case H5O_TYPE_NTYPES: default: throwException("childObjType", "Unknown type of object"); - } + } return(objtype); } @@ -1115,7 +1115,7 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_ // Return a valid type or throw an exception for unknown type else switch (objinfo.type) - { + { case H5O_TYPE_GROUP: case H5O_TYPE_DATASET: case H5O_TYPE_NAMED_DATATYPE: @@ -1125,7 +1125,7 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_ case H5O_TYPE_NTYPES: default: throwException("childObjType", "Unknown type of object"); - } + } return(objtype); } @@ -1194,11 +1194,11 @@ unsigned CommonFG::childObjVersion(const H5std_string& objname) const //-------------------------------------------------------------------------- H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const { - H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx); - if (obj_type == H5G_UNKNOWN) - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx); + if (obj_type == H5G_UNKNOWN) + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - return (obj_type); + return (obj_type); } //-------------------------------------------------------------------------- @@ -1245,7 +1245,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const case H5G_RESERVED_6: case H5G_RESERVED_7: default: - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); } return (obj_type); } diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 2a60333..136493a 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -45,7 +45,7 @@ CompType::CompType() : DataType() {} ///\param original - IN: Original CompType instance // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const CompType& original ) : DataType( original ) {} +CompType::CompType(const CompType& original) : DataType(original) {} //-------------------------------------------------------------------------- // Function: CompType overloaded constructor @@ -53,7 +53,7 @@ CompType::CompType( const CompType& original ) : DataType( original ) {} ///\param existing_id - IN: Id of an existing compound datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {} +CompType::CompType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- // Function: CompType overloaded constructor @@ -65,7 +65,7 @@ CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {} // the compound datatype. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {} +CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size) {} //-------------------------------------------------------------------------- // Function: CompType overloaded constructor @@ -75,16 +75,16 @@ CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const DataSet& dataset ) : DataType() +CompType::CompType(const DataSet& dataset) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); - - // If the datatype id is invalid, throw exception - if( id < 0 ) - { - throw DataSetIException("CompType constructor", "H5Dget_type failed"); - } + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); + + // If the datatype id is invalid, throw exception + if(id < 0) + { + throw DataSetIException("CompType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -96,13 +96,13 @@ CompType::CompType( const DataSet& dataset ) : DataType() //-------------------------------------------------------------------------- int CompType::getNmembers() const { - int num_members = H5Tget_nmembers( id ); - if( num_members < 0 ) - { - throw DataTypeIException("CompType::getNmembers", + int num_members = H5Tget_nmembers(id); + if(num_members < 0) + { + throw DataTypeIException("CompType::getNmembers", "H5Tget_nmembers returns negative number of members"); - } - return( num_members ); + } + return(num_members); } //-------------------------------------------------------------------------- @@ -113,17 +113,17 @@ int CompType::getNmembers() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string CompType::getMemberName( unsigned member_num ) const +H5std_string CompType::getMemberName(unsigned member_num) const { - char* member_name_C = H5Tget_member_name( id, member_num ); - if( member_name_C == NULL ) // NULL means failure + char* member_name_C = H5Tget_member_name(id, member_num); + if(member_name_C == NULL) // NULL means failure { throw DataTypeIException("CompType::getMemberName", "H5Tget_member_name returns NULL for member name"); } H5std_string member_name = H5std_string(member_name_C); // convert C string to string H5free_memory(member_name_C); // free the C string - return( member_name ); // return the member name string + return(member_name); // return the member name string } //-------------------------------------------------------------------------- @@ -140,17 +140,17 @@ H5std_string CompType::getMemberName( unsigned member_num ) const //-------------------------------------------------------------------------- int CompType::getMemberIndex(const char* name) const { - int member_index = H5Tget_member_index(id, name); - if( member_index < 0 ) - { - throw DataTypeIException("CompType::getMemberIndex", + int member_index = H5Tget_member_index(id, name); + if(member_index < 0) + { + throw DataTypeIException("CompType::getMemberIndex", "H5Tget_member_index returns negative value"); - } - return( member_index ); + } + return(member_index); } int CompType::getMemberIndex(const H5std_string& name) const { - return(getMemberIndex(name.c_str())); + return(getMemberIndex(name.c_str())); } //-------------------------------------------------------------------------- @@ -169,10 +169,10 @@ int CompType::getMemberIndex(const H5std_string& name) const // Note that byte offset being returned as 0 doesn't indicate // a failure. (According to Quincey) //-------------------------------------------------------------------------- -size_t CompType::getMemberOffset( unsigned member_num ) const +size_t CompType::getMemberOffset(unsigned member_num) const { - size_t offset = H5Tget_member_offset( id, member_num ); - return( offset ); + size_t offset = H5Tget_member_offset(id, member_num); + return(offset); } //-------------------------------------------------------------------------- @@ -185,15 +185,15 @@ size_t CompType::getMemberOffset( unsigned member_num ) const // Modification // Modified to use H5Tget_member_class instead. - Jul, 2005 //-------------------------------------------------------------------------- -H5T_class_t CompType::getMemberClass( unsigned member_num ) const +H5T_class_t CompType::getMemberClass(unsigned member_num) const { - H5T_class_t member_class = H5Tget_member_class(id, member_num); - if( member_class == H5T_NO_CLASS ) - { - throw DataTypeIException("CompType::getMemberClass", + H5T_class_t member_class = H5Tget_member_class(id, member_num); + if(member_class == H5T_NO_CLASS) + { + throw DataTypeIException("CompType::getMemberClass", "H5Tget_member_class returns H5T_NO_CLASS"); - } - return(member_class); + } + return(member_class); } // This private member function calls the C API to get the identifier @@ -202,16 +202,16 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const // the sub-types. hid_t CompType::p_get_member_type(unsigned member_num) const { - // get the id of the specified member first - hid_t member_type_id = H5Tget_member_type( id, member_num ); - if( member_type_id > 0 ) - return( member_type_id ); - else - { - // p_get_member_type is private, caller will catch this exception - // then throw another with appropriate API name - throw DataTypeIException("", "H5Tget_member_type failed"); - } + // get the id of the specified member first + hid_t member_type_id = H5Tget_member_type(id, member_num); + if(member_type_id > 0) + return(member_type_id); + else + { + // p_get_member_type is private, caller will catch this exception + // then throw another with appropriate API name + throw DataTypeIException("", "H5Tget_member_type failed"); + } } //-------------------------------------------------------------------------- @@ -223,16 +223,16 @@ hid_t CompType::p_get_member_type(unsigned member_num) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CompType::getMemberDataType( unsigned member_num ) const +DataType CompType::getMemberDataType(unsigned member_num) const { - try { + try { DataType datatype; f_DataType_setId(&datatype, p_get_member_type(member_num)); return(datatype); - } - catch (DataTypeIException& E) { + } + catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); - } + } } //-------------------------------------------------------------------------- @@ -244,16 +244,16 @@ DataType CompType::getMemberDataType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CompType::getMemberArrayType( unsigned member_num ) const +ArrayType CompType::getMemberArrayType(unsigned member_num) const { - try { + try { ArrayType arraytype(p_get_member_type(member_num)); f_DataType_setId(&arraytype, p_get_member_type(member_num)); return(arraytype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -265,16 +265,16 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CompType::getMemberCompType( unsigned member_num ) const +CompType CompType::getMemberCompType(unsigned member_num) const { - try { + try { CompType comptype(p_get_member_type(member_num)); f_DataType_setId(&comptype, p_get_member_type(member_num)); - return(comptype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); - } + return(comptype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -286,16 +286,16 @@ CompType CompType::getMemberCompType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CompType::getMemberEnumType( unsigned member_num ) const +EnumType CompType::getMemberEnumType(unsigned member_num) const { - try { + try { EnumType enumtype(p_get_member_type(member_num)); f_DataType_setId(&enumtype, p_get_member_type(member_num)); - return(enumtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); - } + return(enumtype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -307,16 +307,16 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CompType::getMemberIntType( unsigned member_num ) const +IntType CompType::getMemberIntType(unsigned member_num) const { - try { + try { IntType inttype(p_get_member_type(member_num)); f_DataType_setId(&inttype, p_get_member_type(member_num)); - return(inttype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); - } + return(inttype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -328,16 +328,16 @@ IntType CompType::getMemberIntType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CompType::getMemberFloatType( unsigned member_num ) const +FloatType CompType::getMemberFloatType(unsigned member_num) const { - try { + try { FloatType floatype(p_get_member_type(member_num)); f_DataType_setId(&floatype, p_get_member_type(member_num)); - return(floatype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); - } + return(floatype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -349,16 +349,16 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CompType::getMemberStrType( unsigned member_num ) const +StrType CompType::getMemberStrType(unsigned member_num) const { - try { + try { StrType strtype(p_get_member_type(member_num)); f_DataType_setId(&strtype, p_get_member_type(member_num)); - return(strtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); - } + return(strtype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -370,45 +370,45 @@ StrType CompType::getMemberStrType( unsigned member_num ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CompType::getMemberVarLenType( unsigned member_num ) const +VarLenType CompType::getMemberVarLenType(unsigned member_num) const { - try { + try { VarLenType varlentype(p_get_member_type(member_num)); f_DataType_setId(&varlentype, p_get_member_type(member_num)); - return(varlentype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); - } + return(varlentype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); + } } /* old style of getMemberType - using overloads; new style above - returns the appropriate datatypes but has different named functions. + returns the appropriate datatypes but has different named functions. In the old style, a datatype must be passed into the function. May, 2004: These should be reconsidered to provide more convenience. // Returns the datatype of the specified member in this compound datatype. // Several overloading of getMemberType are for different datatypes -void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const +void CompType::getMemberType(unsigned member_num, EnumType& enumtype) const { p_get_member_type(member_num, enumtype); } -void CompType::getMemberType( unsigned member_num, CompType& comptype ) const +void CompType::getMemberType(unsigned member_num, CompType& comptype) const { p_get_member_type(member_num, comptype); } -void CompType::getMemberType( unsigned member_num, IntType& inttype ) const +void CompType::getMemberType(unsigned member_num, IntType& inttype) const { p_get_member_type(member_num, inttype); } -void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const +void CompType::getMemberType(unsigned member_num, FloatType& floatype) const { p_get_member_type(member_num, floatype); } -void CompType::getMemberType( unsigned member_num, StrType& strtype ) const +void CompType::getMemberType(unsigned member_num, StrType& strtype) const { p_get_member_type(member_num, strtype); } @@ -424,20 +424,20 @@ void CompType::getMemberType( unsigned member_num, StrType& strtype ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CompType::insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const +void CompType::insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const { - // Convert string to C-string - const char* name_C; - name_C = name.c_str(); // name_C refers to the contents of name as a C-str - - hid_t new_member_id = new_member.getId(); // get new_member id for C API - - // Call C routine H5Tinsert to add the new member - herr_t ret_value = H5Tinsert( id, name_C, offset, new_member_id ); - if( ret_value < 0 ) - { - throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); - } + // Convert string to C-string + const char* name_C; + name_C = name.c_str(); // name_C refers to the contents of name as a C-str + + hid_t new_member_id = new_member.getId(); // get new_member id for C API + + // Call C routine H5Tinsert to add the new member + herr_t ret_value = H5Tinsert(id, name_C, offset, new_member_id); + if(ret_value < 0) + { + throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); + } } //-------------------------------------------------------------------------- @@ -449,12 +449,12 @@ void CompType::insertMember( const H5std_string& name, size_t offset, const Data //-------------------------------------------------------------------------- void CompType::pack() const { - // Calls C routine H5Tpack to remove padding - herr_t ret_value = H5Tpack( id ); - if( ret_value < 0 ) - { - throw DataTypeIException("CompType::pack", "H5Tpack failed"); - } + // Calls C routine H5Tpack to remove padding + herr_t ret_value = H5Tpack(id); + if(ret_value < 0) + { + throw DataTypeIException("CompType::pack", "H5Tpack failed"); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index bc7e114..e56dbf3 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -30,69 +30,69 @@ class H5_DLLCPP CompType : public DataType { CompType(); // Creates a compound datatype using an existing id - CompType( const hid_t existing_id ); + CompType(const hid_t existing_id); // Creates a new compound datatype, given the type's size - CompType( size_t size ); // H5Tcreate + CompType(size_t size); // H5Tcreate // Gets the compound datatype of the specified dataset - CompType( const DataSet& dataset ); // H5Dget_type + CompType(const DataSet& dataset); // H5Dget_type // Copy constructor - makes a copy of original object - CompType( const CompType& original ); + CompType(const CompType& original); // Returns the type class of the specified member of this compound // datatype. It provides to the user a way of knowing what type // to create another datatype of the same class - H5T_class_t getMemberClass( unsigned member_num ) const; + H5T_class_t getMemberClass(unsigned member_num) const; // Returns the index of a member in this compound data type. int getMemberIndex(const char* name) const; int getMemberIndex(const H5std_string& name) const; // Returns the offset of a member of this compound datatype. - size_t getMemberOffset( unsigned memb_no ) const; + size_t getMemberOffset(unsigned memb_no) const; // Returns the name of a member of this compound datatype. - H5std_string getMemberName( unsigned member_num ) const; + H5std_string getMemberName(unsigned member_num) const; // Returns the generic datatype of the specified member in // this compound datatype. - DataType getMemberDataType( unsigned member_num ) const; + DataType getMemberDataType(unsigned member_num) const; // Returns the array datatype of the specified member in // this compound datatype. - ArrayType getMemberArrayType( unsigned member_num ) const; + ArrayType getMemberArrayType(unsigned member_num) const; // Returns the compound datatype of the specified member in // this compound datatype. - CompType getMemberCompType( unsigned member_num ) const; + CompType getMemberCompType(unsigned member_num) const; // Returns the enumeration datatype of the specified member in // this compound datatype. - EnumType getMemberEnumType( unsigned member_num ) const; + EnumType getMemberEnumType(unsigned member_num) const; // Returns the integer datatype of the specified member in // this compound datatype. - IntType getMemberIntType( unsigned member_num ) const; + IntType getMemberIntType(unsigned member_num) const; // Returns the floating-point datatype of the specified member in // this compound datatype. - FloatType getMemberFloatType( unsigned member_num ) const; + FloatType getMemberFloatType(unsigned member_num) const; // Returns the string datatype of the specified member in // this compound datatype. - StrType getMemberStrType( unsigned member_num ) const; + StrType getMemberStrType(unsigned member_num) const; // Returns the variable length datatype of the specified member in // this compound datatype. - VarLenType getMemberVarLenType( unsigned member_num ) const; + VarLenType getMemberVarLenType(unsigned member_num) const; // Returns the number of members in this compound datatype. int getNmembers() const; // Adds a new member to this compound datatype. - void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const; + void insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const; // Recursively removes padding from within this compound datatype. void pack() const; diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index cc2e6b4..aba2fa3 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -130,18 +130,18 @@ DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type) : //-------------------------------------------------------------------------- DataSpace DataSet::getSpace() const { - // Calls C function H5Dget_space to get the id of the dataspace - hid_t dataspace_id = H5Dget_space( id ); - - // If the dataspace id is invalid, throw an exception - if( dataspace_id < 0 ) - { - throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); - } - //create dataspace object using the existing id then return the object - DataSpace data_space; - f_DataSpace_setId(&data_space, dataspace_id); - return( data_space ); + // Calls C function H5Dget_space to get the id of the dataspace + hid_t dataspace_id = H5Dget_space(id); + + // If the dataspace id is invalid, throw an exception + if(dataspace_id < 0) + { + throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); + } + //create dataspace object using the existing id then return the object + DataSpace data_space; + f_DataSpace_setId(&data_space, dataspace_id); + return(data_space); } // This private member function calls the C API to get the identifier @@ -149,13 +149,13 @@ DataSpace DataSet::getSpace() const // by the various AbstractDs functions to get the specific datatype. hid_t DataSet::p_get_type() const { - hid_t type_id = H5Dget_type( id ); - if( type_id > 0 ) - return( type_id ); - else - { - throw DataSetIException("", "H5Dget_type failed"); - } + hid_t type_id = H5Dget_type(id); + if(type_id > 0) + return(type_id); + else + { + throw DataSetIException("", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -167,16 +167,16 @@ hid_t DataSet::p_get_type() const //-------------------------------------------------------------------------- DSetCreatPropList DataSet::getCreatePlist() const { - hid_t create_plist_id = H5Dget_create_plist( id ); - if( create_plist_id < 0 ) - { - throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); - } - - // create and return the DSetCreatPropList object - DSetCreatPropList create_plist; - f_PropList_setId(&create_plist, create_plist_id); - return(create_plist); + hid_t create_plist_id = H5Dget_create_plist(id); + if(create_plist_id < 0) + { + throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); + } + + // create and return the DSetCreatPropList object + DSetCreatPropList create_plist; + f_PropList_setId(&create_plist, create_plist_id); + return(create_plist); } //-------------------------------------------------------------------------- @@ -190,8 +190,8 @@ DSetCreatPropList DataSet::getCreatePlist() const //-------------------------------------------------------------------------- hsize_t DataSet::getStorageSize() const { - hsize_t storage_size = H5Dget_storage_size(id); - return(storage_size); + hsize_t storage_size = H5Dget_storage_size(id); + return(storage_size); } //-------------------------------------------------------------------------- @@ -207,7 +207,7 @@ size_t DataSet::getInMemDataSize() const // Get the data type of this dataset hid_t mem_type_id = H5Dget_type(id); - if( mem_type_id < 0 ) + if(mem_type_id < 0) { throw DataSetIException(func, "H5Dget_type failed"); } @@ -268,14 +268,14 @@ size_t DataSet::getInMemDataSize() const //-------------------------------------------------------------------------- haddr_t DataSet::getOffset() const { - haddr_t ds_addr; // for address of dataset - - ds_addr = H5Dget_offset(id); - if( ds_addr == HADDR_UNDEF ) - { - throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); - } - return(ds_addr); + haddr_t ds_addr; // for address of dataset + + ds_addr = H5Dget_offset(id); + if(ds_addr == HADDR_UNDEF) + { + throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); + } + return(ds_addr); } //-------------------------------------------------------------------------- @@ -287,11 +287,11 @@ haddr_t DataSet::getOffset() const //-------------------------------------------------------------------------- void DataSet::getSpaceStatus(H5D_space_status_t& status) const { - herr_t ret_value = H5Dget_space_status(id, &status); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); - } + herr_t ret_value = H5Dget_space_status(id, &status); + if(ret_value < 0) + { + throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); + } } //-------------------------------------------------------------------------- @@ -305,20 +305,20 @@ void DataSet::getSpaceStatus(H5D_space_status_t& status) const // Modification // Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- -hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const +hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space) const { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - - hsize_t size; // for amount of storage - - herr_t ret_value = H5Dvlen_get_buf_size( id, type_id, space_id, &size ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); - } - return( size ); + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + + hsize_t size; // for amount of storage + + herr_t ret_value = H5Dvlen_get_buf_size(id, type_id, space_id, &size); + if(ret_value < 0) + { + throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); + } + return(size); } //-------------------------------------------------------------------------- @@ -334,9 +334,9 @@ hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) c // Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 // Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const +//hsize_t DataSet::getVlenBufSize(DataType& type, DataSpace& space) const //{ -// return(getVlenBufSize(type, space)); +// return(getVlenBufSize(type, space)); //} //-------------------------------------------------------------------------- @@ -350,18 +350,18 @@ hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) c ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ) +void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim( type_id, space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); + if(ret_value < 0) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- @@ -380,16 +380,16 @@ void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DS //-------------------------------------------------------------------------- void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- @@ -407,19 +407,19 @@ void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& spac /// to memory datatype \a mem_type and dataspace \a mem_space. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::read(void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dread( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::read", "H5Dread failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); + if(ret_value < 0) + { + throw DataSetIException("DataSet::read", "H5Dread failed"); + } } //-------------------------------------------------------------------------- @@ -483,19 +483,19 @@ void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace /// and dataspace. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::write(const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::write", "H5Dwrite failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); + if(ret_value < 0) + { + throw DataSetIException("DataSet::write", "H5Dwrite failed"); + } } //-------------------------------------------------------------------------- @@ -508,7 +508,7 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& // Modified to pass the buffer into H5Dwrite properly depending // whether the dataset has variable- or fixed-length string. //-------------------------------------------------------------------------- -void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::write(const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { // Check if this attribute has variable-len string or fixed-len string and // proceed appropriately. @@ -518,11 +518,11 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D throw DataSetIException("DataSet::write", "H5Tis_variable_str failed"); } - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); // Convert string to C-string const char* strg_C; @@ -532,12 +532,12 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C ); + ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); } else { // passing string argument by address - ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C ); + ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); } if (ret_value < 0) { @@ -562,18 +562,18 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D /// under development. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data ) +int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - herr_t ret_value = H5Diterate( buf, type_id, space_id, op, op_data ); - if( ret_value >= 0 ) - return( ret_value ); - else // raise exception when H5Diterate returns a negative value - { - throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + herr_t ret_value = H5Diterate(buf, type_id, space_id, op, op_data); + if(ret_value >= 0) + return(ret_value); + else // raise exception when H5Diterate returns a negative value + { + throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); + } } //-------------------------------------------------------------------------- @@ -588,11 +588,11 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::extend( const hsize_t* size ) const +void DataSet::extend(const hsize_t* size) const { - herr_t ret_value = H5Dset_extent( id, size ); - if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value - throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); + herr_t ret_value = H5Dset_extent(id, size); + if(ret_value < 0) // raise exception when H5Dset_extent returns a neg value + throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); } //-------------------------------------------------------------------------- @@ -613,7 +613,7 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(fill, fill_type_id, buf, buf_type_id, space_id); - if( ret_value < 0 ) + if(ret_value < 0) { throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } @@ -657,7 +657,7 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(NULL, buf_type_id, buf, buf_type_id, space_id); - if( ret_value < 0 ) + if(ret_value < 0) { throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } @@ -696,7 +696,7 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- hid_t DataSet::getId() const { - return(id); + return(id); } //-------------------------------------------------------------------------- @@ -725,7 +725,7 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); - if( ret_value < 0 ) + if(ret_value < 0) { delete []strg_C; // de-allocate for fixed-len string throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); @@ -756,7 +756,7 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space // Read dataset, no allocation for variable-len string; C library will herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); - if( ret_value < 0 ) + if(ret_value < 0) { throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); } @@ -788,8 +788,8 @@ void DataSet::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataSetIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } //-------------------------------------------------------------------------- @@ -820,8 +820,8 @@ void DataSet::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Dclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Dclose(id); + if(ret_value < 0) { throw DataSetIException("DataSet::close", "H5Dclose failed"); } diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 049ca48..b646a7a 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -34,7 +34,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { virtual void close(); // Extends the dataset with unlimited dimension. - void extend( const hsize_t* size ) const; + void extend(const hsize_t* size) const; // Fills a selection in memory with a value void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; @@ -63,27 +63,27 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { virtual size_t getInMemDataSize() const; // Returns the number of bytes required to store VL data. - hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; + hsize_t getVlenBufSize(const DataType& type, const DataSpace& space) const; //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 // Reclaims VL datatype memory buffers. - static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); + static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf); static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); // Reads the data of this dataset and stores it in the provided buffer. // The memory and file dataspaces and the transferring property list // can be defaults. - void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void read(void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + void read(H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; // Writes the buffered data to this dataset. // The memory and file dataspaces and the transferring property list // can be defaults. - void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void write(const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + void write(const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet - int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL ); + int iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL); ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataSet"); } @@ -96,7 +96,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { DataSet(); // Copy constructor. - DataSet( const DataSet& original ); + DataSet(const DataSet& original); // Creates a copy of an existing DataSet using its id. DataSet(const hid_t existing_id); diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 4869a0c..538c245 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -97,11 +97,11 @@ const DataSpace& DataSpace::ALL = *getConstant(); //-------------------------------------------------------------------------- DataSpace::DataSpace(H5S_class_t type) : IdComponent() { - id = H5Screate( type ); - if( id < 0 ) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); - } + id = H5Screate(type); + if(id < 0) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); + } } //-------------------------------------------------------------------------- @@ -113,13 +113,13 @@ DataSpace::DataSpace(H5S_class_t type) : IdComponent() ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() +DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() { - id = H5Screate_simple( rank, dims, maxdims ); - if( id < 0 ) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); - } + id = H5Screate_simple(rank, dims, maxdims); + if(id < 0) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); + } } //-------------------------------------------------------------------------- @@ -158,23 +158,23 @@ DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) // - Replaced decRefCount with close() to let the C library // handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void DataSpace::copy( const DataSpace& like_space ) +void DataSpace::copy(const DataSpace& like_space) { - // If this object has an hdf5 valid id, close it - if( id != H5S_ALL ) { - try { + // If this object has an hdf5 valid id, close it + if(id != H5S_ALL) { + try { close(); - } - catch (Exception& close_error) { - throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg()); - } - } // end if + } + catch (Exception& close_error) { + throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg()); + } + } // end if - // call C routine to copy the dataspace - id = H5Scopy( like_space.getId() ); + // call C routine to copy the dataspace + id = H5Scopy(like_space.getId()); - if( id < 0 ) - throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); + if(id < 0) + throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); } //-------------------------------------------------------------------------- @@ -188,7 +188,7 @@ void DataSpace::copy( const DataSpace& like_space ) // the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace& DataSpace::operator=( const DataSpace& rhs ) +DataSpace& DataSpace::operator=(const DataSpace& rhs) { if (this != &rhs) copy(rhs); @@ -205,16 +205,16 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) //-------------------------------------------------------------------------- bool DataSpace::isSimple () const { - htri_t simple = H5Sis_simple( id ); - if( simple > 0 ) - return true; - else if( simple == 0 ) - return false; - else - { - throw DataSpaceIException("DataSpace::isSimple", + htri_t simple = H5Sis_simple(id); + if(simple > 0) + return true; + else if(simple == 0) + return false; + else + { + throw DataSpaceIException("DataSpace::isSimple", "H5Sis_simple returns negative value"); - } + } } //-------------------------------------------------------------------------- @@ -229,13 +229,13 @@ bool DataSpace::isSimple () const /// it to be re-defined. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::offsetSimple ( const hssize_t* offset ) const +void DataSpace::offsetSimple (const hssize_t* offset) const { - herr_t ret_value = H5Soffset_simple( id, offset ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); - } + herr_t ret_value = H5Soffset_simple(id, offset); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); + } } //-------------------------------------------------------------------------- @@ -248,15 +248,15 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const +int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdims) const { - int ndims = H5Sget_simple_extent_dims( id, dims, maxdims ); - if( ndims < 0 ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentDims", + int ndims = H5Sget_simple_extent_dims(id, dims, maxdims); + if(ndims < 0) + { + throw DataSpaceIException("DataSpace::getSimpleExtentDims", "H5Sget_simple_extent_dims returns negative number of dimensions"); - } - return( ndims ); + } + return(ndims); } //-------------------------------------------------------------------------- @@ -268,13 +268,13 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const //-------------------------------------------------------------------------- int DataSpace::getSimpleExtentNdims () const { - int ndims = H5Sget_simple_extent_ndims( id ); - if( ndims < 0 ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentNdims", + int ndims = H5Sget_simple_extent_ndims(id); + if(ndims < 0) + { + throw DataSpaceIException("DataSpace::getSimpleExtentNdims", "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); - } - return( ndims ); + } + return(ndims); } //-------------------------------------------------------------------------- @@ -290,15 +290,15 @@ int DataSpace::getSimpleExtentNdims () const //-------------------------------------------------------------------------- hssize_t DataSpace::getSimpleExtentNpoints () const { - hssize_t num_elements = H5Sget_simple_extent_npoints( id ); + hssize_t num_elements = H5Sget_simple_extent_npoints(id); - if( num_elements > -1 ) - return( num_elements ); - else - { - throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", + if(num_elements > -1) + return(num_elements); + else + { + throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); - } + } } //-------------------------------------------------------------------------- @@ -310,13 +310,13 @@ hssize_t DataSpace::getSimpleExtentNpoints () const //-------------------------------------------------------------------------- H5S_class_t DataSpace::getSimpleExtentType () const { - H5S_class_t class_name = H5Sget_simple_extent_type( id ); - if( class_name == H5S_NO_CLASS ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentType", + H5S_class_t class_name = H5Sget_simple_extent_type(id); + if(class_name == H5S_NO_CLASS) + { + throw DataSpaceIException("DataSpace::getSimpleExtentType", "H5Sget_simple_extent_type returns H5S_NO_CLASS"); - } - return( class_name ); + } + return(class_name); } //-------------------------------------------------------------------------- @@ -330,12 +330,12 @@ H5S_class_t DataSpace::getSimpleExtentType () const //-------------------------------------------------------------------------- void DataSpace::extentCopy (const DataSpace& dest_space) const { - hid_t dest_space_id = dest_space.getId(); - herr_t ret_value = H5Sextent_copy( dest_space_id, id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); - } + hid_t dest_space_id = dest_space.getId(); + herr_t ret_value = H5Sextent_copy(dest_space_id, id); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); + } } //-------------------------------------------------------------------------- @@ -351,7 +351,7 @@ void DataSpace::extentCopy (const DataSpace& dest_space) const // Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 // Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//void DataSpace::extentCopy( DataSpace& dest_space ) const +//void DataSpace::extentCopy(DataSpace& dest_space) const //{ // extentCopy(dest_space); //} @@ -365,14 +365,14 @@ void DataSpace::extentCopy (const DataSpace& dest_space) const ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const +void DataSpace::setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size) const { - herr_t ret_value; - ret_value = H5Sset_extent_simple( id, rank, current_size, maximum_size ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); - } + herr_t ret_value; + ret_value = H5Sset_extent_simple(id, rank, current_size, maximum_size); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); + } } //-------------------------------------------------------------------------- @@ -384,11 +384,11 @@ void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hs //-------------------------------------------------------------------------- void DataSpace::setExtentNone () const { - herr_t ret_value = H5Sset_extent_none( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); - } + herr_t ret_value = H5Sset_extent_none(id); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); + } } //-------------------------------------------------------------------------- @@ -400,13 +400,13 @@ void DataSpace::setExtentNone () const //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectNpoints () const { - hssize_t num_elements = H5Sget_select_npoints( id ); - if( num_elements < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectNpoints", + hssize_t num_elements = H5Sget_select_npoints(id); + if(num_elements < 0) + { + throw DataSpaceIException("DataSpace::getSelectNpoints", "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); - } - return( num_elements ); + } + return(num_elements); } //-------------------------------------------------------------------------- @@ -418,13 +418,13 @@ hssize_t DataSpace::getSelectNpoints () const //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectHyperNblocks () const { - hssize_t num_blocks = H5Sget_select_hyper_nblocks( id ); - if( num_blocks < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectHyperNblocks", + hssize_t num_blocks = H5Sget_select_hyper_nblocks(id); + if(num_blocks < 0) + { + throw DataSpaceIException("DataSpace::getSelectHyperNblocks", "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); - } - return( num_blocks ); + } + return(num_blocks); } //-------------------------------------------------------------------------- @@ -436,15 +436,15 @@ hssize_t DataSpace::getSelectHyperNblocks () const ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const +void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const { - herr_t ret_value; - ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", + herr_t ret_value; + ret_value = H5Sget_select_hyper_blocklist(id, startblock, numblocks, buf); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", "H5Sget_select_hyper_blocklist failed"); - } + } } //-------------------------------------------------------------------------- @@ -456,13 +456,13 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectElemNpoints () const { - hssize_t num_points = H5Sget_select_elem_npoints( id ); - if( num_points < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectElemNpoints", + hssize_t num_points = H5Sget_select_elem_npoints(id); + if(num_points < 0) + { + throw DataSpaceIException("DataSpace::getSelectElemNpoints", "H5Sget_select_elem_npoints failed"); - } - return( num_points ); + } + return(num_points); } //-------------------------------------------------------------------------- @@ -478,15 +478,15 @@ hssize_t DataSpace::getSelectElemNpoints () const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const +void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const { - herr_t ret_value; - ret_value = H5Sget_select_elem_pointlist( id, startpoint, numpoints, buf ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectElemPointlist", + herr_t ret_value; + ret_value = H5Sget_select_elem_pointlist(id, startpoint, numpoints, buf); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectElemPointlist", "H5Sget_select_elem_pointlist failed"); - } + } } //-------------------------------------------------------------------------- @@ -502,14 +502,14 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const +void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const { - herr_t ret_value = H5Sget_select_bounds( id, start, end ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectBounds", + herr_t ret_value = H5Sget_select_bounds(id, start, end); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectBounds", "H5Sget_select_bounds failed"); - } + } } //-------------------------------------------------------------------------- @@ -528,15 +528,15 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const +void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const { - herr_t ret_value; - ret_value = H5Sselect_elements( id, op, num_elements, coord ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectElements", + herr_t ret_value; + ret_value = H5Sselect_elements(id, op, num_elements, coord); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectElements", "H5Sselect_elements failed"); - } + } } //-------------------------------------------------------------------------- @@ -548,11 +548,11 @@ void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, co //-------------------------------------------------------------------------- void DataSpace::selectAll () const { - herr_t ret_value = H5Sselect_all( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); - } + herr_t ret_value = H5Sselect_all(id); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); + } } //-------------------------------------------------------------------------- @@ -564,12 +564,12 @@ void DataSpace::selectAll () const //-------------------------------------------------------------------------- void DataSpace::selectNone () const { - herr_t ret_value = H5Sselect_none( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectNone", + herr_t ret_value = H5Sselect_none(id); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectNone", "H5Sselect_none failed"); - } + } } //-------------------------------------------------------------------------- @@ -583,16 +583,16 @@ void DataSpace::selectNone () const //-------------------------------------------------------------------------- bool DataSpace::selectValid () const { - htri_t ret_value = H5Sselect_valid( id ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataSpaceIException("DataSpace::selectValid", + htri_t ret_value = H5Sselect_valid(id); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else + { + throw DataSpaceIException("DataSpace::selectValid", "H5Sselect_valid returns negative value"); - } + } } //-------------------------------------------------------------------------- @@ -610,15 +610,15 @@ bool DataSpace::selectValid () const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const +void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const { - herr_t ret_value; - ret_value = H5Sselect_hyperslab( id, op, start, stride, count, block ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectHyperslab", + herr_t ret_value; + ret_value = H5Sselect_hyperslab(id, op, start, stride, count, block); + if(ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectHyperslab", "H5Sselect_hyperslab failed"); - } + } } //-------------------------------------------------------------------------- @@ -635,7 +635,7 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h //-------------------------------------------------------------------------- hid_t DataSpace::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -660,8 +660,8 @@ void DataSpace::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataSpaceIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -678,7 +678,7 @@ void DataSpace::close() if (p_valid_id(id)) { herr_t ret_value = H5Sclose(id); - if( ret_value < 0 ) + if(ret_value < 0) { throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); } diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index fc9c54e..2168f4d 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -42,7 +42,7 @@ class H5_DLLCPP DataSpace : public IdComponent { DataSpace(const DataSpace& original); // Assignment operator - DataSpace& operator=( const DataSpace& rhs ); + DataSpace& operator=(const DataSpace& rhs); // Closes this dataspace. virtual void close(); @@ -56,16 +56,16 @@ class H5_DLLCPP DataSpace : public IdComponent { //void extentCopy(DataSpace& dest_space) const; // Gets the bounding box containing the current selection. - void getSelectBounds( hsize_t* start, hsize_t* end ) const; + void getSelectBounds(hsize_t* start, hsize_t* end) const; // Gets the number of element points in the current selection. hssize_t getSelectElemNpoints() const; // Retrieves the list of element points currently selected. - void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; + void getSelectElemPointlist(hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const; // Gets the list of hyperslab blocks currently selected. - void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; + void getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const; // Get number of hyperslab blocks. hssize_t getSelectHyperNblocks() const; @@ -74,7 +74,7 @@ class H5_DLLCPP DataSpace : public IdComponent { hssize_t getSelectNpoints() const; // Retrieves dataspace dimension size and maximum size. - int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; + int getSimpleExtentDims(hsize_t *dims, hsize_t *maxdims = NULL) const; // Gets the dimensionality of this dataspace. int getSimpleExtentNdims() const; @@ -90,17 +90,17 @@ class H5_DLLCPP DataSpace : public IdComponent { bool isSimple() const; // Sets the offset of this simple dataspace. - void offsetSimple( const hssize_t* offset ) const; + void offsetSimple(const hssize_t* offset) const; // Selects the entire dataspace. void selectAll() const; // Selects array elements to be included in the selection for // this dataspace. - void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; + void selectElements(H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; // Selects a hyperslab region to add to the current selected region. - void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; + void selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL) const; // Resets the selection region to include no elements. void selectNone() const; @@ -112,7 +112,7 @@ class H5_DLLCPP DataSpace : public IdComponent { void setExtentNone() const; // Sets or resets the size of this dataspace. - void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; + void setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataSpace"); } diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index c9a0c6b..f29978b 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -80,14 +80,14 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() +DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() { - // Call C routine to create the new datatype - id = H5Tcreate( type_class, size ); - if( id < 0 ) - { - throw DataTypeIException("DataType constructor", "H5Tcreate failed"); - } + // Call C routine to create the new datatype + id = H5Tcreate(type_class, size); + if(id < 0) + { + throw DataTypeIException("DataType constructor", "H5Tcreate failed"); + } } //-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) DataType::DataType(const PredType& pred_type) : H5Object() { // call C routine to copy the datatype - id = H5Tcopy( pred_type.getId() ); + id = H5Tcopy(pred_type.getId()); if (id < 0) throw DataTypeIException("DataType constructor", "H5Tcopy failed"); } @@ -169,7 +169,7 @@ DataType::DataType(const PredType& pred_type) : H5Object() // - Replaced decRefCount with close() to let the C library // handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void DataType::copy( const DataType& like_type ) +void DataType::copy(const DataType& like_type) { // close the current data type before copying like_type to this object try { @@ -180,8 +180,8 @@ void DataType::copy( const DataType& like_type ) } // call C routine to copy the datatype - id = H5Tcopy( like_type.getId() ); - if( id < 0 ) + id = H5Tcopy(like_type.getId()); + if(id < 0) throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } @@ -205,8 +205,8 @@ void DataType::copy(const DataSet& dset) } // call C routine to copy the datatype - id = H5Tcopy( dset.getId() ); - if( id < 0 ) + id = H5Tcopy(dset.getId()); + if(id < 0) throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } @@ -229,7 +229,7 @@ void DataType::copy(const DataSet& dset) // transient datatype. // BMR - Mar, 2015 //-------------------------------------------------------------------------- -DataType& DataType::operator=( const DataType& rhs ) +DataType& DataType::operator=(const DataType& rhs) { if (this != &rhs) { @@ -247,19 +247,19 @@ DataType& DataType::operator=( const DataType& rhs ) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool DataType::operator==(const DataType& compared_type ) const +bool DataType::operator==(const DataType& compared_type) const { - // Call C routine H5Tequal to determines whether two datatype - // identifiers refer to the same datatype - htri_t ret_value = H5Tequal( id, compared_type.getId() ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); - } + // Call C routine H5Tequal to determines whether two datatype + // identifiers refer to the same datatype + htri_t ret_value = H5Tequal(id, compared_type.getId()); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); + } } //-------------------------------------------------------------------------- @@ -278,10 +278,10 @@ bool DataType::operator==(const DataType& compared_type ) const //-------------------------------------------------------------------------- void DataType::p_commit(hid_t loc_id, const char* name) { - // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if( ret_value < 0 ) - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); + // Call C routine to commit the transient datatype + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(ret_value < 0) + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); } //-------------------------------------------------------------------------- @@ -295,7 +295,7 @@ void DataType::p_commit(hid_t loc_id, const char* name) //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const char* name) { - p_commit(loc.getId(), name); + p_commit(loc.getId(), name); } //-------------------------------------------------------------------------- @@ -326,7 +326,7 @@ void DataType::commit(const H5Location& loc, const char* name) //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const H5std_string& name) { - p_commit(loc.getId(), name.c_str()); + p_commit(loc.getId(), name.c_str()); } //-------------------------------------------------------------------------- @@ -359,16 +359,16 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) //-------------------------------------------------------------------------- bool DataType::committed() const { - // Call C function to determine if a datatype is a named one - htri_t is_committed = H5Tcommitted( id ); - if (is_committed > 0) - return true; - else if (is_committed == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); - } + // Call C function to determine if a datatype is a named one + htri_t is_committed = H5Tcommitted(id); + if (is_committed > 0) + return true; + else if (is_committed == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); + } } //-------------------------------------------------------------------------- @@ -381,15 +381,15 @@ bool DataType::committed() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const +H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t **pcdata) const { - // Call C routine to find the conversion function - H5T_conv_t func = H5Tfind( id, dest.getId(), pcdata ); - if( func == NULL ) - { - throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); - } - return( func ); + // Call C routine to find the conversion function + H5T_conv_t func = H5Tfind(id, dest.getId(), pcdata); + if(func == NULL) + { + throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); + } + return(func); } //-------------------------------------------------------------------------- @@ -405,19 +405,19 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist ) const +void DataType::convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist) const { - // Get identifiers for C API - hid_t dest_id = dest.getId(); - hid_t plist_id = plist.getId(); + // Get identifiers for C API + hid_t dest_id = dest.getId(); + hid_t plist_id = plist.getId(); - // Call C routine H5Tconvert to convert the data - herr_t ret_value; - ret_value = H5Tconvert( id, dest_id, nelmts, buf, background, plist_id ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); - } + // Call C routine H5Tconvert to convert the data + herr_t ret_value; + ret_value = H5Tconvert(id, dest_id, nelmts, buf, background, plist_id); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); + } } //-------------------------------------------------------------------------- @@ -436,12 +436,12 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba //-------------------------------------------------------------------------- void DataType::lock() const { - // Call C routine to lock the datatype - herr_t ret_value = H5Tlock( id ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); - } + // Call C routine to lock the datatype + herr_t ret_value = H5Tlock(id); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); + } } //-------------------------------------------------------------------------- @@ -453,14 +453,14 @@ void DataType::lock() const //-------------------------------------------------------------------------- H5T_class_t DataType::getClass() const { - H5T_class_t type_class = H5Tget_class( id ); + H5T_class_t type_class = H5Tget_class(id); - // Return datatype class identifier if successful - if( type_class == H5T_NO_CLASS ) - { - throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); - } - return( type_class ); + // Return datatype class identifier if successful + if(type_class == H5T_NO_CLASS) + { + throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); + } + return(type_class); } //-------------------------------------------------------------------------- @@ -472,13 +472,13 @@ H5T_class_t DataType::getClass() const //-------------------------------------------------------------------------- size_t DataType::getSize() const { - // Call C routine to get the datatype size - size_t type_size = H5Tget_size( id ); - if( type_size <= 0 ) // valid data types are never zero size - { - throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); - } - return( type_size ); + // Call C routine to get the datatype size + size_t type_size = H5Tget_size(id); + if(type_size <= 0) // valid data types are never zero size + { + throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); + } + return(type_size); } //-------------------------------------------------------------------------- @@ -490,22 +490,22 @@ size_t DataType::getSize() const //-------------------------------------------------------------------------- DataType DataType::getSuper() const { - // Call C routine to get the base datatype from which the specified - // datatype is derived. - hid_t base_type_id = H5Tget_super( id ); + // Call C routine to get the base datatype from which the specified + // datatype is derived. + hid_t base_type_id = H5Tget_super(id); - // If H5Tget_super returns a valid datatype id, create and return - // the base type, otherwise, raise exception - if( base_type_id > 0 ) - { + // If H5Tget_super returns a valid datatype id, create and return + // the base type, otherwise, raise exception + if(base_type_id > 0) + { DataType base_type; base_type.p_setId(base_type_id); return(base_type); - } - else - { - throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); - } + } + else + { + throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); + } } //-------------------------------------------------------------------------- @@ -524,16 +524,16 @@ DataType DataType::getSuper() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const +void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const { - hid_t dest_id = dest.getId(); // get id of the destination datatype + hid_t dest_id = dest.getId(); // get id of the destination datatype - // Call C routine H5Tregister to register the conversion function - herr_t ret_value = H5Tregister( pers, name, id, dest_id, func ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); - } + // Call C routine H5Tregister to register the conversion function + herr_t ret_value = H5Tregister(pers, name, id, dest_id, func); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); + } } //-------------------------------------------------------------------------- @@ -543,9 +543,9 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const { - registerFunc( pers, name.c_str(), dest, func ); + registerFunc(pers, name.c_str(), dest, func); } //-------------------------------------------------------------------------- @@ -561,16 +561,16 @@ void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const Da ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const +void DataType::unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const { - hid_t dest_id = dest.getId(); // get id of the dest datatype for C API + hid_t dest_id = dest.getId(); // get id of the dest datatype for C API - // Call C routine H5Tunregister to remove the conversion function - herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); - } + // Call C routine H5Tunregister to remove the conversion function + herr_t ret_value = H5Tunregister(pers, name, id, dest_id, func); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); + } } //-------------------------------------------------------------------------- @@ -580,9 +580,9 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const { - unregister( pers, name.c_str(), dest, func ); + unregister(pers, name.c_str(), dest, func); } //-------------------------------------------------------------------------- @@ -593,14 +593,14 @@ void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const Data ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag( const char* tag ) const +void DataType::setTag(const char* tag) const { - // Call C routine H5Tset_tag to tag an opaque datatype. - herr_t ret_value = H5Tset_tag( id, tag ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); - } + // Call C routine H5Tset_tag to tag an opaque datatype. + herr_t ret_value = H5Tset_tag(id, tag); + if(ret_value < 0) + { + throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); + } } //-------------------------------------------------------------------------- @@ -610,9 +610,9 @@ void DataType::setTag( const char* tag ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag( const H5std_string& tag ) const +void DataType::setTag(const H5std_string& tag) const { - setTag( tag.c_str()); + setTag(tag.c_str()); } //-------------------------------------------------------------------------- @@ -624,11 +624,11 @@ void DataType::setTag( const H5std_string& tag ) const //-------------------------------------------------------------------------- H5std_string DataType::getTag() const { - char* tag_Cstr = H5Tget_tag( id ); + char* tag_Cstr = H5Tget_tag(id); // if the tag C-string returned is not NULL, convert it to C++ string // and return it, otherwise, raise an exception - if( tag_Cstr != NULL ) + if(tag_Cstr != NULL) { H5std_string tag = H5std_string(tag_Cstr); // C string to string object H5free_memory(tag_Cstr); // free the C string @@ -651,16 +651,16 @@ H5std_string DataType::getTag() const //-------------------------------------------------------------------------- bool DataType::detectClass(H5T_class_t cls) const { - htri_t ret_value = H5Tdetect_class(id, cls); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("detectClass"), + htri_t ret_value = H5Tdetect_class(id, cls); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("detectClass"), "H5Tdetect_class returns negative value"); - } + } } //-------------------------------------------------------------------------- @@ -673,16 +673,16 @@ bool DataType::detectClass(H5T_class_t cls) const //-------------------------------------------------------------------------- bool DataType::isVariableStr() const { - htri_t is_varlen_str = H5Tis_variable_str(id); - if( is_varlen_str == 1 ) - return true; - else if( is_varlen_str == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("isVariableStr"), + htri_t is_varlen_str = H5Tis_variable_str(id); + if(is_varlen_str == 1) + return true; + else if(is_varlen_str == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("isVariableStr"), "H5Tis_variable_str returns negative value"); - } + } } //-------------------------------------------------------------------------- @@ -699,7 +699,7 @@ bool DataType::isVariableStr() const //-------------------------------------------------------------------------- hid_t DataType::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -724,8 +724,8 @@ void DataType::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataTypeIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -741,7 +741,7 @@ void DataType::close() if (p_valid_id(id)) { herr_t ret_value = H5Tclose(id); - if( ret_value < 0 ) + if(ret_value < 0) { throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 3ae97dc..6f796b8 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -30,10 +30,10 @@ namespace H5 { class H5_DLLCPP DataType : public H5Object { public: // Creates a datatype given its class and size - DataType( const H5T_class_t type_class, size_t size ); + DataType(const H5T_class_t type_class, size_t size); // Copy constructor: makes a copy of the original object - DataType( const DataType& original ); + DataType(const DataType& original); // Creates a copy of a predefined type DataType(const PredType& pred_type); @@ -69,16 +69,16 @@ class H5_DLLCPP DataType : public H5Object { // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. - H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; + H5T_conv_t find(const DataType& dest, H5T_cdata_t **pcdata) const; // Converts data from between specified datatypes. - void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; + void convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; // Assignment operator - DataType& operator=( const DataType& rhs ); + DataType& operator=(const DataType& rhs); // Determines whether two datatypes are the same. - bool operator==(const DataType& compared_type ) const; + bool operator==(const DataType& compared_type) const; // Locks a datatype. void lock() const; @@ -91,16 +91,16 @@ class H5_DLLCPP DataType : public H5Object { DataType getSuper() const; // Registers a conversion function. - void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; + void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; // Removes a conversion function from all conversion paths. - void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + void unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; + void unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; // Tags an opaque datatype. - void setTag( const char* tag ) const; - void setTag( const H5std_string& tag ) const; + void setTag(const char* tag) const; + void setTag(const H5std_string& tag) const; // Gets the tag associated with an opaque datatype. H5std_string getTag() const; @@ -115,7 +115,7 @@ class H5_DLLCPP DataType : public H5Object { virtual H5std_string fromClass () const { return("DataType"); } // Creates a copy of an existing DataType using its id - DataType( const hid_t type_id ); + DataType(const hid_t type_id); // Default constructor DataType(); diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 0aa9a91..7f4bbf9 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -98,7 +98,7 @@ DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} /// DSetCreatPropList object // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : ObjCreatPropList(orig) {} +DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList& orig) : ObjCreatPropList(orig) {} //-------------------------------------------------------------------------- // Function: DSetCreatPropList overloaded constructor @@ -123,13 +123,13 @@ DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(pl /// changed to \c H5D_CHUNKED, if it is not so already. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const +void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) const { - herr_t ret_value = H5Pset_chunk( id, ndims, dim ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); - } + herr_t ret_value = H5Pset_chunk(id, ndims, dim); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); + } } //-------------------------------------------------------------------------- @@ -141,15 +141,15 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const +int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const { - int chunk_size = H5Pget_chunk( id, max_ndims, dim ); - if( chunk_size < 0 ) - { - throw PropListIException("DSetCreatPropList::getChunk", + int chunk_size = H5Pget_chunk(id, max_ndims, dim); + if(chunk_size < 0) + { + throw PropListIException("DSetCreatPropList::getChunk", "H5Pget_chunk returns negative chunk size"); - } - return( chunk_size ); + } + return(chunk_size); } //-------------------------------------------------------------------------- @@ -164,12 +164,12 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const { - herr_t ret_value = H5Pset_layout( id, layout ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setLayout", + herr_t ret_value = H5Pset_layout(id, layout); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setLayout", "H5Pset_layout failed"); - } + } } //-------------------------------------------------------------------------- @@ -190,13 +190,13 @@ void DSetCreatPropList::setLayout(H5D_layout_t layout) const //-------------------------------------------------------------------------- H5D_layout_t DSetCreatPropList::getLayout() const { - H5D_layout_t layout = H5Pget_layout( id ); - if( layout == H5D_LAYOUT_ERROR ) - { - throw PropListIException("DSetCreatPropList::getLayout", + H5D_layout_t layout = H5Pget_layout(id); + if(layout == H5D_LAYOUT_ERROR) + { + throw PropListIException("DSetCreatPropList::getLayout", "H5Pget_layout returns H5D_LAYOUT_ERROR"); - } - return( layout ); + } + return(layout); } //-------------------------------------------------------------------------- @@ -211,14 +211,14 @@ H5D_layout_t DSetCreatPropList::getLayout() const /// less compression. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setDeflate( int level ) const +void DSetCreatPropList::setDeflate(int level) const { - herr_t ret_value = H5Pset_deflate( id, level ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setDeflate", + herr_t ret_value = H5Pset_deflate(id, level); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setDeflate", "H5Pset_deflate failed"); - } + } } //-------------------------------------------------------------------------- @@ -241,7 +241,7 @@ void DSetCreatPropList::setDeflate( int level ) const void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const { herr_t ret_value = H5Pset_szip(id, options_mask, pixels_per_block); - if( ret_value < 0 ) + if(ret_value < 0) { throw PropListIException("DSetCreatPropList::setSzip", "H5Pset_szip failed"); @@ -263,7 +263,7 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p void DSetCreatPropList::setNbit() const { herr_t ret_value = H5Pset_nbit(id); - if( ret_value < 0 ) + if(ret_value < 0) { throw PropListIException("DSetCreatPropList::setNbit", "H5Pset_nbit failed"); @@ -288,14 +288,14 @@ void DSetCreatPropList::setNbit() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const +void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const { - herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFillValue", + herr_t ret_value = H5Pset_fill_value(id, fvalue_type.getId(), value); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFillValue", "H5Pset_fill_value failed"); - } + } } //-------------------------------------------------------------------------- @@ -311,14 +311,14 @@ void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* v /// specified by \a fvalue_type. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const +void DSetCreatPropList::getFillValue(const DataType& fvalue_type, void* value) const { - herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getFillValue", + herr_t ret_value = H5Pget_fill_value(id, fvalue_type.getId(), value); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getFillValue", "H5Pget_fill_value failed"); - } + } } //-------------------------------------------------------------------------- @@ -333,15 +333,15 @@ void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const { - H5D_fill_value_t status; - herr_t ret_value = H5Pfill_value_defined(id, &status); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::isFillValueDefined", + H5D_fill_value_t status; + herr_t ret_value = H5Pfill_value_defined(id, &status); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::isFillValueDefined", "H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)"); - } - else - return (status); + } + else + return (status); } //-------------------------------------------------------------------------- @@ -364,15 +364,15 @@ H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const /// and the filter fails then the entire I/O operation fails. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[] ) const +void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned int flags, + size_t cd_nelmts, const unsigned int cd_values[]) const { - herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFilter", + herr_t ret_value = H5Pset_filter(id, filter_id, flags, cd_nelmts, cd_values); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFilter", "H5Pset_filter failed"); - } + } } //-------------------------------------------------------------------------- @@ -387,12 +387,12 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, //-------------------------------------------------------------------------- void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const { - herr_t ret_value = H5Premove_filter( id, filter_id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::removeFilter", + herr_t ret_value = H5Premove_filter(id, filter_id); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::removeFilter", "H5Premove_filter failed"); - } + } } //-------------------------------------------------------------------------- @@ -404,14 +404,14 @@ void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const //-------------------------------------------------------------------------- int DSetCreatPropList::getNfilters() const { - int num_filters = H5Pget_nfilters( id ); - if( num_filters < 0 ) - { - throw PropListIException("DSetCreatPropList::getNfilters", + int num_filters = H5Pget_nfilters(id); + if(num_filters < 0) + { + throw PropListIException("DSetCreatPropList::getNfilters", "H5Pget_nfilters returned negative number of filters"); - } - else - return( num_filters ); + } + else + return(num_filters); } //-------------------------------------------------------------------------- @@ -438,14 +438,14 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int& filter_config) const { - H5Z_filter_t filter_id; - filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, + H5Z_filter_t filter_id; + filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, cd_values, namelen, name, &filter_config); - if( filter_id == H5Z_FILTER_ERROR ) - throw PropListIException("DSetCreatPropList::getFilter", + if(filter_id == H5Z_FILTER_ERROR) + throw PropListIException("DSetCreatPropList::getFilter", "H5Pget_filter2 returned H5Z_FILTER_ERROR"); else - return(filter_id); + return(filter_id); } //-------------------------------------------------------------------------- @@ -467,10 +467,10 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const { - herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, + herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, cd_values, namelen, name, &filter_config); - if (ret_value < 0) - throw PropListIException("DSetCreatPropList::getFilterById", + if (ret_value < 0) + throw PropListIException("DSetCreatPropList::getFilterById", "H5Pget_filter_by_id2 failed"); } @@ -495,15 +495,15 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, /// and the filter fails then the entire I/O operation fails. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int - flags, size_t cd_nelmts, const unsigned int cd_values[] ) const +void DSetCreatPropList::modifyFilter(H5Z_filter_t filter_id, unsigned int + flags, size_t cd_nelmts, const unsigned int cd_values[]) const { - herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::modifyFilter", + herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::modifyFilter", "H5Pmodify_filter failed"); - } + } } //-------------------------------------------------------------------------- @@ -517,15 +517,15 @@ void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int //-------------------------------------------------------------------------- bool DSetCreatPropList::allFiltersAvail() const { - htri_t ret_value = H5Pall_filters_avail(id); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pall_filters_avail returns a negative value - { - throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); - } + htri_t ret_value = H5Pall_filters_avail(id); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Pall_filters_avail returns a negative value + { + throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); + } } //-------------------------------------------------------------------------- @@ -541,12 +541,12 @@ bool DSetCreatPropList::allFiltersAvail() const //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const { - herr_t ret_value = H5Pset_shuffle(id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setShuffle", + herr_t ret_value = H5Pset_shuffle(id); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setShuffle", "H5Pset_shuffle failed"); - } + } } //-------------------------------------------------------------------------- @@ -565,15 +565,15 @@ void DSetCreatPropList::setShuffle() const //-------------------------------------------------------------------------- H5D_alloc_time_t DSetCreatPropList::getAllocTime() const { - H5D_alloc_time_t alloc_time; - herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getAllocTime", + H5D_alloc_time_t alloc_time; + herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getAllocTime", "H5Pget_alloc_time failed"); - } - else - return (alloc_time); + } + else + return (alloc_time); } //-------------------------------------------------------------------------- @@ -589,15 +589,15 @@ H5D_alloc_time_t DSetCreatPropList::getAllocTime() const //-------------------------------------------------------------------------- H5D_fill_time_t DSetCreatPropList::getFillTime() const { - H5D_fill_time_t fill_time; - herr_t ret_value = H5Pget_fill_time(id, &fill_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getFillTime", + H5D_fill_time_t fill_time; + herr_t ret_value = H5Pget_fill_time(id, &fill_time); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getFillTime", "H5Pget_fill_time failed"); - } - else - return (fill_time); + } + else + return (fill_time); } //-------------------------------------------------------------------------- @@ -615,12 +615,12 @@ H5D_fill_time_t DSetCreatPropList::getFillTime() const //-------------------------------------------------------------------------- void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const { - herr_t ret_value = H5Pset_alloc_time(id, alloc_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setAllocTime", + herr_t ret_value = H5Pset_alloc_time(id, alloc_time); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setAllocTime", "H5Pset_alloc_time failed"); - } + } } //-------------------------------------------------------------------------- @@ -636,12 +636,12 @@ void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const //-------------------------------------------------------------------------- void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const { - herr_t ret_value = H5Pset_fill_time(id, fill_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFillTime", + herr_t ret_value = H5Pset_fill_time(id, fill_time); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFillTime", "H5Pset_fill_time failed"); - } + } } //-------------------------------------------------------------------------- @@ -653,12 +653,12 @@ void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const //-------------------------------------------------------------------------- void DSetCreatPropList::setFletcher32() const { - herr_t ret_value = H5Pset_fletcher32(id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFletcher32", + herr_t ret_value = H5Pset_fletcher32(id); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFletcher32", "H5Pset_fletcher32 failed"); - } + } } //-------------------------------------------------------------------------- @@ -677,14 +677,14 @@ void DSetCreatPropList::setFletcher32() const /// the extending). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const +void DSetCreatPropList::setExternal(const char* name, off_t offset, hsize_t size) const { - herr_t ret_value = H5Pset_external( id, name, offset, size ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setExternal", + herr_t ret_value = H5Pset_external(id, name, offset, size); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setExternal", "H5Pset_external failed"); - } + } } //-------------------------------------------------------------------------- @@ -696,14 +696,14 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz //-------------------------------------------------------------------------- int DSetCreatPropList::getExternalCount() const { - int num_ext_files = H5Pget_external_count( id ); - if( num_ext_files < 0 ) - { - throw PropListIException("DSetCreatPropList::getExternalCount", + int num_ext_files = H5Pget_external_count(id); + if(num_ext_files < 0) + { + throw PropListIException("DSetCreatPropList::getExternalCount", "H5Pget_external_count returns negative number of external files"); - } - else - return( num_ext_files ); + } + else + return(num_ext_files); } //-------------------------------------------------------------------------- @@ -728,14 +728,14 @@ int DSetCreatPropList::getExternalCount() const /// will not be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const +void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const { - herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getExternal", + herr_t ret_value = H5Pget_external(id, idx, name_size, name, &offset, &size); + if(ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getExternal", "H5Pget_external failed"); - } + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index ca99ca4..90b7ed7 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -43,13 +43,13 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { void setAllocTime(H5D_alloc_time_t alloc_time) const; // Retrieves the size of the chunks used to store a chunked layout dataset. - int getChunk( int max_ndims, hsize_t* dim ) const; + int getChunk(int max_ndims, hsize_t* dim) const; // Sets the size of the chunks used to store a chunked layout dataset. - void setChunk( int ndims, const hsize_t* dim ) const; + void setChunk(int ndims, const hsize_t* dim) const; // Returns information about an external file. - void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const; + void getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const; // Returns the number of external files for a dataset. int getExternalCount() const; @@ -61,10 +61,10 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { void setFillTime(H5D_fill_time_t fill_time) const; // Retrieves a dataset fill value. - void getFillValue( const DataType& fvalue_type, void* value ) const; + void getFillValue(const DataType& fvalue_type, void* value) const; // Sets a dataset fill value. - void setFillValue( const DataType& fvalue_type, const void* value ) const; + void setFillValue(const DataType& fvalue_type, const void* value) const; // Returns information about a filter in a pipeline. H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; @@ -87,19 +87,19 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { H5D_fill_value_t isFillValueDefined() const; // Modifies the specified filter. - void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; + void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[]) const; // Remove one or all filters from the filter pipeline. - void removeFilter( H5Z_filter_t filter_id) const; + void removeFilter(H5Z_filter_t filter_id) const; // Sets compression method and compression level. - void setDeflate( int level ) const; + void setDeflate(int level) const; // Adds an external file to the list of external files. - void setExternal( const char* name, off_t offset, hsize_t size ) const; + void setExternal(const char* name, off_t offset, hsize_t size) const; // Adds a filter to the filter pipeline. - void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; + void setFilter(H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; // Sets Fletcher32 checksum of EDC for this property list. void setFletcher32() const; diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 7d45b24..e1c5964 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -109,7 +109,7 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET /// list object to copy // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original ) : PropList( original ) {} +DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- // Function DSetMemXferPropList overloaded constructor @@ -130,14 +130,14 @@ DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_ ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const +void DSetMemXferPropList::setBuffer(size_t size, void* tconv, void* bkg) const { - herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setBuffer", + herr_t ret_value = H5Pset_buffer(id, size, tconv, bkg); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setBuffer", "H5Pset_buffer failed"); - } + } } //-------------------------------------------------------------------------- @@ -149,15 +149,15 @@ void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const +size_t DSetMemXferPropList::getBuffer(void** tconv, void** bkg) const { - size_t buffer_size = H5Pget_buffer( id, tconv, bkg ); - if( buffer_size == 0 ) - { - throw PropListIException("DSetMemXferPropList::getBuffer", + size_t buffer_size = H5Pget_buffer(id, tconv, bkg); + if(buffer_size == 0) + { + throw PropListIException("DSetMemXferPropList::getBuffer", "H5Pget_buffer returned 0 for buffer size - failure"); - } - return( buffer_size ); + } + return(buffer_size); } //-------------------------------------------------------------------------- @@ -167,14 +167,14 @@ size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setPreserve( bool status ) const +void DSetMemXferPropList::setPreserve(bool status) const { - herr_t ret_value = H5Pset_preserve( id, (hbool_t) status ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setPreserve", + herr_t ret_value = H5Pset_preserve(id, (hbool_t) status); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setPreserve", "H5Pset_preserve failed"); - } + } } //-------------------------------------------------------------------------- @@ -186,16 +186,16 @@ void DSetMemXferPropList::setPreserve( bool status ) const //-------------------------------------------------------------------------- bool DSetMemXferPropList::getPreserve() const { - int ret_value = H5Pget_preserve( id ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw PropListIException("DSetMemXferPropList::getPreserve", + int ret_value = H5Pget_preserve(id); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else + { + throw PropListIException("DSetMemXferPropList::getPreserve", "H5Pget_preserve returned negative value for status"); - } + } } //-------------------------------------------------------------------------- @@ -207,14 +207,14 @@ bool DSetMemXferPropList::getPreserve() const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const +void DSetMemXferPropList::setBtreeRatios(double left, double middle, double right) const { - herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setBtreeRatios", + herr_t ret_value = H5Pset_btree_ratios(id, left, middle, right); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setBtreeRatios", "H5Pset_btree_ratios failed"); - } + } } //-------------------------------------------------------------------------- @@ -226,14 +226,14 @@ void DSetMemXferPropList::setBtreeRatios( double left, double middle, double rig ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const +void DSetMemXferPropList::getBtreeRatios(double& left, double& middle, double& right) const { - herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getBtreeRatios", + herr_t ret_value = H5Pget_btree_ratios(id, &left, &middle, &right); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getBtreeRatios", "H5Pget_btree_ratios failed"); - } + } } //-------------------------------------------------------------------------- @@ -245,12 +245,12 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const char* expression) const { - herr_t ret_value = H5Pset_data_transform( id, expression); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setDataTransform", + herr_t ret_value = H5Pset_data_transform(id, expression); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setDataTransform", "H5Pset_data_transform failed"); - } + } } //-------------------------------------------------------------------------- @@ -349,14 +349,14 @@ H5std_string DSetMemXferPropList::getDataTransform() const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const +void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const { - herr_t ret_value = H5Pset_type_conv_cb( id, op, user_data); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setTypeConvCB", + herr_t ret_value = H5Pset_type_conv_cb(id, op, user_data); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setTypeConvCB", "H5Pset_type_conv_cb failed"); - } + } } //-------------------------------------------------------------------------- @@ -367,14 +367,14 @@ void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_d ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const +void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const { - herr_t ret_value = H5Pget_type_conv_cb( id, op, user_data); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getTypeConvCB", + herr_t ret_value = H5Pget_type_conv_cb(id, op, user_data); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getTypeConvCB", "H5Pget_type_conv_cb failed"); - } + } } //-------------------------------------------------------------------------- @@ -387,15 +387,15 @@ void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const +void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info) const { - herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, - free_func, free_info ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setVlenMemManager", + herr_t ret_value = H5Pset_vlen_mem_manager(id, alloc_func, alloc_info, + free_func, free_info); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setVlenMemManager", "H5Pset_vlen_mem_manager failed"); - } + } } //-------------------------------------------------------------------------- @@ -408,7 +408,7 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager() const { - setVlenMemManager( NULL, NULL, NULL, NULL ); + setVlenMemManager(NULL, NULL, NULL, NULL); } //-------------------------------------------------------------------------- @@ -421,14 +421,14 @@ void DSetMemXferPropList::setVlenMemManager() const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const +void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info) const { - herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getVlenMemManager", + herr_t ret_value = H5Pget_vlen_mem_manager(id, &alloc_func, alloc_info, &free_func, free_info); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getVlenMemManager", "H5Pget_vlen_mem_manager failed"); - } + } } //-------------------------------------------------------------------------- @@ -443,12 +443,12 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const { - herr_t ret_value = H5Pset_small_data_block_size(id, size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", + herr_t ret_value = H5Pset_small_data_block_size(id, size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", "H5Pset_small_data_block_size failed"); - } + } } //-------------------------------------------------------------------------- @@ -460,14 +460,14 @@ void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const //-------------------------------------------------------------------------- hsize_t DSetMemXferPropList::getSmallDataBlockSize() const { - hsize_t size; - herr_t ret_value = H5Pget_small_data_block_size(id, &size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", + hsize_t size; + herr_t ret_value = H5Pget_small_data_block_size(id, &size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", "H5Pget_small_data_block_size failed"); - } - return(size); + } + return(size); } //-------------------------------------------------------------------------- @@ -483,12 +483,12 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const { - herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setHyperVectorSize", + herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setHyperVectorSize", "H5Pset_hyper_vector_size failed"); - } + } } //-------------------------------------------------------------------------- @@ -501,14 +501,14 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const //-------------------------------------------------------------------------- size_t DSetMemXferPropList::getHyperVectorSize() const { - size_t vector_size; - herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getHyperVectorSize", + size_t vector_size; + herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getHyperVectorSize", "H5Pget_hyper_vector_size failed"); - } - return(vector_size); + } + return(vector_size); } //-------------------------------------------------------------------------- @@ -531,12 +531,12 @@ size_t DSetMemXferPropList::getHyperVectorSize() const //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const { - herr_t ret_value = H5Pset_edc_check(id, check); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setEDCCheck", + herr_t ret_value = H5Pset_edc_check(id, check); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setEDCCheck", "H5Pset_edc_check failed"); - } + } } //-------------------------------------------------------------------------- @@ -548,13 +548,13 @@ void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const //-------------------------------------------------------------------------- H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const { - H5Z_EDC_t check = H5Pget_edc_check(id); - if (check < 0) - { - throw PropListIException("DSetMemXferPropList::getEDCCheck", + H5Z_EDC_t check = H5Pget_edc_check(id); + if (check < 0) + { + throw PropListIException("DSetMemXferPropList::getEDCCheck", "H5Pget_edc_check failed"); - } - return(check); + } + return(check); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 72b64a16..0429508 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -36,16 +36,16 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { DSetMemXferPropList(const char* expression); // Sets type conversion and background buffers. - void setBuffer( size_t size, void* tconv, void* bkg ) const; + void setBuffer(size_t size, void* tconv, void* bkg) const; // Reads buffer settings. - size_t getBuffer( void** tconv, void** bkg ) const; + size_t getBuffer(void** tconv, void** bkg) const; // Sets B-tree split ratios for a dataset transfer property list. - void setBtreeRatios( double left, double middle, double right ) const; + void setBtreeRatios(double left, double middle, double right) const; // Gets B-tree split ratios for a dataset transfer property list. - void getBtreeRatios( double& left, double& middle, double& right ) const; + void getBtreeRatios(double& left, double& middle, double& right) const; // Sets data transform expression. void setDataTransform(const char* expression) const; @@ -56,21 +56,21 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { H5std_string getDataTransform() const; // Sets the dataset transfer property list status to TRUE or FALSE. - void setPreserve( bool status ) const; + void setPreserve(bool status) const; // Checks status of the dataset transfer property list. bool getPreserve() const; // Sets an exception handling callback for datatype conversion. - void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const; + void setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const; // Gets the exception handling callback for datatype conversion. - void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; + void getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const; // Sets the memory manager for variable-length datatype // allocation in H5Dread and H5Dvlen_reclaim. - void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, - H5MM_free_t free, void* free_info ) const; + void setVlenMemManager(H5MM_allocate_t alloc, void* alloc_info, + H5MM_free_t free, void* free_info) const; // alloc and free are set to NULL, indicating that system // malloc and free are to be used. @@ -78,8 +78,8 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Gets the memory manager for variable-length datatype // allocation in H5Dread and H5Tvlen_reclaim. - void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, - H5MM_free_t& free, void** free_info ) const; + void getVlenMemManager(H5MM_allocate_t& alloc, void** alloc_info, + H5MM_free_t& free, void** free_info) const; // Sets the size of a contiguous block reserved for small data. void setSmallDataBlockSize(hsize_t size) const; diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 8f7e911..14a6f43 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -49,14 +49,14 @@ EnumType::EnumType() : DataType() {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {} +EnumType::EnumType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- // Function: EnumType copy constructor ///\brief Copy constructor: makes a copy of the original EnumType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const EnumType& original ) : DataType( original ) {} +EnumType::EnumType(const EnumType& original) : DataType(original) {} //-------------------------------------------------------------------------- // Function: EnumType overloaded constructor @@ -68,7 +68,7 @@ EnumType::EnumType( const EnumType& original ) : DataType( original ) {} // the enum datatype. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {} +EnumType::EnumType(size_t size) : DataType(H5T_ENUM, size) {} //-------------------------------------------------------------------------- // Function: EnumType overloaded constructor @@ -77,16 +77,16 @@ EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const DataSet& dataset ) : DataType() +EnumType::EnumType(const DataSet& dataset) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - // If the datatype id is not valid, throw an exception - if( id < 0 ) - { - throw DataSetIException("EnumType constructor", "H5Dget_type failed"); - } + // If the datatype id is not valid, throw an exception + if(id < 0) + { + throw DataSetIException("EnumType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -96,16 +96,16 @@ EnumType::EnumType( const DataSet& dataset ) : DataType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const IntType& data_type ) : DataType() +EnumType::EnumType(const IntType& data_type) : DataType() { - // Calls C function H5Tenum_create to get the id of the datatype - id = H5Tenum_create( data_type.getId() ); + // Calls C function H5Tenum_create to get the id of the datatype + id = H5Tenum_create(data_type.getId()); - // If the datatype id is not valid, throw an exception - if( id < 0 ) - { - throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); - } + // If the datatype id is not valid, throw an exception + if(id < 0) + { + throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); + } } //-------------------------------------------------------------------------- @@ -116,14 +116,14 @@ EnumType::EnumType( const IntType& data_type ) : DataType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert( const char* name, void *value ) const +void EnumType::insert(const char* name, void *value) const { - // Calls C routine H5Tenum_insert to insert the new enum datatype member. - herr_t ret_value = H5Tenum_insert( id, name, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); - } + // Calls C routine H5Tenum_insert to insert the new enum datatype member. + herr_t ret_value = H5Tenum_insert(id, name, value); + if(ret_value < 0) + { + throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); + } } //-------------------------------------------------------------------------- @@ -133,9 +133,9 @@ void EnumType::insert( const char* name, void *value ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert( const H5std_string& name, void *value ) const +void EnumType::insert(const H5std_string& name, void *value) const { - insert( name.c_str(), value ); + insert(name.c_str(), value); } //-------------------------------------------------------------------------- @@ -147,24 +147,24 @@ void EnumType::insert( const H5std_string& name, void *value ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string EnumType::nameOf( void *value, size_t size ) const +H5std_string EnumType::nameOf(void *value, size_t size) const { - char* name_C = new char[size+1]; // temporary C-string for C API - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for C API + HDmemset(name_C, 0, size+1); // clear buffer - // Calls C routine H5Tenum_nameof to get the name of the specified enum type - herr_t ret_value = H5Tenum_nameof( id, value, name_C, size ); + // Calls C routine H5Tenum_nameof to get the name of the specified enum type + herr_t ret_value = H5Tenum_nameof(id, value, name_C, size); - // If H5Tenum_nameof returns a negative value, raise an exception, - if( ret_value < 0 ) - { + // If H5Tenum_nameof returns a negative value, raise an exception, + if(ret_value < 0) + { delete []name_C; - throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); - } - // otherwise, create the string to hold the datatype name and return it - H5std_string name(name_C); - delete []name_C; - return( name ); + throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); + } + // otherwise, create the string to hold the datatype name and return it + H5std_string name(name_C); + delete []name_C; + return(name); } //-------------------------------------------------------------------------- @@ -176,14 +176,14 @@ H5std_string EnumType::nameOf( void *value, size_t size ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf( const char* name, void *value ) const +void EnumType::valueOf(const char* name, void *value) const { // Calls C routine H5Tenum_valueof to get the enum datatype value - herr_t ret_value = H5Tenum_valueof( id, name, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); - } + herr_t ret_value = H5Tenum_valueof(id, name, value); + if(ret_value < 0) + { + throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); + } } //-------------------------------------------------------------------------- @@ -193,9 +193,9 @@ void EnumType::valueOf( const char* name, void *value ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf( const H5std_string& name, void *value ) const +void EnumType::valueOf(const H5std_string& name, void *value) const { - valueOf( name.c_str(), value ); + valueOf(name.c_str(), value); } //-------------------------------------------------------------------------- @@ -210,13 +210,13 @@ void EnumType::valueOf( const H5std_string& name, void *value ) const //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const char *name) const { - int member_index = H5Tget_member_index(id, name); - if( member_index < 0 ) - { - throw DataTypeIException("EnumType::getMemberIndex", + int member_index = H5Tget_member_index(id, name); + if(member_index < 0) + { + throw DataTypeIException("EnumType::getMemberIndex", "H5Tget_member_index returns negative value"); - } - return( member_index ); + } + return(member_index); } //-------------------------------------------------------------------------- @@ -240,13 +240,13 @@ int EnumType::getMemberIndex(const H5std_string& name) const //-------------------------------------------------------------------------- int EnumType::getNmembers() const { - int num_members = H5Tget_nmembers( id ); - if( num_members < 0 ) - { - throw DataTypeIException("EnumType::getNmembers", + int num_members = H5Tget_nmembers(id); + if(num_members < 0) + { + throw DataTypeIException("EnumType::getNmembers", "H5Tget_nmembers returns negative number of members"); - } - return( num_members ); + } + return(num_members); } //-------------------------------------------------------------------------- @@ -258,14 +258,14 @@ int EnumType::getNmembers() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::getMemberValue( unsigned memb_no, void *value ) const +void EnumType::getMemberValue(unsigned memb_no, void *value) const { - // Call C routine H5Tget_member_value to get the datatype member's value - hid_t ret_value = H5Tget_member_value( id, memb_no, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); - } + // Call C routine H5Tget_member_value to get the datatype member's value + hid_t ret_value = H5Tget_member_value(id, memb_no, value); + if(ret_value < 0) + { + throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 7f10d15..949c75d 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -29,13 +29,13 @@ class H5_DLLCPP EnumType : public DataType { public: // Creates an empty enumeration datatype based on a native signed // integer type, whose size is given by size. - EnumType( size_t size ); + EnumType(size_t size); // Gets the enum datatype of the specified dataset - EnumType( const DataSet& dataset ); // H5Dget_type + EnumType(const DataSet& dataset); // H5Dget_type // Creates a new enum datatype based on an integer datatype - EnumType( const IntType& data_type ); // H5Tenum_create + EnumType(const IntType& data_type); // H5Tenum_create // Returns the number of members in this enumeration datatype. int getNmembers () const; @@ -45,20 +45,20 @@ class H5_DLLCPP EnumType : public DataType { int getMemberIndex(const H5std_string& name) const; // Returns the value of an enumeration datatype member - void getMemberValue( unsigned memb_no, void *value ) const; + void getMemberValue(unsigned memb_no, void *value) const; // Inserts a new member to this enumeration type. - void insert( const char* name, void *value ) const; - void insert( const H5std_string& name, void *value ) const; + void insert(const char* name, void *value) const; + void insert(const H5std_string& name, void *value) const; // Returns the symbol name corresponding to a specified member // of this enumeration datatype. - H5std_string nameOf( void *value, size_t size ) const; + H5std_string nameOf(void *value, size_t size) const; // Returns the value corresponding to a specified member of this // enumeration datatype. - void valueOf( const char* name, void *value ) const; - void valueOf( const H5std_string& name, void *value ) const; + void valueOf(const char* name, void *value) const; + void valueOf(const H5std_string& name, void *value) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("EnumType"); } @@ -67,10 +67,10 @@ class H5_DLLCPP EnumType : public DataType { EnumType(); // Creates an enumeration datatype using an existing id - EnumType( const hid_t existing_id ); + EnumType(const hid_t existing_id); // Copy constructor: makes a copy of the original EnumType object. - EnumType( const EnumType& original ); + EnumType(const EnumType& original); virtual ~EnumType(); diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index ecc50d2..ebb7d62 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -45,7 +45,7 @@ Exception::Exception(const H5std_string& func, const H5std_string& message) : de ///\param orig - IN: Exception instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception( const Exception& orig ) : detail_message(orig.detail_message), func_name(orig.func_name) {} +Exception::Exception(const Exception& orig) : detail_message(orig.detail_message), func_name(orig.func_name) {} //-------------------------------------------------------------------------- // Function: Exception::getMajorString @@ -58,32 +58,32 @@ Exception::Exception( const Exception& orig ) : detail_message(orig.detail_messa /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMajorString( hid_t err_major ) const +H5std_string Exception::getMajorString(hid_t err_major) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); - // If H5Eget_msg() returns a negative value, raise an exception, - if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", + // If H5Eget_msg() returns a negative value, raise an exception, + if(mesg_size < 0) + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); - // Check for failure again - if( mesg_size < 0 ) - { - delete []mesg_C; - throw IdComponentException("Exception::getMajorString", + // Check for failure again + if(mesg_size < 0) + { + delete []mesg_C; + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); - } + } - // Convert the C error description and return - H5std_string major_str(mesg_C); - delete []mesg_C; - return( major_str ); + // Convert the C error description and return + H5std_string major_str(mesg_C); + delete []mesg_C; + return(major_str); } //-------------------------------------------------------------------------- @@ -97,32 +97,32 @@ H5std_string Exception::getMajorString( hid_t err_major ) const /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMinorString( hid_t err_minor ) const +H5std_string Exception::getMinorString(hid_t err_minor) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); - // If H5Eget_msg() returns a negative value, raise an exception, - if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", + // If H5Eget_msg() returns a negative value, raise an exception, + if(mesg_size < 0) + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); - // Check for failure again - if( mesg_size < 0 ) - { - delete []mesg_C; - throw IdComponentException("Exception::getMinorString", + // Check for failure again + if(mesg_size < 0) + { + delete []mesg_C; + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); - } + } - // Convert the C error description and return - H5std_string minor_str(mesg_C); - delete []mesg_C; - return( minor_str ); + // Convert the C error description and return + H5std_string minor_str(mesg_C); + delete []mesg_C; + return(minor_str); } //-------------------------------------------------------------------------- @@ -141,13 +141,13 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const /// handlers // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) +void Exception::setAutoPrint(H5E_auto2_t& func, void* client_data) { - // calls the C API routine H5Eset_auto to set the auto printing to - // the specified function. - herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::setAutoPrint", "H5Eset_auto failed" ); + // calls the C API routine H5Eset_auto to set the auto printing to + // the specified function. + herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, func, client_data); + if(ret_value < 0) + throw Exception("Exception::setAutoPrint", "H5Eset_auto failed"); } //-------------------------------------------------------------------------- @@ -157,11 +157,11 @@ void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) //-------------------------------------------------------------------------- void Exception::dontPrint() { - // calls the C API routine H5Eset_auto with NULL parameters to turn - // off the automatic error printing. - herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, NULL, NULL ); - if( ret_value < 0 ) - throw Exception( "Exception::dontPrint", "H5Eset_auto failed" ); + // calls the C API routine H5Eset_auto with NULL parameters to turn + // off the automatic error printing. + herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + if(ret_value < 0) + throw Exception("Exception::dontPrint", "H5Eset_auto failed"); } //-------------------------------------------------------------------------- @@ -174,13 +174,13 @@ void Exception::dontPrint() /// the error function // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) +void Exception::getAutoPrint(H5E_auto2_t& func, void** client_data) { - // calls the C API routine H5Eget_auto to get the current setting of - // the automatic error printing - herr_t ret_value = H5Eget_auto2( H5E_DEFAULT, &func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); + // calls the C API routine H5Eget_auto to get the current setting of + // the automatic error printing + herr_t ret_value = H5Eget_auto2(H5E_DEFAULT, &func, client_data); + if(ret_value < 0) + throw Exception("Exception::getAutoPrint", "H5Eget_auto failed"); } //-------------------------------------------------------------------------- @@ -193,10 +193,10 @@ void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) //-------------------------------------------------------------------------- void Exception::clearErrorStack() { - // calls the C API routine H5Eclear to clear the error stack - herr_t ret_value = H5Eclear2(H5E_DEFAULT); - if( ret_value < 0 ) - throw Exception( "Exception::clearErrorStack", "H5Eclear failed" ); + // calls the C API routine H5Eclear to clear the error stack + herr_t ret_value = H5Eclear2(H5E_DEFAULT); + if(ret_value < 0) + throw Exception("Exception::clearErrorStack", "H5Eclear failed"); } //-------------------------------------------------------------------------- @@ -240,12 +240,12 @@ void Exception::clearErrorStack() ///\endcode // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, void* client_data ) +void Exception::walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void* client_data) { - // calls the C API routine H5Ewalk to walk the error stack - herr_t ret_value = H5Ewalk2( H5E_DEFAULT, direction, func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::walkErrorStack", "H5Ewalk failed" ); + // calls the C API routine H5Ewalk to walk the error stack + herr_t ret_value = H5Ewalk2(H5E_DEFAULT, direction, func, client_data); + if(ret_value < 0) + throw Exception("Exception::walkErrorStack", "H5Ewalk failed"); } //-------------------------------------------------------------------------- @@ -257,7 +257,7 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, voi //-------------------------------------------------------------------------- H5std_string Exception::getDetailMsg() const { - return(detail_message); + return(detail_message); } //-------------------------------------------------------------------------- @@ -269,7 +269,7 @@ H5std_string Exception::getDetailMsg() const //-------------------------------------------------------------------------- const char* Exception::getCDetailMsg() const { - return(detail_message.c_str()); + return(detail_message.c_str()); } //-------------------------------------------------------------------------- @@ -280,7 +280,7 @@ const char* Exception::getCDetailMsg() const //-------------------------------------------------------------------------- H5std_string Exception::getFuncName() const { - return(func_name); + return(func_name); } //-------------------------------------------------------------------------- @@ -291,7 +291,7 @@ H5std_string Exception::getFuncName() const //-------------------------------------------------------------------------- const char* Exception::getCFuncName() const { - return(func_name.c_str()); + return(func_name.c_str()); } //-------------------------------------------------------------------------- @@ -304,8 +304,8 @@ const char* Exception::getCFuncName() const void Exception::printErrorStack(FILE* stream, hid_t err_stack) { herr_t ret_value = H5Eprint2(err_stack, stream); - if( ret_value < 0 ) - throw Exception( "Printing error stack", "H5Eprint2 failed" ); + if(ret_value < 0) + throw Exception("Printing error stack", "H5Eprint2 failed"); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index e5f4eab..fd67118 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -39,11 +39,11 @@ class H5_DLLCPP Exception { // Returns a character string that describes the error specified by // a major error number. - H5std_string getMajorString( hid_t err_major_id ) const; + H5std_string getMajorString(hid_t err_major_id) const; // Returns a character string that describes the error specified by // a minor error number. - H5std_string getMinorString( hid_t err_minor_id ) const; + H5std_string getMinorString(hid_t err_minor_id) const; // Returns the detailed message set at the time the exception is thrown H5std_string getDetailMsg() const; @@ -52,21 +52,21 @@ class H5_DLLCPP Exception { const char* getCFuncName() const; // function name as a char string // Turns on the automatic error printing. - static void setAutoPrint( H5E_auto2_t& func, void* client_data); + static void setAutoPrint(H5E_auto2_t& func, void* client_data); // Turns off the automatic error printing. static void dontPrint(); // Retrieves the current settings for the automatic error stack // traversal function and its data. - static void getAutoPrint( H5E_auto2_t& func, void** client_data); + static void getAutoPrint(H5E_auto2_t& func, void** client_data); // Clears the error stack for the current thread. static void clearErrorStack(); // Walks the error stack for the current thread, calling the // specified function. - static void walkErrorStack( H5E_direction_t direction, + static void walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void* client_data); // Prints the error stack in a default manner. @@ -78,7 +78,7 @@ class H5_DLLCPP Exception { Exception(); // copy constructor - Exception( const Exception& orig); + Exception(const Exception& orig); // virtual Destructor virtual ~Exception() throw(); @@ -94,14 +94,14 @@ class H5_DLLCPP Exception { class H5_DLLCPP FileIException : public Exception { public: - FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); FileIException(); virtual ~FileIException() throw(); }; class H5_DLLCPP GroupIException : public Exception { public: - GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); GroupIException(); virtual ~GroupIException() throw(); }; diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 548d9d9..76981e1 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -86,7 +86,7 @@ const FileAccPropList& FileAccPropList::DEFAULT = *getConstant(); ///\brief Creates a file access property list // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {} +FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {} //-------------------------------------------------------------------------- // Function: FileAccPropList copy constructor @@ -113,11 +113,11 @@ FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- void FileAccPropList::setStdio() const { - herr_t ret_value = H5Pset_fapl_stdio(id); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); - } + herr_t ret_value = H5Pset_fapl_stdio(id); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); + } } //-------------------------------------------------------------------------- @@ -133,12 +133,12 @@ void FileAccPropList::setStdio() const //-------------------------------------------------------------------------- hid_t FileAccPropList::getDriver() const { - hid_t driver = H5Pget_driver(id); - if (driver < 0) - { - throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); - } - return(driver); + hid_t driver = H5Pget_driver(id); + if (driver < 0) + { + throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); + } + return(driver); } //-------------------------------------------------------------------------- @@ -155,11 +155,11 @@ hid_t FileAccPropList::getDriver() const //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const { - herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); - } + herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); + } } //-------------------------------------------------------------------------- @@ -171,11 +171,11 @@ void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info //-------------------------------------------------------------------------- void FileAccPropList::setFamilyOffset(hsize_t offset) const { - herr_t ret_value = H5Pset_family_offset(id, offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); - } + herr_t ret_value = H5Pset_family_offset(id, offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); + } } //-------------------------------------------------------------------------- @@ -187,13 +187,13 @@ void FileAccPropList::setFamilyOffset(hsize_t offset) const //-------------------------------------------------------------------------- hsize_t FileAccPropList::getFamilyOffset() const { - hsize_t offset; - herr_t ret_value = H5Pget_family_offset(id, &offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); - } - return(offset); + hsize_t offset; + herr_t ret_value = H5Pget_family_offset(id, &offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); + } + return(offset); } //-------------------------------------------------------------------------- @@ -213,11 +213,11 @@ hsize_t FileAccPropList::getFamilyOffset() const //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const { - herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); - if (ret_value < 0) - { - throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); - } + herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); + if (ret_value < 0) + { + throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); + } } //-------------------------------------------------------------------------- @@ -231,11 +231,11 @@ void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const //-------------------------------------------------------------------------- void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const { - herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); - } + herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); + } } //-------------------------------------------------------------------------- @@ -249,13 +249,13 @@ void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const /// Note that \a memb_size is used only when creating a new file. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const +void FileAccPropList::setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const { - herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId() ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); - } + herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId()); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); + } } //-------------------------------------------------------------------------- @@ -270,12 +270,12 @@ void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_ //-------------------------------------------------------------------------- void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } memb_plist.p_setId(memb_plist_id); } @@ -291,14 +291,14 @@ void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) //-------------------------------------------------------------------------- FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } FileAccPropList memb_plist(memb_plist_id); - return(memb_plist); + return(memb_plist); } //-------------------------------------------------------------------------- @@ -317,15 +317,15 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const // Modification // Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext) const { - hid_t meta_pid = meta_plist.getId(); - hid_t raw_pid = raw_plist.getId(); - herr_t ret_value = H5Pset_fapl_split( id, meta_ext, meta_pid, raw_ext, raw_pid ); - if( ret_value < 0 ) + hid_t meta_pid = meta_plist.getId(); + hid_t raw_pid = raw_plist.getId(); + herr_t ret_value = H5Pset_fapl_split(id, meta_ext, meta_pid, raw_ext, raw_pid); + if(ret_value < 0) { - throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); - } + throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); + } } //-------------------------------------------------------------------------- @@ -341,9 +341,9 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP // Modification // Replaced the version without const parameter - Apr, 2014 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext) const { - setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); + setSplit(meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str()); } // Stream Virtual File Driver had been removed from the main library. @@ -360,13 +360,13 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP //-------------------------------------------------------------------------- size_t FileAccPropList::getSieveBufSize() const { - size_t bufsize; - herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } - return(bufsize); + size_t bufsize; + herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } + return(bufsize); } //-------------------------------------------------------------------------- @@ -381,11 +381,11 @@ size_t FileAccPropList::getSieveBufSize() const //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const { - herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } + herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } } //-------------------------------------------------------------------------- @@ -401,11 +401,11 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const { - herr_t ret_value = H5Pset_meta_block_size(id, block_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); - } + herr_t ret_value = H5Pset_meta_block_size(id, block_size); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); + } } //-------------------------------------------------------------------------- @@ -417,13 +417,13 @@ void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const //-------------------------------------------------------------------------- hsize_t FileAccPropList::getMetaBlockSize() const { - hsize_t block_size; - herr_t ret_value = H5Pget_meta_block_size(id, &block_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); - } - return(block_size); + hsize_t block_size; + herr_t ret_value = H5Pget_meta_block_size(id, &block_size); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); + } + return(block_size); } //-------------------------------------------------------------------------- @@ -441,11 +441,11 @@ hsize_t FileAccPropList::getMetaBlockSize() const //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const { - herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); - } + herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); + } } //-------------------------------------------------------------------------- @@ -460,7 +460,7 @@ void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_siz //-------------------------------------------------------------------------- void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const { - setLog(logfile.c_str(), flags, buf_size); + setLog(logfile.c_str(), flags, buf_size); } //-------------------------------------------------------------------------- @@ -473,11 +473,11 @@ void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t //-------------------------------------------------------------------------- void FileAccPropList::setSec2() const { - herr_t ret_value = H5Pset_fapl_sec2(id); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); - } + herr_t ret_value = H5Pset_fapl_sec2(id); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); + } } //-------------------------------------------------------------------------- @@ -496,13 +496,13 @@ void FileAccPropList::setSec2() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const +void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const { - herr_t ret_value = H5Pset_alignment( id, threshold, alignment ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); - } + herr_t ret_value = H5Pset_alignment(id, threshold, alignment); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); + } } //-------------------------------------------------------------------------- @@ -514,13 +514,13 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const +void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const { - herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); - } + herr_t ret_value = H5Pget_alignment(id, &threshold, &alignment); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); + } } //-------------------------------------------------------------------------- @@ -535,11 +535,11 @@ void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) con //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const { - herr_t ret_value = H5Pset_multi_type(id, dtype); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); - } + herr_t ret_value = H5Pset_multi_type(id, dtype); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); + } } //-------------------------------------------------------------------------- @@ -554,13 +554,13 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const { - H5FD_mem_t dtype; - herr_t ret_value = H5Pget_multi_type(id, &dtype); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); - } - return(dtype); + H5FD_mem_t dtype; + herr_t ret_value = H5Pget_multi_type(id, &dtype); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); + } + return(dtype); } //-------------------------------------------------------------------------- @@ -580,13 +580,13 @@ H5FD_mem_t FileAccPropList::getMultiType() const /// means fully read chunks are always preempted before other chunks. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const +void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const { - herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); - } + herr_t ret_value = H5Pset_cache(id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); + } } //-------------------------------------------------------------------------- @@ -599,13 +599,13 @@ void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_ ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const +void FileAccPropList::getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const { - herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); - } + herr_t ret_value = H5Pget_cache(id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); + } } //-------------------------------------------------------------------------- @@ -617,11 +617,11 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd //-------------------------------------------------------------------------- void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const { - herr_t ret_value = H5Pset_fclose_degree(id, degree); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); - } + herr_t ret_value = H5Pset_fclose_degree(id, degree); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); + } } //-------------------------------------------------------------------------- @@ -633,13 +633,13 @@ void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const //-------------------------------------------------------------------------- H5F_close_degree_t FileAccPropList::getFcloseDegree() const { - H5F_close_degree_t degree; - herr_t ret_value = H5Pget_fclose_degree(id, °ree); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); - } - return(degree); + H5F_close_degree_t degree; + herr_t ret_value = H5Pget_fclose_degree(id, °ree); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); + } + return(degree); } //-------------------------------------------------------------------------- @@ -653,13 +653,13 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setGcReferences( unsigned gc_ref ) const +void FileAccPropList::setGcReferences(unsigned gc_ref) const { - herr_t ret_value = H5Pset_gc_references( id, gc_ref ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); - } + herr_t ret_value = H5Pset_gc_references(id, gc_ref); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); + } } //-------------------------------------------------------------------------- @@ -671,15 +671,15 @@ void FileAccPropList::setGcReferences( unsigned gc_ref ) const //-------------------------------------------------------------------------- unsigned FileAccPropList::getGcReferences() const { - unsigned gc_ref; + unsigned gc_ref; - // the name of this routine will be changed to H5Pget_gc_references??? - herr_t ret_value = H5Pget_gc_references( id, &gc_ref ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); - } - return( gc_ref ); + // the name of this routine will be changed to H5Pget_gc_references??? + herr_t ret_value = H5Pget_gc_references(id, &gc_ref); + if(ret_value < 0) + { + throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); + } + return(gc_ref); } //-------------------------------------------------------------------------- @@ -737,7 +737,7 @@ void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libv void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const { herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high); - if( ret_value < 0 ) + if(ret_value < 0) { throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); } diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 272bf39..237dd68 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -58,7 +58,7 @@ class H5_DLLCPP FileAccPropList : public PropList { void getCore (size_t& increment, hbool_t& backing_store) const; // Sets this file access properties list to the family driver. - void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const; + void setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const; // Returns information about the family file access property list. void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; @@ -68,7 +68,7 @@ class H5_DLLCPP FileAccPropList : public PropList { void setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext = ".meta", - const char* raw_ext = ".raw" ) const; + const char* raw_ext = ".raw") const; void setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext = ".meta", @@ -92,11 +92,11 @@ class H5_DLLCPP FileAccPropList : public PropList { void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; // Sets alignment properties of this file access property list - void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; + void setAlignment(hsize_t threshold = 1, hsize_t alignment = 1) const; // Retrieves the current settings for alignment properties from // this property list. - void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; + void getAlignment(hsize_t& threshold, hsize_t& alignment) const; // Sets data type for multi driver. void setMultiType(H5FD_mem_t dtype) const; @@ -105,10 +105,10 @@ class H5_DLLCPP FileAccPropList : public PropList { H5FD_mem_t getMultiType() const; // Sets the meta data cache and raw data chunk cache parameters. - void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; + void setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const; // Queries the meta data cache and raw data chunk cache parameters. - void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; + void getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const; // Sets the degree for the file close behavior. void setFcloseDegree(H5F_close_degree_t degree) const; @@ -117,7 +117,7 @@ class H5_DLLCPP FileAccPropList : public PropList { H5F_close_degree_t getFcloseDegree() const; // Sets garbage collecting references flag. - void setGcReferences( unsigned gc_ref = 0 ) const; + void setGcReferences(unsigned gc_ref = 0) const; // Returns garbage collecting references setting. unsigned getGcReferences() const; @@ -133,7 +133,7 @@ class H5_DLLCPP FileAccPropList : public PropList { virtual H5std_string fromClass () const { return("FileAccPropList"); } // Copy constructor: creates a copy of a FileAccPropList object. - FileAccPropList( const FileAccPropList& original ); + FileAccPropList(const FileAccPropList& original); // Creates a copy of an existing file access property list // using the property list id. diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 1da3aa8..117bf01 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -84,7 +84,7 @@ const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant(); ///\brief Default constructor: Creates a file create property list // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} +FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor @@ -93,7 +93,7 @@ FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {} +FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList overloaded constructor @@ -118,12 +118,12 @@ FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) //-------------------------------------------------------------------------- void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const { - herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getVersion", + herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::getVersion", "H5Pget_version failed"); - } + } } //-------------------------------------------------------------------------- @@ -136,14 +136,14 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned /// of 2 equal to 512 or greater (512, 1024, 2048, etc.) // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setUserblock( hsize_t size ) const +void FileCreatPropList::setUserblock(hsize_t size) const { - herr_t ret_value = H5Pset_userblock( id, size); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setUserblock", + herr_t ret_value = H5Pset_userblock(id, size); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::setUserblock", "H5Pset_userblock failed"); - } + } } //-------------------------------------------------------------------------- @@ -155,14 +155,14 @@ void FileCreatPropList::setUserblock( hsize_t size ) const //-------------------------------------------------------------------------- hsize_t FileCreatPropList::getUserblock() const { - hsize_t userblock_size; - herr_t ret_value = H5Pget_userblock( id, &userblock_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getUserblock", + hsize_t userblock_size; + herr_t ret_value = H5Pget_userblock(id, &userblock_size); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::getUserblock", "H5Pget_userblock failed"); - } - return( userblock_size ); + } + return(userblock_size); } //-------------------------------------------------------------------------- @@ -178,14 +178,14 @@ hsize_t FileCreatPropList::getUserblock() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const +void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const { - herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setSizes", + herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::setSizes", "H5Pset_sizes failed"); - } + } } //-------------------------------------------------------------------------- @@ -196,14 +196,14 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const +void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const { - herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getSizes", + herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::getSizes", "H5Pget_sizes failed"); - } + } } //-------------------------------------------------------------------------- @@ -218,14 +218,14 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const +void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const { - herr_t ret_value = H5Pset_sym_k( id, ik, lk ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setSymk", + herr_t ret_value = H5Pset_sym_k(id, ik, lk); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed"); - } + } } //-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const +void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const { - herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getSymk", + herr_t ret_value = H5Pget_sym_k(id, &ik, &lk); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed"); - } + } } //-------------------------------------------------------------------------- @@ -260,14 +260,14 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setIstorek( unsigned ik ) const +void FileCreatPropList::setIstorek(unsigned ik) const { - herr_t ret_value = H5Pset_istore_k( id, ik ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setIstorek", + herr_t ret_value = H5Pset_istore_k(id, ik); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::setIstorek", "H5Pset_istore_k failed"); - } + } } //-------------------------------------------------------------------------- @@ -282,14 +282,14 @@ void FileCreatPropList::setIstorek( unsigned ik ) const //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const { - unsigned ik; - herr_t ret_value = H5Pget_istore_k( id, &ik ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getIstorek", + unsigned ik; + herr_t ret_value = H5Pget_istore_k(id, &ik); + if(ret_value < 0) + { + throw PropListIException("FileCreatPropList::getIstorek", "H5Pget_istore_k failed"); - } - return( ik ); + } + return(ik); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 02eacbc..f50b4c6 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -33,34 +33,34 @@ class H5_DLLCPP FileCreatPropList : public PropList { FileCreatPropList(); // Retrieves version information for various parts of a file. - void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; + void getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const; // Sets the userblock size field of a file creation property list. - void setUserblock( hsize_t size ) const; + void setUserblock(hsize_t size) const; // Gets the size of a user block in this file creation property list. hsize_t getUserblock() const; // Retrieves the size-of address and size quantities stored in a // file according to this file creation property list. - void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; + void getSizes(size_t& sizeof_addr, size_t& sizeof_size) const; // Sets file size-of addresses and sizes. - void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const; + void setSizes(size_t sizeof_addr = 4, size_t sizeof_size = 4) const; // Retrieves the size of the symbol table B-tree 1/2 rank and the // symbol table leaf node 1/2 size. - void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const; + void getSymk(unsigned& int_nodes_k, unsigned& leaf_nodes_k) const; // Sets the size of parameters used to control the symbol table nodes. - void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const; + void setSymk(unsigned int_nodes_k, unsigned leaf_nodes_k) const; // Returns the 1/2 rank of an indexed storage B-tree. unsigned getIstorek() const; // Sets the size of parameter used to control the B-trees for // indexing chunked datasets. - void setIstorek( unsigned ik ) const; + void setIstorek(unsigned ik) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("FileCreatPropList"); } diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 9475da9..c18431c 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -82,7 +82,7 @@ H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {} // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID) +H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : H5Location(), CommonFG(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -107,7 +107,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID) +H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : H5Location(), CommonFG(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -129,12 +129,12 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro { // These bits only set for creation, so if any of them are set, // create the file. - if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) + if(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { hid_t create_plist_id = create_plist.getId(); hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail + id = H5Fcreate(name, flags, create_plist_id, access_plist_id); + if(id < 0) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fcreate failed"); } @@ -143,8 +143,8 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro else { hid_t access_plist_id = access_plist.getId(); - id = H5Fopen( name, flags, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail + id = H5Fopen(name, flags, access_plist_id); + if(id < 0) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fopen failed"); } @@ -195,17 +195,17 @@ H5File::H5File(const H5File& original) : H5Location(), CommonFG() //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { - // Calls C routine H5Fis_hdf5 to determine whether the file is in - // HDF5 format. It returns positive value, 0, or negative value - htri_t ret_value = H5Fis_hdf5( name ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Fis_hdf5 returns a negative value - { - throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); - } + // Calls C routine H5Fis_hdf5 to determine whether the file is in + // HDF5 format. It returns positive value, 0, or negative value + htri_t ret_value = H5Fis_hdf5(name); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Fis_hdf5 returns a negative value + { + throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); + } } //-------------------------------------------------------------------------- @@ -215,9 +215,9 @@ bool H5File::isHdf5(const char* name) ///\param name - IN: Name of the file - \c H5std_string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const H5std_string& name ) +bool H5File::isHdf5(const H5std_string& name) { - return( isHdf5( name.c_str()) ); + return(isHdf5(name.c_str())); } //-------------------------------------------------------------------------- @@ -296,11 +296,11 @@ void H5File::reOpen() throw FileIException("H5File::reOpen", close_error.getDetailMsg()); } - // call C routine to reopen the file - Note: not sure about this, - // which id to be the parameter when closing? - id = H5Freopen( id ); - if( id < 0 ) // Raise exception when H5Freopen returns a neg value - throw FileIException("H5File::reOpen", "H5Freopen failed"); + // call C routine to reopen the file - Note: not sure about this, + // which id to be the parameter when closing? + id = H5Freopen(id); + if(id < 0) // Raise exception when H5Freopen returns a neg value + throw FileIException("H5File::reOpen", "H5Freopen failed"); } //-------------------------------------------------------------------------- @@ -312,19 +312,19 @@ void H5File::reOpen() //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { - hid_t create_plist_id = H5Fget_create_plist( id ); - - // if H5Fget_create_plist returns a valid id, create and return - // the FileCreatPropList object for this property list - if( create_plist_id > 0 ) - { - FileCreatPropList create_plist( create_plist_id ); - return( create_plist ); - } - else - { - throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); - } + hid_t create_plist_id = H5Fget_create_plist(id); + + // if H5Fget_create_plist returns a valid id, create and return + // the FileCreatPropList object for this property list + if(create_plist_id > 0) + { + FileCreatPropList create_plist(create_plist_id); + return(create_plist); + } + else + { + throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); + } } //-------------------------------------------------------------------------- @@ -336,19 +336,19 @@ FileCreatPropList H5File::getCreatePlist() const //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { - hid_t access_plist_id = H5Fget_access_plist( id ); - - // if H5Fget_access_plist returns a valid id, create and return - // the FileAccPropList object for this property list - if( access_plist_id > 0 ) - { - FileAccPropList access_plist( access_plist_id ); - return access_plist; - } - else // Raise an exception - { - throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); - } + hid_t access_plist_id = H5Fget_access_plist(id); + + // if H5Fget_access_plist returns a valid id, create and return + // the FileAccPropList object for this property list + if(access_plist_id > 0) + { + FileAccPropList access_plist(access_plist_id); + return access_plist; + } + else // Raise an exception + { + throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); + } } //-------------------------------------------------------------------------- @@ -360,12 +360,12 @@ FileAccPropList H5File::getAccessPlist() const //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const { - hssize_t free_space = H5Fget_freespace(id); - if( free_space < 0 ) - { - throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); - } - return (free_space); + hssize_t free_space = H5Fget_freespace(id); + if(free_space < 0) + { + throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); + } + return (free_space); } @@ -392,12 +392,12 @@ hssize_t H5File::getFreeSpace() const //-------------------------------------------------------------------------- ssize_t H5File::getObjCount(unsigned types) const { - ssize_t num_objs = H5Fget_obj_count(id, types); - if( num_objs < 0 ) - { - throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); - } - return (num_objs); + ssize_t num_objs = H5Fget_obj_count(id, types); + if(num_objs < 0) + { + throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); + } + return (num_objs); } //-------------------------------------------------------------------------- @@ -427,11 +427,11 @@ ssize_t H5File::getObjCount(unsigned types) const //-------------------------------------------------------------------------- void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const { - ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); - if( ret_value < 0 ) - { - throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); - } + ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); + if(ret_value < 0) + { + throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); + } } //-------------------------------------------------------------------------- @@ -457,12 +457,12 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { - hid_t fapl_id = fapl.getId(); - herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); - if( ret_value < 0 ) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + hid_t fapl_id = fapl.getId(); + herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); + if(ret_value < 0) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- @@ -497,11 +497,11 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const { - herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); - if( ret_value < 0 ) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); + if(ret_value < 0) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- @@ -516,13 +516,13 @@ void H5File::getVFDHandle(void **file_handle) const //-------------------------------------------------------------------------- hsize_t H5File::getFileSize() const { - hsize_t file_size; - herr_t ret_value = H5Fget_filesize(id, &file_size); - if (ret_value < 0) - { - throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); - } - return (file_size); + hsize_t file_size; + herr_t ret_value = H5Fget_filesize(id, &file_size); + if (ret_value < 0) + { + throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); + } + return (file_size); } //-------------------------------------------------------------------------- @@ -539,7 +539,7 @@ hsize_t H5File::getFileSize() const //-------------------------------------------------------------------------- hid_t H5File::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -553,7 +553,7 @@ hid_t H5File::getId() const //-------------------------------------------------------------------------- void H5File::reopen() { - H5File::reOpen(); + H5File::reOpen(); } //-------------------------------------------------------------------------- @@ -566,7 +566,7 @@ void H5File::reopen() //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { - return( getId() ); + return(getId()); } //-------------------------------------------------------------------------- @@ -590,8 +590,8 @@ void H5File::p_setId(const hid_t new_id) catch (Exception& E) { throw FileIException("H5File::p_setId", E.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -606,8 +606,8 @@ void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Fclose(id); + if(ret_value < 0) { throw FileIException("H5File::close", "H5Fclose failed"); } @@ -632,9 +632,9 @@ void H5File::close() //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "H5File::"); - throw FileIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "H5File::"); + throw FileIException(full_name, msg); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 22bb6c5..bf6e655 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -26,12 +26,12 @@ namespace H5 { class H5_DLLCPP H5File : public H5Location, public CommonFG { public: // Creates or opens an HDF5 file. - H5File( const char* name, unsigned int flags, + H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - H5File( const H5std_string& name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); // Open the file void openFile(const H5std_string& name, unsigned int flags, @@ -68,8 +68,8 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG { //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 // Determines if a file, specified by its name, is in HDF5 format - static bool isHdf5(const char* name ); - static bool isHdf5(const H5std_string& name ); + static bool isHdf5(const char* name); + static bool isHdf5(const H5std_string& name); // Reopens this file. void reOpen(); // added for better name @@ -115,7 +115,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG { // This function is private and contains common code between the // constructors taking a string or a char* - void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); + void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); }; // end of H5File } // namespace H5 diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 0e2d0c7..0e3417b 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -48,10 +48,10 @@ FloatType::FloatType() {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const PredType& pred_type ) : AtomType() +FloatType::FloatType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- @@ -62,14 +62,14 @@ FloatType::FloatType( const PredType& pred_type ) : AtomType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {} +FloatType::FloatType(const hid_t existing_id) : AtomType(existing_id) {} //-------------------------------------------------------------------------- // Function: FloatType copy constructor ///\brief Copy constructor: makes a copy of the original FloatType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const FloatType& original ) : AtomType( original ){} +FloatType::FloatType(const FloatType& original) : AtomType(original){} //-------------------------------------------------------------------------- // Function: EnumType overloaded constructor @@ -79,15 +79,15 @@ FloatType::FloatType( const FloatType& original ) : AtomType( original ){} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const DataSet& dataset ) : AtomType() +FloatType::FloatType(const DataSet& dataset) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - if( id < 0 ) - { - throw DataSetIException("FloatType constructor", "H5Dget_type failed"); - } + if(id < 0) + { + throw DataSetIException("FloatType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -101,13 +101,13 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const +void FloatType::getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const { - herr_t ret_value = H5Tget_fields( id, &spos, &epos, &esize, &mpos, &msize ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); - } + herr_t ret_value = H5Tget_fields(id, &spos, &epos, &esize, &mpos, &msize); + if(ret_value < 0) + { + throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); + } } //-------------------------------------------------------------------------- @@ -122,13 +122,13 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const +void FloatType::setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const { - herr_t ret_value = H5Tset_fields( id, spos, epos, esize, mpos, msize ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); - } + herr_t ret_value = H5Tset_fields(id, spos, epos, esize, mpos, msize); + if(ret_value < 0) + { + throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); + } } //-------------------------------------------------------------------------- @@ -140,13 +140,13 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, //-------------------------------------------------------------------------- size_t FloatType::getEbias() const { - size_t ebias = H5Tget_ebias( id ); - // Returns the bias if successful - if( ebias == 0 ) - { - throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); - } - return( ebias ); + size_t ebias = H5Tget_ebias(id); + // Returns the bias if successful + if(ebias == 0) + { + throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); + } + return(ebias); } //-------------------------------------------------------------------------- @@ -156,13 +156,13 @@ size_t FloatType::getEbias() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setEbias( size_t ebias ) const +void FloatType::setEbias(size_t ebias) const { - herr_t ret_value = H5Tset_ebias( id, ebias ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); - } + herr_t ret_value = H5Tset_ebias(id, ebias); + if(ret_value < 0) + { + throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); + } } //-------------------------------------------------------------------------- @@ -180,21 +180,21 @@ void FloatType::setEbias( size_t ebias ) const /// \a norm_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const +H5T_norm_t FloatType::getNorm(H5std_string& norm_string) const { - H5T_norm_t norm = H5Tget_norm( id ); // C routine - // Returns a valid normalization type if successful - if( norm == H5T_NORM_ERROR ) - { - throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); - } - if( norm == H5T_NORM_IMPLIED ) - norm_string = "H5T_NORM_IMPLIED (0)"; - else if( norm == H5T_NORM_MSBSET ) - norm_string = "H5T_NORM_MSBSET (1)"; - else if( norm == H5T_NORM_NONE ) - norm_string = "H5T_NORM_NONE (2)"; - return( norm ); + H5T_norm_t norm = H5Tget_norm(id); // C routine + // Returns a valid normalization type if successful + if(norm == H5T_NORM_ERROR) + { + throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); + } + if(norm == H5T_NORM_IMPLIED) + norm_string = "H5T_NORM_IMPLIED (0)"; + else if(norm == H5T_NORM_MSBSET) + norm_string = "H5T_NORM_MSBSET (1)"; + else if(norm == H5T_NORM_NONE) + norm_string = "H5T_NORM_NONE (2)"; + return(norm); } //-------------------------------------------------------------------------- @@ -209,13 +209,13 @@ H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const /// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setNorm( H5T_norm_t norm ) const +void FloatType::setNorm(H5T_norm_t norm) const { - herr_t ret_value = H5Tset_norm( id, norm ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); - } + herr_t ret_value = H5Tset_norm(id, norm); + if(ret_value < 0) + { + throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); + } } //-------------------------------------------------------------------------- @@ -233,21 +233,21 @@ void FloatType::setNorm( H5T_norm_t norm ) const /// \a pad_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const +H5T_pad_t FloatType::getInpad(H5std_string& pad_string) const { - H5T_pad_t pad_type = H5Tget_inpad( id ); - // Returns a valid padding type if successful - if( pad_type == H5T_PAD_ERROR ) - { - throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); - } - if( pad_type == H5T_PAD_ZERO ) - pad_string = "H5T_PAD_ZERO (0)"; - else if( pad_type == H5T_PAD_ONE ) - pad_string = "H5T_PAD_ONE (1)"; - else if( pad_type == H5T_PAD_BACKGROUND ) - pad_string = "H5T_PAD_BACKGROUD (2)"; - return( pad_type ); + H5T_pad_t pad_type = H5Tget_inpad(id); + // Returns a valid padding type if successful + if(pad_type == H5T_PAD_ERROR) + { + throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); + } + if(pad_type == H5T_PAD_ZERO) + pad_string = "H5T_PAD_ZERO (0)"; + else if(pad_type == H5T_PAD_ONE) + pad_string = "H5T_PAD_ONE (1)"; + else if(pad_type == H5T_PAD_BACKGROUND) + pad_string = "H5T_PAD_BACKGROUD (2)"; + return(pad_type); } //-------------------------------------------------------------------------- @@ -267,13 +267,13 @@ H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const /// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setInpad( H5T_pad_t inpad ) const +void FloatType::setInpad(H5T_pad_t inpad) const { - herr_t ret_value = H5Tset_inpad( id, inpad ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); - } + herr_t ret_value = H5Tset_inpad(id, inpad); + if(ret_value < 0) + { + throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index a784105..67eee66 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -27,34 +27,34 @@ namespace H5 { class H5_DLLCPP FloatType : public AtomType { public: // Creates a floating-point type using a predefined type. - FloatType( const PredType& pred_type ); + FloatType(const PredType& pred_type); // Gets the floating-point datatype of the specified dataset. - FloatType( const DataSet& dataset ); + FloatType(const DataSet& dataset); // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; // Sets the exponent bias of a floating-point type. - void setEbias( size_t ebias ) const; + void setEbias(size_t ebias) const; // Retrieves floating point datatype bit field information. - void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; + void getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const; // Sets locations and sizes of floating point bit fields. - void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; + void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const; // Retrieves the internal padding type for unused bits in floating-point datatypes. - H5T_pad_t getInpad( H5std_string& pad_string ) const; + H5T_pad_t getInpad(H5std_string& pad_string) const; // Fills unused internal floating point bits. - void setInpad( H5T_pad_t inpad ) const; + void setInpad(H5T_pad_t inpad) const; // Retrieves mantissa normalization of a floating-point datatype. - H5T_norm_t getNorm( H5std_string& norm_string ) const; + H5T_norm_t getNorm(H5std_string& norm_string) const; // Sets the mantissa normalization of a floating-point datatype. - void setNorm( H5T_norm_t norm ) const; + void setNorm(H5T_norm_t norm) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("FloatType"); } @@ -63,10 +63,10 @@ class H5_DLLCPP FloatType : public AtomType { FloatType(); // Creates a floating-point datatype using an existing id. - FloatType( const hid_t existing_id ); + FloatType(const hid_t existing_id); // Copy constructor: makes a copy of the original FloatType object. - FloatType( const FloatType& original ); + FloatType(const FloatType& original); // Noop destructor. virtual ~FloatType(); diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 9e131ca..1bcafe1 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -71,7 +71,7 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) //-------------------------------------------------------------------------- hid_t Group::getLocId() const { - return( getId() ); + return(getId()); } //-------------------------------------------------------------------------- @@ -130,7 +130,7 @@ Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Ob //-------------------------------------------------------------------------- hid_t Group::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -155,8 +155,8 @@ void Group::p_setId(const hid_t new_id) catch (Exception& close_error) { throw GroupIException("Group::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -171,8 +171,8 @@ void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Gclose(id); + if(ret_value < 0) { throw GroupIException("Group::close", "H5Gclose failed"); } @@ -197,9 +197,9 @@ void Group::close() //-------------------------------------------------------------------------- void Group::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "Group::"); - throw GroupIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "Group::"); + throw GroupIException(full_name, msg); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 9f789f1..244f99e 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -54,7 +54,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { virtual ~Group(); // Creates a copy of an existing group using its id. - Group( const hid_t group_id ); + Group(const hid_t group_id); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 67b2e11..7b36d64 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -181,7 +181,7 @@ H5I_type_t IdComponent::getHDFObjType() const // care of close() and setId takes care incRefCount(). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IdComponent& IdComponent::operator=( const IdComponent& rhs ) +IdComponent& IdComponent::operator=(const IdComponent& rhs) { if (this != &rhs) { @@ -221,11 +221,11 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs ) //-------------------------------------------------------------------------- void IdComponent::setId(const hid_t new_id) { - // set to new_id - p_setId(new_id); + // set to new_id + p_setId(new_id); - // increment the reference counter of the new id - incRefCount(); + // increment the reference counter of the new id + incRefCount(); } //-------------------------------------------------------------------------- @@ -255,10 +255,10 @@ IdComponent::~IdComponent() {} //-------------------------------------------------------------------------- H5std_string IdComponent::inMemFunc(const char* func_name) const { - H5std_string full_name = func_name; - full_name.insert(0, "::"); - full_name.insert(0, fromClass()); - return (full_name); + H5std_string full_name = func_name; + full_name.insert(0, "::"); + full_name.insert(0, fromClass()); + return (full_name); } //-------------------------------------------------------------------------- @@ -289,34 +289,34 @@ IdComponent::IdComponent() //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const { - hid_t temp_id = getId(); + hid_t temp_id = getId(); - // Preliminary call to H5Fget_name to get the length of the file name - ssize_t name_size = H5Fget_name(temp_id, NULL, 0); + // Preliminary call to H5Fget_name to get the length of the file name + ssize_t name_size = H5Fget_name(temp_id, NULL, 0); - // If H5Aget_name returns a negative value, raise an exception, - if( name_size < 0 ) - { - throw IdComponentException("", "H5Fget_name failed"); - } + // If H5Aget_name returns a negative value, raise an exception, + if(name_size < 0) + { + throw IdComponentException("", "H5Fget_name failed"); + } - // Call H5Fget_name again to get the actual file name - char* name_C = new char[name_size+1]; // temporary C-string for C API - HDmemset(name_C, 0, name_size+1); // clear buffer + // Call H5Fget_name again to get the actual file name + char* name_C = new char[name_size+1]; // temporary C-string for C API + HDmemset(name_C, 0, name_size+1); // clear buffer - name_size = H5Fget_name(temp_id, name_C, name_size+1); + name_size = H5Fget_name(temp_id, name_C, name_size+1); - // Check for failure again - if( name_size < 0 ) - { + // Check for failure again + if(name_size < 0) + { delete []name_C; - throw IdComponentException("", "H5Fget_name failed"); - } + throw IdComponentException("", "H5Fget_name failed"); + } - // Convert the C file name and return - H5std_string file_name(name_C); - delete []name_C; - return(file_name); + // Convert the C file name and return + H5std_string file_name(name_C); + delete []name_C; + return(file_name); } // diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 7874af5..24d1d1b 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -49,7 +49,7 @@ class H5_DLLCPP IdComponent { H5I_type_t getHDFObjType() const; // Assignment operator. - IdComponent& operator=( const IdComponent& rhs ); + IdComponent& operator=(const IdComponent& rhs); // Sets the identifier of this object to a new value. void setId(const hid_t new_id); @@ -62,12 +62,12 @@ class H5_DLLCPP IdComponent { // removal does not raise any problems in two 1.10 releases. // Creates an object to hold an HDF5 identifier. - IdComponent( const hid_t h5_id ); + IdComponent(const hid_t h5_id); #ifndef DOXYGEN_SHOULD_SKIP_THIS // Copy constructor: makes copy of the original IdComponent object. - // IdComponent( const IdComponent& original ); - removed from 1.8.15 + // IdComponent(const IdComponent& original); - removed from 1.8.15 // Gets the identifier of this object. virtual hid_t getId () const = 0; diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 446bcc6..cd87306 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -47,7 +47,7 @@ IntType::IntType() {} ///\brief Copy constructor: makes a copy of the original IntType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const IntType& original ) : AtomType( original ) {} +IntType::IntType(const IntType& original) : AtomType(original) {} //-------------------------------------------------------------------------- // Function: IntType overloaded constructor @@ -56,10 +56,10 @@ IntType::IntType( const IntType& original ) : AtomType( original ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const PredType& pred_type ) : AtomType() +IntType::IntType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- @@ -70,7 +70,7 @@ IntType::IntType( const PredType& pred_type ) : AtomType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} +IntType::IntType(const hid_t existing_id) : AtomType(existing_id) {} //-------------------------------------------------------------------------- // Function: IntType overloaded constructor @@ -79,15 +79,15 @@ IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const DataSet& dataset ) : AtomType() +IntType::IntType(const DataSet& dataset) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - if( id < 0 ) - { - throw DataSetIException("IntType constructor", "H5Dget_type failed"); - } + if(id < 0) + { + throw DataSetIException("IntType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -99,15 +99,15 @@ IntType::IntType( const DataSet& dataset ) : AtomType() //-------------------------------------------------------------------------- H5T_sign_t IntType::getSign() const { - H5T_sign_t type_sign = H5Tget_sign( id ); // C routine + H5T_sign_t type_sign = H5Tget_sign(id); // C routine - // Returns a valid sign type if no errors - if( type_sign == H5T_SGN_ERROR ) - { - throw DataTypeIException("IntType::getSign", + // Returns a valid sign type if no errors + if(type_sign == H5T_SGN_ERROR) + { + throw DataTypeIException("IntType::getSign", "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); - } - return( type_sign ); + } + return(type_sign); } //-------------------------------------------------------------------------- @@ -117,14 +117,14 @@ H5T_sign_t IntType::getSign() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void IntType::setSign( H5T_sign_t sign ) const +void IntType::setSign(H5T_sign_t sign) const { - // Call C routine to set the sign property - herr_t ret_value = H5Tset_sign( id, sign ); - if( ret_value < 0 ) - { - throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); - } + // Call C routine to set the sign property + herr_t ret_value = H5Tset_sign(id, sign); + if(ret_value < 0) + { + throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 355a51b..628df12 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -36,7 +36,7 @@ class H5_DLLCPP IntType : public AtomType { H5T_sign_t getSign() const; // Sets the sign proprety for an integer type. - void setSign( H5T_sign_t sign ) const; + void setSign(H5T_sign_t sign) const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("IntType"); } diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index a2858a4..62e21b8 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -44,11 +44,11 @@ namespace H5 { //-------------------------------------------------------------------------- void H5Library::open() { - herr_t ret_value = H5open(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::open", "H5open failed"); - } + herr_t ret_value = H5open(); + if(ret_value < 0) + { + throw LibraryIException("H5Library::open", "H5open failed"); + } } //-------------------------------------------------------------------------- @@ -60,11 +60,11 @@ void H5Library::open() //-------------------------------------------------------------------------- void H5Library::close() { - herr_t ret_value = H5close(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::close", "H5close failed"); - } + herr_t ret_value = H5close(); + if(ret_value < 0) + { + throw LibraryIException("H5Library::close", "H5close failed"); + } } //-------------------------------------------------------------------------- @@ -79,7 +79,7 @@ void H5Library::close() //-------------------------------------------------------------------------- void H5Library::dontAtExit() { - herr_t ret_value = H5dont_atexit(); + herr_t ret_value = H5dont_atexit(); } //-------------------------------------------------------------------------- @@ -91,13 +91,13 @@ void H5Library::dontAtExit() ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ) +void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum) { - herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum ); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); - } + herr_t ret_value = H5get_libversion(&majnum, &minnum, &relnum); + if(ret_value < 0) + { + throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); + } } //-------------------------------------------------------------------------- @@ -116,11 +116,11 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) { - herr_t ret_value = H5check_version(majnum, minnum, relnum); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); - } + herr_t ret_value = H5check_version(majnum, minnum, relnum); + if(ret_value < 0) + { + throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); + } } //-------------------------------------------------------------------------- @@ -145,11 +145,11 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) //-------------------------------------------------------------------------- void H5Library::garbageCollect() { - herr_t ret_value = H5garbage_collect(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); - } + herr_t ret_value = H5garbage_collect(); + if(ret_value < 0) + { + throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); + } } //-------------------------------------------------------------------------- @@ -184,23 +184,23 @@ void H5Library::initH5cpp() if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating PropList::deleteConstants failed"); - ret_value = std::atexit(FileAccPropList::deleteConstants); + ret_value = std::atexit(FileAccPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed"); - ret_value = std::atexit(FileCreatPropList::deleteConstants); + ret_value = std::atexit(FileCreatPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating FileCreatPropList::deleteConstants failed"); - ret_value = std::atexit(DSetMemXferPropList::deleteConstants); + ret_value = std::atexit(DSetMemXferPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating DSetMemXferPropList::deleteConstants failed"); - ret_value = std::atexit(DSetCreatPropList::deleteConstants); + ret_value = std::atexit(DSetCreatPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating DSetCreatPropList::deleteConstants failed"); - ret_value = std::atexit(ObjCreatPropList::deleteConstants); + ret_value = std::atexit(ObjCreatPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating ObjCreatPropList::deleteConstants failed"); @@ -245,11 +245,11 @@ void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { - herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); - } + herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); + if(ret_value < 0) + { + throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index a93a68b..ff0cd20 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -36,11 +36,11 @@ class H5_DLLCPP H5Library { static void dontAtExit(); // Returns the HDF library release number. - static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); + static void getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum); // Verifies that the arguments match the version numbers compiled // into the library - static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); + static void checkVersion(unsigned majnum, unsigned minnum, unsigned relnum); // Walks through all the garbage collection routines for the library, // which are supposed to free any unused memory they have allocated. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 05c3e23..709a94e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -44,14 +44,14 @@ namespace H5 { extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data) { - H5std_string s_attr_name = H5std_string( attr_name ); + H5std_string s_attr_name = H5std_string(attr_name); #ifdef NO_STATIC_CAST - UserData4Aiterate* myData = (UserData4Aiterate *) op_data; + UserData4Aiterate* myData = (UserData4Aiterate *) op_data; #else - UserData4Aiterate* myData = static_cast (op_data); + UserData4Aiterate* myData = static_cast (op_data); #endif - myData->op( *myData->location, s_attr_name, myData->opData ); - return 0; + myData->op(*myData->location, s_attr_name, myData->opData); + return 0; } //-------------------------------------------------------------------------- @@ -113,22 +113,22 @@ H5Location::H5Location() : IdComponent() {} /// recreate it with this function. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Location::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const +Attribute H5Location::createAttribute(const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const { - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t plist_id = create_plist.getId(); - hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT ); + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t plist_id = create_plist.getId(); + hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT); - // If the attribute id is valid, create and return the Attribute object - if( attr_id > 0 ) - { + // If the attribute id is valid, create and return the Attribute object + if(attr_id > 0) + { Attribute attr; f_Attribute_setId(&attr, attr_id); - return( attr ); - } - else - throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); + return(attr); + } + else + throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); } //-------------------------------------------------------------------------- @@ -138,9 +138,9 @@ Attribute H5Location::createAttribute( const char* name, const DataType& data_ty /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Location::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const +Attribute H5Location::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const { - return( createAttribute( name.c_str(), data_type, data_space, create_plist )); + return(createAttribute(name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- @@ -151,19 +151,19 @@ Attribute H5Location::createAttribute( const H5std_string& name, const DataType& ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Location::openAttribute( const char* name ) const +Attribute H5Location::openAttribute(const char* name) const { - hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); - if( attr_id > 0 ) - { + hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); + if(attr_id > 0) + { Attribute attr; f_Attribute_setId(&attr, attr_id); - return( attr ); - } - else - { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); - } + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); + } } //-------------------------------------------------------------------------- @@ -173,9 +173,9 @@ Attribute H5Location::openAttribute( const char* name ) const /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Location::openAttribute( const H5std_string& name ) const +Attribute H5Location::openAttribute(const H5std_string& name) const { - return( openAttribute( name.c_str()) ); + return(openAttribute(name.c_str())); } //-------------------------------------------------------------------------- @@ -186,20 +186,20 @@ Attribute H5Location::openAttribute( const H5std_string& name ) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Location::openAttribute( const unsigned int idx ) const +Attribute H5Location::openAttribute(const unsigned int idx) const { - hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, + hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); - if( attr_id > 0 ) - { + if(attr_id > 0) + { Attribute attr; f_Attribute_setId(&attr, attr_id); return(attr); - } - else - { + } + else + { throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); - } + } } //-------------------------------------------------------------------------- @@ -220,31 +220,31 @@ Attribute H5Location::openAttribute( const unsigned int idx ) const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data ) +int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) { - // store the user's function and data - UserData4Aiterate* userData = new UserData4Aiterate; - userData->opData = op_data; - userData->op = user_op; - userData->location = this; + // store the user's function and data + UserData4Aiterate* userData = new UserData4Aiterate; + userData->opData = op_data; + userData->op = user_op; + userData->location = this; - // call the C library routine H5Aiterate2 to iterate the attributes - hsize_t idx = _idx ? static_cast(*_idx) : 0; - int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, + // call the C library routine H5Aiterate2 to iterate the attributes + hsize_t idx = _idx ? static_cast(*_idx) : 0; + int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, userAttrOpWrpr, static_cast(userData)); - // release memory - delete userData; + // release memory + delete userData; - if( ret_value >= 0 ) { - /* Pass back update index value to calling code */ - if (_idx) - *_idx = static_cast(idx); + if(ret_value >= 0) { + /* Pass back update index value to calling code */ + if (_idx) + *_idx = static_cast(idx); - return( ret_value ); - } - else // raise exception when H5Aiterate returns a negative value - throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); + return(ret_value); + } + else // raise exception when H5Aiterate returns a negative value + throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); } //-------------------------------------------------------------------------- @@ -258,10 +258,10 @@ int H5Location::getNumAttrs() const { H5O_info_t oinfo; /* Object info */ - if(H5Oget_info(getId(), &oinfo) < 0) - throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); - else - return(static_cast(oinfo.num_attrs)); + if(H5Oget_info(getId(), &oinfo) < 0) + throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); + else + return(static_cast(oinfo.num_attrs)); } //-------------------------------------------------------------------------- @@ -273,16 +273,16 @@ int H5Location::getNumAttrs() const //-------------------------------------------------------------------------- bool H5Location::attrExists(const char* name) const { - // Call C routine H5Aexists to determine whether an attribute exists - // at this location, which could be specified by a file, group, dataset, - // or named datatype. - herr_t ret_value = H5Aexists(getId(), name); - if( ret_value > 0 ) - return true; - else if(ret_value == 0) - return false; - else // Raise exception when H5Aexists returns a negative value - throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); } //-------------------------------------------------------------------------- @@ -294,7 +294,7 @@ bool H5Location::attrExists(const char* name) const //-------------------------------------------------------------------------- bool H5Location::attrExists(const H5std_string& name) const { - return(attrExists(name.c_str())); + return(attrExists(name.c_str())); } //-------------------------------------------------------------------------- @@ -304,11 +304,11 @@ bool H5Location::attrExists(const H5std_string& name) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::removeAttr( const char* name ) const +void H5Location::removeAttr(const char* name) const { - herr_t ret_value = H5Adelete(getId(), name); - if( ret_value < 0 ) - throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); + herr_t ret_value = H5Adelete(getId(), name); + if(ret_value < 0) + throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); } //-------------------------------------------------------------------------- @@ -318,9 +318,9 @@ void H5Location::removeAttr( const char* name ) const /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::removeAttr( const H5std_string& name ) const +void H5Location::removeAttr(const H5std_string& name) const { - removeAttr( name.c_str() ); + removeAttr(name.c_str()); } //-------------------------------------------------------------------------- @@ -333,9 +333,9 @@ void H5Location::removeAttr( const H5std_string& name ) const //-------------------------------------------------------------------------- void H5Location::renameAttr(const char* oldname, const char* newname) const { - herr_t ret_value = H5Arename(getId(), oldname, newname); - if (ret_value < 0) - throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); + herr_t ret_value = H5Arename(getId(), oldname, newname); + if (ret_value < 0) + throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); } //-------------------------------------------------------------------------- @@ -367,11 +367,11 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new //-------------------------------------------------------------------------- void H5Location::flush(H5F_scope_t scope) const { - herr_t ret_value = H5Fflush(getId(), scope); - if( ret_value < 0 ) - { - throw LocationException(inMemFunc("flush"), "H5Fflush failed"); - } + herr_t ret_value = H5Fflush(getId(), scope); + if(ret_value < 0) + { + throw LocationException(inMemFunc("flush"), "H5Fflush failed"); + } } //-------------------------------------------------------------------------- @@ -383,12 +383,12 @@ void H5Location::flush(H5F_scope_t scope) const //-------------------------------------------------------------------------- H5std_string H5Location::getFileName() const { - try { - return(p_get_file_name()); - } - catch (LocationException& E) { - throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); - } + try { + return(p_get_file_name()); + } + catch (LocationException& E) { + throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -413,9 +413,9 @@ H5std_string H5Location::getFileName() const //-------------------------------------------------------------------------- void H5Location::setComment(const char* name, const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); + if(ret_value < 0) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- @@ -427,7 +427,7 @@ void H5Location::setComment(const char* name, const char* comment) const //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const { - setComment(name.c_str(), comment.c_str()); + setComment(name.c_str(), comment.c_str()); } //-------------------------------------------------------------------------- @@ -440,9 +440,9 @@ void H5Location::setComment(const H5std_string& name, const H5std_string& commen //-------------------------------------------------------------------------- void H5Location::setComment(const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); + if(ret_value < 0) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- @@ -454,7 +454,7 @@ void H5Location::setComment(const char* comment) const //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& comment) const { - setComment(comment.c_str()); + setComment(comment.c_str()); } //-------------------------------------------------------------------------- @@ -470,9 +470,9 @@ void H5Location::setComment(const H5std_string& comment) const //-------------------------------------------------------------------------- void H5Location::removeComment(const char* name) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); + if(ret_value < 0) + throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- @@ -484,7 +484,7 @@ void H5Location::removeComment(const char* name) const //-------------------------------------------------------------------------- void H5Location::removeComment(const H5std_string& name) const { - removeComment (name.c_str()); + removeComment (name.c_str()); } //-------------------------------------------------------------------------- @@ -605,11 +605,11 @@ H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) c //-------------------------------------------------------------------------- void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const { - herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); - } + herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); + } } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -630,12 +630,12 @@ void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_ty //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { + try { p_reference(ref, name, dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -656,12 +656,12 @@ void H5Location::reference(void* ref, const char* name, const DataSpace& dataspa //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { + try { p_reference(ref, name.c_str(), dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -680,12 +680,12 @@ void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const { - try { + try { p_reference(ref, name, -1, ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- @@ -703,7 +703,7 @@ void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) con //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const { - reference(ref, name.c_str(), ref_type); + reference(ref, name.c_str(), ref_type); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -723,13 +723,13 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t //-------------------------------------------------------------------------- hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const char* from_func) { - hid_t temp_id = H5Rdereference(loc_id, ref_type, ref); - if (temp_id < 0) - { - throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); - } + hid_t temp_id = H5Rdereference(loc_id, ref_type, ref); + if (temp_id < 0) + { + throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); + } - return(temp_id); + return(temp_id); } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -747,7 +747,7 @@ hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_ty //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type) { - p_setId(p_dereference(loc.getId(), ref, ref_type, "dereference")); + p_setId(p_dereference(loc.getId(), ref, ref_type, "dereference")); } //-------------------------------------------------------------------------- @@ -764,7 +764,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t //-------------------------------------------------------------------------- void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type) { - p_setId(p_dereference(attr.getId(), ref, ref_type, "dereference")); + p_setId(p_dereference(attr.getId(), ref, ref_type, "dereference")); } #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -789,12 +789,12 @@ void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const { - try { - return(p_get_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); - } + try { + return(p_get_obj_type(ref, ref_type)); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -816,13 +816,13 @@ H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const { - H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref); + H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref); - if (obj_type == H5G_UNKNOWN) - { - throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); - } - return(obj_type); + if (obj_type == H5G_UNKNOWN) + { + throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); + } + return(obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -845,12 +845,12 @@ H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const { - try { - return(p_get_ref_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); - } + try { + return(p_get_ref_obj_type(ref, ref_type)); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -871,17 +871,17 @@ H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const { - H5O_type_t obj_type = H5O_TYPE_UNKNOWN; - herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); - } - if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); - } - return(obj_type); + H5O_type_t obj_type = H5O_TYPE_UNKNOWN; + herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); + } + if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); + } + return(obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -904,19 +904,19 @@ H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const { - hid_t space_id = H5Rget_region(getId(), ref_type, ref); - if (space_id < 0) - { - throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); - } - try { + hid_t space_id = H5Rget_region(getId(), ref_type, ref); + if (space_id < 0) + { + throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); + } + try { DataSpace dataspace; f_DataSpace_setId(&dataspace, space_id); return(dataspace); - } - catch (DataSpaceIException& E) { - throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); - } + } + catch (DataSpaceIException& E) { + throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); + } } diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index b93c71e..9861118 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -33,7 +33,7 @@ namespace H5 { class H5_DLLCPP H5Location; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). -typedef void (*attr_operator_t)( H5Location& loc/*in*/, +typedef void (*attr_operator_t)(H5Location& loc/*in*/, const H5std_string attr_name/*in*/, void *operator_data/*in,out*/); @@ -57,20 +57,20 @@ class H5_DLLCPP H5Location : public IdComponent { public: // Creates an attribute for the specified object at this location // PropList is currently not used, so always be default. - Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; // Given its name, opens the attribute that belongs to an object at // this location. - Attribute openAttribute( const char* name ) const; - Attribute openAttribute( const H5std_string& name ) const; + Attribute openAttribute(const char* name) const; + Attribute openAttribute(const H5std_string& name) const; // Given its index, opens the attribute that belongs to an object at // this location. - Attribute openAttribute( const unsigned int idx ) const; + Attribute openAttribute(const unsigned int idx) const; // Flushes all buffers associated with this location to disk. - void flush( H5F_scope_t scope ) const; + void flush(H5F_scope_t scope) const; // Gets the name of the file, specified by this location. H5std_string getFileName() const; diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 016f5a2..3fd29a4 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -63,7 +63,7 @@ class H5_DLLCPP H5Object : public H5Location { // removal does not raise any problems in two 1.10 releases. // Creates a copy of an existing object giving the object id - H5Object( const hid_t object_id ); + H5Object(const hid_t object_id); // Copy constructor: makes copy of an H5Object object. // H5Object(const H5Object& original); diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index c14bb57..c4687f7 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -49,7 +49,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { virtual H5std_string fromClass () const { return("ObjCreatPropList"); } // Copy constructor: creates a copy of a ObjCreatPropList object. - ObjCreatPropList( const ObjCreatPropList& original ); + ObjCreatPropList(const ObjCreatPropList& original); // Creates a copy of an existing object creation property list // using the property list id. diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index f4aca2e..a640d32 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -69,7 +69,7 @@ PredType::PredType(const PredType& original) : AtomType(original) {} // the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PredType& PredType::operator=( const PredType& rhs ) +PredType& PredType::operator=(const PredType& rhs) { if (this != &rhs) copy(rhs); @@ -79,19 +79,19 @@ PredType& PredType::operator=( const PredType& rhs ) #ifndef DOXYGEN_SHOULD_SKIP_THIS // These dummy functions do not inherit from DataType - they'll // throw an DataTypeIException if invoked. -void PredType::commit(H5Location& loc, const char* name ) +void PredType::commit(H5Location& loc, const char* name) { - throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" ); + throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!"); } -void PredType::commit(H5Location& loc, const H5std_string& name ) +void PredType::commit(H5Location& loc, const H5std_string& name) { - commit( loc, name.c_str()); + commit(loc, name.c_str()); } bool PredType::committed() { - throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." ); + throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype."); } #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 447c2b5..1d95865 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -34,10 +34,10 @@ class H5_DLLCPP PredType : public AtomType { // Makes a copy of the predefined type and stores the new // id in the left hand side object. - PredType& operator=( const PredType& rhs ); + PredType& operator=(const PredType& rhs); // Copy constructor - makes copy of the original object - PredType( const PredType& original ); + PredType(const PredType& original); // Noop destructor virtual ~PredType(); @@ -45,11 +45,11 @@ class H5_DLLCPP PredType : public AtomType { /*! \brief This dummy function do not inherit from DataType - it will throw a DataTypeIException if invoked. */ - void commit(H5Location& loc, const H5std_string& name ); + void commit(H5Location& loc, const H5std_string& name); /*! \brief This dummy function do not inherit from DataType - it will throw a DataTypeIException if invoked. */ - void commit(H5Location& loc, const char* name ); + void commit(H5Location& loc, const char* name); /*! \brief This dummy function do not inherit from DataType - it will throw a DataTypeIException if invoked. */ @@ -245,7 +245,7 @@ class H5_DLLCPP PredType : public AtomType { PredType(); // Creates a pre-defined type using an HDF5 pre-defined constant - PredType( const hid_t predtype_id ); // used by the library only + PredType(const hid_t predtype_id); // used by the library only private: // Activates the creation of the PredType global constants diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index fd223b3..d7083f8 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -28,7 +28,7 @@ #include "H5private.h" // for HDfree -namespace H5 { +namespace H5{ #ifndef H5_NO_STD using std::cerr; using std::endl; @@ -119,7 +119,7 @@ PropList::PropList(const PropList& original) : IdComponent(), id(original.id) // property's id to H5P_DEFAULT. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList::PropList( const hid_t plist_id ) : IdComponent() +PropList::PropList(const hid_t plist_id) : IdComponent() { if (plist_id <= 0) id = H5P_DEFAULT; @@ -129,7 +129,7 @@ PropList::PropList( const hid_t plist_id ) : IdComponent() case H5I_GENPROP_CLS: // call C routine to create a new property from the given prop class id = H5Pcreate(plist_id); - if( id < 0 ) + if(id < 0) { throw PropListIException("PropList constructor", "H5Pcreate failed"); } @@ -137,7 +137,7 @@ PropList::PropList( const hid_t plist_id ) : IdComponent() case H5I_GENPROP_LST: // call C routine to make a copy of the given property list id = H5Pcopy(plist_id); - if( id < 0 ) + if(id < 0) { throw PropListIException("PropList constructor", "H5Pcopy failed"); } @@ -160,7 +160,7 @@ PropList::PropList( const hid_t plist_id ) : IdComponent() // - Replaced decRefCount with close() to let the C library // handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void PropList::copy( const PropList& like_plist ) +void PropList::copy(const PropList& like_plist) { // If this object is representing an hdf5 object, close it before // copying like_plist to it @@ -172,8 +172,8 @@ void PropList::copy( const PropList& like_plist ) } // call C routine to copy the property list - id = H5Pcopy( like_plist.getId() ); - if( id < 0 ) + id = H5Pcopy(like_plist.getId()); + if(id < 0) throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); } @@ -188,7 +188,7 @@ void PropList::copy( const PropList& like_plist ) // and stores the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList& PropList::operator=( const PropList& rhs ) +PropList& PropList::operator=(const PropList& rhs) { if (this != &rhs) copy(rhs); @@ -205,12 +205,12 @@ PropList& PropList::operator=( const PropList& rhs ) //-------------------------------------------------------------------------- void PropList::copyProp(PropList& dest, const char *name) const { - hid_t dst_id = dest.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, id, name); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, id, name); + if(ret_value < 0) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } //-------------------------------------------------------------------------- @@ -222,9 +222,9 @@ void PropList::copyProp(PropList& dest, const char *name) const ///\param name - IN: Name of the property to copy - \c H5std_string // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, const H5std_string& name ) const +void PropList::copyProp(PropList& dest, const H5std_string& name) const { - copyProp( dest, name.c_str()); + copyProp(dest, name.c_str()); } //-------------------------------------------------------------------------- @@ -237,15 +237,15 @@ void PropList::copyProp( PropList& dest, const H5std_string& name ) const ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const +void PropList::copyProp(PropList& dest, PropList& src, const char *name) const { - hid_t dst_id = dest.getId(); - hid_t src_id = src.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + hid_t src_id = src.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); + if(ret_value < 0) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } @@ -259,9 +259,9 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const ///\param name - IN: Name of the property to copy - \c H5std_string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name ) const +void PropList::copyProp(PropList& dest, PropList& src, const H5std_string& name) const { - copyProp( dest, src, name.c_str()); + copyProp(dest, src, name.c_str()); } //-------------------------------------------------------------------------- @@ -277,7 +277,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name //-------------------------------------------------------------------------- hid_t PropList::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -302,8 +302,8 @@ void PropList::p_setId(const hid_t new_id) catch (Exception& close_error) { throw PropListIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -319,8 +319,8 @@ void PropList::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Pclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Pclose(id); + if(ret_value < 0) { throw PropListIException(inMemFunc("close"), "H5Pclose failed"); } @@ -338,13 +338,13 @@ void PropList::close() //-------------------------------------------------------------------------- hid_t PropList::getClass() const { - hid_t plist_class = H5Pget_class( id ); - if( plist_class == H5P_ROOT ) - { - throw PropListIException(inMemFunc("getClass"), + hid_t plist_class = H5Pget_class(id); + if(plist_class == H5P_ROOT) + { + throw PropListIException(inMemFunc("getClass"), "H5Pget_class failed - returned H5P_ROOT"); - } - return( plist_class ); + } + return(plist_class); } //-------------------------------------------------------------------------- @@ -359,20 +359,20 @@ hid_t PropList::getClass() const /// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const char* name ) const -{ - // Calls C routine H5Pexist to determine whether a property exists - // within a property list or class. It returns a positive value, 0, - // or a negative value - htri_t ret_value = H5Pexist(id, name); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pexist returns a negative value - { - throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); - } +bool PropList::propExist(const char* name) const +{ + // Calls C routine H5Pexist to determine whether a property exists + // within a property list or class. It returns a positive value, 0, + // or a negative value + htri_t ret_value = H5Pexist(id, name); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Pexist returns a negative value + { + throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); + } } //-------------------------------------------------------------------------- // Function: PropList::propExist @@ -382,9 +382,9 @@ bool PropList::propExist(const char* name ) const ///\param name - IN: Name of property to check for - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const H5std_string& name ) const +bool PropList::propExist(const H5std_string& name) const { - return( propExist( name.c_str()) ); + return(propExist(name.c_str())); } //-------------------------------------------------------------------------- @@ -399,11 +399,11 @@ bool PropList::propExist(const H5std_string& name ) const //-------------------------------------------------------------------------- void PropList::closeClass() const { - herr_t ret_value = H5Pclose_class(id); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); - } + herr_t ret_value = H5Pclose_class(id); + if(ret_value < 0) + { + throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); + } } //-------------------------------------------------------------------------- @@ -420,11 +420,11 @@ void PropList::closeClass() const //-------------------------------------------------------------------------- void PropList::getProperty(const char* name, void* value) const { - herr_t ret_value = H5Pget(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + herr_t ret_value = H5Pget(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } } //-------------------------------------------------------------------------- // Function: PropList::getProperty @@ -438,26 +438,26 @@ void PropList::getProperty(const char* name, void* value) const //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const char* name) const { - // Get property size first - size_t size = getPropSize(name); + // Get property size first + size_t size = getPropSize(name); - // Allocate buffer then get the property - char* prop_strg_C = new char[size+1]; // temporary C-string for C API - HDmemset(prop_strg_C, 0, size+1); // clear buffer + // Allocate buffer then get the property + char* prop_strg_C = new char[size+1]; // temporary C-string for C API + HDmemset(prop_strg_C, 0, size+1); // clear buffer - herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API + herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API - // Throw exception if H5Pget returns failure - if (ret_value < 0) - { + // Throw exception if H5Pget returns failure + if (ret_value < 0) + { delete []prop_strg_C; - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } - // Return propety value as a string after deleting temp C-string - H5std_string prop_strg(prop_strg_C); - delete []prop_strg_C; - return (prop_strg); + // Return propety value as a string after deleting temp C-string + H5std_string prop_strg(prop_strg_C); + delete []prop_strg_C; + return (prop_strg); } //-------------------------------------------------------------------------- // Function: PropList::getProperty @@ -470,7 +470,7 @@ H5std_string PropList::getProperty(const char* name) const //-------------------------------------------------------------------------- void PropList::getProperty(const H5std_string& name, void* value) const { - getProperty(name.c_str(), value); + getProperty(name.c_str(), value); } //-------------------------------------------------------------------------- // Function: PropList::getProperty @@ -483,7 +483,7 @@ void PropList::getProperty(const H5std_string& name, void* value) const //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const H5std_string& name) const { - return (getProperty(name.c_str())); + return (getProperty(name.c_str())); } //-------------------------------------------------------------------------- @@ -501,13 +501,13 @@ H5std_string PropList::getProperty(const H5std_string& name) const //-------------------------------------------------------------------------- size_t PropList::getPropSize(const char *name) const { - size_t prop_size; - herr_t ret_value = H5Pget_size(id, name, &prop_size); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); - } - return(prop_size); + size_t prop_size; + herr_t ret_value = H5Pget_size(id, name, &prop_size); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); + } + return(prop_size); } //-------------------------------------------------------------------------- // Function: PropList::getPropSize @@ -520,7 +520,7 @@ size_t PropList::getPropSize(const char *name) const //-------------------------------------------------------------------------- size_t PropList::getPropSize(const H5std_string& name) const { - return (getPropSize(name.c_str())); + return (getPropSize(name.c_str())); } //-------------------------------------------------------------------------- @@ -532,18 +532,18 @@ size_t PropList::getPropSize(const H5std_string& name) const //-------------------------------------------------------------------------- H5std_string PropList::getClassName() const { - char* temp_str; - temp_str = H5Pget_class_name(id); // this API specified that temp_str must + char* temp_str; + temp_str = H5Pget_class_name(id); // this API specified that temp_str must // be freed. - if (temp_str != NULL) - { - H5std_string class_name(temp_str); - H5free_memory(temp_str); - return(class_name); - } - else - return 0; + if (temp_str != NULL) + { + H5std_string class_name(temp_str); + H5free_memory(temp_str); + return(class_name); + } + else + return 0; } //-------------------------------------------------------------------------- // Function: PropList::getNumProps @@ -554,13 +554,13 @@ H5std_string PropList::getClassName() const //-------------------------------------------------------------------------- size_t PropList::getNumProps() const { - size_t nprops; - herr_t ret_value = H5Pget_nprops (id, &nprops); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); - } - return (nprops); + size_t nprops; + herr_t ret_value = H5Pget_nprops (id, &nprops); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); + } + return (nprops); } //-------------------------------------------------------------------------- @@ -573,11 +573,11 @@ size_t PropList::getNumProps() const //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const { - herr_t ret_value = H5Pset(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- // Function: PropList::setProperty @@ -590,11 +590,11 @@ void PropList::setProperty(const char* name, void* value) const //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const { - herr_t ret_value = H5Pset(id, name, (void*)charptr); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, (void*)charptr); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- // Function: PropList::setProperty @@ -607,7 +607,7 @@ void PropList::setProperty(const char* name, const char* charptr) const //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const { - setProperty(name, strg.c_str()); + setProperty(name, strg.c_str()); } //-------------------------------------------------------------------------- @@ -621,7 +621,7 @@ void PropList::setProperty(const char* name, H5std_string& strg) const //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const { - setProperty(name.c_str(), value); + setProperty(name.c_str(), value); } //-------------------------------------------------------------------------- @@ -635,7 +635,7 @@ void PropList::setProperty(const H5std_string& name, void* value) const //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const { - setProperty(name.c_str(), strg.c_str()); + setProperty(name.c_str(), strg.c_str()); } //-------------------------------------------------------------------------- @@ -649,15 +649,15 @@ void PropList::setProperty(const H5std_string& name, H5std_string& strg) const //-------------------------------------------------------------------------- bool PropList::isAClass(const PropList& prop_class) const { - htri_t ret_value = H5Pisa_class(id, prop_class.getId()); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pisa_class returns a negative value - { - throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); - } + htri_t ret_value = H5Pisa_class(id, prop_class.getId()); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Pisa_class returns a negative value + { + throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); + } } @@ -670,11 +670,11 @@ bool PropList::isAClass(const PropList& prop_class) const //-------------------------------------------------------------------------- void PropList::removeProp(const char *name) const { - herr_t ret_value = H5Premove(id, name); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); - } + herr_t ret_value = H5Premove(id, name); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); + } } //-------------------------------------------------------------------------- @@ -687,7 +687,7 @@ void PropList::removeProp(const char *name) const //-------------------------------------------------------------------------- void PropList::removeProp(const H5std_string& name) const { - removeProp(name.c_str()); + removeProp(name.c_str()); } //-------------------------------------------------------------------------- @@ -701,15 +701,15 @@ void PropList::removeProp(const H5std_string& name) const //-------------------------------------------------------------------------- bool PropList::operator==(const PropList& rhs) const { - htri_t ret_value = H5Pequal(id, rhs.getId()); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pequal returns a negative value - { - throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); - } + htri_t ret_value = H5Pequal(id, rhs.getId()); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Pequal returns a negative value + { + throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); + } } //-------------------------------------------------------------------------- @@ -721,13 +721,13 @@ bool PropList::operator==(const PropList& rhs) const //-------------------------------------------------------------------------- PropList PropList::getClassParent() const { - hid_t class_id = H5Pget_class_parent(id); - if (class_id < 0) - { - throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); - } + hid_t class_id = H5Pget_class_parent(id); + if (class_id < 0) + { + throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); + } PropList pclass(class_id); - return(pclass); + return(pclass); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 6ef43cf..4c50fb9 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -35,7 +35,7 @@ class H5_DLLCPP PropList : public IdComponent { PropList(const hid_t plist_id); // Make a copy of the given property list using assignment statement - PropList& operator=( const PropList& rhs ); + PropList& operator=(const PropList& rhs); // Compares this property list or class against the given list or class. bool operator==(const PropList& rhs) const; @@ -47,15 +47,15 @@ class H5_DLLCPP PropList : public IdComponent { void closeClass() const; // Makes a copy of the given property list. - void copy( const PropList& like_plist ); + void copy(const PropList& like_plist); // Copies a property from this property list or class to another - void copyProp( PropList& dest, const char* name) const; - void copyProp( PropList& dest, const H5std_string& name) const; + void copyProp(PropList& dest, const char* name) const; + void copyProp(PropList& dest, const H5std_string& name) const; // Copies a property from one property list or property class to another - void copyProp( PropList& dest, PropList& src, const char* name) const; - void copyProp( PropList& dest, PropList& src, const H5std_string& name) const; + void copyProp(PropList& dest, PropList& src, const char* name) const; + void copyProp(PropList& dest, PropList& src, const H5std_string& name) const; // Gets the class of this property list, i.e. H5P_FILE_CREATE, // H5P_FILE_ACCESS, ... diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 3638f99..ed60c6b 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -48,10 +48,10 @@ StrType::StrType() : AtomType() {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const PredType& pred_type ) : AtomType() +StrType::StrType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- @@ -77,12 +77,12 @@ StrType::StrType( const PredType& pred_type ) : AtomType() // Planned for removal. -BMR, 2005/12/02 // Removed from documentation. -BMR, 2016/03/07 //-------------------------------------------------------------------------- -StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() +StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(pred_type); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(pred_type); + setSize(size); } //-------------------------------------------------------------------------- @@ -101,12 +101,12 @@ StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() // This constructor replaced the previous one. // Programmer Binh-Minh Ribler - Nov 28, 2005 //-------------------------------------------------------------------------- -StrType::StrType( const int dummy, const size_t& size ) : AtomType() +StrType::StrType(const int dummy, const size_t& size) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(PredType::C_S1); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(PredType::C_S1); + setSize(size); } //-------------------------------------------------------------------------- @@ -116,14 +116,14 @@ StrType::StrType( const int dummy, const size_t& size ) : AtomType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {} +StrType::StrType(const hid_t existing_id) : AtomType(existing_id) {} //-------------------------------------------------------------------------- // Function: StrType copy constructor ///\brief Copy constructor: makes a copy of the original StrType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const StrType& original ) : AtomType ( original ) {} +StrType::StrType(const StrType& original) : AtomType (original) {} //-------------------------------------------------------------------------- // Function: StrType overloaded constructor @@ -132,15 +132,15 @@ StrType::StrType( const StrType& original ) : AtomType ( original ) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const DataSet& dataset ) : AtomType () +StrType::StrType(const DataSet& dataset) : AtomType () { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - if( id < 0 ) - { - throw DataSetIException("StrType constructor", "H5Dget_type failed"); - } + if(id < 0) + { + throw DataSetIException("StrType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- @@ -160,14 +160,14 @@ StrType::StrType( const DataSet& dataset ) : AtomType () //-------------------------------------------------------------------------- H5T_cset_t StrType::getCset() const { - H5T_cset_t cset = H5Tget_cset( id ); - - // Returns a valid character set type if successful - if( cset == H5T_CSET_ERROR ) - { - throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); - } - return( cset ); + H5T_cset_t cset = H5Tget_cset(id); + + // Returns a valid character set type if successful + if(cset == H5T_CSET_ERROR) + { + throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); + } + return(cset); } //-------------------------------------------------------------------------- @@ -185,14 +185,14 @@ H5T_cset_t StrType::getCset() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setCset( H5T_cset_t cset ) const +void StrType::setCset(H5T_cset_t cset) const { - herr_t ret_value = H5Tset_cset( id, cset ); + herr_t ret_value = H5Tset_cset(id, cset); - if( ret_value < 0 ) - { - throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); - } + if(ret_value < 0) + { + throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); + } } //-------------------------------------------------------------------------- @@ -207,15 +207,15 @@ void StrType::setCset( H5T_cset_t cset ) const //-------------------------------------------------------------------------- H5T_str_t StrType::getStrpad() const { - H5T_str_t strpad = H5Tget_strpad( id ); + H5T_str_t strpad = H5Tget_strpad(id); - // Returns a valid string padding type if successful - if( strpad == H5T_STR_ERROR ) - { - throw DataTypeIException("StrType::getStrpad", + // Returns a valid string padding type if successful + if(strpad == H5T_STR_ERROR) + { + throw DataTypeIException("StrType::getStrpad", "H5Tget_strpad failed - returned H5T_STR_ERROR"); - } - return( strpad ); + } + return(strpad); } //-------------------------------------------------------------------------- @@ -228,14 +228,14 @@ H5T_str_t StrType::getStrpad() const /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setStrpad( H5T_str_t strpad ) const +void StrType::setStrpad(H5T_str_t strpad) const { - herr_t ret_value = H5Tset_strpad( id, strpad ); + herr_t ret_value = H5Tset_strpad(id, strpad); - if( ret_value < 0 ) - { - throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); - } + if(ret_value < 0) + { + throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index eb11d76..07508e4 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -64,12 +64,12 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() { - id = H5Tvlen_create(base_type->getId()); - if (id < 0) - { - throw DataTypeIException("VarLenType constructor", + id = H5Tvlen_create(base_type->getId()); + if (id < 0) + { + throw DataTypeIException("VarLenType constructor", "H5Tvlen_create returns negative value"); - } + } } //-------------------------------------------------------------------------- diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 7a2cfc1..2676fb3 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -34,10 +34,10 @@ class H5_DLLCPP VarLenType : public DataType { virtual H5std_string fromClass () const { return("VarLenType"); } // Copy constructor: makes copy of the original object. - VarLenType( const VarLenType& original ); + VarLenType(const VarLenType& original); // Constructor that takes an existing id - VarLenType( const hid_t existing_id ); + VarLenType(const hid_t existing_id); // Noop destructor virtual ~VarLenType(); -- cgit v0.12 From dff30ae9c7e71d3e6675222e2fffd7202871390d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 26 Apr 2017 08:01:29 -0400 Subject: Added missing #ifdef __cplusplus macros to H5Epubgen.h. Fixes HDFFV-9638. --- bin/make_err | 12 ++++++++++++ release_docs/RELEASE.txt | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/make_err b/bin/make_err index 4b1f474..1b39d53fb 100755 --- a/bin/make_err +++ b/bin/make_err @@ -175,6 +175,12 @@ sub create_public ($) { print_warning(*HEADER); print_startprotect(*HEADER, $file); + # Begin extern C block + print HEADER "\n"; + print HEADER "#ifdef __cplusplus\n"; + print HEADER "extern \"C\" {\n"; + print HEADER "#endif\n"; + # Iterate over all the major errors print HEADER "\n/*********************/\n"; print HEADER "/* Major error codes */\n"; @@ -202,6 +208,12 @@ sub create_public ($) { } } + # End extern C block + print HEADER "\n"; + print HEADER "#ifdef __cplusplus\n"; + print HEADER "}\n"; + print HEADER "#endif\n"; + print_endprotect(*HEADER, $file); # Close header file diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 40c9644..afab87c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -99,7 +99,7 @@ Support for New Platforms, Languages, and Compilers -Bug Fixes since HDF5-1.8.17 +Bug Fixes since HDF5-1.8.18 =========================== Configuration @@ -109,7 +109,9 @@ Bug Fixes since HDF5-1.8.17 Library ------- - - None + - Missing #ifdef __cplusplus macros were added to the generated H5Epubgen.h file. + + (HDFFV-9638, DER, 4/25/2017) Parallel Library -- cgit v0.12 From 932e1883035d2c676bbaa129d44e57a180804d14 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 26 Apr 2017 07:55:02 -0500 Subject: Ran bin/reconfigure on jam after changes to make_err. --- hl/src/H5LTparse.c | 144 ++++++++++++++++++++++++++--------------------------- hl/src/H5LTparse.h | 4 +- src/H5Epubgen.h | 8 +++ 3 files changed, 82 insertions(+), 74 deletions(-) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 36591d3..6ca95c54 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 1461830..621dacd 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 75eca0b..bd68f04 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -20,6 +20,10 @@ #ifndef _H5Epubgen_H #define _H5Epubgen_H +#ifdef __cplusplus +extern "C" { +#endif + /*********************/ /* Major error codes */ /*********************/ @@ -365,4 +369,8 @@ H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ +#ifdef __cplusplus +} +#endif + #endif /* H5Epubgen_H */ -- cgit v0.12 From 01e55ba75c48f73ba35819b7c9c9f868802ec6f2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 2 May 2017 19:34:20 -0500 Subject: Incorporate additional code changes for the H5DOread_chunk patch from GE healthcare (HDFFV-9934) Incorporate the code changes that were missing from the original patch: (1) Additional tests in hl/test/test_dset_opt.c (2) Fix in src/H5Dchunk.c for direct access when an entry is in chunk cache but not dirty Tested on playtpus, ostrich, kituo, mayll, osx1010test, quail, emu. --- hl/src/H5DO.c | 1 - hl/test/test_dset_opt.c | 1058 ++++++++++++++++++++++++++++++++++------------- src/H5Dchunk.c | 74 ++-- 3 files changed, 807 insertions(+), 326 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index be5f658..982625a 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -44,7 +44,6 @@ H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *o { hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ hbool_t do_direct_write = TRUE; /* Flag for direct writes */ - hbool_t tt=FALSE; /* Flag for direct writes */ uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ herr_t ret_value = FAIL; /* Return value */ diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index bec0ae3..1aa4872 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -29,19 +29,29 @@ #define FILE_NAME "test_dectris.h5" +/* Datasets for Direct Write tests */ #define DATASETNAME1 "direct_write" #define DATASETNAME2 "skip_one_filter" #define DATASETNAME3 "skip_two_filters" #define DATASETNAME4 "data_conv" #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" +/* Datasets for Direct Read tests */ +#define DATASETNAME7 "disabled_chunk_cache" +#define DATASETNAME8 "read_w_valid_cache" +#define DATASETNAME9 "flush_chunk_cache" +#define DATASETNAME10 "unallocated_chunk" +#define DATASETNAME11 "unfiltered_data" + + + #define RANK 2 #define NX 16 #define NY 16 #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001F)+12) +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 @@ -79,10 +89,10 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ /*------------------------------------------------------------------------- * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk/H5DOread_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -105,32 +115,24 @@ test_direct_chunk_write (hid_t file) int i, j, n; unsigned filter_mask = 0; - unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ - - /* For H5DOread_chunk() */ - void *readbuf = NULL; /* Buffer for reading data */ - const Bytef *pt_readbuf; /* Point to the buffer for data read */ - hsize_t read_chunk_nbytes; /* Size of chunk on disk */ - int read_dst_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to hold un-compressed data */ - + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("basic functionality of H5DOwrite_chunk/H5DOread_chunk"); + TESTING("basic functionality of H5DOwrite_chunk"); /* * Create the data space with unlimited dimensions. @@ -161,75 +163,26 @@ test_direct_chunk_write (hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; + /* Initialize the dataset */ + for(i = n = 0; i < NX; i++) + for(j = 0; j < NY; j++) + data[i][j] = n++; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; - HDmemset(data, 0, sizeof(data)); - /* Initialize data for the first chunk */ - for(i = n = 0; i < CHUNK_NX; i++) - for(j = 0; j < CHUNK_NY; j++) - data[i][j] = n++; - - /* Write the data to the dataset. */ + /* + * Write the data for the dataset. It should stay in the chunk cache. + * It will be evicted from the cache by the H5DOwrite_chunk calls. + */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, data)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) - goto error; - - if(H5Dclose(dataset) < 0) - goto error; - - if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) - goto error; - - offset[0] = offset[1] = 0; - - /* Get the size of the compressed chunk */ - ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - - readbuf = HDmalloc(read_chunk_nbytes); - pt_readbuf = (const Bytef *)readbuf; - - /* Test to use H5DOread_chunk() to read the chunk back */ - if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) - goto error; - - /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ - ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); - - /* Check for various zlib errors */ - if(Z_BUF_ERROR == ret) { - HDfprintf(stderr, "error: not enough room in output buffer"); - goto error; - } else if(Z_MEM_ERROR == ret) { - HDfprintf(stderr, "error: not enough memory"); - goto error; - } else if(Z_OK != ret) { - HDfprintf(stderr, "error: corrupted input data"); - goto error; - } - - /* Check that the values read are the same as the values written */ - for(i = 0; i < CHUNK_NX; i++) { - for(j = 0; j < CHUNK_NY; j++) { - if(data[i][j] != read_dst_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" data=%d, read_dst_buf=%d\n", data[i][j], read_dst_buf[i][j]); - goto error; - } - } - } - - if(readbuf) - HDfree(readbuf); - /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -273,59 +226,6 @@ test_direct_chunk_write (hid_t file) if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) goto error; - offset[0] = CHUNK_NX; - offset[1] = CHUNK_NY; - - /* Get the size of the compressed chunk */ - ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - - if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { - HDfprintf(stderr, "Read/write chunk size not the same."); - goto error; - } - - readbuf = HDmalloc(read_chunk_nbytes); - pt_readbuf = (const Bytef *)readbuf; - - /* Test to use H5DOread_chunk() to read the chunk back */ - if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) - goto error; - - if(read_filter_mask != filter_mask) { - HDfprintf(stderr, " Read/write filter mask not the same."); - goto error; - } - - /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ - ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); - - /* Check for various zlib errors */ - if(Z_BUF_ERROR == ret) { - HDfprintf(stderr, "error: not enough room in output buffer"); - goto error; - } else if(Z_MEM_ERROR == ret) { - HDfprintf(stderr, "error: not enough memory"); - goto error; - } else if(Z_OK != ret) { - HDfprintf(stderr, "error: corrupted input data"); - goto error; - } - - /* Check that the values read are the same as the values written */ - for(i = 0; i < CHUNK_NX; i++) { - for(j = 0; j < CHUNK_NY; j++) { - if(direct_buf[i][j] != read_dst_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, read_dst_buf=%d\n", direct_buf[i][j], read_dst_buf[i][j]); - goto error; - } - } - } - - if(readbuf) - HDfree(readbuf); - /* * Select hyperslab for one chunk in the file */ @@ -336,7 +236,7 @@ test_direct_chunk_write (hid_t file) if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - /* Test to use H5Dread() to read the chunk back */ + /* Read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -352,11 +252,10 @@ test_direct_chunk_write (hid_t file) } } - /* Reinitialize different data for one chunk */ for(i = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = i + j; + direct_buf[i][j] = i + j; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -401,60 +300,7 @@ test_direct_chunk_write (hid_t file) if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) goto error; - offset[0] = CHUNK_NX; - offset[1] = CHUNK_NY; - - /* Get the size of the compressed chunk */ - ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - - if(read_chunk_nbytes != (hsize_t)z_dst_nbytes) { - HDfprintf(stderr, "Read/write chunk size not the same."); - goto error; - } - - readbuf = HDmalloc(read_chunk_nbytes); - pt_readbuf = (const Bytef *)readbuf; - - /* Test to use H5DOread_chunk() to read the chunk back */ - if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) - goto error; - - if(read_filter_mask != filter_mask) { - HDfprintf(stderr, " Read/write filter mask not the same."); - goto error; - } - - /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ - ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); - - /* Check for various zlib errors */ - if(Z_BUF_ERROR == ret) { - HDfprintf(stderr, "error: not enough room in output buffer"); - goto error; - } else if(Z_MEM_ERROR == ret) { - HDfprintf(stderr, "error: not enough memory"); - goto error; - } else if(Z_OK != ret) { - HDfprintf(stderr, "error: corrupted input data"); - goto error; - } - - /* Check that the values read are the same as the values written */ - for(i = 0; i < CHUNK_NX; i++) { - for(j = 0; j < CHUNK_NY; j++) { - if(direct_buf[i][j] != read_dst_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, my_buf=%d\n", direct_buf[i][j], read_dst_buf[i][j]); - goto error; - } - } - } - - if(readbuf) - HDfree(readbuf); - - /* Test to use H5Dread() to read the chunk back */ + /* Read the chunk back */ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; @@ -493,12 +339,10 @@ error: if(outbuf) HDfree(outbuf); - if(readbuf) - HDfree(readbuf); return 1; -} /* test_direct_chunk_write() */ -#endif +} +#endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- * Function: test_skip_compress_write1 @@ -520,20 +364,23 @@ test_skip_compress_write1(hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; int i, j, n; unsigned filter_mask = 0; - unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); int aggression = 9; /* Compression aggression setting */ + unsigned read_filter_mask = 0; /* filter mask after direct read */ + int read_direct_buf[CHUNK_NX][CHUNK_NY]; + hsize_t read_buf_size = 0; /* buf size */ + hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ @@ -576,11 +423,11 @@ test_skip_compress_write1(hid_t file) /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) { - direct_buf[i][j] = n++; - } + direct_buf[i][j] = n++; + } - /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. - * Indicate skipping the compression filter. */ + /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. + * Indicate skipping the compression filter. */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY; @@ -589,7 +436,7 @@ test_skip_compress_write1(hid_t file) if((status = H5DOwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; if(H5Dclose(dataset) < 0) @@ -598,14 +445,19 @@ test_skip_compress_write1(hid_t file) if((dataset = H5Dopen2(file, DATASETNAME2, H5P_DEFAULT)) < 0) goto error; - /* Use H5DOread_chunk() to read the uncompressed data */ - if((status = H5DOread_chunk(dataset, dxpl, offset, &read_filter_mask, check_chunk)) < 0) + /* + * Select hyperslab for the chunk just written in the file + */ + start[0] = CHUNK_NX; start[1] = CHUNK_NY; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = CHUNK_NX; block[1] = CHUNK_NY; + if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - if(read_filter_mask != filter_mask) { - HDfprintf(stderr, " Read/write filter mask not the same."); + /* Read the chunk back */ + if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; - } /* Check that the values read are the same as the values written */ for(i = 0; i < CHUNK_NX; i++) { @@ -613,35 +465,32 @@ test_skip_compress_write1(hid_t file) if(direct_buf[i][j] != check_chunk[i][j]) { printf(" 1. Read different values than written."); printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } } - /* Clear the buffer */ - HDmemset(check_chunk, 0, buf_size); - /* - * Select hyperslab for the chunk just written in the file - */ - start[0] = CHUNK_NX; start[1] = CHUNK_NY; - stride[0] = 1; stride[1] = 1; - count[0] = 1; count[1] = 1; - block[0] = CHUNK_NX; block[1] = CHUNK_NY; - if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) + /* Query chunk storage size */ + if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0) + goto error; + if(read_buf_size != buf_size) goto error; - /* Use H5Dread() to read the chunk back */ - if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) + /* Read the raw chunk back */ + HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf)); + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0) + goto error; + if(read_filter_mask != filter_mask) goto error; - /* Check that the values read are the same as the values written */ + /* Check that the direct chunk read is the same as the chunk written */ for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { - if(direct_buf[i][j] != check_chunk[i][j]) { + if(direct_buf[i][j] != read_direct_buf[i][j]) { printf(" 1. Read different values than written."); printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); goto error; } } @@ -655,7 +504,7 @@ test_skip_compress_write1(hid_t file) H5Sclose(dataspace); H5Pclose(cparms); H5Pclose(dxpl); - + PASSED(); return 0; @@ -669,7 +518,7 @@ error: } H5E_END_TRY; return 1; -} +} /* test_skip_compress_write1() */ /*------------------------------------------------------------------------- * Function: filter_bogus1 @@ -707,7 +556,7 @@ filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, } /* end else */ return nbytes; -} +} /* filter_bogus1() */ /*------------------------------------------------------------------------- * Function: filter_bogus2 @@ -744,7 +593,7 @@ filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, } /* end else */ return nbytes; -} +} /* filter_bogus2() */ /*------------------------------------------------------------------------- * Function: test_skip_compress_write2 @@ -766,25 +615,28 @@ test_skip_compress_write2(hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; int i, j, n; - unsigned filter_mask = 0; - unsigned read_filter_mask = 0; + unsigned filter_mask = 0; /* orig filter mask */ int origin_direct_buf[CHUNK_NX][CHUNK_NY]; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); - int aggression = 9; /* Compression aggression setting */ + int aggression = 9; /* Compression aggression setting */ - hsize_t start[2]; /* Start of hyperslab */ - hsize_t stride[2]; /* Stride of hyperslab */ - hsize_t count[2]; /* Block count */ - hsize_t block[2]; /* Block sizes */ + unsigned read_filter_mask = 0; /* filter mask after direct read */ + int read_direct_buf[CHUNK_NX][CHUNK_NY]; + hsize_t read_buf_size = 0; /* buf size */ + + hsize_t start[2]; /* Start of hyperslab */ + hsize_t stride[2]; /* Stride of hyperslab */ + hsize_t count[2]; /* Block count */ + hsize_t block[2]; /* Block sizes */ TESTING("skipping compression filters but keep two other filters"); @@ -808,10 +660,10 @@ test_skip_compress_write2(hid_t file) goto error; /* Register and enable first bogus filter */ - if(H5Zregister (H5Z_BOGUS1) < 0) + if(H5Zregister (H5Z_BOGUS1) < 0) goto error; - if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS1, 0, (size_t)0, NULL) < 0) + if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS1, 0, (size_t)0, NULL) < 0) goto error; /* Enable compression filter */ @@ -819,10 +671,10 @@ test_skip_compress_write2(hid_t file) goto error; /* Register and enable second bogus filter */ - if(H5Zregister (H5Z_BOGUS2) < 0) + if(H5Zregister (H5Z_BOGUS2) < 0) goto error; - if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS2, 0, (size_t)0, NULL) < 0) + if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS2, 0, (size_t)0, NULL) < 0) goto error; /* @@ -843,8 +695,8 @@ test_skip_compress_write2(hid_t file) direct_buf[i][j] = (origin_direct_buf[i][j] + ADD_ON) * FACTOR; } - /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. - * Indicate skipping the compression filter but keep the other two bogus filters */ + /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function. + * Indicate skipping the compression filter but keep the other two bogus filters */ offset[0] = CHUNK_NX; offset[1] = CHUNK_NY; @@ -854,7 +706,7 @@ test_skip_compress_write2(hid_t file) if((status = H5DOwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; if(H5Dclose(dataset) < 0) @@ -863,19 +715,19 @@ test_skip_compress_write2(hid_t file) if((dataset = H5Dopen2(file, DATASETNAME3, H5P_DEFAULT)) < 0) goto error; - /* Use H5DOread_chunk() to read the uncompressed data */ - if((status = H5DOread_chunk(dataset, dxpl, offset, &read_filter_mask, check_chunk)) < 0) + /* + * Select hyperslab for one chunk in the file + */ + start[0] = CHUNK_NX; start[1] = CHUNK_NY; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = CHUNK_NX; block[1] = CHUNK_NY; + if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) goto error; - if(read_filter_mask != filter_mask) { - HDfprintf(stderr, " Read/write filter mask not the same."); + /* Read the chunk back */ + if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) goto error; - } - - /* De-compress the operations of the two bogus filters to the chunk */ - for(i = n = 0; i < CHUNK_NX; i++) - for(j = 0; j < CHUNK_NY; j++) - check_chunk[i][j] = (check_chunk[i][j]/FACTOR) - ADD_ON; /* Check that the values read are the same as the values written */ for(i = 0; i < CHUNK_NX; i++) { @@ -883,36 +735,32 @@ test_skip_compress_write2(hid_t file) if(origin_direct_buf[i][j] != check_chunk[i][j]) { printf(" 1. Read different values than written."); printf(" At index %d,%d\n", i, j); - printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); + printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); goto error; } } } - /* Clear the buffer */ - HDmemset(check_chunk, 0, buf_size); - - /* - * Select hyperslab for one chunk in the file - */ - start[0] = CHUNK_NX; start[1] = CHUNK_NY; - stride[0] = 1; stride[1] = 1; - count[0] = 1; count[1] = 1; - block[0] = CHUNK_NX; block[1] = CHUNK_NY; - if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0) + /* Query chunk storage size */ + if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0) + goto error; + if(read_buf_size != buf_size) goto error; - /* Use H5Dread() to read the chunk back */ - if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0) + /* Read the raw chunk back */ + HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf)); + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0) + goto error; + if(read_filter_mask != filter_mask) goto error; - /* Check that the values read are the same as the values written */ + /* Check that the direct chunk read is the same as the chunk written */ for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { - if(origin_direct_buf[i][j] != check_chunk[i][j]) { + if(direct_buf[i][j] != read_direct_buf[i][j]) { printf(" 1. Read different values than written."); printf(" At index %d,%d\n", i, j); - printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); + printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); goto error; } } @@ -926,7 +774,7 @@ test_skip_compress_write2(hid_t file) H5Sclose(dataspace); H5Pclose(cparms); H5Pclose(dxpl); - + PASSED(); return 0; @@ -940,7 +788,7 @@ error: } H5E_END_TRY; return 1; -} +} /* test_skip_compress_write2() */ /*------------------------------------------------------------------------- * Function: test_data_conv @@ -1168,7 +1016,7 @@ error: } H5E_END_TRY; return 1; -} +} /* test_data_conv() */ /*------------------------------------------------------------------------- * Function: test_invalid_parameters @@ -1379,41 +1227,673 @@ error: } H5E_END_TRY; return 1; -} +} /* test_invalid_parameters() */ /*------------------------------------------------------------------------- - * Function: Main function - * - * Purpose: Test direct chunk write function H5DOwrite_chunk + * Function: test_direct_chunk_read_no_cache * - * Return: Success: 0 + * Purpose: Test the basic functionality of H5DOread_chunk with the + * chunk cache diabled. * - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu - * 30 November 2012 + * Programmer: Matthew Strong (GE Healthcare) + * 14 February 2016 * *------------------------------------------------------------------------- */ -int main( void ) +#ifdef H5_HAVE_FILTER_DEFLATE +static int +test_direct_chunk_read_no_cache (hid_t file) { - hid_t file_id; - int nerrors=0; + hid_t dataspace = -1, dataset = -1; + hid_t mem_space = -1; + hid_t cparms = -1, dxpl = -1, dapl = -1; + hsize_t dims[2] = {NX, NY}; + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; + herr_t status; /* status from H5 function calls */ + int ret; /* deflate return status */ + int data[NX][NY]; + int i, j, k, l, n; /* local index variables */ - /* - * Create a new file. If file exists its contents will be overwritten. - */ - if((file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ + int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */ + int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */ + hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */ + size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); + + Bytef *z_src; /* source buffer */ + uLongf z_src_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); + Bytef *z_dst = (Bytef*)(direct_buf); + uLong z_dst_nbytes = (uLong)buf_size; + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ + + hsize_t start[2]; /* Start of hyperslab */ + hsize_t stride[2]; /* Stride of hyperslab */ + hsize_t count[2]; /* Block count */ + hsize_t block[2]; /* Block sizes */ + + TESTING("basic functionality of H5DOread_chunk (chunk cache disabled)"); + + /* Create the data space with unlimited dimensions. */ + if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0) + goto error; + if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0) goto error; - /* Test direct chunk write and direct chunk read */ -#ifdef H5_HAVE_FILTER_DEFLATE - nerrors += test_direct_chunk_write(file_id); -#endif /* H5_HAVE_FILTER_DEFLATE */ - nerrors += test_skip_compress_write1(file_id); - nerrors += test_skip_compress_write2(file_id); - nerrors += test_data_conv(file_id); - nerrors += test_invalid_parameters(file_id); + /* Modify dataset creation properties, i.e. enable chunking and compression */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0) + goto error; + if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0) + goto error; + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + goto error; + + /* Disable chunk cache by setting number of slots to 0 */ + if((status = H5Pset_chunk_cache(dapl, 0, H5D_CHUNK_CACHE_NBYTES_DEFAULT, H5D_CHUNK_CACHE_W0_DEFAULT)) < 0) + goto error; + + /* Create a new dataset within the file using cparms creation properties. */ + if((dataset = H5Dcreate2(file, DATASETNAME7, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + cparms, dapl)) < 0) + goto error; + + /* Initialize the dataset */ + for(i = n = 0; i < NX; i++) + for(j = 0; j < NY; j++) + data[i][j] = n++; + + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + + /* Write the data for the dataset. + * Data will skip chunk cache and go directly to disk. */ + if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + dxpl, data)) < 0) + goto error; + + /* Allocate output (compressed) buffer */ + outbuf = HDmalloc(z_src_nbytes); + z_src = (Bytef *)outbuf; + + /* For each chunk in the dataset, compare the result of H5Dread and H5DOread_chunk. */ + for(i=0; ishared->layout.u.chunk.ndims - 1; @@ -460,31 +462,31 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, /* Check if the requested chunk exists in the chunk cache */ if(UINT_MAX != udata.idx_hint) { H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + hbool_t flush; /* Sanity checks */ HDassert(udata.idx_hint < rdcc->nslots); HDassert(rdcc->slot[udata.idx_hint]); - /* If the cached chunk is dirty, it must be flushed to get accurate size */ - if( ent->dirty == TRUE ) { - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + flush = (ent->dirty == TRUE) ? TRUE : FALSE; - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Reset fields about the chunk we are looking for */ - udata.nbytes = 0; - udata.filter_mask = 0; - udata.addr = HADDR_UNDEF; - udata.idx_hint = UINT_MAX; + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], flush) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") - /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.filter_mask = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; + + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") } /* Make sure the address of the chunk is returned. */ @@ -526,6 +528,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h hsize_t chunk_idx; /* Index of chunk cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + hbool_t flush; /* Flush cache or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -535,13 +538,13 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h HDassert(offset); HDassert(storage_size); + *storage_size = 0; + /* Retrieve the dataset dimensions */ space_ndims = dset->shared->layout.u.chunk.ndims - 1; - if(H5D__chunk_is_space_alloc(&(layout->storage)) == FALSE) { - *storage_size = 0; + if(H5D__chunk_is_space_alloc(&(layout->storage)) == FALSE) HGOTO_DONE(SUCCEED) - } /* Initialize the chunk offset */ HDmemcpy(chunk_offset, offset, (space_ndims * sizeof(chunk_offset[0]))); @@ -574,25 +577,24 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h HDassert(rdcc->slot[udata.idx_hint]); H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; - /* If the cached chunk is dirty, it must be flushed to get accurate size */ - if( ent->dirty == TRUE ) { - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + flush = (ent->dirty == TRUE) ? TRUE : FALSE; + + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], flush) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") - /* Reset fields about the chunk we are looking for */ - udata.nbytes = 0; - udata.addr = HADDR_UNDEF; - udata.idx_hint = UINT_MAX; + /* Reset fields about the chunk we are looking for */ + udata.nbytes = 0; + udata.addr = HADDR_UNDEF; + udata.idx_hint = UINT_MAX; - /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") } /* Make sure the address of the chunk is returned. */ -- cgit v0.12 From 45c7e2607d48fb5d6f3f920d83f90bfbcbfaad6b Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 7 May 2017 22:45:06 -0500 Subject: Code improvement Description: - Moved class H5File to inherit from class Group because an HDF5 file is a root group - Cleanup header file inclusion and class forward declaration - Revised comments Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5AbstractDs.cpp | 7 ++----- c++/src/H5AbstractDs.h | 20 +++++++++++--------- c++/src/H5ArrayType.cpp | 4 +--- c++/src/H5ArrayType.h | 4 ++-- c++/src/H5AtomType.cpp | 4 +--- c++/src/H5AtomType.h | 4 ++-- c++/src/H5Attribute.cpp | 11 +++++------ c++/src/H5Attribute.h | 4 ++-- c++/src/H5CommonFG.cpp | 5 +++-- c++/src/H5CommonFG.h | 10 ++++------ c++/src/H5CompType.cpp | 5 +---- c++/src/H5CompType.h | 8 ++++++-- c++/src/H5DataSet.cpp | 8 ++------ c++/src/H5DataSet.h | 5 ++--- c++/src/H5DataSpace.h | 4 ++-- c++/src/H5DataType.cpp | 10 ++-------- c++/src/H5DataType.h | 4 ++-- c++/src/H5DcreatProp.cpp | 6 +++--- c++/src/H5DcreatProp.h | 7 +++++-- c++/src/H5DxferProp.cpp | 2 +- c++/src/H5DxferProp.h | 4 ++-- c++/src/H5EnumType.cpp | 6 ++---- c++/src/H5EnumType.h | 5 ++--- c++/src/H5Exception.h | 1 + c++/src/H5FaccProp.h | 4 ++-- c++/src/H5FcreatProp.h | 4 ++-- c++/src/H5File.cpp | 18 +++++++----------- c++/src/H5File.h | 10 ++++++++-- c++/src/H5FloatType.cpp | 9 +++------ c++/src/H5FloatType.h | 4 ++-- c++/src/H5Group.cpp | 12 +++--------- c++/src/H5Group.h | 4 ++-- c++/src/H5IdComponent.cpp | 3 +-- c++/src/H5IdComponent.h | 3 ++- c++/src/H5IntType.cpp | 6 +----- c++/src/H5IntType.h | 6 ++++-- c++/src/H5Library.cpp | 3 ++- c++/src/H5Library.h | 1 + c++/src/H5Location.cpp | 10 +--------- c++/src/H5Location.h | 17 ++++++----------- c++/src/H5Object.cpp | 15 ++++----------- c++/src/H5Object.h | 16 ++++++---------- c++/src/H5OcreatProp.h | 4 ++-- c++/src/H5PredType.cpp | 1 + c++/src/H5PredType.h | 4 ++-- c++/src/H5PropList.cpp | 2 +- c++/src/H5PropList.h | 4 ++-- c++/src/H5StrType.cpp | 9 ++++----- c++/src/H5StrType.h | 4 ++-- c++/src/H5VarLenType.cpp | 4 +--- c++/src/H5VarLenType.h | 4 ++-- 51 files changed, 140 insertions(+), 189 deletions(-) diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 7642be6..4763bf2 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -19,13 +19,10 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5AbstractDs.h" -#include "H5DataSpace.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5Alltypes.h" +#include "H5AbstractDs.h" namespace H5 { diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 516188a..893cd8f 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -19,15 +19,6 @@ namespace H5 { -class ArrayType; -class CompType; -class EnumType; -class FloatType; -class IntType; -class StrType; -class VarLenType; -class DataSpace; - /*! \class AbstractDs \brief AbstractDs is an abstract base class, inherited by Attribute and DataSet. @@ -35,6 +26,17 @@ class DataSpace; It provides a collection of services that are common to both Attribute and DataSet. */ + +class DataType; +class ArrayType; +class IntType; +class FloatType; +class StrType; +class CompType; +class EnumType; +class VarLenType; +class DataSpace; + class H5_DLLCPP AbstractDs { public: // Gets a copy the datatype of that this abstract dataset uses. diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index c99e880..4dc0a74 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -19,10 +19,8 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5ArrayType.h" diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index d55a767..c9f3b3e 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -18,12 +18,12 @@ #define __H5ArrayType_H namespace H5 { + /*! \class ArrayType \brief Class ArrayType inherits from DataType and provides wrappers for the HDF5's Array Datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP ArrayType : public DataType { public: // Constructor that creates a new array data type based on the diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 3b801ba..0e57676 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -19,10 +19,8 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index c588f38..e9c0945 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -18,15 +18,15 @@ #define __H5AtomType_H namespace H5 { + /*! \class AtomType \brief AtomType is a base class, inherited by IntType, FloatType, StrType, and PredType. AtomType provides operations on HDF5 atomic datatypes. It also inherits from DataType. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP AtomType : public DataType { public: // Returns the byte order of an atomic datatype. diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 00407bc..cb0186a 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -20,22 +20,21 @@ #endif #include +#include "H5private.h" // for HDfree #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" -#include "H5AbstractDs.h" #include "H5FaccProp.h" #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" -#include "H5CommonFG.h" +#include "H5Location.h" +#include "H5Object.h" +#include "H5AbstractDs.h" #include "H5DataType.h" #include "H5DataSpace.h" -#include "H5File.h" #include "H5Attribute.h" -#include "H5private.h" // for HDfree namespace H5 { #ifndef H5_NO_STD @@ -43,7 +42,7 @@ namespace H5 { using std::endl; #endif // H5_NO_STD -class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate +//class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate //-------------------------------------------------------------------------- // Function: Attribute default constructor diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index e61da01..10f46ae 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -18,6 +18,7 @@ #define __H5Attribute_H namespace H5 { + /*! \class Attribute \brief Class Attribute operates on HDF5 attributes. @@ -25,9 +26,8 @@ namespace H5 { Attribute and DataSet are derivatives of AbstractDs. Attribute also inherits from IdComponent because an attribute is an HDF5 component that is identified by an identifier. - - Inheritance: multiple IdComponent/AbstractDs */ +// Inheritance: multiple IdComponent/AbstractDs class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { public: diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 10f6c58..d9a66e2 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -15,16 +15,18 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" #include "H5FaccProp.h" #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5Location.h" +#include "H5Object.h" #include "H5CommonFG.h" #include "H5Group.h" #include "H5AbstractDs.h" @@ -32,7 +34,6 @@ #include "H5DataSet.h" #include "H5File.h" #include "H5Alltypes.h" -#include "H5private.h" // for HDstrcpy // There are a few comments that are common to most of the functions // defined in this file so they are listed here. diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index f1a8886..761125c 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -19,17 +19,15 @@ namespace H5 { -// Class forwarding -class Group; -class H5File; -class ArrayType; -class VarLenType; - /*! \class CommonFG \brief \a CommonFG is an abstract base class of H5File and H5Group. It provides common operations of H5File and H5Group. */ + +class ArrayType; +class VarLenType; + class H5_DLLCPP CommonFG { public: // Creates a new group at this location which can be a file diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 136493a..96fabd4 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -19,16 +19,13 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5Alltypes.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" #include "H5DataSpace.h" #include "H5DataSet.h" -#include "H5private.h" namespace H5 { diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index e56dbf3..75089e8 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -18,12 +18,16 @@ #define __H5CompType_H namespace H5 { + /*! \class CompType \brief CompType is a derivative of a DataType and operates on HDF5 compound datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent + +class ArrayType; +class VarLenType; + class H5_DLLCPP CompType : public DataType { public: // Default constructor diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index aba2fa3..75d45b4 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -20,25 +20,21 @@ #endif #include +#include "H5private.h" // for HDfree and HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" -#include "H5FaccProp.h" -#include "H5FcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" -#include "H5File.h" #include "H5Attribute.h" #include "H5DataSet.h" -#include "H5private.h" // for HDfree namespace H5 { #ifndef H5_NO_STD diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index b646a7a..f7a344c 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -18,18 +18,17 @@ #define __H5DataSet_H namespace H5 { + /*! \class DataSet \brief Class DataSet operates on HDF5 datasets. An datasets has many characteristics similar to an attribute, thus both Attribute and DataSet are derivatives of AbstractDs. DataSet also inherits from H5Object because a dataset is an HDF5 object. - - Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent */ +// Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: - // Close this dataset. virtual void close(); diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 2168f4d..b490141 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -18,12 +18,12 @@ #define __H5DataSpace_H namespace H5 { + /*! \class DataSpace \brief Class DataSpace inherits from IdComponent and provides wrappers for the HDF5's dataspaces. - - Inheritance: IdComponent */ +// Inheritance: IdComponent class H5_DLLCPP DataSpace : public IdComponent { public: ///\brief Default DataSpace objects diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index f29978b..625feaf 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -24,21 +24,15 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5DataSpace.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5FaccProp.h" -#include "H5FcreatProp.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" #include "H5DxferProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" #include "H5PredType.h" -#include "H5private.h" #include "H5AbstractDs.h" +#include "H5DataSpace.h" #include "H5DataSet.h" -#include "H5File.h" #include "H5Attribute.h" namespace H5 { diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 6f796b8..1118dcf 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -18,15 +18,15 @@ #define __H5DataType_H namespace H5 { + /*! \class DataType \brief Class DataType provides generic operations on HDF5 datatypes. DataType inherits from H5Object because a named datatype is an HDF5 object and is a base class of ArrayType, AtomType, CompType, EnumType, and VarLenType. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP DataType : public H5Object { public: // Creates a datatype given its class and size diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 7f4bbf9..53a96d1 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -19,11 +19,11 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5OcreatProp.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" +#include "H5OcreatProp.h" +#include "H5DcreatProp.h" namespace H5 { diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 90b7ed7..1072ff4 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -18,12 +18,15 @@ #define __H5DSCreatPropList_H namespace H5 { + /*! \class DSetCreatPropList \brief Class DSetCreatPropList inherits from ObjCreatPropList and provides wrappers for the HDF5 dataset creation property functions. - - Inheritance: ObjCreatPropList -> PropList -> IdComponent */ +// Inheritance: ObjCreatPropList -> PropList -> IdComponent + +class DataType; + class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: ///\brief Default dataset creation property list. diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index e1c5964..fd2f36d 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -15,12 +15,12 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" #include "H5DxferProp.h" -#include "H5private.h" // for HDmemset namespace H5 { diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 0429508..181aeeb 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -18,12 +18,12 @@ #define __H5DSetMemXferPropList_H namespace H5 { + /*! \class DSetMemXferPropList \brief Class DSetCreatPropList inherits from PropList and provides wrappers for the HDF5 dataset memory and transfer property list. - - Inheritance: ObjCreatPropList -> PropList -> IdComponent */ +// Inheritance: ObjCreatPropList -> PropList -> IdComponent class H5_DLLCPP DSetMemXferPropList : public PropList { public: ///\brief Default dataset memory and transfer property list. diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 14a6f43..9403cb8 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -15,23 +15,21 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" #include "H5DataSpace.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSet.h" #include "H5AtomType.h" #include "H5IntType.h" #include "H5EnumType.h" -#include "H5private.h" // for HDmemset namespace H5 { diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 949c75d..af8d9c6 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -18,14 +18,13 @@ #define __H5EnumType_H namespace H5 { + /*! \class EnumType \brief EnumType is a derivative of a DataType and operates on HDF5 enum datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP EnumType : public DataType { - public: // Creates an empty enumeration datatype based on a native signed // integer type, whose size is given by size. diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index fd67118..b57ca64 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -20,6 +20,7 @@ #include namespace H5 { + #ifdef H5_NO_STD #define H5std_string ::string #else diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 237dd68..186cac1 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -18,12 +18,12 @@ #define __H5FileAccPropList_H namespace H5 { + /*! \class FileAccPropList \brief Class FileAccPropList inherits from PropList and provides wrappers for the HDF5 file access property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP FileAccPropList : public PropList { public: ///\brief Default file access property list. diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index f50b4c6..6bb4cc2 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -18,12 +18,12 @@ #define __H5FileCreatPropList_H namespace H5 { + /*! \class FileCreatPropList \brief Class FileCreatPropList inherits from PropList and provides wrappers for the HDF5 file create property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP FileCreatPropList : public PropList { public: ///\brief Default file creation property list. diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index c18431c..768ac5e 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -24,19 +24,15 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" #include "H5FaccProp.h" #include "H5FcreatProp.h" #include "H5OcreatProp.h" -#include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5Location.h" +#include "H5Object.h" #include "H5CommonFG.h" #include "H5Group.h" -#include "H5AbstractDs.h" -#include "H5DataSpace.h" -#include "H5DataSet.h" #include "H5File.h" -#include "H5Alltypes.h" namespace H5 { #ifndef H5_NO_STD @@ -49,7 +45,7 @@ namespace H5 { ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {} +H5File::H5File() : Group(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: H5File overloaded constructor @@ -82,7 +78,7 @@ H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {} // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : H5Location(), CommonFG(), id(H5I_INVALID_HID) +H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -107,7 +103,7 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : H5Location(), CommonFG(), id(H5I_INVALID_HID) +H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -164,7 +160,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // constructor is needed by the library in order to return // an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) //-------------------------------------------------------------------------- -H5File::H5File(hid_t existing_id) : H5Location(), CommonFG() +H5File::H5File(hid_t existing_id) : Group() { id = existing_id; incRefCount(); // increment number of references to this id @@ -179,7 +175,7 @@ H5File::H5File(hid_t existing_id) : H5Location(), CommonFG() ///\param original - IN: H5File instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File(const H5File& original) : H5Location(), CommonFG() +H5File::H5File(const H5File& original) : Group() { id = original.getId(); incRefCount(); // increment number of references to this id diff --git a/c++/src/H5File.h b/c++/src/H5File.h index bf6e655..55ae73e 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -18,12 +18,18 @@ #define __H5File_H namespace H5 { + /*! \class H5File \brief Class H5File represents an HDF5 file. - Inheritance: CommonFG/H5Location -> IdComponent + Modification: + May 5, 2017: In the class rearrangement of 1.8.10, H5File should have + been moved to inherit from Group instead, because HDF5 file is + a root group. It is now done in 1.10 (Mar 30) and 1.8.19 + releases. -BMR */ -class H5_DLLCPP H5File : public H5Location, public CommonFG { +// Inheritance: CommonFG/H5Location -> IdComponent +class H5_DLLCPP H5File : public Group { public: // Creates or opens an HDF5 file. H5File(const char* name, unsigned int flags, diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 0e3417b..9e64972 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -19,18 +19,15 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" -#include "H5DataType.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" #include "H5DataSpace.h" +#include "H5DataSet.h" +#include "H5DataType.h" #include "H5AtomType.h" #include "H5FloatType.h" -#include "H5DataSet.h" -#include "H5PredType.h" namespace H5 { diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 67eee66..7954709 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -18,12 +18,12 @@ #define __H5FloatType_H namespace H5 { + /*! \class FloatType \brief FloatType is a derivative of a DataType and operates on HDF5 floating point datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP FloatType : public AtomType { public: // Creates a floating-point type using a predefined type. diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 1bcafe1..16a715c 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -24,20 +24,14 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" -#include "H5AbstractDs.h" -#include "H5FaccProp.h" -#include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" -#include "H5DxferProp.h" -#include "H5DataSpace.h" -#include "H5DataSet.h" +#include "H5Location.h" +#include "H5Object.h" +#include "H5AbstractDs.h" #include "H5CommonFG.h" #include "H5Attribute.h" #include "H5Group.h" -#include "H5File.h" -#include "H5Alltypes.h" namespace H5 { #ifndef H5_NO_STD diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 244f99e..0d26b27 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -18,11 +18,11 @@ #define __H5Group_H namespace H5 { + /*! \class Group \brief Class Group represents an HDF5 group. - - Inheritance: CommonFG/H5Object -> H5Location -> IdComponent */ +// Inheritance: CommonFG/H5Object -> H5Location -> IdComponent class H5_DLLCPP Group : public H5Object, public CommonFG { public: // Close this group. diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 7b36d64..7054369 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -15,12 +15,11 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" #include "H5IdComponent.h" -#include "H5DataSpace.h" -#include "H5private.h" // for HDmemset namespace H5 { diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 24d1d1b..0f83168 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -19,7 +19,8 @@ namespace H5 { -class DataSpace; +//class DataSpace; + /*! \class IdComponent \brief Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier. diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index cd87306..a9bb146 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -19,10 +19,8 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" @@ -30,11 +28,9 @@ #include "H5AtomType.h" #include "H5IntType.h" #include "H5DataSet.h" -#include "H5PredType.h" namespace H5 { - //-------------------------------------------------------------------------- // Function: IntType default constructor ///\brief Default constructor: Creates a stub integer datatype diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 628df12..1ddf2bd 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -18,12 +18,14 @@ #define __H5IntType_H namespace H5 { + +class PredType; + /*! \class IntType \brief IntType is a derivative of a DataType and operates on HDF5 integer datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP IntType : public AtomType { public: // Creates an integer type using a predefined type diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 62e21b8..b25dc90 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -24,10 +24,11 @@ #include "H5FaccProp.h" #include "H5FcreatProp.h" #include "H5OcreatProp.h" +#include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" -#include "H5DcreatProp.h" #include "H5AtomType.h" #include "H5PredType.h" #include "H5DataSpace.h" diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index ff0cd20..ed13339 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -18,6 +18,7 @@ #define __H5Library_H namespace H5 { + /*! \class H5Library \brief Class H5Library operates the HDF5 library globably. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 709a94e..855e6d2 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -15,25 +15,17 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5DxferProp.h" -#include "H5FaccProp.h" -#include "H5FcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" -#include "H5File.h" -#include "H5DataSet.h" #include "H5Attribute.h" -#include "H5private.h" // for HDmemset namespace H5 { diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 9861118..c49b23b 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -20,17 +20,8 @@ #include "H5Classes.h" // constains forward class declarations namespace H5 { -/*! \class H5Location - \brief H5Location is an abstract base class, added in version 1.8.12. - It provides a collection of wrappers for the C functions that take a - location identifier to specify the HDF5 object. The location identifier - can be either file, group, dataset, attribute, or named datatype. - Wrappers for H5A functions stay in H5Object. - - Inheritance: IdComponent -*/ -class H5_DLLCPP H5Location; // forward declaration for UserData4Aiterate +class H5Location; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). typedef void (*attr_operator_t)(H5Location& loc/*in*/, @@ -49,10 +40,14 @@ class UserData4Aiterate { // user data for attribute iteration It provides a collection of wrappers for the C functions that take a location identifier to specify the HDF5 object. The location identifier - can be either file, group, dataset, or named datatype. + can be either file, group, dataset, attribute, or named datatype. */ +// Inheritance: IdComponent + // Most of these methods were in H5Object but are now moved here because // a location can be a file, group, dataset, or named datatype. -BMR, 2013-10-1 +// Wrappers for H5A functions that operate existing attributes are in H5Object. +// -BMR, 2017-05-04 class H5_DLLCPP H5Location : public IdComponent { public: // Creates an attribute for the specified object at this location diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 3ac149a..60e7afb 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -15,24 +15,17 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5DxferProp.h" -#include "H5FaccProp.h" -#include "H5FcreatProp.h" -#include "H5CommonFG.h" -#include "H5DataType.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" -#include "H5File.h" -#include "H5DataSet.h" #include "H5Attribute.h" -#include "H5private.h" // for HDmemset +#include "H5Location.h" +#include "H5Object.h" +#include "H5DataType.h" namespace H5 { diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 3fd29a4..fa9e8a9 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -17,10 +17,8 @@ #ifndef __H5Object_H #define __H5Object_H -#include "H5Location.h" -#include "H5Classes.h" // constains forward class declarations - namespace H5 { + /*! \class H5Object \brief Class H5Object is a bridge between H5Location and DataSet, DataType, and Group. @@ -33,21 +31,19 @@ namespace H5 { group, dataset, and named datatype. Note that the reason for adding H5Location instead of simply moving H5File to be under H5Object is H5File is not an HDF5 object, and renaming H5Object - to H5Location will risk breaking user applications. - -BMR - Apr 2, 2014: Added wrapper getObjName for H5Iget_name - - Inheritance: H5Location -> IdComponent + to H5Location will risk breaking user applications. -BMR + Apr 2, 2014: Added wrapper getObjName for H5Iget_name -BMR */ +// Inheritance: H5Location -> IdComponent class H5_DLLCPP H5Object : public H5Location { public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. These should have const but are retiring anyway. + // DataType. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; H5std_string getObjName() const; +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Noop destructor. virtual ~H5Object(); diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index c4687f7..dcc07cc 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -18,12 +18,12 @@ #define __H5ObjCreatPropList_H namespace H5 { + /*! \class ObjCreatPropList \brief Class ObjCreatPropList inherits from PropList and provides wrappers for the HDF5 file create property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP ObjCreatPropList : public PropList { public: ///\brief Default object creation property list. diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index a640d32..52334ef 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" #include "H5AtomType.h" diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 1d95865..9581420 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -18,15 +18,15 @@ #define __H5PredType_H namespace H5 { + /*! \class PredType \brief Class PredType holds the definition of all the HDF5 predefined datatypes. These types can only be made copy of, not created by H5Tcreate or closed by H5Tclose. They are treated as constants. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP PredType : public AtomType { public: ///\brief Returns this class name. diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index d7083f8..c60b34e 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -21,11 +21,11 @@ #include +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5private.h" // for HDfree namespace H5{ diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 4c50fb9..bd04194 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -18,13 +18,13 @@ #define __H5PropList_H namespace H5 { + //! Class PropList provides operations for generic property lists. /*! \class PropList \brief Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list. - - Inheritance: IdComponent */ +// Inheritance: IdComponent class H5_DLLCPP PropList : public IdComponent { public: ///\brief Default property list diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index ed60c6b..4335ea7 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -19,18 +19,17 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" -#include "H5AtomType.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" #include "H5DataSpace.h" -#include "H5StrType.h" #include "H5DataSet.h" +#include "H5AtomType.h" #include "H5PredType.h" +#include "H5StrType.h" + namespace H5 { diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 4479223..d78240a 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -18,12 +18,12 @@ #define __H5StrType_H namespace H5 { + /*! \class StrType \brief StrType is a derivative of a DataType and operates on HDF5 string datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP StrType : public AtomType { public: // Creates a string type using a predefined type diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 07508e4..32a5bd8 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -19,10 +19,8 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5Location.h" #include "H5Object.h" -#include "H5OcreatProp.h" -#include "H5DcreatProp.h" -#include "H5CommonFG.h" #include "H5DataType.h" #include "H5VarLenType.h" diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 2676fb3..70a2ab8 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -18,12 +18,12 @@ #define __H5VarLenType_H namespace H5 { + /*! \class VarLenType \brief VarLenType is a derivative of a DataType and operates on HDF5 C's Variable-length Datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP VarLenType : public DataType { public: // Constructor that creates a variable-length datatype based -- cgit v0.12 From 6c161ba4dc7c25da6ecbe98aec10fff7b1365df6 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 7 May 2017 22:56:22 -0500 Subject: Fixed a comment. --- c++/src/H5File.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 55ae73e..e06a942 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -28,7 +28,7 @@ namespace H5 { a root group. It is now done in 1.10 (Mar 30) and 1.8.19 releases. -BMR */ -// Inheritance: CommonFG/H5Location -> IdComponent +// Inheritance: Group -> CommonFG/H5Object -> H5Location -> IdComponent class H5_DLLCPP H5File : public Group { public: // Creates or opens an HDF5 file. -- cgit v0.12 From 8df5c966e09c34524c39d4afe71029ef6664d687 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 10 May 2017 10:20:28 -0500 Subject: Improvement of class hierarchy Description: - Moved class Attribute to be derived from class H5Location instead of IdComponent because an attribute id can be used as loc_id in C APIs. - Copied wrappers of H5A APIs in H5Location into H5Object because H5A functions do not take an attribute id as loc_id. The original wrappers will be deprecated in future releases. - Revised comments Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5Attribute.cpp | 6 +- c++/src/H5Attribute.h | 4 +- c++/src/H5IdComponent.h | 2 - c++/src/H5Location.cpp | 36 ++++++--- c++/src/H5Location.h | 47 ++++++----- c++/src/H5Object.cpp | 210 +++++++++++++++++++++++++++++++++++++++++++++++- c++/src/H5Object.h | 24 ++++++ c++/test/tfile.cpp | 12 +++ 8 files changed, 298 insertions(+), 43 deletions(-) diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index cb0186a..55ccfe7 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -49,7 +49,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub attribute // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {} +Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Attribute copy constructor @@ -57,7 +57,7 @@ Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {} ///\param original - IN: Original Attribute object to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), id(original.id) +Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id) { incRefCount(); // increment number of references to this id } @@ -70,7 +70,7 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), i ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent(), id(existing_id) +Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(existing_id) { incRefCount(); // increment number of references to this id } diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 10f46ae..33145bc 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -27,8 +27,8 @@ namespace H5 { inherits from IdComponent because an attribute is an HDF5 component that is identified by an identifier. */ -// Inheritance: multiple IdComponent/AbstractDs -class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { +// Inheritance: multiple H5Location/AbstractDs +class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: // Copy constructor: makes a copy of an existing Attribute object. diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 0f83168..e9d0c84 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -19,8 +19,6 @@ namespace H5 { -//class DataSpace; - /*! \class IdComponent \brief Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 855e6d2..60f9c3b 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -84,9 +84,19 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS +/*************************************************************************** + Notes for H5A wrappers + ====================== +May, 2017 (1.8.19) + These H5A wrappers are copied from H5Object to prevent an attribute + id being passed in to H5A APIs. The original H5A wrapper functions + here will be deprecated in future releases. + +***************************************************************************/ + //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief Creates an attribute for a group, dataset, or named datatype. +///\brief Deprecated - Creates an attribute for a group, dataset, or named datatype. ///\param name - IN: Name of the attribute ///\param data_type - IN: Datatype for the attribute ///\param data_space - IN: Dataspace for the attribute - only simple @@ -125,7 +135,7 @@ Attribute H5Location::createAttribute(const char* name, const DataType& data_typ //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief This is an overloaded member function, provided for convenience. +///\brief Deprecated - This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -137,7 +147,7 @@ Attribute H5Location::createAttribute(const H5std_string& name, const DataType& //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Opens an attribute given its name. +///\brief Deprecated - Opens an attribute given its name. ///\param name - IN: Name of the attribute ///\return Attribute instance ///\exception H5::AttributeIException @@ -160,7 +170,7 @@ Attribute H5Location::openAttribute(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief This is an overloaded member function, provided for convenience. +///\brief Deprecated - This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -172,7 +182,7 @@ Attribute H5Location::openAttribute(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Opens an attribute given its index. +///\brief Deprecated - Opens an attribute given its index. ///\param idx - IN: Index of the attribute, a 0-based, non-negative integer ///\return Attribute instance ///\exception H5::AttributeIException @@ -196,7 +206,7 @@ Attribute H5Location::openAttribute(const unsigned int idx) const //-------------------------------------------------------------------------- // Function: H5Location::iterateAttrs -///\brief Iterates a user's function over all the attributes of an H5 +///\brief Deprecated - Iterates a user's function over all the attributes of an H5 /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute ///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices @@ -241,7 +251,7 @@ int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_d //-------------------------------------------------------------------------- // Function: H5Location::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. +///\brief Deprecated - Returns the number of attributes attached to this HDF5 object. ///\return Number of attributes ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 @@ -258,7 +268,7 @@ int H5Location::getNumAttrs() const //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief Checks whether the named attribute exists at this location. +///\brief Deprecated - Checks whether the named attribute exists at this location. ///\param name - IN: Name of the attribute to be queried ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2013 @@ -279,7 +289,7 @@ bool H5Location::attrExists(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief This is an overloaded member function, provided for convenience. +///\brief Deprecated - This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -291,7 +301,7 @@ bool H5Location::attrExists(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief Removes the named attribute from this object. +///\brief Deprecated - Removes the named attribute from this object. ///\param name - IN: Name of the attribute to be removed ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 @@ -305,7 +315,7 @@ void H5Location::removeAttr(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief This is an overloaded member function, provided for convenience. +///\brief Deprecated - This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -317,7 +327,7 @@ void H5Location::removeAttr(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief Renames the named attribute from this object. +///\brief Deprecated - Renames the named attribute from this object. ///\param oldname - IN: Name of the attribute to be renamed ///\param newname - IN: New name ame of the attribute ///\exception H5::AttributeIException @@ -332,7 +342,7 @@ void H5Location::renameAttr(const char* oldname, const char* newname) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief This is an overloaded member function, provided for convenience. +///\brief Deprecated - This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for the names. // Programmer Binh-Minh Ribler - Mar, 2005 diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index c49b23b..edc2b53 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -36,33 +36,26 @@ class UserData4Aiterate { // user data for attribute iteration }; /*! \class H5Location - \brief H5Location is an abstract base class, added in version 1.8.12. - - It provides a collection of wrappers for the C functions that take a - location identifier to specify the HDF5 object. The location identifier - can be either file, group, dataset, attribute, or named datatype. + \brief H5Location is an abstract base class, providing a collection of + wrappers of the C functions that take a location identifier, which can be + either file, group, dataset, attribute, or named datatype. */ // Inheritance: IdComponent - -// Most of these methods were in H5Object but are now moved here because -// a location can be a file, group, dataset, or named datatype. -BMR, 2013-10-1 -// Wrappers for H5A functions that operate existing attributes are in H5Object. -// -BMR, 2017-05-04 class H5_DLLCPP H5Location : public IdComponent { public: // Creates an attribute for the specified object at this location // PropList is currently not used, so always be default. - Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; - Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + virtual Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + virtual Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; // Given its name, opens the attribute that belongs to an object at // this location. - Attribute openAttribute(const char* name) const; - Attribute openAttribute(const H5std_string& name) const; + virtual Attribute openAttribute(const char* name) const; + virtual Attribute openAttribute(const H5std_string& name) const; // Given its index, opens the attribute that belongs to an object at // this location. - Attribute openAttribute(const unsigned int idx) const; + virtual Attribute openAttribute(const unsigned int idx) const; // Flushes all buffers associated with this location to disk. void flush(H5F_scope_t scope) const; @@ -84,19 +77,19 @@ class H5_DLLCPP H5Location : public IdComponent { // misleading, so getRefObjType is used in the new function instead. // Iterate user's function over the attributes at this location. - int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + virtual int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); // Checks whether the named attribute exists at this location. - bool attrExists(const char* name) const; - bool attrExists(const H5std_string& name) const; + virtual bool attrExists(const char* name) const; + virtual bool attrExists(const H5std_string& name) const; // Renames the named attribute to a new name. - void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + virtual void renameAttr(const char* oldname, const char* newname) const; + virtual void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; // Removes the named attribute from this location. - void removeAttr(const char* name) const; - void removeAttr(const H5std_string& name) const; + virtual void removeAttr(const char* name) const; + virtual void removeAttr(const H5std_string& name) const; // Sets the comment for an HDF5 object specified by its name. void setComment(const char* name, const char* comment) const; @@ -177,3 +170,13 @@ class H5_DLLCPP H5Location : public IdComponent { } // namespace H5 #endif // __H5Location_H + +// Modification +// Oct 1, 2013 -BMR +// H5Location is added in version 1.8.12. +// Most of these methods were in H5Object but are now moved here +// because a location can be a file, group, dataset, or named datatype. +// May 04, 2017 -BMR +// Wrappers for H5A functions are copied to H5Object because H5A +// functions do not take an attribute id as loc_id. The original +// wrappers will be deprecated in future releases. diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 60e7afb..933e8ec 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -22,8 +22,8 @@ #include "H5PropList.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" -#include "H5Attribute.h" #include "H5Location.h" +#include "H5Attribute.h" #include "H5Object.h" #include "H5DataType.h" @@ -64,6 +64,214 @@ H5Object::H5Object() : H5Location() {} //-------------------------------------------------------------------------- // H5Object::H5Object(const H5Object& original) : H5Location() {} +/*************************************************************************** + Notes for H5A wrappers + ====================== +May, 2017 (1.8.19) + These H5A wrappers are copied from H5Location to prevent an attribute + id being passed in to H5A APIs. The original H5A wrapper functions + in H5Location will be deprecated in future releases. + +***************************************************************************/ + +//-------------------------------------------------------------------------- +// Function: H5Object::createAttribute +///\brief Creates an attribute for a group, dataset, or named datatype. +///\param name - IN: Name of the attribute +///\param data_type - IN: Datatype for the attribute +///\param data_space - IN: Dataspace for the attribute - only simple +/// dataspaces are allowed at this time +///\param create_plist - IN: Creation property list - default to +/// PropList::DEFAULT +///\return Attribute instance +///\exception H5::AttributeIException +///\par Description +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first +/// delete the existing one with \c H5Object::removeAttr, then +/// recreate it with this function. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::createAttribute(const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const +{ + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t plist_id = create_plist.getId(); + hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT); + + // If the attribute id is valid, create and return the Attribute object + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::createAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const +{ + return(createAttribute(name.c_str(), data_type, data_space, create_plist)); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::openAttribute +///\brief Opens an attribute given its name. +///\param name - IN: Name of the attribute +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::openAttribute(const char* name) const +{ + hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Object::openAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::openAttribute(const H5std_string& name) const +{ + return(openAttribute(name.c_str())); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::openAttribute +///\brief Opens an attribute given its index. +///\param idx - IN: Index of the attribute, a 0-based, non-negative integer +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::openAttribute(const unsigned int idx) const +{ + hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, + H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Object::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 +//-------------------------------------------------------------------------- +bool H5Object::attrExists(const char* name) const +{ + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +bool H5Object::attrExists(const H5std_string& name) const +{ + return(attrExists(name.c_str())); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::removeAttr +///\brief Removes the named attribute from this object. +///\param name - IN: Name of the attribute to be removed +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void H5Object::removeAttr(const char* name) const +{ + herr_t ret_value = H5Adelete(getId(), name); + if(ret_value < 0) + throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::removeAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void H5Object::removeAttr(const H5std_string& name) const +{ + removeAttr(name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::renameAttr +///\brief Renames the named attribute from this object. +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar, 2005 +//-------------------------------------------------------------------------- +void H5Object::renameAttr(const char* oldname, const char* newname) const +{ + herr_t ret_value = H5Arename(getId(), oldname, newname); + if (ret_value < 0) + throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Object::renameAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for the names. +// Programmer Binh-Minh Ribler - Mar, 2005 +//-------------------------------------------------------------------------- +void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const +{ + renameAttr (oldname.c_str(), newname.c_str()); +} + +// end of Notes for H5A wrappers + //-------------------------------------------------------------------------- // Function: getObjName ///\brief Given an id, returns the type of the object. diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index fa9e8a9..b118bb8 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -37,6 +37,30 @@ namespace H5 { // Inheritance: H5Location -> IdComponent class H5_DLLCPP H5Object : public H5Location { public: + // Creates an attribute for the specified object + // PropList is currently not used, so always be default. + Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + + // Given its name, opens the attribute that belongs to this object. + Attribute openAttribute(const char* name) const; + Attribute openAttribute(const H5std_string& name) const; + + // Given its index, opens the attribute that belongs to this object. + Attribute openAttribute(const unsigned int idx) const; + + // Checks whether the named attribute exists for this object. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; + + // Renames the named attribute of this object to a new name. + void renameAttr(const char* oldname, const char* newname) const; + void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + + // Removes the named attribute from this object. + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or // DataType. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index bd229d7..6e12dfd 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -601,6 +601,18 @@ static void test_file_attribute() n_attrs = dataset.getNumAttrs(); verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); + // Get and verify the number of attributes at the location specified + // by a dataset's attribute + n_attrs = 0; + n_attrs = dattr.getNumAttrs(); + verify_val(n_attrs, 1, "Attribute::getNumAttrs()", __LINE__, __FILE__); + + // Get and verify the number of attributes at the location specified + // by a file's attribute + n_attrs = 0; + n_attrs = fattr1.getNumAttrs(); + verify_val(n_attrs, 2, "Attribute::getNumAttrs()", __LINE__, __FILE__); + // Read back attribute's data HDmemset(rdata, 0, sizeof(rdata)); dattr.read(PredType::NATIVE_INT, rdata); -- cgit v0.12 From 0ff30fa67ca92fe59d99b4bbc6addbc01f219043 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 10 May 2017 13:54:18 -0500 Subject: Move libdynlib* test lib files from lib_LTLIBRARIES to dyn_LTLIBRARIES and other changes to Makefiles and config/conclude.am to eliminate link errors with new libdynlib*_la_LDFLAGS which were added to stop libdynlib* files linking to external libraries. --- c++/Makefile.in | 7 +- c++/examples/Makefile.in | 7 +- c++/src/Makefile.in | 7 +- c++/test/Makefile.in | 7 +- config/conclude.am | 7 +- examples/Makefile.in | 7 +- fortran/Makefile.in | 7 +- fortran/examples/Makefile.in | 7 +- fortran/src/Makefile.in | 7 +- fortran/test/Makefile.in | 7 +- fortran/testpar/Makefile.in | 7 +- hl/Makefile.in | 7 +- hl/c++/Makefile.in | 7 +- hl/c++/examples/Makefile.in | 7 +- hl/c++/src/Makefile.in | 7 +- hl/c++/test/Makefile.in | 7 +- hl/examples/Makefile.in | 7 +- hl/fortran/Makefile.in | 7 +- hl/fortran/examples/Makefile.in | 7 +- hl/fortran/src/Makefile.in | 7 +- hl/fortran/test/Makefile.in | 7 +- hl/src/H5LTparse.c | 144 ++++++++++++++++++++-------------------- hl/src/H5LTparse.h | 4 +- hl/src/Makefile.in | 7 +- hl/test/Makefile.in | 7 +- hl/tools/Makefile.in | 7 +- hl/tools/gif2h5/Makefile.in | 7 +- src/Makefile.in | 7 +- test/Makefile.am | 18 ++++- test/Makefile.in | 107 ++++++++++++++++------------- testpar/Makefile.in | 7 +- tools/Makefile.in | 7 +- tools/h5copy/Makefile.in | 7 +- tools/h5diff/Makefile.am | 8 ++- tools/h5diff/Makefile.in | 91 ++++++++++++------------- tools/h5dump/Makefile.am | 9 ++- tools/h5dump/Makefile.in | 92 ++++++++++++------------- tools/h5import/Makefile.in | 7 +- tools/h5jam/Makefile.in | 7 +- tools/h5ls/Makefile.am | 10 ++- tools/h5ls/Makefile.in | 99 ++++++++++++++------------- tools/h5repack/Makefile.am | 11 ++- tools/h5repack/Makefile.in | 90 +++++++++++++------------ tools/h5stat/Makefile.in | 7 +- tools/lib/Makefile.in | 7 +- tools/misc/Makefile.in | 7 +- tools/perform/Makefile.in | 7 +- 47 files changed, 543 insertions(+), 385 deletions(-) diff --git a/c++/Makefile.in b/c++/Makefile.in index cea1990..ec67f96 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -668,7 +668,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 @BUILD_CXX_CONDITIONAL_TRUE@SUBDIRS = src test DIST_SUBDIRS = src test examples -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -676,10 +676,12 @@ DIST_SUBDIRS = src test examples LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1181,6 +1183,7 @@ check-clean :: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1188,7 +1191,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index d13f818..95ab397 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -648,7 +648,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -656,10 +656,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1134,6 +1136,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1141,7 +1144,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 669a33d..813254f 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -741,7 +741,7 @@ DISTCLEANFILES = h5c++ libhdf5.settings # Mark this directory as part of the C++ API CXX_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -749,10 +749,12 @@ CXX_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1351,6 +1353,7 @@ mostlyclean-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1358,7 +1361,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index a9a2434..e065782 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -686,7 +686,7 @@ testhdf5_SOURCES = testhdf5.cpp dsets.cpp tattr.cpp tarray.cpp \ # Tell conclude.am that these are C++ tests. CXX_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -694,10 +694,12 @@ CXX_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1188,6 +1190,7 @@ mostlyclean-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1195,7 +1198,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/config/conclude.am b/config/conclude.am index 1ba56fb..d380c9a 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -18,17 +18,19 @@ ## Textually included at the end of most HDF5 Makefiles.am. ## Contains build rules. -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to # be built at certain times. LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +dyndir=$(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -36,6 +38,7 @@ AM_SH_LOG_FLAGS = # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -43,7 +46,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/examples/Makefile.in b/examples/Makefile.in index 1d9cbfc..98eacf6 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -659,7 +659,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -667,10 +667,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1164,6 +1166,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1171,7 +1174,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 313b99a..461591d 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -677,7 +677,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # All directories that have Makefiles DIST_SUBDIRS = src test testpar examples -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -685,10 +685,12 @@ DIST_SUBDIRS = src test testpar examples LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1190,6 +1192,7 @@ check-clean :: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1197,7 +1200,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index ac91c72..f5ceed7 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -660,7 +660,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -668,10 +668,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1155,6 +1157,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1162,7 +1165,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c976948..386c177 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -829,7 +829,7 @@ H5fortran_detect_SOURCES = H5fortran_detect.f90 # Mark this directory as part of the Fortran API FORTRAN_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -837,10 +837,12 @@ FORTRAN_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1500,6 +1502,7 @@ HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1507,7 +1510,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index a29ec52..2d917b2 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -791,7 +791,7 @@ MOSTLYCLEANFILES = *.tmp # from tests in conclude.am) FORTRAN_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -799,10 +799,12 @@ FORTRAN_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1463,6 +1465,7 @@ fflush2.chkexe_: fflush1.chkexe_ # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1470,7 +1473,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 27e576f..2b7a219 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -680,7 +680,7 @@ LDADD = $(LIBH5FTEST) $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) # Mark this directory as part of the Fortran API FORTRAN_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -688,10 +688,12 @@ FORTRAN_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1135,6 +1137,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1142,7 +1145,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/Makefile.in b/hl/Makefile.in index e27d13f..9119498 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -674,7 +674,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 @BUILD_HDF5_HL_CONDITIONAL_TRUE@SUBDIRS = src test tools $(CXX_DIR) $(FORTRAN_DIR) DIST_SUBDIRS = src test tools c++ fortran examples -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -682,10 +682,12 @@ DIST_SUBDIRS = src test tools c++ fortran examples LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1191,6 +1193,7 @@ build-check-clean: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1198,7 +1201,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index c267998..f56ff9c 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -668,7 +668,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 SUBDIRS = src test DIST_SUBDIRS = src test examples -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -676,10 +676,12 @@ DIST_SUBDIRS = src test examples LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1181,6 +1183,7 @@ check-clean :: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1188,7 +1191,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index bcd4cc1..8dfd546 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -638,7 +638,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -646,10 +646,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1099,6 +1101,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1106,7 +1109,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 2ed452e..f11a2ed 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -711,7 +711,7 @@ libhdf5_hl_cpp_la_LIBADD = $(LIBH5_HL) $(LIBH5CPP) # Public headers include_HEADERS = H5PacketTable.h -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -719,10 +719,12 @@ include_HEADERS = H5PacketTable.h LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1245,6 +1247,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1252,7 +1255,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 25300fe..ac1a802 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -677,7 +677,7 @@ ptableTest_SOURCES = ptableTest.cpp # Tell conclude.am that these are C++ tests. CXX_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -685,10 +685,12 @@ CXX_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1155,6 +1157,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1162,7 +1165,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index f1b5190..4bb96aa 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -653,7 +653,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -661,10 +661,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1138,6 +1140,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1145,7 +1148,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index dab566f..d57a0f8 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -672,7 +672,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 SUBDIRS = src test DIST_SUBDIRS = src test examples -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -680,10 +680,12 @@ DIST_SUBDIRS = src test examples LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1185,6 +1187,7 @@ check-clean :: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1192,7 +1195,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 8f16c59..7c335c3 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -646,7 +646,7 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -654,10 +654,12 @@ CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1103,6 +1105,7 @@ installcheck-local: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1110,7 +1113,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 1497107..96233fa 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -732,7 +732,7 @@ libhdf5hl_fortran_la_SOURCES = H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ # HDF5 HL Fortran library depends on HDF5 Library. libhdf5hl_fortran_la_LIBADD = $(LIBH5_HL) $(LIBH5F) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -740,10 +740,12 @@ libhdf5hl_fortran_la_LIBADD = $(LIBH5_HL) $(LIBH5F) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1293,6 +1295,7 @@ H5TBff.lo: $(srcdir)/H5TBff.f90 # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1300,7 +1303,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index a1dcc20..1ecaa15 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -695,7 +695,7 @@ tsttable_SOURCES = tsttable.f90 # from tests in conclude.am) FORTRAN_API = yes -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -703,10 +703,12 @@ FORTRAN_API = yes LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1190,6 +1192,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1197,7 +1200,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 6ca95c54..36591d3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 621dacd..1461830 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index aee58b5..d386dc0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -709,7 +709,7 @@ libhdf5_hl_la_LIBADD = $(LIBHDF5) # Public header files (to be installed) include_HEADERS = hdf5_hl.h H5DOpublic.h H5IMpublic.h H5LTpublic.h H5TBpublic.h H5DSpublic.h H5PTpublic.h -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -717,10 +717,12 @@ include_HEADERS = hdf5_hl.h H5DOpublic.h H5IMpublic.h H5LTpublic.h H5TBpublic.h LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1250,6 +1252,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1257,7 +1260,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 1a9b390..ffc4cf7 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -729,7 +729,7 @@ BUILD_ALL_PROGS = gen_test_ds # Sources for test_packet executable test_packet_SOURCES = test_packet.c test_packet_vlen.c -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -737,10 +737,12 @@ test_packet_SOURCES = test_packet.c test_packet_vlen.c LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1297,6 +1299,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1304,7 +1307,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 11fd7ef..6f5fc84 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # All subdirectories SUBDIRS = gif2h5 -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -678,10 +678,12 @@ SUBDIRS = gif2h5 LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1167,6 +1169,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1174,7 +1177,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 231cb08..ce2bc6c 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -695,7 +695,7 @@ h52gifgentst_SOURCES = h52gifgentst.c # library. LDADD = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -703,10 +703,12 @@ LDADD = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1237,6 +1239,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1244,7 +1247,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/src/Makefile.in b/src/Makefile.in index c1d926e..b783a5a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -847,7 +847,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers settingsdir = $(libdir) settings_DATA = libhdf5.settings -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -855,10 +855,12 @@ settings_DATA = libhdf5.settings LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1742,6 +1744,7 @@ trace: $(libhdf5_la_SOURCES) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1749,7 +1752,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/test/Makefile.am b/test/Makefile.am index fb611b3..2b9ee83 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -81,7 +81,7 @@ noinst_LTLIBRARIES=libh5test.la if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + dyn_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c @@ -91,8 +91,20 @@ if HAVE_SHARED_CONDITIONAL libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) + +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) + +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) + +libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c diff --git a/test/Makefile.in b/test/Makefile.in index 1e481bc..79e31ba 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -154,8 +154,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(dyndir)" +LTLIBRARIES = $(dyn_LTLIBRARIES) $(noinst_LTLIBRARIES) libdynlib1_la_LIBADD = am__libdynlib1_la_SOURCES_DIST = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo @@ -168,7 +168,7 @@ libdynlib1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdynlib1_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) libdynlib2_la_LIBADD = am__libdynlib2_la_SOURCES_DIST = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo @@ -177,7 +177,7 @@ libdynlib2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdynlib2_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) libdynlib3_la_LIBADD = am__libdynlib3_la_SOURCES_DIST = dynlib3.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo @@ -186,7 +186,7 @@ libdynlib3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdynlib3_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) libdynlib4_la_LIBADD = am__libdynlib4_la_SOURCES_DIST = dynlib4.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_OBJECTS = dynlib4.lo @@ -195,7 +195,7 @@ libdynlib4_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdynlib4_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib4_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) @@ -1124,7 +1124,7 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_i # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la +@HAVE_SHARED_CONDITIONAL_TRUE@dyn_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c @@ -1133,6 +1133,9 @@ noinst_LTLIBRARIES = libh5test.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -1155,7 +1158,7 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -1163,10 +1166,12 @@ DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env. LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1221,33 +1226,33 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-dynLTLIBRARIES: $(dyn_LTLIBRARIES) @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(dyndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dyndir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dyndir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dyndir)"; \ } -uninstall-libLTLIBRARIES: +uninstall-dynLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dyndir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dyndir)/$$f"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-dynLTLIBRARIES: + -test -z "$(dyn_LTLIBRARIES)" || rm -f $(dyn_LTLIBRARIES) + @list='$(dyn_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -1267,17 +1272,17 @@ clean-noinstLTLIBRARIES: rm -f $${locs}; \ } -libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) -libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) -libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) -libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) @@ -2269,7 +2274,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ + for dir in "$(DESTDIR)$(dyndir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -2306,10 +2311,9 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ +clean-am: clean-checkPROGRAMS clean-dynLTLIBRARIES clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am @@ -2331,15 +2335,14 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dynLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: + install-html: install-html-am install-html-am: @@ -2378,26 +2381,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: uninstall-dynLTLIBRARIES -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + check-am clean clean-checkPROGRAMS clean-dynLTLIBRARIES \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-dvi-am install-dynLTLIBRARIES install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-libLTLIBRARIES + uninstall-dynLTLIBRARIES .PRECIOUS: Makefile @@ -2416,8 +2419,17 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) + +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) + +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) + +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) # Additional target for running timing test timings _timings: testmeta @@ -2433,6 +2445,7 @@ flush2.chkexe_: flush1.chkexe_ # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -2440,7 +2453,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 00dd130..b27bc45 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -717,7 +717,7 @@ testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ # The tests all depend on the hdf5 library and the test library LDADD = $(LIBH5TEST) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -725,10 +725,12 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1237,6 +1239,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1244,7 +1247,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/Makefile.in b/tools/Makefile.in index 536ae63..8321845 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -673,7 +673,7 @@ SUBDIRS = lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat \ perform -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -681,10 +681,12 @@ SUBDIRS = lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat \ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1170,6 +1172,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1177,7 +1180,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 60f5b5c..77964d2 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -692,7 +692,7 @@ h5copygentest_SOURCES = h5copygentest.c # All programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -700,10 +700,12 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1231,6 +1233,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1238,7 +1241,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5diff/Makefile.am b/tools/h5diff/Makefile.am index 00fc9b0..c667ee4 100644 --- a/tools/h5diff/Makefile.am +++ b/tools/h5diff/Makefile.am @@ -60,12 +60,14 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdiff.la + dyn_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5diff. They should diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 1ac145d..271663d 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -148,8 +148,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(dyn_LTLIBRARIES) libdynlibdiff_la_LIBADD = am__libdynlibdiff_la_SOURCES_DIST = dynlib_diff.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdiff_la_OBJECTS = \ @@ -164,7 +164,7 @@ libdynlibdiff_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_CFLAGS) $(CFLAGS) $(libdynlibdiff_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdiff_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) @BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = ph5diff$(EXEEXT) am__EXEEXT_2 = h5diffgentest$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) @@ -694,6 +694,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. # *.clog and *.clog2 are from the MPE option. +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* # Temporary files. *.h5 are generated by h5diff. They should # be copied to the testfiles/ directory if update is required @@ -722,12 +724,12 @@ h5diffgentest_SOURCES = h5diffgentest.c # Programs depend on the main HDF5 library and tools library LDADD = $(LIBH5TOOLS) $(LIBHDF5) -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdiff.la +@HAVE_SHARED_CONDITIONAL_TRUE@dyn_LTLIBRARIES = libdynlibdiff.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff_la_SOURCES = dynlib_diff.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = h5diff_plugin.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -735,10 +737,12 @@ DISTCLEANFILES = h5diff_plugin.sh LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -787,33 +791,33 @@ testh5diff.sh: $(top_builddir)/config.status $(srcdir)/testh5diff.sh.in testph5diff.sh: $(top_builddir)/config.status $(srcdir)/testph5diff.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-dynLTLIBRARIES: $(dyn_LTLIBRARIES) @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(dyndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dyndir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dyndir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dyndir)"; \ } -uninstall-libLTLIBRARIES: +uninstall-dynLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dyndir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dyndir)/$$f"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-dynLTLIBRARIES: + -test -z "$(dyn_LTLIBRARIES)" || rm -f $(dyn_LTLIBRARIES) + @list='$(dyn_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -822,8 +826,8 @@ clean-libLTLIBRARIES: rm -f $${locs}; \ } -libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1173,10 +1177,8 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local -install-binPROGRAMS: install-libLTLIBRARIES - installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1213,11 +1215,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-dynLTLIBRARIES \ + clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1237,15 +1238,14 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dynLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-binPROGRAMS + install-html: install-html-am install-html-am: @@ -1284,26 +1284,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES +uninstall-am: uninstall-binPROGRAMS uninstall-dynLTLIBRARIES -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + clean-dynLTLIBRARIES clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES + install-dynLTLIBRARIES install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-dynLTLIBRARIES .PRECIOUS: Makefile @@ -1321,11 +1321,12 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1333,7 +1334,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 4b54960..bdb65fa 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -50,12 +50,15 @@ h5dump_SOURCES=h5dump.c h5dump_ddl.c h5dump_xml.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdump.la + dyn_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5dumpgentest. They should diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 7909889..e878db2 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -149,8 +149,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(dyn_LTLIBRARIES) libdynlibdump_la_LIBADD = am__libdynlibdump_la_SOURCES_DIST = dynlib_dump.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdump_la_OBJECTS = \ @@ -165,7 +165,7 @@ libdynlibdump_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_CFLAGS) $(CFLAGS) $(libdynlibdump_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibdump_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) am__EXEEXT_1 = h5dumpgentest$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) binread_SOURCES = binread.c @@ -697,6 +697,9 @@ TRACE = perl $(top_srcdir)/bin/trace # .chklog files are output from those tests. # *.clog and *.clog2 are from the MPE option. +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin @@ -716,12 +719,12 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) # Source files for the program h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibdump.la +@HAVE_SHARED_CONDITIONAL_TRUE@dyn_LTLIBRARIES = libdynlibdump.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump_la_SOURCES = dynlib_dump.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -729,10 +732,12 @@ DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -783,33 +788,33 @@ testh5dumppbits.sh: $(top_builddir)/config.status $(srcdir)/testh5dumppbits.sh.i testh5dumpxml.sh: $(top_builddir)/config.status $(srcdir)/testh5dumpxml.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-dynLTLIBRARIES: $(dyn_LTLIBRARIES) @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(dyndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dyndir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dyndir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dyndir)"; \ } -uninstall-libLTLIBRARIES: +uninstall-dynLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dyndir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dyndir)/$$f"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-dynLTLIBRARIES: + -test -z "$(dyn_LTLIBRARIES)" || rm -f $(dyn_LTLIBRARIES) + @list='$(dyn_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -818,8 +823,8 @@ clean-libLTLIBRARIES: rm -f $${locs}; \ } -libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1170,10 +1175,8 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local -install-binPROGRAMS: install-libLTLIBRARIES - installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1210,11 +1213,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-dynLTLIBRARIES \ + clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1234,15 +1236,14 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dynLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-binPROGRAMS + install-html: install-html-am install-html-am: @@ -1281,26 +1282,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES +uninstall-am: uninstall-binPROGRAMS uninstall-dynLTLIBRARIES -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + clean-dynLTLIBRARIES clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES + install-dynLTLIBRARIES install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-dynLTLIBRARIES .PRECIOUS: Makefile @@ -1318,11 +1319,12 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1330,7 +1332,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 4c03689..4613104 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -689,7 +689,7 @@ h5import_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All programs depend on the main hdf5 library and the tools library LDADD = $(LIBH5TOOLS) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -697,10 +697,12 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1228,6 +1230,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1235,7 +1238,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index d44ef43..08012bf 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -701,7 +701,7 @@ SCRIPT_DEPEND = h5jam$(EXEEXT) h5unjam$(EXEEXT) LDADD = $(LIBH5TOOLS) $(LIBHDF5) DISTCLEANFILES = testh5jam.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -709,10 +709,12 @@ DISTCLEANFILES = testh5jam.sh LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1249,6 +1251,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1256,7 +1259,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5ls/Makefile.am b/tools/h5ls/Makefile.am index bee5d79..f78e777 100644 --- a/tools/h5ls/Makefile.am +++ b/tools/h5ls/Makefile.am @@ -44,11 +44,15 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibls.la + dyn_LTLIBRARIES=libdynlibls.la libdynlibls_la_SOURCES=dynlib_ls.c + libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* endif DISTCLEANFILES=h5ls_plugin.sh diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 317fb8b..b9c3dda 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -147,8 +147,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(dyn_LTLIBRARIES) libdynlibls_la_LIBADD = am__libdynlibls_la_SOURCES_DIST = dynlib_ls.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibls_la_OBJECTS = \ @@ -158,8 +158,12 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libdynlibls_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libdynlibls_la_LDFLAGS) $(LDFLAGS) -o \ + $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibls_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) PROGRAMS = $(bin_PROGRAMS) h5ls_SOURCES = h5ls.c h5ls_OBJECTS = h5ls.$(OBJEXT) @@ -687,11 +691,15 @@ h5ls_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibls.la +@HAVE_SHARED_CONDITIONAL_TRUE@dyn_LTLIBRARIES = libdynlibls.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibls_la_SOURCES = dynlib_ls.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* DISTCLEANFILES = h5ls_plugin.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -699,10 +707,12 @@ DISTCLEANFILES = h5ls_plugin.sh LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -749,33 +759,33 @@ h5ls_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5ls_plugin.sh.in testh5ls.sh: $(top_builddir)/config.status $(srcdir)/testh5ls.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-dynLTLIBRARIES: $(dyn_LTLIBRARIES) @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(dyndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dyndir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dyndir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dyndir)"; \ } -uninstall-libLTLIBRARIES: +uninstall-dynLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dyndir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dyndir)/$$f"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-dynLTLIBRARIES: + -test -z "$(dyn_LTLIBRARIES)" || rm -f $(dyn_LTLIBRARIES) + @list='$(dyn_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -784,8 +794,8 @@ clean-libLTLIBRARIES: rm -f $${locs}; \ } -libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1108,10 +1118,8 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local -install-binPROGRAMS: install-libLTLIBRARIES - installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1148,10 +1156,9 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ +clean-am: clean-binPROGRAMS clean-dynLTLIBRARIES clean-generic \ clean-libtool mostlyclean-am distclean: distclean-am @@ -1172,15 +1179,14 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dynLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-binPROGRAMS + install-html: install-html-am install-html-am: @@ -1219,26 +1225,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES +uninstall-am: uninstall-binPROGRAMS uninstall-dynLTLIBRARIES -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-binPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ + check-am clean clean-binPROGRAMS clean-dynLTLIBRARIES \ + clean-generic clean-libtool cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES + install-dynLTLIBRARIES install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-dynLTLIBRARIES .PRECIOUS: Makefile @@ -1256,11 +1262,12 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1268,7 +1275,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 83e94f6..d7690a8 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -63,14 +63,19 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + dyn_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* +libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) +libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) + +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 2045631..a0a4a4b 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -149,8 +149,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)" +LTLIBRARIES = $(dyn_LTLIBRARIES) libdynlibadd_la_LIBADD = am__libdynlibadd_la_SOURCES_DIST = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_OBJECTS = \ @@ -165,7 +165,7 @@ libdynlibadd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_CFLAGS) $(CFLAGS) $(libdynlibadd_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) libdynlibvers_la_LIBADD = am__libdynlibvers_la_SOURCES_DIST = dynlib_vrpk.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_OBJECTS = \ @@ -176,7 +176,7 @@ libdynlibvers_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_CFLAGS) $(CFLAGS) $(libdynlibvers_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = -rpath \ -@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(dyndir) am__EXEEXT_1 = h5repacktst$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = h5repack.$(OBJEXT) h5repack_copy.$(OBJEXT) \ @@ -715,6 +715,9 @@ TRACE = perl $(top_srcdir)/bin/trace # .chklog files are output from those tests. # *.clog and *.clog2 are from the MPE option. +#install-exec-hook: +# $(RM) $(DESTDIR)$(libdir)/*dynlib* + # Temporary files. *.h5 are generated by h5repack. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin \ @@ -740,14 +743,14 @@ COMMON_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \ h5repack_SOURCES = $(COMMON_SOURCES) h5repack_main.c h5repacktst_SOURCES = $(COMMON_SOURCES) h5repacktst.c testh5repack_detect_szip_SOURCES = testh5repack_detect_szip.c -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la libdynlibvers.la +@HAVE_SHARED_CONDITIONAL_TRUE@dyn_LTLIBRARIES = libdynlibadd.la libdynlibvers.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = dynlib_rpk.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_SOURCES = dynlib_vrpk.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic @HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic DISTCLEANFILES = h5repack.sh h5repack_plugin.sh -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -755,10 +758,12 @@ DISTCLEANFILES = h5repack.sh h5repack_plugin.sh LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -805,33 +810,33 @@ h5repack.sh: $(top_builddir)/config.status $(srcdir)/h5repack.sh.in h5repack_plugin.sh: $(top_builddir)/config.status $(srcdir)/h5repack_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-dynLTLIBRARIES: $(dyn_LTLIBRARIES) @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(dyndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dyndir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dyndir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dyndir)"; \ } -uninstall-libLTLIBRARIES: +uninstall-dynLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + @list='$(dyn_LTLIBRARIES)'; test -n "$(dyndir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dyndir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dyndir)/$$f"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ +clean-dynLTLIBRARIES: + -test -z "$(dyn_LTLIBRARIES)" || rm -f $(dyn_LTLIBRARIES) + @list='$(dyn_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -840,11 +845,11 @@ clean-libLTLIBRARIES: rm -f $${locs}; \ } -libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) $(LIBS) -libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS) +@HAVE_SHARED_CONDITIONAL_FALSE@libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_FALSE@ $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1210,10 +1215,8 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local -install-binPROGRAMS: install-libLTLIBRARIES - installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(dyndir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1250,11 +1253,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-dynLTLIBRARIES \ + clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -1275,15 +1277,14 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dynLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-binPROGRAMS + install-html: install-html-am install-html-am: @@ -1322,27 +1323,27 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES +uninstall-am: uninstall-binPROGRAMS uninstall-dynLTLIBRARIES -.MAKE: check-am install-am install-exec-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-dynLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-exec-hook install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ + install-data-am install-dvi install-dvi-am \ + install-dynLTLIBRARIES install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES + uninstall-binPROGRAMS uninstall-dynLTLIBRARIES .PRECIOUS: Makefile @@ -1363,11 +1364,14 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) +@HAVE_SHARED_CONDITIONAL_TRUE@ $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1375,7 +1379,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 4807da1..68185c1 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -700,7 +700,7 @@ DISTCLEANFILES = testh5stat.sh # All programs rely on hdf5 library and h5tools library LDADD = $(LIBH5TOOLS) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -708,10 +708,12 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1277,6 +1279,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1284,7 +1287,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 5d41cb7..b4c2491 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -678,7 +678,7 @@ TEST_PROG = # to build 'libh5tools.la', but not '../../tools/lib/libh5tools.la'. LDADD = libh5tools.la $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -686,10 +686,12 @@ LDADD = libh5tools.la $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1173,6 +1175,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1180,7 +1183,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index dfbdc2a..96d34ae 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -732,7 +732,7 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) # named h5pcc if hdf5 is being built in parallel mode. @BUILD_PARALLEL_CONDITIONAL_TRUE@H5CC_NAME = h5pcc -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -740,10 +740,12 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1351,6 +1353,7 @@ h5redeploy: h5redeploy.in # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1358,7 +1361,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index f3e07b0..63dde78 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -739,7 +739,7 @@ iopipe_LDADD = $(LIBH5TEST) $(LIBHDF5) zip_perf_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) perf_meta_LDADD = $(LIBH5TEST) $(LIBHDF5) -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, dyn, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to @@ -747,10 +747,12 @@ perf_meta_LDADD = $(LIBH5TEST) $(LIBHDF5) LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +dyndir = $(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1344,6 +1346,7 @@ help: # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -1351,7 +1354,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ -- cgit v0.12 From 8c2d4c354413d4f3578aa30cf28ee4c4f5c137cf Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 11 May 2017 03:11:05 -0500 Subject: Incorporate additional code changes for the H5DOread_chunk patch from GE healthcare (HDFFV-9934) Modifications made based on pull request (#485) comments. --- hl/test/test_dset_opt.c | 122 ++++++++++++++++++++++++------------------------ src/H5private.h | 3 ++ 2 files changed, 64 insertions(+), 61 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 1aa4872..1e64a9c 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -121,11 +121,11 @@ test_direct_chunk_write (hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst = NULL; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -244,9 +244,9 @@ test_direct_chunk_write (hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(direct_buf[i][j] != check_chunk[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -308,9 +308,9 @@ test_direct_chunk_write (hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(direct_buf[i][j] != check_chunk[i][j]) { - printf(" 2. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + HDprintf(" 2. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -463,9 +463,9 @@ test_skip_compress_write1(hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(direct_buf[i][j] != check_chunk[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -488,9 +488,9 @@ test_skip_compress_write1(hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(direct_buf[i][j] != read_direct_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); goto error; } } @@ -523,9 +523,9 @@ error: /*------------------------------------------------------------------------- * Function: filter_bogus1 * - * Purpose: A bogus filter that adds ADD_ON to the original value + * Purpose: A bogus filter that adds ADD_ON to the original value * - * Return: Success: Data chunk size + * Return: Success: Data chunk size * * Programmer: Raymond Lu * 30 November 2012 @@ -733,9 +733,9 @@ test_skip_compress_write2(hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(origin_direct_buf[i][j] != check_chunk[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]); goto error; } } @@ -758,9 +758,9 @@ test_skip_compress_write2(hid_t file) for(i = 0; i < CHUNK_NX; i++) { for(j = 0; j < CHUNK_NY; j++) { if(direct_buf[i][j] != read_direct_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]); goto error; } } @@ -938,12 +938,12 @@ test_data_conv(hid_t file) (direct_buf[i][j]).c[3] != (read_chunk[i][j]).c[3] || (direct_buf[i][j]).d != (read_chunk[i][j]).d || (direct_buf[i][j]).e != (read_chunk[i][j]).e) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); - printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (read_chunk[i][j]).a, (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1], (read_chunk[i][j]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d, (read_chunk[i][j]).e); @@ -975,12 +975,12 @@ test_data_conv(hid_t file) (direct_buf[i][j]).c[2] != (check_chunk[i][j]).c[2] || (direct_buf[i][j]).c[3] != (check_chunk[i][j]).c[3] || (direct_buf[i][j]).e != (check_chunk[i][j]).e) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + HDprintf(" 1. Read different values than written."); + HDprintf(" At index %d,%d\n", i, j); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a, (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1], (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d, (direct_buf[i][j]).e); - printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", + HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", (check_chunk[i][j]).a, (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2], (check_chunk[i][j]).c[3], (check_chunk[i][j]).e); @@ -1021,10 +1021,10 @@ error: /*------------------------------------------------------------------------- * Function: test_invalid_parameters * - * Purpose: Test invalid parameters for H5DOwrite_chunk and H5DOread_chunk + * Purpose: Test invalid parameters for H5DOwrite_chunk and H5DOread_chunk * - * Return: Success: 0 - * ` Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -1253,18 +1253,18 @@ test_direct_chunk_read_no_cache (hid_t file) hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; - herr_t status; /* status from H5 function calls */ - int ret; /* deflate return status */ + herr_t status; /* status from H5 function calls */ + int ret; /* deflate return status */ int data[NX][NY]; - int i, j, k, l, n; /* local index variables */ + int i, j, k, l, n; /* local index variables */ - unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ + unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */ int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */ hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); - Bytef *z_src; /* source buffer */ + Bytef *z_src = NULL; /* source buffer */ uLongf z_src_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); Bytef *z_dst = (Bytef*)(direct_buf); uLong z_dst_nbytes = (uLong)buf_size; @@ -1369,9 +1369,9 @@ test_direct_chunk_read_no_cache (hid_t file) for(k = 0; k < CHUNK_NX; k++) { for(l = 0; l < CHUNK_NY; l++) { if(direct_buf[k][l] != check_chunk[k][l]) { - printf("\n 1. Read different values than written."); - printf(" At index %d,%d\n", k, l); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); + HDprintf("\n 1. Read different values than written."); + HDprintf(" At index %d,%d\n", k, l); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); goto error; } } @@ -1420,18 +1420,18 @@ test_direct_chunk_read_cache (hid_t file, hbool_t flush) hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; - herr_t status; /* status from H5 function calls */ - int ret; /* deflate return status */ + herr_t status; /* status from H5 function calls */ + int ret; /* deflate return status */ int data[NX][NY]; - int i, j, k, l, n; /* local index variables */ + int i, j, k, l, n; /* local index variables */ - unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ + unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */ int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */ hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); - Bytef *z_src; /* source buffer */ + Bytef *z_src = NULL; /* source buffer */ uLongf z_src_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); Bytef *z_dst = (Bytef*)(direct_buf); uLong z_dst_nbytes = (uLong)buf_size; @@ -1548,9 +1548,9 @@ test_direct_chunk_read_cache (hid_t file, hbool_t flush) for(k = 0; k < CHUNK_NX; k++) { for(l = 0; l < CHUNK_NY; l++) { if(direct_buf[k][l] != check_chunk[k][l]) { - printf("\n 1. Read different values than written."); - printf(" At index %d,%d\n", k, l); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); + HDprintf("\n 1. Read different values than written."); + HDprintf(" At index %d,%d\n", k, l); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); goto error; } } @@ -1702,9 +1702,9 @@ test_read_unfiltered_dset(hid_t file) for(k = 0; k < CHUNK_NX; k++) { for(l = 0; l < CHUNK_NY; l++) { if(direct_buf[k][l] != check_chunk[k][l]) { - printf("\n 1. Read different values than written."); - printf(" At index %d,%d\n", k, l); - printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); + HDprintf("\n 1. Read different values than written."); + HDprintf(" At index %d,%d\n", k, l); + HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]); goto error; } } @@ -1759,13 +1759,13 @@ test_read_unallocated_chunk (hid_t file) hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; hsize_t chunk_nbytes = CHUNK_NX*CHUNK_NY*sizeof(int); - hsize_t direct_chunk_nbytes = 0; /* size (bytes) of the on-disk chunk */ - herr_t status; /* status from H5 function calls */ - uint i, j; /* local index variables */ + hsize_t direct_chunk_nbytes = 0; /* size (bytes) of the on-disk chunk */ + herr_t status; /* status from H5 function calls */ + uint i, j; /* local index variables */ - unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ - int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */ - hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */ + unsigned filter_mask = 0; /* filter mask returned from H5DOread_chunk */ + int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */ + hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */ TESTING("H5DOread_chunk with unallocated chunks"); @@ -1902,8 +1902,8 @@ int main( void ) if (nerrors) goto error; - return 0; + return EXIT_SUCCESS; error: - return 1; + return EXIT_FAILURE; } diff --git a/src/H5private.h b/src/H5private.h index 3c0cb75..b079136 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1048,6 +1048,9 @@ typedef off_t h5_stat_size_t; #define HDpow(X,Y) pow(X,Y) #endif /* HDpow */ /* printf() variable arguments */ +#ifndef HDprintf + #define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) +#endif /* HDprintf */ #ifndef HDputc #define HDputc(C,F) putc(C,F) #endif /* HDputc*/ -- cgit v0.12 From 724538ad54e512d788ccbd99c8501667784e26b2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 16:14:53 -0500 Subject: Change the signature of H5PLget_size function --- src/H5PL.c | 20 ++++++++++++++------ src/H5PLpublic.h | 12 ++++++------ test/plugin.c | 23 +++++++++++++++-------- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index e786742..1478c3e 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -600,7 +600,7 @@ ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { ssize_t ret_value = 0; /* Return value */ - ssize_t len = 0; /* Length of pathname */ + size_t len = 0; /* Length of pathname */ char *dl_path = NULL; FUNC_ENTER_API(FAIL) @@ -619,7 +619,7 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) } /* end if */ /* Set return value */ - ret_value = len; + ret_value = (ssize_t)len; done: FUNC_LEAVE_API(ret_value) @@ -631,14 +631,22 @@ done: * * Purpose: Query the size of the current list of plugin paths. * - * Return: Non-negative or success. + * Return: Plugin path size * *------------------------------------------------------------------------- */ -unsigned int -H5PLsize(void) +herr_t +H5PLsize(unsigned int *listsize) { - return (unsigned int)H5PL_num_paths_g; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*Iu", listsize); + + *listsize = (unsigned int)H5PL_num_paths_g; + +done: + FUNC_LEAVE_API(ret_value) } /* end H5PLsize() */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 5e4dcae..12cdc87 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -43,14 +43,14 @@ extern "C" { /* plugin state */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); -H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/); -H5_DLL herr_t H5PLappend(const char* plugin_path); -H5_DLL herr_t H5PLprepend(const char* plugin_path); -H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); -H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_type/*out*/); +H5_DLL herr_t H5PLappend(const char *plugin_path); +H5_DLL herr_t H5PLprepend(const char *plugin_path); +H5_DLL herr_t H5PLreplace(const char *plugin_path, unsigned int index); +H5_DLL herr_t H5PLinsert(const char *plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size); -H5_DLL unsigned int H5PLsize(void); +H5_DLL herr_t H5PLsize(unsigned int *listsize/*out*/); #ifdef __cplusplus } diff --git a/test/plugin.c b/test/plugin.c index f65d345..855273b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -733,7 +733,7 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR - ndx = H5PLsize(); + H5PLsize(&ndx); TESTING(" remove"); /* Remove all existing paths*/ @@ -743,7 +743,8 @@ test_filter_path_apis(void) TEST_ERROR } /* end if */ /* Verify the table is empty */ - if(H5PLsize() > 0) TEST_ERROR + H5PLsize(&ndx); + if(ndx > 0) TEST_ERROR PASSED(); TESTING(" remove (exceed min)"); @@ -764,7 +765,8 @@ test_filter_path_apis(void) } } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -835,7 +837,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR + H5PLsize(&ndx); + if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); /* Prepend one path*/ @@ -846,7 +849,8 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR @@ -880,7 +884,8 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR @@ -909,7 +914,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if(H5PLsize() != 15) TEST_ERROR + H5PLsize(&ndx); + if(ndx != 15) TEST_ERROR TESTING(" insert"); /* Insert one path*/ @@ -928,7 +934,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(&ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ -- cgit v0.12 From 073f13ed5fc0190d3ffd4561bbde71c531f08ec8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 16:17:29 -0500 Subject: Change position of declaration to top of block --- src/H5Dchunk.c | 851 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 426 insertions(+), 425 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index f024be3..6e5cb17 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -13,53 +13,53 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol - * Thursday, April 24, 2008 - * - * Purpose: Abstract indexed (chunked) I/O functions. The logical - * multi-dimensional data space is regularly partitioned into - * same-sized "chunks", the first of which is aligned with the - * logical origin. The chunks are indexed by different methods, - * that map a chunk index to disk address. Each chunk can be +/* Programmer: Quincey Koziol + * Thursday, April 24, 2008 + * + * Purpose: Abstract indexed (chunked) I/O functions. The logical + * multi-dimensional data space is regularly partitioned into + * same-sized "chunks", the first of which is aligned with the + * logical origin. The chunks are indexed by different methods, + * that map a chunk index to disk address. Each chunk can be * compressed independently and the chunks may move around in the * file as their storage requirements change. * - * Cache: Disk I/O is performed in units of chunks and H5MF_alloc() - * contains code to optionally align chunks on disk block - * boundaries for performance. - * - * The chunk cache is an extendible hash indexed by a function - * of storage B-tree address and chunk N-dimensional offset - * within the dataset. Collisions are not resolved -- one of - * the two chunks competing for the hash slot must be preempted - * from the cache. All entries in the hash also participate in - * a doubly-linked list and entries are penalized by moving them - * toward the front of the list. When a new chunk is about to - * be added to the cache the heap is pruned by preempting - * entries near the front of the list to make room for the new - * entry which is added to the end of the list. + * Cache: Disk I/O is performed in units of chunks and H5MF_alloc() + * contains code to optionally align chunks on disk block + * boundaries for performance. + * + * The chunk cache is an extendible hash indexed by a function + * of storage B-tree address and chunk N-dimensional offset + * within the dataset. Collisions are not resolved -- one of + * the two chunks competing for the hash slot must be preempted + * from the cache. All entries in the hash also participate in + * a doubly-linked list and entries are penalized by moving them + * toward the front of the list. When a new chunk is about to + * be added to the cache the heap is pruned by preempting + * entries near the front of the list to make room for the new + * entry which is added to the end of the list. */ /****************/ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #ifdef H5_HAVE_PARALLEL -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #endif /* H5_HAVE_PARALLEL */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -73,26 +73,26 @@ /* * Feature: If this constant is defined then every cache preemption and load - * causes a character to be printed on the standard error stream: + * causes a character to be printed on the standard error stream: * * `.': Entry was preempted because it has been completely read or - * completely written but not partially read and not partially - * written. This is often a good reason for preemption because such - * a chunk will be unlikely to be referenced in the near future. + * completely written but not partially read and not partially + * written. This is often a good reason for preemption because such + * a chunk will be unlikely to be referenced in the near future. * * `:': Entry was preempted because it hasn't been used recently. * * `#': Entry was preempted because another chunk collided with it. This - * is usually a relatively bad thing. If there are too many of - * these then the number of entries in the cache can be increased. + * is usually a relatively bad thing. If there are too many of + * these then the number of entries in the cache can be increased. * * c: Entry was preempted because the file is closing. * - * w: A chunk read operation was eliminated because the library is - * about to write new values to the entire chunk. This is a good - * thing, especially on files where the chunk size is the same as - * the disk block size, chunks are aligned on disk block boundaries, - * and the operating system can also eliminate a read operation. + * w: A chunk read operation was eliminated because the library is + * about to write new values to the entire chunk. This is a good + * thing, especially on files where the chunk size is the same as + * the disk block size, chunks are aligned on disk block boundaries, + * and the operating system can also eliminate a read operation. */ /*#define H5D_CHUNK_DEBUG */ @@ -107,7 +107,7 @@ typedef struct H5D_chunk_it_ud1_t { H5D_chunk_common_ud_t common; /* Common info for B-tree user data (must be first) */ const H5D_chk_idx_info_t *idx_info; /* Chunked index info */ const H5D_io_info_t *io_info; /* I/O info for dataset operation */ - const hsize_t *space_dim; /* New dataset dimensions */ + const hsize_t *space_dim; /* New dataset dimensions */ const hbool_t *shrunk_dim; /* Dimensions which have been shrunk */ H5S_t *chunk_space; /* Dataspace for a chunk */ uint32_t elmts_per_chunk;/* Elements in chunk */ @@ -156,7 +156,7 @@ typedef struct H5D_chunk_it_ud3_t { /* Callback info for iteration to dump index */ typedef struct H5D_chunk_it_ud4_t { - FILE *stream; /* Output stream */ + FILE *stream; /* Output stream */ hbool_t header_displayed; /* Node's header is displayed? */ unsigned ndims; /* Number of dimensions for chunk/dataset */ } H5D_chunk_it_ud4_t; @@ -304,13 +304,13 @@ H5FL_BLK_DEFINE_STATIC(chunk); /*------------------------------------------------------------------------- - * Function: H5D__chunk_direct_write + * Function: H5D__chunk_direct_write * - * Purpose: Internal routine to write a chunk directly into the file. + * Purpose: Internal routine to write a chunk directly into the file. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 July 2012 * *------------------------------------------------------------------------- @@ -324,7 +324,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz hsize_t chunk_idx; /* Index of chunk cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value = SUCCEED; /* Return value */ @@ -496,7 +496,7 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, /* Read the chunk data into the supplied buffer */ if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.addr, udata.nbytes, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - + /* Return the filter mask */ *filters = udata.filter_mask; @@ -542,7 +542,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* Retrieve the dataset dimensions */ space_ndims = dset->shared->layout.u.chunk.ndims - 1; - + if(H5D__chunk_is_space_alloc(&(layout->storage)) == FALSE) HGOTO_DONE(SUCCEED) @@ -572,10 +572,11 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h if( dset->shared->dcpl_cache.pline.nused > 0 ) { /* Check if the requested chunk exists in the chunk cache */ if(UINT_MAX != udata.idx_hint) { + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + /* Sanity checks */ HDassert(udata.idx_hint < rdcc->nslots); HDassert(rdcc->slot[udata.idx_hint]); - H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; flush = (ent->dirty == TRUE) ? TRUE : FALSE; @@ -594,7 +595,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* Get the new file address / chunk size after flushing */ if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") } /* Make sure the address of the chunk is returned. */ @@ -615,13 +616,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_set_info_real + * Function: H5D__chunk_set_info_real * - * Purpose: Internal routine to set the information about chunks for a dataset + * Purpose: Internal routine to set the information about chunks for a dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * *------------------------------------------------------------------------- @@ -642,10 +643,10 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize /* Compute the # of chunks in dataset dimensions */ for(u = 0, layout->nchunks = 1; u < ndims; u++) { /* Round up to the next integer # of chunks, to accomodate partial chunks */ - layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; + layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; /* Accumulate the # of chunks */ - layout->nchunks *= layout->chunks[u]; + layout->nchunks *= layout->chunks[u]; } /* end for */ /* Get the "down" sizes for each dimension */ @@ -658,13 +659,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_set_info + * Function: H5D__chunk_set_info * - * Purpose: Sets the information about chunks for a dataset + * Purpose: Sets the information about chunks for a dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * *------------------------------------------------------------------------- @@ -684,12 +685,12 @@ H5D__chunk_set_info(const H5D_t *dset) /* Get the dim info for dataset */ if((sndims = H5S_get_simple_extent_dims(dset->shared->space, curr_dims, NULL)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") H5_CHECKED_ASSIGN(ndims, unsigned, sndims, int); /* Set the base layout information */ if(H5D__chunk_set_info_real(&dset->shared->layout.u.chunk, ndims, curr_dims) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") /* Call the index's "resize" callback */ if(dset->shared->layout.storage.u.chunk.ops->resize && (dset->shared->layout.storage.u.chunk.ops->resize)(&dset->shared->layout.u.chunk) < 0) @@ -701,13 +702,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_construct + * Function: H5D__chunk_construct * - * Purpose: Constructs new chunked layout information for dataset + * Purpose: Constructs new chunked layout information for dataset * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 22, 2008 * *------------------------------------------------------------------------- @@ -792,14 +793,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_init + * Function: H5D__chunk_init * - * Purpose: Initialize the raw data chunk cache for a dataset. This is - * called when the dataset is initialized. + * Purpose: Initialize the raw data chunk cache for a dataset. This is + * called when the dataset is initialized. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, May 18, 1998 * *------------------------------------------------------------------------- @@ -808,7 +809,7 @@ herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ H5P_genplist_t *dapl; /* Data access property list object pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -858,7 +859,7 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) /* Allocate any indexing structures */ if(dset->shared->layout.storage.u.chunk.ops->init && (dset->shared->layout.storage.u.chunk.ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") /* Set the number of chunks in dataset, etc. */ if(H5D__chunk_set_info(dset) < 0) @@ -870,13 +871,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_is_space_alloc + * Function: H5D__chunk_is_space_alloc * - * Purpose: Query if space is allocated for layout + * Purpose: Query if space is allocated for layout * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 15, 2009 * *------------------------------------------------------------------------- @@ -899,13 +900,13 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__chunk_io_init + * Function: H5D__chunk_io_init * - * Purpose: Performs initialization before any sort of I/O on the raw data + * Purpose: Performs initialization before any sort of I/O on the raw data * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 20, 2008 * *------------------------------------------------------------------------- @@ -928,7 +929,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf H5S_sel_type fsel_type; /* Selection type on disk */ char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1138,7 +1139,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid") if(H5S_select_iter_init(&(fm->mem_iter), mem_space, elmt_size) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") - iter_init = TRUE; /* Selection iteration info has been initialized */ + iter_init = TRUE; /* Selection iteration info has been initialized */ iter_op.op_type = H5S_SEL_ITER_OP_LIB; iter_op.u.lib_op = H5D__chunk_mem_cb; @@ -1200,15 +1201,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_alloc + * Function: H5D__chunk_alloc * - * Purpose: Allocate space for a chunk in memory. This routine allocates + * Purpose: Allocate space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list * and uses malloc()/free() for filtered chunks. * - * Return: Pointer to memory for chunk on success/NULL on failure + * Return: Pointer to memory for chunk on success/NULL on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2004 * *------------------------------------------------------------------------- @@ -1216,7 +1217,7 @@ done: static void * H5D__chunk_alloc(size_t size, const H5O_pline_t *pline) { - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1233,15 +1234,15 @@ H5D__chunk_alloc(size_t size, const H5O_pline_t *pline) /*------------------------------------------------------------------------- - * Function: H5D__chunk_xfree + * Function: H5D__chunk_xfree * - * Purpose: Free space for a chunk in memory. This routine allocates + * Purpose: Free space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list * and uses malloc()/free() for filtered chunks. * - * Return: NULL (never fails) + * Return: NULL (never fails) * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2004 * *------------------------------------------------------------------------- @@ -1341,14 +1342,14 @@ H5D__free_chunk_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_map_single + * Function: H5D__create_chunk_map_single * - * Purpose: Create chunk selections when appending a single record + * Purpose: Create chunk selections when appending a single record * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, November 20, 2007 + * Programmer: Quincey Koziol + * Tuesday, November 20, 2007 * *------------------------------------------------------------------------- */ @@ -1363,7 +1364,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1422,14 +1423,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_file_map_hyper + * Function: H5D__create_chunk_file_map_hyper * - * Purpose: Create all chunk selections in file. + * Purpose: Create all chunk selections in file. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, May 29, 2003 + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 * *------------------------------------------------------------------------- */ @@ -1449,7 +1450,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t chunk_index; /* Index of chunk */ int curr_dim; /* Current dimension to increment */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1599,16 +1600,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__create_chunk_mem_map_hyper + * Function: H5D__create_chunk_mem_map_hyper * - * Purpose: Create all chunk selections in memory by copying the file + * Purpose: Create all chunk selections in memory by copying the file * chunk selections and adjusting their offsets to be correct * for the memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, May 29, 2003 + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 * * Assumptions: That the file and memory selections are the same shape. * @@ -1625,7 +1626,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) hssize_t adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to all file chunks */ hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1711,15 +1712,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_file_cb + * Function: H5D__chunk_file_cb * - * Purpose: Callback routine for file selection iterator. Used when + * Purpose: Callback routine for file selection iterator. Used when * creating selections in file for each point selected. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, July 23, 2003 + * Programmer: Quincey Koziol + * Wednesday, July 23, 2003 * *------------------------------------------------------------------------- */ @@ -1732,7 +1733,7 @@ H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ hsize_t chunk_index; /* Chunk index */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1830,15 +1831,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_mem_cb + * Function: H5D__chunk_mem_cb * - * Purpose: Callback routine for file selection iterator. Used when + * Purpose: Callback routine for file selection iterator. Used when * creating selections in memory for each chunk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -1850,7 +1851,7 @@ H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */ hsize_t chunk_index; /* Chunk index */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1909,15 +1910,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_cacheable + * Function: H5D__chunk_cacheable * - * Purpose: A small internal function to if it's possible to load the + * Purpose: A small internal function to if it's possible to load the * chunk into cache. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Raymond Lu - * 17 July 2007 + * Programmer: Raymond Lu + * 17 July 2007 * *------------------------------------------------------------------------- */ @@ -1984,14 +1985,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_read + * Function: H5D__chunk_read * - * Purpose: Read from a chunked dataset. + * Purpose: Read from a chunked dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -2009,7 +2010,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t src_accessed_bytes = 0; /* Total accessed size in a chunk */ hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -2063,7 +2064,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_info_t *chunk_info; /* Chunk information */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ void *chunk; /* Pointer to locked chunk buffer */ - H5D_chunk_ud_t udata; /* B-tree pass-through */ + H5D_chunk_ud_t udata; /* B-tree pass-through */ htri_t cacheable; /* Whether the chunk is cacheable */ /* Get the actual chunk information from the skip list node */ @@ -2136,14 +2137,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_write + * Function: H5D__chunk_write * - * Purpose: Writes to a chunked dataset. + * Purpose: Writes to a chunked dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Raymond Lu + * Thursday, April 10, 2003 * *------------------------------------------------------------------------- */ @@ -2159,7 +2160,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2191,7 +2192,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_info_t *chunk_info; /* Chunk information */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ void *chunk; /* Pointer to locked chunk buffer */ - H5D_chunk_ud_t udata; /* Index pass-through */ + H5D_chunk_ud_t udata; /* Index pass-through */ htri_t cacheable; /* Whether the chunk is cacheable */ /* Get the actual chunk information from the skip list node */ @@ -2285,14 +2286,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_flush + * Function: H5D__chunk_flush * - * Purpose: Writes all dirty chunks to disk and optionally preempts them - * from the cache. + * Purpose: Writes all dirty chunks to disk and optionally preempts them + * from the cache. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -2303,8 +2304,8 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - H5D_rdcc_ent_t *ent, *next; - unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ + H5D_rdcc_ent_t *ent, *next; + unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2322,12 +2323,12 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; + next = ent->next; if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2335,21 +2336,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_io_term + * Function: H5D__chunk_io_term * - * Purpose: Destroy I/O operation information. + * Purpose: Destroy I/O operation information. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Saturday, May 17, 2003 + * Programmer: Quincey Koziol + * Saturday, May 17, 2003 * *------------------------------------------------------------------------- */ static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -2386,13 +2387,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_idx_reset + * Function: H5D_chunk_idx_reset * - * Purpose: Reset index information + * Purpose: Reset index information * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 15, 2009 * *------------------------------------------------------------------------- @@ -2410,7 +2411,7 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index structures */ if((storage->ops->reset)(storage, reset_addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2418,13 +2419,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_reset + * Function: H5D__chunk_cinfo_cache_reset * - * Purpose: Reset the cached chunk info + * Purpose: Reset the cached chunk info * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -2445,13 +2446,13 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_update + * Function: H5D__chunk_cinfo_cache_update * - * Purpose: Update the cached chunk info + * Purpose: Update the cached chunk info * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -2482,13 +2483,13 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud /*------------------------------------------------------------------------- - * Function: H5D__chunk_cinfo_cache_found + * Function: H5D__chunk_cinfo_cache_found * - * Purpose: Look for chunk info in cache + * Purpose: Look for chunk info in cache * - * Return: TRUE/FALSE/FAIL + * Return: TRUE/FALSE/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * November 27, 2007 * *------------------------------------------------------------------------- @@ -2531,17 +2532,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_create + * Function: H5D__chunk_create * - * Purpose: Creates a new chunked storage index and initializes the - * layout information with information about the storage. The - * layout info should be immediately written to the object header. + * Purpose: Creates a new chunked storage index and initializes the + * layout information with information about the storage. The + * layout info should be immediately written to the object header. * - * Return: Non-negative on success (with the layout information initialized - * and ready to write to an object header). Negative on failure. + * Return: Non-negative on success (with the layout information initialized + * and ready to write to an object header). Negative on failure. * - * Programmer: Quincey Koziol - * Thursday, May 22, 2008 + * Programmer: Quincey Koziol + * Thursday, May 22, 2008 * *------------------------------------------------------------------------- */ @@ -2562,7 +2563,7 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) unsigned u; /* Local index variable */ for(u = 0; u < dset->shared->layout.u.chunk.ndims; u++) - HDassert(dset->shared->layout.u.chunk.dim[u] > 0); + HDassert(dset->shared->layout.u.chunk.dim[u] > 0); } #endif @@ -2575,7 +2576,7 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) /* Create the index for the chunks */ if((dset->shared->layout.storage.u.chunk.ops->create)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2583,14 +2584,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_lookup + * Function: H5D__chunk_lookup * - * Purpose: Loops up a chunk in cache and on disk, and retrieves + * Purpose: Loops up a chunk in cache and on disk, and retrieves * information about that chunk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * June 27, 1998 * *------------------------------------------------------------------------- @@ -2602,7 +2603,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ hbool_t found = FALSE; /* In cache? */ unsigned u; /* Counter */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2669,16 +2670,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_flush_entry + * Function: H5D__chunk_flush_entry * - * Purpose: Writes a chunk to disk. If RESET is non-zero then the - * entry is cleared -- it's slightly faster to flush a chunk if - * the RESET flag is turned on because it results in one fewer - * memory copy. + * Purpose: Writes a chunk to disk. If RESET is non-zero then the + * entry is cleared -- it's slightly faster to flush a chunk if + * the RESET flag is turned on because it results in one fewer + * memory copy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -2687,9 +2688,9 @@ static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset) { - void *buf = NULL; /* Temporary buffer */ - hbool_t point_of_no_return = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + void *buf = NULL; /* Temporary buffer */ + hbool_t point_of_no_return = FALSE; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2701,7 +2702,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t buf = ent->chunk; if(ent->dirty && !ent->deleted) { - H5D_chunk_ud_t udata; /* pass through B-tree */ + H5D_chunk_ud_t udata; /* pass through B-tree */ hbool_t must_insert = FALSE; /* Whether the chunk must go through the "insert" method */ /* Set up user data for index callbacks */ @@ -2715,7 +2716,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Should the chunk be filtered before writing it to disk? */ if(dset->shared->dcpl_cache.pline.nused) { - size_t alloc = udata.nbytes; /* Bytes allocated for BUF */ + size_t alloc = udata.nbytes; /* Bytes allocated for BUF */ size_t nbytes; /* Chunk size (in bytes) */ if(!reset) { @@ -2889,15 +2890,15 @@ H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /*------------------------------------------------------------------------- - * Function: H5D__chunk_cache_prune + * Function: H5D__chunk_cache_prune * - * Purpose: Prune the cache by preempting some things until the cache has - * room for something which is SIZE bytes. Only unlocked - * entries are considered for preemption. + * Purpose: Prune the cache by preempting some things until the cache has + * room for something which is SIZE bytes. Only unlocked + * entries are considered for preemption. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -2906,13 +2907,13 @@ static herr_t H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, size_t size) { - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - size_t total = rdcc->nbytes_max; - const int nmeth = 2; /*number of methods */ - int w[1]; /*weighting as an interval */ - H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ - H5D_rdcc_ent_t *n[2]; /*list next pointers */ - int nerrors = 0; /* Accumulated error count during preemptions */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + size_t total = rdcc->nbytes_max; + const int nmeth = 2; /*number of methods */ + int w[1]; /*weighting as an interval */ + H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ + H5D_rdcc_ent_t *n[2]; /*list next pointers */ + int nerrors = 0; /* Accumulated error count during preemptions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2934,62 +2935,62 @@ H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) { int i; /* Local index variable */ - /* Introduce new pointers */ - for(i = 0; i < nmeth - 1; i++) + /* Introduce new pointers */ + for(i = 0; i < nmeth - 1; i++) if(0 == w[i]) p[i + 1] = rdcc->head; - /* Compute next value for each pointer */ - for(i = 0; i < nmeth; i++) + /* Compute next value for each pointer */ + for(i = 0; i < nmeth; i++) n[i] = p[i] ? p[i]->next : NULL; - /* Give each method a chance */ - for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { - if(0 == i && p[0] && !p[0]->locked && + /* Give each method a chance */ + for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { + if(0 == i && p[0] && !p[0]->locked && ((0 == p[0]->rd_count && 0 == p[0]->wr_count) || (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { - /* - * Method 0: Preempt entries that have been completely written - * and/or completely read but not entries that are partially - * written or partially read. - */ - cur = p[0]; - } else if(1 == i && p[1] && !p[1]->locked) { - /* - * Method 1: Preempt the entry without regard to - * considerations other than being locked. This is the last - * resort preemption. - */ - cur = p[1]; - } else { - /* Nothing to preempt at this point */ - cur = NULL; - } - - if(cur) { + /* + * Method 0: Preempt entries that have been completely written + * and/or completely read but not entries that are partially + * written or partially read. + */ + cur = p[0]; + } else if(1 == i && p[1] && !p[1]->locked) { + /* + * Method 1: Preempt the entry without regard to + * considerations other than being locked. This is the last + * resort preemption. + */ + cur = p[1]; + } else { + /* Nothing to preempt at this point */ + cur = NULL; + } + + if(cur) { int j; /* Local index variable */ - for(j = 0; j < nmeth; j++) { - if(p[j] == cur) + for(j = 0; j < nmeth; j++) { + if(p[j] == cur) p[j] = NULL; - if(n[j] == cur) + if(n[j] == cur) n[j] = cur->next; - } /* end for */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) + } /* end for */ + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) nerrors++; - } /* end if */ - } /* end for */ + } /* end if */ + } /* end for */ - /* Advance pointers */ - for(i = 0; i < nmeth; i++) + /* Advance pointers */ + for(i = 0; i < nmeth; i++) p[i] = n[i]; - for(i = 0; i < nmeth - 1; i++) + for(i = 0; i < nmeth - 1; i++) w[i] -= 1; } /* end while */ if(nerrors) - HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") + HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2997,28 +2998,28 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_lock + * Function: H5D__chunk_lock * - * Purpose: Return a pointer to a dataset chunk. The pointer points - * directly into the chunk cache and should not be freed - * by the caller but will be valid until it is unlocked. The - * input value IDX_HINT is used to speed up cache lookups and - * it's output value should be given to H5D__chunk_unlock(). - * IDX_HINT is ignored if it is out of range, and if it points - * to the wrong entry then we fall back to the normal search - * method. + * Purpose: Return a pointer to a dataset chunk. The pointer points + * directly into the chunk cache and should not be freed + * by the caller but will be valid until it is unlocked. The + * input value IDX_HINT is used to speed up cache lookups and + * it's output value should be given to H5D__chunk_unlock(). + * IDX_HINT is ignored if it is out of range, and if it points + * to the wrong entry then we fall back to the normal search + * method. * - * If RELAX is non-zero and the chunk isn't in the cache then - * don't try to read it from the file, but just allocate an - * uninitialized buffer to hold the result. This is intended - * for output functions that are about to overwrite the entire - * chunk. + * If RELAX is non-zero and the chunk isn't in the cache then + * don't try to read it from the file, but just allocate an + * uninitialized buffer to hold the result. This is intended + * for output functions that are about to overwrite the entire + * chunk. * - * Return: Success: Ptr to a file chunk. + * Return: Success: Ptr to a file chunk. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -3033,12 +3034,12 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/ - H5D_rdcc_ent_t *ent = NULL; /*cache entry */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/ + H5D_rdcc_ent_t *ent = NULL; /*cache entry */ haddr_t chunk_addr = HADDR_UNDEF; /* Address of chunk on disk */ - size_t chunk_size; /*size of a chunk */ - void *chunk = NULL; /*the file chunk */ - void *ret_value; /*return value */ + size_t chunk_size; /*size of a chunk */ + void *chunk = NULL; /*the file chunk */ + void *ret_value; /*return value */ FUNC_ENTER_PACKAGE @@ -3064,7 +3065,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, #ifndef NDEBUG { - unsigned u; /*counters */ + unsigned u; /*counters */ /* Make sure this is the right chunk */ for(u = 0; u < layout->u.chunk.ndims; u++) @@ -3107,7 +3108,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Check if the chunk exists on disk */ if(H5F_addr_defined(chunk_addr)) { - size_t chunk_alloc = 0; /*allocated chunk size */ + size_t chunk_alloc = 0; /*allocated chunk size */ /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ @@ -3128,7 +3129,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, rdcc->stats.nmisses++; } /* end if */ else { - H5D_fill_value_t fill_status; + H5D_fill_value_t fill_status; /* Sanity check */ HDassert(fill->alloc_time != H5D_ALLOC_TIME_EARLY); @@ -3275,23 +3276,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_unlock + * Function: H5D__chunk_unlock * - * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and - * OFFSET arguments should be the same as for H5D__chunk_lock(). - * The DIRTY argument should be set to non-zero if the chunk has - * been modified since it was locked. The IDX_HINT argument is - * the returned index hint from the lock operation and BUF is - * the return value from the lock. + * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and + * OFFSET arguments should be the same as for H5D__chunk_lock(). + * The DIRTY argument should be set to non-zero if the chunk has + * been modified since it was locked. The IDX_HINT argument is + * the returned index hint from the lock operation and BUF is + * the return value from the lock. * - * The NACCESSED argument should be the number of bytes accessed - * for reading or writing (depending on the value of DIRTY). - * It's only purpose is to provide additional information to the - * preemption policy. + * The NACCESSED argument should be the number of bytes accessed + * for reading or writing (depending on the value of DIRTY). + * It's only purpose is to provide additional information to the + * preemption policy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -3301,7 +3302,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */ - const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); + const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3314,7 +3315,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, * It's not in the cache, probably because it's too big. If it's * dirty then flush it to disk. In any case, free the chunk. * Note: we have to copy the layout and filter messages so we - * don't discard the `const' qualifier. + * don't discard the `const' qualifier. */ if(dirty) { H5D_rdcc_ent_t fake_ent; /* "fake" chunk cache entry */ @@ -3335,12 +3336,12 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, } /* end else */ } /* end if */ else { - H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ + H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ /* Sanity check */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); - HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); + HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); /* * It's in the cache so unlock it. @@ -3362,14 +3363,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocated_cb + * Function: H5D__chunk_allocated_cb * - * Purpose: Simply counts the number of chunks for a dataset. + * Purpose: Simply counts the number of chunks for a dataset. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- @@ -3389,15 +3390,15 @@ H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocated + * Function: H5D__chunk_allocated * - * Purpose: Return the number of bytes allocated in the file for storage - * of raw data in the chunked dataset + * Purpose: Return the number of bytes allocated in the file for storage + * of raw data in the chunked dataset * - * Return: Success: Number of bytes stored in all chunks. - * Failure: 0 + * Return: Success: Number of bytes stored in all chunks. + * Failure: 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 20, 2008 * *------------------------------------------------------------------------- @@ -3406,7 +3407,7 @@ herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ H5D_rdcc_ent_t *ent; /* Cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ @@ -3449,16 +3450,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_allocate + * Function: H5D__chunk_allocate * - * Purpose: Allocate file space for all chunks that are not allocated yet. - * Return SUCCEED if all needed allocation succeed, otherwise - * FAIL. + * Purpose: Allocate file space for all chunks that are not allocated yet. + * Return SUCCEED if all needed allocation succeed, otherwise + * FAIL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Albert Cheng - * June 26, 1998 + * Programmer: Albert Cheng + * June 26, 1998 * *------------------------------------------------------------------------- */ @@ -3470,8 +3471,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, const H5D_chunk_ops_t *ops = dset->shared->layout.storage.u.chunk.ops; /* Chunk operations */ hsize_t min_unalloc[H5O_LAYOUT_NDIMS]; /* First chunk in each dimension that is unallocated */ hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated */ - hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ - size_t orig_chunk_size; /* Original size of chunk in bytes */ + hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ + size_t orig_chunk_size; /* Original size of chunk in bytes */ size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */ unsigned filter_mask = 0; /* Filter mask for chunks that have them */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ @@ -3486,14 +3487,14 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ H5D_chunk_coll_info_t chunk_info; /* chunk address information for doing I/O */ #endif /* H5_HAVE_PARALLEL */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ int space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ int op_dim; /* Current operationg dimension */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3769,7 +3770,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, chunk_offset[i] = min_unalloc[i]; else chunk_offset[i] = 0; - } /* end if */ + } /* end if */ else { carry = FALSE; break; @@ -3815,16 +3816,16 @@ done: #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5D__chunk_collective_fill + * Function: H5D__chunk_collective_fill * * Purpose: Use MPIO collective write to fill the chunks (if number of * chunks to fill is greater than the number of MPI procs; * otherwise use independent I/O). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi - * July 30, 2014 + * Programmer: Mohamad Chaarawi + * July 30, 2014 * *------------------------------------------------------------------------- */ @@ -3832,7 +3833,7 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf) { - MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ + MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ int mpi_size = (-1); /* MPI Comm size */ int mpi_code; /* MPI return code */ @@ -3984,15 +3985,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_prune_fill + * Function: H5D__chunk_prune_fill * - * Purpose: Write the fill value to the parts of the chunk that are no + * Purpose: Write the fill value to the parts of the chunk that are no * longer part of the dataspace * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * March 26, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * March 26, 2002 * *------------------------------------------------------------------------- */ @@ -4008,7 +4009,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) hssize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ size_t chunk_size; /*size of a chunk */ - void *chunk; /* The file chunk */ + void *chunk; /* The file chunk */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ uint32_t bytes_accessed; /* Bytes accessed in chunk */ hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */ @@ -4106,16 +4107,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_prune_by_extent + * Function: H5D__chunk_prune_by_extent * - * Purpose: This function searches for chunks that are no longer necessary + * Purpose: This function searches for chunks that are no longer necessary * both in the raw data cache and in the chunk index. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Algorithm: Robb Matzke - * March 27, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Algorithm: Robb Matzke + * March 27, 2002 * * The algorithm is: * @@ -4220,8 +4221,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ int space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Current dataspace dimensions */ int op_dim; /* Current operationg dimension */ @@ -4236,7 +4237,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) hsize_t hyper_start[H5O_LAYOUT_NDIMS]; /* Starting location of hyperslab */ uint32_t elmts_per_chunk; /* Elements in chunk */ hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4253,7 +4254,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) /* Go get the rank & dimensions (including the element size) */ if((space_ndims = H5S_get_simple_extent_dims(dset->shared->space, space_dim, NULL)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") space_dim[space_ndims] = layout->u.chunk.dim[space_ndims]; /* The last dimension in chunk_offset is always 0 */ @@ -4275,13 +4276,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) elmts_per_chunk = 1; for(u = 0; u < (unsigned)space_ndims; u++) { elmts_per_chunk *= layout->u.chunk.dim[u]; - chunk_dim[u] = layout->u.chunk.dim[u]; - shrunk_dim[u] = space_dim[u] < old_dim[u]; + chunk_dim[u] = layout->u.chunk.dim[u]; + shrunk_dim[u] = space_dim[u] < old_dim[u]; } /* end for */ /* Create a dataspace for a chunk & set the extent */ if(NULL == (chunk_space = H5S_create_simple((unsigned)space_ndims, chunk_dim, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Reset hyperslab start array */ /* (hyperslabs will always start from origin) */ @@ -4397,7 +4398,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) } /* end if */ while(!carry) { - int i; /* Local index variable */ + int i; /* Local index variable */ /* Calculate the index of this chunk */ if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset, @@ -4511,14 +4512,14 @@ done: #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5D__chunk_addrmap_cb + * Function: H5D__chunk_addrmap_cb * * Purpose: Callback when obtaining the chunk addresses for all existing chunks * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Kent Yang + * Programmer: Kent Yang * Tuesday, November 15, 2005 * *------------------------------------------------------------------------- @@ -4526,7 +4527,7 @@ done: static int H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ + H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */ hsize_t chunk_index; int ret_value = H5_ITER_CONT; /* Return value */ @@ -4546,12 +4547,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_addrmap + * Function: H5D__chunk_addrmap * * Purpose: Obtain the chunk addresses for all existing chunks * - * Return: Success: Non-negative on succeed. - * Failure: negative value + * Return: Success: Non-negative on succeed. + * Failure: negative value * * Programmer: Kent Yang * November 15, 2005 @@ -4563,7 +4564,7 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ - H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ + H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4597,14 +4598,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_delete + * Function: H5D__chunk_delete * - * Purpose: Delete raw data storage for entire dataset (i.e. all chunks) + * Purpose: Delete raw data storage for entire dataset (i.e. all chunks) * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 20, 2003 * *------------------------------------------------------------------------- @@ -4617,7 +4618,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */ H5O_pline_t pline; /* I/O pipeline message */ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ - htri_t exists; /* Flag if header message of interest exists */ + htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4674,15 +4675,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_update_cache + * Function: H5D__chunk_update_cache * - * Purpose: Update any cached chunks index values after the dataspace + * Purpose: Update any cached chunks index values after the dataspace * size has changed * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, May 29, 2004 * *------------------------------------------------------------------------- @@ -4690,12 +4691,12 @@ done: herr_t H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) { - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - H5D_rdcc_ent_t *ent, *next; /*cache entry */ - H5D_rdcc_ent_t *old_ent; /* Old cache entry */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ + H5D_rdcc_ent_t *ent, *next; /*cache entry */ + H5D_rdcc_ent_t *old_ent; /* Old cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - unsigned rank; /* Current # of dimensions */ + unsigned rank; /* Current # of dimensions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4719,7 +4720,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) /* Recompute the index for each cached chunk that is in a dataset */ for(ent = rdcc->head; ent; ent = next) { hsize_t idx; /* Chunk index */ - unsigned old_idx; /* Previous index number */ + unsigned old_idx; /* Previous index number */ /* Get the pointer to the next cache entry */ next = ent->next; @@ -4916,8 +4917,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ H5_CHECKED_ASSIGN(udata_dst.nbytes, uint32_t, nbytes, size_t); - udata->buf = buf; - udata->buf_size = buf_size; + udata->buf = buf; + udata->buf_size = buf_size; } /* end if */ /* Insert chunk into the destination index */ @@ -4935,15 +4936,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_copy + * Function: H5D__chunk_copy * - * Purpose: Copy chunked storage from SRC file to DST file. + * Purpose: Copy chunked storage from SRC file to DST file. * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * * Programmer: Peter Cao - * August 20, 2005 + * August 20, 2005 * *------------------------------------------------------------------------- */ @@ -5229,7 +5230,7 @@ H5D__chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, /* Get size of index structure */ if((layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5237,16 +5238,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_dump_index_cb + * Function: H5D__chunk_dump_index_cb * - * Purpose: If the UDATA.STREAM member is non-null then debugging + * Purpose: If the UDATA.STREAM member is non-null then debugging * information is written to that stream. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- @@ -5255,7 +5256,7 @@ done: static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ + H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ FUNC_ENTER_STATIC_NOERR @@ -5283,15 +5284,15 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /*------------------------------------------------------------------------- - * Function: H5D__chunk_dump_index + * Function: H5D__chunk_dump_index * - * Purpose: Prints information about the storage index to the specified - * stream. + * Purpose: Prints information about the storage index to the specified + * stream. * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 28, 1999 * *------------------------------------------------------------------------- @@ -5338,14 +5339,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__chunk_dest + * Function: H5D__chunk_dest * - * Purpose: Destroy the entire chunk cache by flushing dirty entries, - * preempting all entries, and freeing the cache itself. + * Purpose: Destroy the entire chunk cache by flushing dirty entries, + * preempting all entries, and freeing the cache itself. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -5356,9 +5357,9 @@ H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ - H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ - int nerrors = 0; /* Accumulated count of errors */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ + H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ + int nerrors = 0; /* Accumulated count of errors */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5372,14 +5373,14 @@ H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) /* Flush all the cached chunks */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) - nerrors++; + next = ent->next; + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + nerrors++; } /* end for */ /* Continue even if there are failures. */ if(nerrors) - HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") /* Release cache structures */ if(rdcc->slot) @@ -5396,7 +5397,7 @@ H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) /* Free any index structures */ if(dset->shared->layout.storage.u.chunk.ops->dest && (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5405,15 +5406,15 @@ done: #ifdef H5D_CHUNK_DEBUG /*------------------------------------------------------------------------- - * Function: H5D__chunk_stats + * Function: H5D__chunk_stats * - * Purpose: Print raw data cache statistics to the debug stream. If - * HEADERS is non-zero then print table column headers, - * otherwise assume that the H5AC layer has already printed them. + * Purpose: Print raw data cache statistics to the debug stream. If + * HEADERS is non-zero then print table column headers, + * otherwise assume that the H5AC layer has already printed them. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 21, 1998 * *------------------------------------------------------------------------- @@ -5421,9 +5422,9 @@ done: herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers) { - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - double miss_rate; - char ascii[32]; + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + double miss_rate; + char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5468,20 +5469,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__nonexistent_readvv_cb + * Function: H5D__nonexistent_readvv_cb * - * Purpose: Callback operation for performing fill value I/O operation + * Purpose: Callback operation for performing fill value I/O operation * on memory buffer. * - * Note: This algorithm is pretty inefficient about initializing and + * Note: This algorithm is pretty inefficient about initializing and * terminating the fill buffer info structure and it would be * faster to refactor this into a "real" initialization routine, * and a "vectorized fill" routine. -QAK * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * 30 Sep 2010 + * Programmer: Quincey Koziol + * 30 Sep 2010 * *------------------------------------------------------------------------- */ @@ -5517,22 +5518,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__nonexistent_readvv + * Function: H5D__nonexistent_readvv * - * Purpose: When the chunk doesn't exist on disk and the chunk is bigger + * Purpose: When the chunk doesn't exist on disk and the chunk is bigger * than the cache size, performs fill value I/O operation on * memory buffer, advancing through two I/O vectors, until one * runs out. * - * Note: This algorithm is pretty inefficient about initializing and + * Note: This algorithm is pretty inefficient about initializing and * terminating the fill buffer info structure and it would be * faster to refactor this into a "real" initialization routine, * and a "vectorized fill" routine. -QAK * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * 6 Feb 2009 + * Programmer: Raymond Lu + * 6 Feb 2009 * *------------------------------------------------------------------------- */ -- cgit v0.12 From 7112b53b32445a067247fd802356002b182a7a02 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 11 May 2017 14:30:45 -0500 Subject: Windows does not know what a uint is Index value used in math operation with hsize_t --- hl/test/test_dset_opt.c | 176 ++++++++++++++++++++++++------------------------ 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 1e64a9c..27b74bd 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -20,7 +20,7 @@ #include "H5DOpublic.h" #include -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) @@ -54,10 +54,10 @@ #define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) /* Temporary filter IDs used for testing */ -#define H5Z_FILTER_BOGUS1 305 -#define H5Z_FILTER_BOGUS2 306 -#define ADD_ON 7 -#define FACTOR 3 +#define H5Z_FILTER_BOGUS1 305 +#define H5Z_FILTER_BOGUS2 306 +#define ADD_ON 7 +#define FACTOR 3 /* Local prototypes for filter functions */ static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts, @@ -68,33 +68,33 @@ static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS1, /* Filter id number */ + H5Z_FILTER_BOGUS1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus1", /* Filter name for debugging */ + "bogus1", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus1, /* The actual filter function */ + filter_bogus1, /* The actual filter function */ }}; const H5Z_class2_t H5Z_BOGUS2[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS2, /* Filter id number */ + H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus2", /* Filter name for debugging */ + "bogus2", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus2, /* The actual filter function */ + filter_bogus2, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: test_direct_chunk_write + * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -106,7 +106,7 @@ test_direct_chunk_write (hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; @@ -121,11 +121,11 @@ test_direct_chunk_write (hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst = NULL; /*destination buffer */ - uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); - uLong z_src_nbytes = (uLong)buf_size; + Bytef *z_dst = NULL; /*destination buffer */ + uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); + uLong z_src_nbytes = (uLong)buf_size; int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -160,29 +160,29 @@ test_direct_chunk_write (hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME1, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; /* Initialize the dataset */ for(i = n = 0; i < NX; i++) for(j = 0; j < NY; j++) - data[i][j] = n++; + data[i][j] = n++; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; /* * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5DOwrite_chunk calls. + * It will be evicted from the cache by the H5DOwrite_chunk calls. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - dxpl, data)) < 0) + dxpl, data)) < 0) goto error; /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -203,8 +203,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i Date: Thu, 11 May 2017 23:32:07 -0500 Subject: Fix for HDFFV-10051 Fix for issue #2 reported in HDFFV-10051: The layout "dirty" flag for a compact dataset is not reset properly after flusing the data at dataset close. --Reset the "dirty" flag before flushing the message. Issue #1 reported in HDFFV-10051 is not a problem for 1.8. --- src/H5Dcompact.c | 6 ++-- src/H5Dpkg.h | 1 + src/H5Dtest.c | 41 ++++++++++++++++++++++ test/dsets.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+), 2 deletions(-) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 826daad..49c28a6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -373,9 +373,11 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") dset->shared->layout.storage.u.compact.dirty = FALSE; + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) { + dset->shared->layout.storage.u.compact.dirty = TRUE; + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } } /* end if */ done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 91cf5f3..13d7284 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -714,6 +714,7 @@ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, #ifdef H5D_TESTING H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); +H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); #endif /* H5D_TESTING */ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index eef3c91..2e62a75 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -144,6 +144,47 @@ done: /*-------------------------------------------------------------------------- NAME + H5D__layout_compact_dirty_test + PURPOSE + Determine the "dirty" flag of a compact layout for a dataset's layout information + USAGE + herr_t H5D__layout_compact_dirty_test(did, dirty) + hid_t did; IN: Dataset to query + hbool_t *dirty; OUT: Pointer to location to place "dirty" info + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Checks the "dirty" flag of a compact dataset. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) +{ + H5D_t *dset; /* Pointer to dataset to query */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") + + if(dirty) { + HDassert(dset->shared->layout.type == H5D_COMPACT); + *dirty = dset->shared->layout.storage.u.compact.dirty; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__layout_compact_dirty_test() */ + + +/*-------------------------------------------------------------------------- + NAME H5D__current_cache_size_test PURPOSE Determine current the size of the dataset's chunk cache diff --git a/test/dsets.c b/test/dsets.c index e523680..cff7204 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -9083,6 +9083,109 @@ error: return -1; } /* end test_gather_error() */ +/*------------------------------------------------------------------------- + * Function: test_compact_dirty + * + * Purpose: Verify that issue #2 reported in HDFFV-10051 is fixed: + * --the layout "dirty" flag for a compact dataset is not reset + * properly after flushing the data at dataset close. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Vailin Choi; April 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_compact_dirty(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hsize_t dims[1] = {10}; /* Dimension */ + int wbuf[10]; /* Data buffer */ + char filename[FILENAME_BUF_SIZE]; /* Filename */ + int i; /* Local index variable */ + hbool_t dirty; /* The dirty flag */ + + TESTING("compact dataset repeated open/close and dirty flag"); + + /* Create a file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Initialize data */ + for(i = 0; i < 10; i++) + wbuf[i] = i; + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Set compact layout */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) + TEST_ERROR + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create a compact dataset */ + if((did = H5Dcreate2(fid, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Open the dataset */ + if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Retrieve the "dirty" flag from the compact dataset layout */ + if(H5D__layout_compact_dirty_test(did, &dirty) < 0) + TEST_ERROR + + /* Verify that the "dirty" flag is false */ + if(dirty) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + TEST_ERROR + + /* Close the dataset creation property list */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Pclose(dcpl); + H5Dclose(did); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* test_compact_dirty() */ + /*------------------------------------------------------------------------- * Function: main @@ -9168,6 +9271,7 @@ main(void) nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_dirty(my_fapl) < 0 ? 1 : 0); nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); nerrors += (test_tconv(file) < 0 ? 1 : 0); nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); -- cgit v0.12 From 8501476da2ae370035de5421711345e4f4d645a7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 12 May 2017 17:39:24 -0400 Subject: Adds a new H5DO HL test that ensures chunk overwrites work properly. Part of HDFFV-10187. --- hl/test/test_dset_opt.c | 137 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 125 insertions(+), 12 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 27b74bd..e3e7569 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -36,14 +36,14 @@ #define DATASETNAME4 "data_conv" #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" -/* Datasets for Direct Read tests */ -#define DATASETNAME7 "disabled_chunk_cache" -#define DATASETNAME8 "read_w_valid_cache" -#define DATASETNAME9 "flush_chunk_cache" -#define DATASETNAME10 "unallocated_chunk" -#define DATASETNAME11 "unfiltered_data" - +#define DATASETNAME7 "overwrite_chunk" +/* Datasets for Direct Read tests */ +#define DATASETNAME8 "disabled_chunk_cache" +#define DATASETNAME9 "read_w_valid_cache" +#define DATASETNAME10 "flush_chunk_cache" +#define DATASETNAME11 "unallocated_chunk" +#define DATASETNAME12 "unfiltered_data" #define RANK 2 #define NX 16 @@ -59,6 +59,13 @@ #define ADD_ON 7 #define FACTOR 3 +/* Constants for the overwrite test */ +#define OVERWRITE_NDIMS 3 +#define OVERWRITE_CHUNK_NX 3 +#define OVERWRITE_CHUNK_2NX 6 +#define OVERWRITE_CHUNK_NY 2 +#define OVERWRITE_VALUE 42 + /* Local prototypes for filter functions */ static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -345,7 +352,112 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- - * Function: test_skip_compress_write1 + * Function: test_direct_chunk_overwrite_data + * + * Purpose: Test overwriting a chunk with new data. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Dana Robinson + * Spring 2017 + * + *------------------------------------------------------------------------- + */ +static int +test_direct_chunk_overwrite_data(hid_t fid) +{ + size_t buf_size = OVERWRITE_CHUNK_NX * OVERWRITE_CHUNK_NY * sizeof(int16_t); + int16_t data_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + int16_t overwrite_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + uint32_t filter_mask = 0; + hid_t tid = H5T_NATIVE_UINT16; + hid_t dcpl_id = -1; + hid_t sid = -1; + hid_t did = -1; + uint16_t fill_value = 0; + hsize_t dset_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t dset_max_dims[] = {H5S_UNLIMITED, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t chunk_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_NX}; + hsize_t offset[] = {0, 0, 0}; + hsize_t i, j; + int16_t n; + int16_t read_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_2NX]; + + TESTING("overwriting existing data with H5DOwrite_chunk"); + + /* Create the dataset's data space */ + if ((sid = H5Screate_simple(OVERWRITE_NDIMS, dset_dims, dset_max_dims)) < 0) + FAIL_STACK_ERROR + + /* Set chunk size and filll value */ + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + FAIL_STACK_ERROR + if (H5Pset_fill_value(dcpl_id, tid, &fill_value) < 0) + FAIL_STACK_ERROR + if (H5Pset_chunk(dcpl_id, OVERWRITE_NDIMS, chunk_dims) < 0) + FAIL_STACK_ERROR + + /* Create dataset */ + if ((did = H5Dcreate2(fid, DATASETNAME7, tid, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Initialize data buffers */ + n = 0; + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) { + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + data_buf[i][j] = n++; + overwrite_buf[i][j] = OVERWRITE_VALUE; + } + } + + /* Write chunk data using the direct write function. */ + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Write second chunk. */ + offset[2] = OVERWRITE_CHUNK_NX; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Overwrite first chunk. */ + offset[2] = 0; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, overwrite_buf) < 0) + FAIL_STACK_ERROR + + /* Read the data back out */ + if (H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) + FAIL_STACK_ERROR + + /* Ensure that the data are correct in chunk 1 */ + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + if (read_buf[i][j] != OVERWRITE_VALUE) + TEST_ERROR + } + + if (H5Pclose(dcpl_id) < 0) + FAIL_STACK_ERROR + if (H5Sclose(sid) < 0) + FAIL_STACK_ERROR + if (H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl_id); + H5Sclose(sid); + H5Dclose(did); + } H5E_END_TRY; + + return 1; +} /* end test_direct_chunk_overwrite_data() */ + +/*------------------------------------------------------------------------- + * Function: test_skip_compress_write1 * * Purpose: Test skipping compression filter when it is the only filter * for the dataset @@ -1299,7 +1411,7 @@ test_direct_chunk_read_no_cache (hid_t file) goto error; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset = H5Dcreate2(file, DATASETNAME7, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + if((dataset = H5Dcreate2(file, DATASETNAME8, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, dapl)) < 0) goto error; @@ -1465,7 +1577,7 @@ test_direct_chunk_read_cache (hid_t file, hbool_t flush) goto error; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset = H5Dcreate2(file, flush?DATASETNAME8:DATASETNAME9, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + if((dataset = H5Dcreate2(file, flush?DATASETNAME9:DATASETNAME10, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) goto error; @@ -1641,7 +1753,7 @@ test_read_unfiltered_dset(hid_t file) goto error; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset = H5Dcreate2(file, DATASETNAME11, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + if((dataset = H5Dcreate2(file, DATASETNAME12, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) goto error; @@ -1782,7 +1894,7 @@ test_read_unallocated_chunk (hid_t file) goto error; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset = H5Dcreate2(file, DATASETNAME10, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, + if((dataset = H5Dcreate2(file, DATASETNAME11, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) goto error; @@ -1880,6 +1992,7 @@ int main( void ) #ifdef H5_HAVE_FILTER_DEFLATE nerrors += test_direct_chunk_write(file_id); #endif /* H5_HAVE_FILTER_DEFLATE */ + nerrors += test_direct_chunk_overwrite_data(file_id); nerrors += test_skip_compress_write1(file_id); nerrors += test_skip_compress_write2(file_id); nerrors += test_data_conv(file_id); -- cgit v0.12 From 8b1a53896565cafca3795d139a37148f89bf928d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 13 May 2017 06:00:33 -0500 Subject: Add H5Lexists wrappers Description: Added wrappers H5Location::exists() for H5Lexists. Added new class LinkAccPropList to be used by H5Location::exists() Rearranged source files in Makefile.am Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- MANIFEST | 2 + c++/src/H5AbstractDs.cpp | 1 + c++/src/H5ArrayType.cpp | 1 + c++/src/H5AtomType.cpp | 1 + c++/src/H5Attribute.cpp | 1 + c++/src/H5CommonFG.cpp | 1 + c++/src/H5CompType.cpp | 1 + c++/src/H5Cpp.h | 1 + c++/src/H5DataSet.cpp | 1 + c++/src/H5DataType.cpp | 1 + c++/src/H5DcreatProp.cpp | 1 + c++/src/H5EnumType.cpp | 1 + c++/src/H5File.cpp | 1 + c++/src/H5FloatType.cpp | 1 + c++/src/H5Group.cpp | 1 + c++/src/H5IntType.cpp | 1 + c++/src/H5LaccProp.cpp | 151 +++++++++++++++++++++++++++++++++++++++++++++++ c++/src/H5LaccProp.h | 75 +++++++++++++++++++++++ c++/src/H5Library.cpp | 6 ++ c++/src/H5Location.cpp | 37 ++++++++++++ c++/src/H5Location.h | 4 ++ c++/src/H5Object.cpp | 1 + c++/src/H5PredType.cpp | 1 + c++/src/H5StrType.cpp | 1 + c++/src/H5VarLenType.cpp | 1 + c++/src/Makefile.am | 29 +++++---- c++/src/Makefile.in | 44 +++++++------- c++/test/tattr.cpp | 11 +++- c++/test/tlinks.cpp | 8 +-- 29 files changed, 348 insertions(+), 38 deletions(-) create mode 100644 c++/src/H5LaccProp.cpp create mode 100644 c++/src/H5LaccProp.h diff --git a/MANIFEST b/MANIFEST index 24e00a8..8436591 100644 --- a/MANIFEST +++ b/MANIFEST @@ -392,6 +392,8 @@ ./c++/src/H5IntType.h ./c++/src/H5Library.cpp ./c++/src/H5Library.h +./c++/src/H5LaccProp.cpp +./c++/src/H5LaccProp.h ./c++/src/H5Location.cpp ./c++/src/H5Location.h ./c++/src/H5Object.cpp diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 4763bf2..4536afb 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5Alltypes.h" diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 4dc0a74..018eed5 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 0e57676..c9c1b46 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 55ccfe7..353a15c 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -29,6 +29,7 @@ #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index d9a66e2..f1e45b8 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -25,6 +25,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5CommonFG.h" diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 96fabd4..aff89f2 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5Alltypes.h" diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index 4e82ee3..42f925a 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -22,6 +22,7 @@ #include "H5IdComponent.h" #include "H5DataSpace.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 75d45b4..7b449d8 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -25,6 +25,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5OcreatProp.h" diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 625feaf..84e59e8 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -24,6 +24,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DxferProp.h" diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 53a96d1..0cd9458 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 9403cb8..acfae4e 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -20,6 +20,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 768ac5e..4d7177a 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -28,6 +28,7 @@ #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5CommonFG.h" diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 9e64972..0a0bc1d 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 16a715c..a5d052c 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -26,6 +26,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index a9bb146..673bd7a 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp new file mode 100644 index 0000000..e457e83 --- /dev/null +++ b/c++/src/H5LaccProp.cpp @@ -0,0 +1,151 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "H5Include.h" +#include "H5Exception.h" +#include "H5IdComponent.h" +#include "H5PropList.h" +#include "H5LaccProp.h" + +namespace H5 { + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control +// the order of creation and deletion of the global constants. See Design Notes +// in "H5PredType.cpp" for information. + +// Initialize a pointer for the constant +LinkAccPropList* LinkAccPropList::DEFAULT_ = 0; + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList::getConstant +// Creates a LinkAccPropList object representing the HDF5 constant +// H5P_LINK_ACCESS, pointed to by LinkAccPropList::DEFAULT_ +// exception H5::PropListIException +// Description +// If LinkAccPropList::DEFAULT_ already points to an allocated +// object, throw a PropListIException. This scenario should not +// happen. +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +LinkAccPropList* LinkAccPropList::getConstant() +{ + // Tell the C library not to clean up, H5Library::termH5cpp will call + // H5close - more dependency if use H5Library::dontAtExit() + if (!IdComponent::H5dontAtexit_called) + { + (void) H5dont_atexit(); + IdComponent::H5dontAtexit_called = true; + } + + // If the constant pointer is not allocated, allocate it. Otherwise, + // throw because it shouldn't be. + if (DEFAULT_ == 0) + DEFAULT_ = new LinkAccPropList(H5P_LINK_ACCESS); + else + throw PropListIException("LinkAccPropList::getConstant", "LinkAccPropList::getConstant is being invoked on an allocated DEFAULT_"); + return(DEFAULT_); +} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList::deleteConstants +// Purpose: Deletes the constant object that LinkAccPropList::DEFAULT_ +// points to. +// exception H5::PropListIException +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +void LinkAccPropList::deleteConstants() +{ + if (DEFAULT_ != 0) + delete DEFAULT_; +} + +//-------------------------------------------------------------------------- +// Purpose: Constant for default property +//-------------------------------------------------------------------------- +const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +//-------------------------------------------------------------------------- +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: LinkAccPropList instance to copy +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList::setNumLinks +///\brief Set the number of soft or user-defined link traversals allowed +/// before the library assumes it has found a cycle and aborts the +/// traversal. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - March 1, 2017 +//-------------------------------------------------------------------------- +void LinkAccPropList::setNumLinks(size_t nlinks) const +{ + herr_t ret_value = H5Pset_nlinks(id, nlinks); + // Throw exception if H5Pset_nlinks returns failure + if (ret_value < 0) + { + throw PropListIException("setNumLinks", "H5Pset_nlinks failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList::getNumLinks +///\brief Gets the number of soft or user-defined links that can be +/// traversed before a failure occurs. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - March 1, 2017 +//-------------------------------------------------------------------------- +size_t LinkAccPropList::getNumLinks() const +{ + size_t nlinks = 0; + herr_t ret_value = H5Pget_nlinks(id, &nlinks); + // Throw exception if H5Pget_nlinks returns failure + if (ret_value < 0) + { + throw PropListIException("getNumLinks", "H5Pget_nlinks failed"); + } + return(nlinks); +} + +//-------------------------------------------------------------------------- +// Function: LinkAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - December, 2016 +//-------------------------------------------------------------------------- +LinkAccPropList::~LinkAccPropList() {} + +} // end namespace diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h new file mode 100644 index 0000000..f31c3fc --- /dev/null +++ b/c++/src/H5LaccProp.h @@ -0,0 +1,75 @@ +// C++ informative line for the emacs editor: -*- C++ -*- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Class LinkAccPropList represents the HDF5 file access property list and +// inherits from DataType. + +#ifndef __H5LinkAccPropList_H +#define __H5LinkAccPropList_H + +namespace H5 { + +/*! \class LinkAccPropList + \brief Class LinkAccPropList inherits from PropList and provides + wrappers for the HDF5 file access property list. + + Inheritance: PropList -> IdComponent +*/ +class H5_DLLCPP LinkAccPropList : public PropList { + public: + ///\brief Default file access property list. + static const LinkAccPropList& DEFAULT; + + // Creates a file access property list. + LinkAccPropList(); + + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("LinkAccPropList"); } + + // Copy constructor: creates a copy of a LinkAccPropList object. + LinkAccPropList(const LinkAccPropList& original); + + // Creates a copy of an existing file access property list + // using the property list id. + LinkAccPropList (const hid_t plist_id); + + // Sets the number of soft or user-defined links that can be + // traversed before a failure occurs. + void setNumLinks(size_t nlinks) const; + + // Gets the number of soft or user-defined link traversals allowed + size_t getNumLinks() const; + + // Noop destructor + virtual ~LinkAccPropList(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + // Deletes the global constant, should only be used by the library + static void deleteConstants(); + + private: + static LinkAccPropList* DEFAULT_; + + // Creates the global constant, should only be used by the library + static LinkAccPropList* getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +}; // end of LinkAccPropList +} // namespace H5 + +#endif // __H5LinkAccPropList_H diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index b25dc90..7adc508 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -26,6 +26,8 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LaccProp.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" @@ -185,6 +187,10 @@ void H5Library::initH5cpp() if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating PropList::deleteConstants failed"); + ret_value = std::atexit(LinkAccPropList::deleteConstants); + if (ret_value != 0) + throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed"); + ret_value = std::atexit(FileAccPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed"); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 60f9c3b..f10ad0d 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -20,6 +20,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" @@ -353,6 +354,42 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new } //-------------------------------------------------------------------------- +// Function: H5Location::nameExists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Nov, 2016 +// Modification +//-------------------------------------------------------------------------- +bool H5Location::nameExists(const char* name, const LinkAccPropList& lapl) const +{ + htri_t ret_value = H5Lexists(getId(), name, lapl.getId()); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Lexists returns a negative value + { + throw LocationException(inMemFunc("nameExists"), "H5Lexists failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::nameExists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Dec, 2016 +// Modification +//-------------------------------------------------------------------------- +bool H5Location::nameExists(const H5std_string& name, const LinkAccPropList& lapl) const +{ + return(nameExists(name.c_str(), lapl)); +} + +//-------------------------------------------------------------------------- // Function: H5Location::flush ///\brief Flushes all buffers associated with a location to disk. ///\param scope - IN: Specifies the scope of the flushing action, diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index edc2b53..11f8f87 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -57,6 +57,10 @@ class H5_DLLCPP H5Location : public IdComponent { // this location. virtual Attribute openAttribute(const unsigned int idx) const; + // Checks if a link of a given name exists in this location + bool nameExists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + bool nameExists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Flushes all buffers associated with this location to disk. void flush(H5F_scope_t scope) const; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 933e8ec..91d0f82 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -22,6 +22,7 @@ #include "H5PropList.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Attribute.h" #include "H5Object.h" diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 52334ef..109f221 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 4335ea7..e5355ff 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 32a5bd8..fc6d2ba 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -19,6 +19,7 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" +#include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" #include "H5DataType.h" diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index 6cd4768..f06b801 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -33,25 +33,28 @@ libhdf5_cpp_la_LDFLAGS= -version-info $(LT_CXX_VERS_INTERFACE):$(LT_CXX_VERS_REV bin_SCRIPTS=h5c++ # Source files for the library -libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp H5Library.cpp \ - H5Attribute.cpp H5Location.cpp H5Object.cpp H5PropList.cpp \ - H5FaccProp.cpp H5FcreatProp.cpp H5DcreatProp.cpp H5DxferProp.cpp \ - H5OcreatProp.cpp H5DataType.cpp H5DataSpace.cpp H5AbstractDs.cpp \ - H5AtomType.cpp H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ - H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp H5VarLenType.cpp \ - H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp +libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp \ + H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ + H5FaccProp.cpp H5FcreatProp.cpp H5LaccProp.cpp \ + H5DxferProp.cpp H5DcreatProp.cpp H5Location.cpp \ + H5AbstractDs.cpp H5Attribute.cpp H5Object.cpp \ + H5OcreatProp.cpp H5DataType.cpp H5AtomType.cpp \ + H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ + H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp \ + H5VarLenType.cpp H5CompType.cpp H5DataSet.cpp \ + H5CommonFG.cpp H5Group.cpp H5File.cpp # HDF5 C++ library depends on HDF5 Library. libhdf5_cpp_la_LIBADD=$(LIBHDF5) # Public headers include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h \ - H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ - H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ - H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ - H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5Library.h \ - H5Location.h H5Object.h H5PredType.h H5PropList.h H5StrType.h \ - H5CppDoc.h H5ArrayType.h H5VarLenType.h + H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ + H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ + H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ + H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5LaccProp.h \ + H5Library.h H5Location.h H5Object.h H5PredType.h H5PropList.h \ + H5StrType.h H5CppDoc.h H5ArrayType.h H5VarLenType.h # h5c++ and libhdf5.settings are generated during configure. Remove only when # distclean. diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 669a33d..cc6682e 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -152,13 +152,13 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_cpp_la_DEPENDENCIES = $(LIBHDF5) am_libhdf5_cpp_la_OBJECTS = H5Exception.lo H5IdComponent.lo \ - H5Library.lo H5Attribute.lo H5Location.lo H5Object.lo \ - H5PropList.lo H5FaccProp.lo H5FcreatProp.lo H5DcreatProp.lo \ - H5DxferProp.lo H5OcreatProp.lo H5DataType.lo H5DataSpace.lo \ - H5AbstractDs.lo H5AtomType.lo H5PredType.lo H5EnumType.lo \ - H5IntType.lo H5FloatType.lo H5StrType.lo H5ArrayType.lo \ - H5VarLenType.lo H5CompType.lo H5DataSet.lo H5CommonFG.lo \ - H5Group.lo H5File.lo + H5DataSpace.lo H5PropList.lo H5Library.lo H5FaccProp.lo \ + H5FcreatProp.lo H5LaccProp.lo H5DxferProp.lo H5DcreatProp.lo \ + H5Location.lo H5AbstractDs.lo H5Attribute.lo H5Object.lo \ + H5OcreatProp.lo H5DataType.lo H5AtomType.lo H5PredType.lo \ + H5EnumType.lo H5IntType.lo H5FloatType.lo H5StrType.lo \ + H5ArrayType.lo H5VarLenType.lo H5CompType.lo H5DataSet.lo \ + H5CommonFG.lo H5Group.lo H5File.lo libhdf5_cpp_la_OBJECTS = $(am_libhdf5_cpp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -712,13 +712,16 @@ libhdf5_cpp_la_LDFLAGS = -version-info $(LT_CXX_VERS_INTERFACE):$(LT_CXX_VERS_RE bin_SCRIPTS = h5c++ # Source files for the library -libhdf5_cpp_la_SOURCES = H5Exception.cpp H5IdComponent.cpp H5Library.cpp \ - H5Attribute.cpp H5Location.cpp H5Object.cpp H5PropList.cpp \ - H5FaccProp.cpp H5FcreatProp.cpp H5DcreatProp.cpp H5DxferProp.cpp \ - H5OcreatProp.cpp H5DataType.cpp H5DataSpace.cpp H5AbstractDs.cpp \ - H5AtomType.cpp H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ - H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp H5VarLenType.cpp \ - H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp +libhdf5_cpp_la_SOURCES = H5Exception.cpp H5IdComponent.cpp \ + H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ + H5FaccProp.cpp H5FcreatProp.cpp H5LaccProp.cpp \ + H5DxferProp.cpp H5DcreatProp.cpp H5Location.cpp \ + H5AbstractDs.cpp H5Attribute.cpp H5Object.cpp \ + H5OcreatProp.cpp H5DataType.cpp H5AtomType.cpp \ + H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ + H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp \ + H5VarLenType.cpp H5CompType.cpp H5DataSet.cpp \ + H5CommonFG.cpp H5Group.cpp H5File.cpp # HDF5 C++ library depends on HDF5 Library. @@ -726,12 +729,12 @@ libhdf5_cpp_la_LIBADD = $(LIBHDF5) # Public headers include_HEADERS = H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h \ - H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ - H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ - H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ - H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5Library.h \ - H5Location.h H5Object.h H5PredType.h H5PropList.h H5StrType.h \ - H5CppDoc.h H5ArrayType.h H5VarLenType.h + H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ + H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ + H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ + H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5LaccProp.h \ + H5Library.h H5Location.h H5Object.h H5PredType.h H5PropList.h \ + H5StrType.h H5CppDoc.h H5ArrayType.h H5VarLenType.h # h5c++ and libhdf5.settings are generated during configure. Remove only when @@ -896,6 +899,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Group.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5IdComponent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5IntType.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5LaccProp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Library.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Location.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Object.Plo@am__quote@ diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index bb33b2b..70c4003 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1561,11 +1561,20 @@ static void test_attr_exists() // Open a group. Group group = fid1.openGroup(GROUP1_NAME); - // Check for existence of attribute + // Check for existence of attribute, Group::attrExists attr_exists = group.attrExists(ATTR2_NAME); if (attr_exists == false) throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + // Open attribute + Attribute attr = group.openAttribute(ATTR2_NAME); + + // Test the existence of a name using attribute as location, + // Attribute::nameExists + bool name_exists = attr.nameExists(GROUP1_NAME); + if (name_exists == false) + throw InvalidActionException("Attribute::nameExists", "group GROUP1_NAME should exist but does not"); + PASSED(); } // end try block diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index bb1ea17..0786bb5 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -422,10 +422,10 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Verify link existence - if(H5Lexists(file.getId(), "dset1", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "dset1 doesn't exist"); - if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "grp1/soft doesn't exist"); + if(file.nameExists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "dset1 doesn't exist"); + if(file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "grp1/soft doesn't exist"); // Verify link values H5std_string softlink_val = file.getLinkval("grp1/soft"); -- cgit v0.12 From 04a50b421bee736c13ea69ac1007b46919cc847a Mon Sep 17 00:00:00 2001 From: hdftest Date: Mon, 15 May 2017 09:14:00 -0500 Subject: Snapshot 1.8.19-snap3 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- configure | 22 ++++---- configure.ac | 2 +- hl/src/H5LTparse.c | 144 +++++++++++++++++++++++------------------------ hl/src/H5LTparse.h | 4 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- 8 files changed, 91 insertions(+), 91 deletions(-) diff --git a/README.txt b/README.txt index e81dcee..6fbbf59 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap2 currently under development +HDF5 version 1.8.19-snap3 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index b059e5e..27e581b 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.19-snap2 currently under development" +PROJECT_NUMBER = "1.8.19-snap3 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/configure b/configure index 69a2b42..336d3cd 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap2. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap3. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.19-snap2' -PACKAGE_STRING='HDF5 1.8.19-snap2' +PACKAGE_VERSION='1.8.19-snap3' +PACKAGE_STRING='HDF5 1.8.19-snap3' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.8.19-snap2 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.19-snap3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.19-snap2:";; + short | recursive ) echo "Configuration of HDF5 1.8.19-snap3:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.19-snap2 +HDF5 configure 1.8.19-snap3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.8.19-snap2, which was +It was created by HDF5 $as_me 1.8.19-snap3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.19-snap2' + VERSION='1.8.19-snap3' cat >>confdefs.h <<_ACEOF @@ -29296,7 +29296,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.19-snap2 +HDF5 config.lt 1.8.19-snap3 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31331,7 +31331,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.19-snap2, which was +This file was extended by HDF5 $as_me 1.8.19-snap3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31397,7 +31397,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.19-snap2 +HDF5 config.status 1.8.19-snap3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f0a1bb3..efa4f13 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.19-snap2], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.19-snap3], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 36591d3..6ca95c54 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 1461830..621dacd 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index afab87c..d30106f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap2 currently under development +HDF5 version 1.8.19-snap3 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index b8919c9..ad4979a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -95,9 +95,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap2" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap3" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap2" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap3" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 4732761fe69bde35363f4041d2da13c3a1709663 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 15 May 2017 23:13:41 -0500 Subject: Added H5LaccProp.h/cpp to CMakeLists.txt --- c++/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 0a76d6f..579ef64 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -32,6 +32,7 @@ set (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5Group.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.cpp + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.cpp @@ -68,6 +69,7 @@ set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Include.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.h + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.h -- cgit v0.12 From 05a8519e8852e9efabe80af3b0002272e7dd0957 Mon Sep 17 00:00:00 2001 From: hdftest Date: Tue, 16 May 2017 08:41:01 -0500 Subject: Increment snap version. --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- configure | 22 ++++---- configure.ac | 2 +- hl/src/H5LTparse.c | 144 +++++++++++++++++++++++------------------------ hl/src/H5LTparse.h | 4 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- 8 files changed, 91 insertions(+), 91 deletions(-) diff --git a/README.txt b/README.txt index 6fbbf59..f209f77 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap3 currently under development +HDF5 version 1.8.19-snap4 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 27e581b..23e853c 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.19-snap3 currently under development" +PROJECT_NUMBER = "1.8.19-snap4 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/configure b/configure index 336d3cd..8fc3a8b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap3. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap4. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.19-snap3' -PACKAGE_STRING='HDF5 1.8.19-snap3' +PACKAGE_VERSION='1.8.19-snap4' +PACKAGE_STRING='HDF5 1.8.19-snap4' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.8.19-snap3 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.19-snap4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.19-snap3:";; + short | recursive ) echo "Configuration of HDF5 1.8.19-snap4:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.19-snap3 +HDF5 configure 1.8.19-snap4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.8.19-snap3, which was +It was created by HDF5 $as_me 1.8.19-snap4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.19-snap3' + VERSION='1.8.19-snap4' cat >>confdefs.h <<_ACEOF @@ -29296,7 +29296,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.19-snap3 +HDF5 config.lt 1.8.19-snap4 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31331,7 +31331,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.19-snap3, which was +This file was extended by HDF5 $as_me 1.8.19-snap4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31397,7 +31397,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.19-snap3 +HDF5 config.status 1.8.19-snap4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index efa4f13..7f34ad6c 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.19-snap3], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.19-snap4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 6ca95c54..36591d3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 102 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 157 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 168 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 214 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 236 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 248 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 252 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 285 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 292 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 319 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 320 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 326 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 621dacd..1461830 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 68 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d30106f..21e3362 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap3 currently under development +HDF5 version 1.8.19-snap4 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index ad4979a..98a925b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -95,9 +95,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap3" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap4" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap3" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap4" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 583952ed15819fc86897301774b91151129ad08e Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 16 May 2017 10:16:12 -0500 Subject: Change copyright headers to replace url referring to file to be removed and replace it with new url for COPYING file. --- .autom4te.cfg | 10 ++++------ .h5chkright.ini | 10 ++++------ MANIFEST | 10 ++++------ Makefile.am | 10 ++++------ Makefile.dist | 10 ++++------ Makefile.in | 10 ++++------ bin/bbrelease | 10 ++++------ bin/buildhdf5 | 10 ++++------ bin/checkapi | 10 ++++------ bin/checkposix | 10 ++++------ bin/chkcopyright | 10 ++++------ bin/chkmanifest | 10 ++++------ bin/debug-ohdr | 10 ++++------ bin/dependencies | 10 ++++------ bin/deploy | 10 ++++------ bin/distdep | 10 ++++------ bin/errors | 10 ++++------ bin/gcov_script | 10 ++++------ bin/genltanalyze | 10 ++++------ bin/h5vers | 10 ++++------ bin/iostats | 10 ++++------ bin/locate_sw | 10 ++++------ bin/make_err | 10 ++++------ bin/make_overflow | 10 ++++------ bin/make_vers | 10 ++++------ bin/mkdirs | 10 ++++------ bin/newer | 10 ++++------ bin/output_filter.sh | 10 ++++------ bin/pkgscrpts/h5rmflags | 10 ++++------ bin/release | 10 ++++------ bin/runtest | 10 ++++------ bin/snapshot | 10 ++++------ bin/snapshot_version | 10 ++++------ bin/timekeeper | 10 ++++------ bin/trace | 10 ++++------ c++/Makefile.am | 10 ++++------ c++/Makefile.in | 10 ++++------ c++/examples/Makefile.am | 10 ++++------ c++/examples/Makefile.in | 10 ++++------ c++/examples/chunks.cpp | 10 ++++------ c++/examples/compound.cpp | 10 ++++------ c++/examples/create.cpp | 10 ++++------ c++/examples/extend_ds.cpp | 10 ++++------ c++/examples/h5group.cpp | 10 ++++------ c++/examples/h5tutr_cmprss.cpp | 10 ++++------ c++/examples/h5tutr_crtatt.cpp | 10 ++++------ c++/examples/h5tutr_crtdat.cpp | 10 ++++------ c++/examples/h5tutr_crtgrp.cpp | 10 ++++------ c++/examples/h5tutr_crtgrpar.cpp | 10 ++++------ c++/examples/h5tutr_crtgrpd.cpp | 10 ++++------ c++/examples/h5tutr_extend.cpp | 10 ++++------ c++/examples/h5tutr_rdwt.cpp | 10 ++++------ c++/examples/h5tutr_subset.cpp | 10 ++++------ c++/examples/readdata.cpp | 10 ++++------ c++/examples/run-c++-ex.sh.in | 10 ++++------ c++/examples/testh5c++.sh.in | 10 ++++------ c++/examples/writedata.cpp | 10 ++++------ c++/src/H5AbstractDs.cpp | 10 ++++------ c++/src/H5AbstractDs.h | 10 ++++------ c++/src/H5Alltypes.h | 10 ++++------ c++/src/H5ArrayType.cpp | 10 ++++------ c++/src/H5ArrayType.h | 10 ++++------ c++/src/H5AtomType.cpp | 10 ++++------ c++/src/H5AtomType.h | 10 ++++------ c++/src/H5Attribute.cpp | 10 ++++------ c++/src/H5Attribute.h | 10 ++++------ c++/src/H5Classes.h | 10 ++++------ c++/src/H5CommonFG.cpp | 10 ++++------ c++/src/H5CommonFG.h | 10 ++++------ c++/src/H5CompType.cpp | 10 ++++------ c++/src/H5CompType.h | 10 ++++------ c++/src/H5Cpp.h | 10 ++++------ c++/src/H5CppDoc.h | 10 ++++------ c++/src/H5DataSet.cpp | 10 ++++------ c++/src/H5DataSet.h | 10 ++++------ c++/src/H5DataSpace.cpp | 10 ++++------ c++/src/H5DataSpace.h | 10 ++++------ c++/src/H5DataType.cpp | 10 ++++------ c++/src/H5DataType.h | 10 ++++------ c++/src/H5DcreatProp.cpp | 10 ++++------ c++/src/H5DcreatProp.h | 10 ++++------ c++/src/H5DxferProp.cpp | 10 ++++------ c++/src/H5DxferProp.h | 10 ++++------ c++/src/H5EnumType.cpp | 10 ++++------ c++/src/H5EnumType.h | 10 ++++------ c++/src/H5Exception.cpp | 10 ++++------ c++/src/H5Exception.h | 10 ++++------ c++/src/H5FaccProp.cpp | 10 ++++------ c++/src/H5FaccProp.h | 10 ++++------ c++/src/H5FcreatProp.cpp | 10 ++++------ c++/src/H5FcreatProp.h | 10 ++++------ c++/src/H5File.cpp | 10 ++++------ c++/src/H5File.h | 10 ++++------ c++/src/H5FloatType.cpp | 10 ++++------ c++/src/H5FloatType.h | 10 ++++------ c++/src/H5Group.cpp | 10 ++++------ c++/src/H5Group.h | 10 ++++------ c++/src/H5IdComponent.cpp | 10 ++++------ c++/src/H5IdComponent.h | 10 ++++------ c++/src/H5Include.h | 10 ++++------ c++/src/H5IntType.cpp | 10 ++++------ c++/src/H5IntType.h | 10 ++++------ c++/src/H5LaccProp.cpp | 10 ++++------ c++/src/H5LaccProp.h | 10 ++++------ c++/src/H5Library.cpp | 10 ++++------ c++/src/H5Library.h | 10 ++++------ c++/src/H5Location.cpp | 10 ++++------ c++/src/H5Location.h | 10 ++++------ c++/src/H5Object.cpp | 10 ++++------ c++/src/H5Object.h | 10 ++++------ c++/src/H5OcreatProp.cpp | 10 ++++------ c++/src/H5OcreatProp.h | 10 ++++------ c++/src/H5PredType.cpp | 10 ++++------ c++/src/H5PredType.h | 10 ++++------ c++/src/H5PropList.cpp | 10 ++++------ c++/src/H5PropList.h | 10 ++++------ c++/src/H5StrType.cpp | 10 ++++------ c++/src/H5StrType.h | 10 ++++------ c++/src/H5VarLenType.cpp | 10 ++++------ c++/src/H5VarLenType.h | 10 ++++------ c++/src/Makefile.am | 10 ++++------ c++/src/Makefile.in | 10 ++++------ c++/src/h5c++.in | 10 ++++------ c++/src/header.html | 10 ++++------ c++/test/H5srcdir_str.h.in | 10 ++++------ c++/test/Makefile.am | 10 ++++------ c++/test/Makefile.in | 10 ++++------ c++/test/dsets.cpp | 10 ++++------ c++/test/h5cpputil.cpp | 10 ++++------ c++/test/h5cpputil.h | 10 ++++------ c++/test/tarray.cpp | 10 ++++------ c++/test/tattr.cpp | 10 ++++------ c++/test/tcompound.cpp | 10 ++++------ c++/test/tdspl.cpp | 10 ++++------ c++/test/testhdf5.cpp | 10 ++++------ c++/test/tfile.cpp | 10 ++++------ c++/test/tfilter.cpp | 10 ++++------ c++/test/th5s.cpp | 10 ++++------ c++/test/tlinks.cpp | 10 ++++------ c++/test/tobject.cpp | 10 ++++------ c++/test/trefer.cpp | 10 ++++------ c++/test/ttypes.cpp | 10 ++++------ c++/test/tvlstr.cpp | 10 ++++------ config/BlankForm | 10 ++++------ config/Makefile.am.blank | 10 ++++------ config/apple | 10 ++++------ config/cce-fflags | 10 ++++------ config/cce-flags | 10 ++++------ config/commence.am | 10 ++++------ config/conclude.am | 10 ++++------ config/cygwin | 10 ++++------ config/examples.am | 10 ++++------ config/freebsd | 10 ++++------ config/gnu-fflags | 10 ++++------ config/gnu-flags | 10 ++++------ config/ibm-aix | 10 ++++------ config/ibm-flags | 10 ++++------ config/intel-fflags | 10 ++++------ config/intel-flags | 10 ++++------ config/linux-gnu | 10 ++++------ config/linux-gnuaout | 10 ++++------ config/linux-gnulibc1 | 10 ++++------ config/linux-gnulibc2 | 10 ++++------ config/lt_vers.am | 10 ++++------ config/pgi-fflags | 10 ++++------ config/pgi-flags | 10 ++++------ config/site-specific/BlankForm | 10 ++++------ config/solaris | 10 ++++------ examples/Makefile.am | 10 ++++------ examples/Makefile.in | 10 ++++------ examples/h5_attribute.c | 10 ++++------ examples/h5_chunk_read.c | 10 ++++------ examples/h5_cmprss.c | 10 ++++------ examples/h5_compound.c | 10 ++++------ examples/h5_crtatt.c | 10 ++++------ examples/h5_crtdat.c | 10 ++++------ examples/h5_crtgrp.c | 10 ++++------ examples/h5_crtgrpar.c | 10 ++++------ examples/h5_crtgrpd.c | 10 ++++------ examples/h5_drivers.c | 10 ++++------ examples/h5_dtransform.c | 10 ++++------ examples/h5_elink_unix2win.c | 10 ++++------ examples/h5_extend.c | 10 ++++------ examples/h5_extend_write.c | 10 ++++------ examples/h5_extlink.c | 10 ++++------ examples/h5_group.c | 10 ++++------ examples/h5_interm_group.c | 10 ++++------ examples/h5_mount.c | 10 ++++------ examples/h5_rdwt.c | 10 ++++------ examples/h5_read.c | 10 ++++------ examples/h5_ref2reg.c | 10 ++++------ examples/h5_reference.c | 10 ++++------ examples/h5_select.c | 10 ++++------ examples/h5_shared_mesg.c | 10 ++++------ examples/h5_subset.c | 10 ++++------ examples/h5_write.c | 10 ++++------ examples/ph5example.c | 10 ++++------ examples/run-all-ex.sh | 10 ++++------ examples/run-c-ex.sh.in | 10 ++++------ examples/testh5cc.sh.in | 10 ++++------ fortran/Makefile.am | 10 ++++------ fortran/Makefile.in | 10 ++++------ fortran/examples/Makefile.am | 10 ++++------ fortran/examples/Makefile.in | 10 ++++------ fortran/examples/compound.f90 | 10 ++++------ fortran/examples/compound_complex_fortran2003.f90 | 10 ++++------ fortran/examples/compound_fortran2003.f90 | 10 ++++------ fortran/examples/h5_cmprss.f90 | 10 ++++------ fortran/examples/h5_crtatt.f90 | 10 ++++------ fortran/examples/h5_crtdat.f90 | 10 ++++------ fortran/examples/h5_crtgrp.f90 | 10 ++++------ fortran/examples/h5_crtgrpar.f90 | 10 ++++------ fortran/examples/h5_crtgrpd.f90 | 10 ++++------ fortran/examples/h5_extend.f90 | 10 ++++------ fortran/examples/h5_rdwt.f90 | 10 ++++------ fortran/examples/h5_subset.f90 | 10 ++++------ fortran/examples/hyperslab.f90 | 10 ++++------ fortran/examples/mountexample.f90 | 10 ++++------ fortran/examples/nested_derived_type.f90 | 10 ++++------ fortran/examples/ph5example.f90 | 10 ++++------ fortran/examples/refobjexample.f90 | 10 ++++------ fortran/examples/refregexample.f90 | 10 ++++------ fortran/examples/run-fortran-ex.sh.in | 10 ++++------ fortran/examples/rwdset_fortran2003.f90 | 10 ++++------ fortran/examples/selectele.f90 | 10 ++++------ fortran/examples/testh5fc.sh.in | 10 ++++------ fortran/src/H5Af.c | 10 ++++------ fortran/src/H5Aff.f90 | 10 ++++------ fortran/src/H5Aff_F03.f90 | 10 ++++------ fortran/src/H5Aff_F90.f90 | 10 ++++------ fortran/src/H5Df.c | 10 ++++------ fortran/src/H5Dff.f90 | 10 ++++------ fortran/src/H5Dff_F03.f90 | 10 ++++------ fortran/src/H5Dff_F90.f90 | 10 ++++------ fortran/src/H5Ef.c | 10 ++++------ fortran/src/H5Eff.f90 | 10 ++++------ fortran/src/H5Eff_F03.f90 | 10 ++++------ fortran/src/H5Eff_F90.f90 | 10 ++++------ fortran/src/H5FDmpiof.c | 10 ++++------ fortran/src/H5FDmpioff.f90 | 10 ++++------ fortran/src/H5Ff.c | 10 ++++------ fortran/src/H5Fff.f90 | 10 ++++------ fortran/src/H5Fff_F03.f90 | 10 ++++------ fortran/src/H5Fff_F90.f90 | 10 ++++------ fortran/src/H5Gf.c | 10 ++++------ fortran/src/H5Gff.f90 | 10 ++++------ fortran/src/H5If.c | 10 ++++------ fortran/src/H5Iff.f90 | 10 ++++------ fortran/src/H5Lf.c | 10 ++++------ fortran/src/H5Lff.f90 | 10 ++++------ fortran/src/H5Lff_F03.f90 | 10 ++++------ fortran/src/H5Lff_F90.f90 | 10 ++++------ fortran/src/H5Of.c | 10 ++++------ fortran/src/H5Off.f90 | 10 ++++------ fortran/src/H5Off_F03.f90 | 10 ++++------ fortran/src/H5Off_F90.f90 | 10 ++++------ fortran/src/H5Pf.c | 10 ++++------ fortran/src/H5Pff.f90 | 10 ++++------ fortran/src/H5Pff_F03.f90 | 10 ++++------ fortran/src/H5Pff_F90.f90 | 10 ++++------ fortran/src/H5Rf.c | 10 ++++------ fortran/src/H5Rff.f90 | 10 ++++------ fortran/src/H5Rff_F03.f90 | 10 ++++------ fortran/src/H5Rff_F90.f90 | 10 ++++------ fortran/src/H5Sf.c | 10 ++++------ fortran/src/H5Sff.f90 | 10 ++++------ fortran/src/H5Tf.c | 10 ++++------ fortran/src/H5Tff.f90 | 10 ++++------ fortran/src/H5Tff_F03.f90 | 10 ++++------ fortran/src/H5Tff_F90.f90 | 10 ++++------ fortran/src/H5Zf.c | 10 ++++------ fortran/src/H5Zff.f90 | 10 ++++------ fortran/src/H5_DBLE_InterfaceExclude.f90 | 10 ++++------ fortran/src/H5_DBLE_InterfaceInclude.f90 | 10 ++++------ fortran/src/H5_f.c | 10 ++++------ fortran/src/H5_ff.f90 | 10 ++++------ fortran/src/H5_ff_F03.f90 | 10 ++++------ fortran/src/H5_ff_F90.f90 | 10 ++++------ fortran/src/H5f90.h | 10 ++++------ fortran/src/H5f90global.f90 | 10 ++++------ fortran/src/H5f90i.h | 10 ++++------ fortran/src/H5f90kit.c | 10 ++++------ fortran/src/H5f90proto.h | 10 ++++------ fortran/src/H5test_kind_SIZEOF.f90 | 10 ++++------ fortran/src/H5test_kind_STORAGE_SIZE.f90 | 10 ++++------ fortran/src/HDF5.f90 | 10 ++++------ fortran/src/HDF5mpio.f90 | 10 ++++------ fortran/src/Makefile.am | 10 ++++------ fortran/src/Makefile.in | 10 ++++------ fortran/src/h5fc.in | 10 ++++------ fortran/test/Makefile.am | 10 ++++------ fortran/test/Makefile.in | 10 ++++------ fortran/test/fflush1.f90 | 10 ++++------ fortran/test/fflush2.f90 | 10 ++++------ fortran/test/fortranlib_test.f90 | 10 ++++------ fortran/test/fortranlib_test_1_8.f90 | 10 ++++------ fortran/test/fortranlib_test_F03.f90 | 10 ++++------ fortran/test/t.c | 10 ++++------ fortran/test/t.h | 10 ++++------ fortran/test/tH5A.f90 | 10 ++++------ fortran/test/tH5A_1_8.f90 | 10 ++++------ fortran/test/tH5D.f90 | 10 ++++------ fortran/test/tH5E.f90 | 10 ++++------ fortran/test/tH5E_F03.f90 | 10 ++++------ fortran/test/tH5F.f90 | 10 ++++------ fortran/test/tH5F_F03.f90 | 10 ++++------ fortran/test/tH5G.f90 | 10 ++++------ fortran/test/tH5G_1_8.f90 | 10 ++++------ fortran/test/tH5I.f90 | 10 ++++------ fortran/test/tH5L_F03.f90 | 10 ++++------ fortran/test/tH5MISC_1_8.f90 | 10 ++++------ fortran/test/tH5O.f90 | 10 ++++------ fortran/test/tH5O_F03.f90 | 10 ++++------ fortran/test/tH5P.f90 | 10 ++++------ fortran/test/tH5P_F03.f90 | 10 ++++------ fortran/test/tH5R.f90 | 10 ++++------ fortran/test/tH5S.f90 | 10 ++++------ fortran/test/tH5Sselect.f90 | 10 ++++------ fortran/test/tH5T.f90 | 10 ++++------ fortran/test/tH5T_F03.f90 | 10 ++++------ fortran/test/tH5VL.f90 | 10 ++++------ fortran/test/tH5Z.f90 | 10 ++++------ fortran/test/tHDF5.f90 | 10 ++++------ fortran/test/tHDF5_1_8.f90 | 10 ++++------ fortran/test/tHDF5_F03.f90 | 10 ++++------ fortran/test/tf.f90 | 10 ++++------ fortran/test/tf_F03.f90 | 10 ++++------ fortran/test/tf_F08.f90 | 10 ++++------ fortran/test/tf_F90.f90 | 10 ++++------ fortran/testpar/Makefile.am | 10 ++++------ fortran/testpar/Makefile.in | 10 ++++------ fortran/testpar/hyper.f90 | 10 ++++------ fortran/testpar/mdset.f90 | 10 ++++------ fortran/testpar/ptest.f90 | 10 ++++------ hl/Makefile.am | 10 ++++------ hl/Makefile.in | 10 ++++------ hl/c++/Makefile.am | 10 ++++------ hl/c++/Makefile.in | 10 ++++------ hl/c++/examples/Makefile.am | 10 ++++------ hl/c++/examples/Makefile.in | 10 ++++------ hl/c++/examples/ptExampleFL.cpp | 10 ++++------ hl/c++/examples/run-hlc++-ex.sh.in | 10 ++++------ hl/c++/src/H5PacketTable.cpp | 10 ++++------ hl/c++/src/H5PacketTable.h | 10 ++++------ hl/c++/src/Makefile.am | 10 ++++------ hl/c++/src/Makefile.in | 10 ++++------ hl/c++/test/Makefile.am | 10 ++++------ hl/c++/test/Makefile.in | 10 ++++------ hl/c++/test/ptableTest.cpp | 10 ++++------ hl/c++/test/ptableTest.h | 10 ++++------ hl/examples/Makefile.am | 10 ++++------ hl/examples/Makefile.in | 10 ++++------ hl/examples/ex_ds1.c | 10 ++++------ hl/examples/ex_image1.c | 10 ++++------ hl/examples/ex_image2.c | 10 ++++------ hl/examples/ex_lite1.c | 10 ++++------ hl/examples/ex_lite2.c | 10 ++++------ hl/examples/ex_lite3.c | 10 ++++------ hl/examples/ex_table_01.c | 10 ++++------ hl/examples/ex_table_02.c | 10 ++++------ hl/examples/ex_table_03.c | 10 ++++------ hl/examples/ex_table_04.c | 10 ++++------ hl/examples/ex_table_05.c | 10 ++++------ hl/examples/ex_table_06.c | 10 ++++------ hl/examples/ex_table_07.c | 10 ++++------ hl/examples/ex_table_08.c | 10 ++++------ hl/examples/ex_table_09.c | 10 ++++------ hl/examples/ex_table_10.c | 10 ++++------ hl/examples/ex_table_11.c | 10 ++++------ hl/examples/ex_table_12.c | 10 ++++------ hl/examples/pal_rgb.h | 10 ++++------ hl/examples/ptExampleFL.c | 10 ++++------ hl/examples/run-hl-ex.sh | 10 ++++------ hl/examples/run-hlc-ex.sh.in | 10 ++++------ hl/fortran/Makefile.am | 10 ++++------ hl/fortran/Makefile.in | 10 ++++------ hl/fortran/examples/Makefile.am | 10 ++++------ hl/fortran/examples/Makefile.in | 10 ++++------ hl/fortran/examples/ex_ds1.f90 | 10 ++++------ hl/fortran/examples/exlite.f90 | 10 ++++------ hl/fortran/examples/run-hlfortran-ex.sh.in | 10 ++++------ hl/fortran/src/H5DSfc.c | 10 ++++------ hl/fortran/src/H5DSff.f90 | 10 ++++------ hl/fortran/src/H5IMcc.c | 10 ++++------ hl/fortran/src/H5IMcc.h | 10 ++++------ hl/fortran/src/H5IMfc.c | 10 ++++------ hl/fortran/src/H5IMff.f90 | 10 ++++------ hl/fortran/src/H5LTf90proto.h | 10 ++++------ hl/fortran/src/H5LTfc.c | 10 ++++------ hl/fortran/src/H5LTff.f90 | 10 ++++------ hl/fortran/src/H5TBfc.c | 10 ++++------ hl/fortran/src/H5TBff.f90 | 10 ++++------ hl/fortran/src/Makefile.am | 10 ++++------ hl/fortran/src/Makefile.in | 10 ++++------ hl/fortran/test/Makefile.am | 10 ++++------ hl/fortran/test/Makefile.in | 10 ++++------ hl/fortran/test/tstds.f90 | 10 ++++------ hl/fortran/test/tstimage.f90 | 10 ++++------ hl/fortran/test/tstlite.f90 | 10 ++++------ hl/fortran/test/tsttable.f90 | 10 ++++------ hl/src/H5DO.c | 10 ++++------ hl/src/H5DOpublic.h | 10 ++++------ hl/src/H5DS.c | 10 ++++------ hl/src/H5DSprivate.h | 10 ++++------ hl/src/H5DSpublic.h | 10 ++++------ hl/src/H5HLprivate2.h | 10 ++++------ hl/src/H5IM.c | 10 ++++------ hl/src/H5IMprivate.h | 10 ++++------ hl/src/H5IMpublic.h | 10 ++++------ hl/src/H5LT.c | 10 ++++------ hl/src/H5LTanalyze.c | 10 ++++------ hl/src/H5LTanalyze.l | 10 ++++------ hl/src/H5LTparse.y | 10 ++++------ hl/src/H5LTprivate.h | 10 ++++------ hl/src/H5LTpublic.h | 10 ++++------ hl/src/H5PT.c | 10 ++++------ hl/src/H5PTprivate.h | 10 ++++------ hl/src/H5PTpublic.h | 10 ++++------ hl/src/H5TB.c | 10 ++++------ hl/src/H5TBprivate.h | 10 ++++------ hl/src/H5TBpublic.h | 10 ++++------ hl/src/Makefile.am | 10 ++++------ hl/src/Makefile.in | 10 ++++------ hl/src/hdf5_hl.h | 10 ++++------ hl/test/H5srcdir_str.h.in | 10 ++++------ hl/test/Makefile.am | 10 ++++------ hl/test/Makefile.in | 10 ++++------ hl/test/dectris_hl_perf.c | 10 ++++------ hl/test/gen_test_ds.c | 10 ++++------ hl/test/h5hltest.h | 10 ++++------ hl/test/pal_rgb.h | 10 ++++------ hl/test/test_ds.c | 10 ++++------ hl/test/test_dset_opt.c | 10 ++++------ hl/test/test_file_image.c | 10 ++++------ hl/test/test_image.c | 10 ++++------ hl/test/test_lite.c | 10 ++++------ hl/test/test_packet.c | 10 ++++------ hl/test/test_packet_vlen.c | 10 ++++------ hl/test/test_table.c | 10 ++++------ hl/tools/Makefile.am | 10 ++++------ hl/tools/Makefile.in | 10 ++++------ hl/tools/gif2h5/Makefile.am | 10 ++++------ hl/tools/gif2h5/Makefile.in | 10 ++++------ hl/tools/gif2h5/decompress.c | 10 ++++------ hl/tools/gif2h5/gif.h | 10 ++++------ hl/tools/gif2h5/gif2hdf.c | 10 ++++------ hl/tools/gif2h5/gif2mem.c | 10 ++++------ hl/tools/gif2h5/gifread.c | 10 ++++------ hl/tools/gif2h5/h52gifgentst.c | 10 ++++------ hl/tools/gif2h5/h52giftest.sh.in | 10 ++++------ hl/tools/gif2h5/hdf2gif.c | 10 ++++------ hl/tools/gif2h5/hdfgifwr.c | 10 ++++------ hl/tools/gif2h5/writehdf.c | 10 ++++------ src/H5.c | 10 ++++------ src/H5A.c | 10 ++++------ src/H5AC.c | 10 ++++------ src/H5ACpkg.h | 10 ++++------ src/H5ACprivate.h | 10 ++++------ src/H5ACpublic.h | 10 ++++------ src/H5Abtree2.c | 10 ++++------ src/H5Adense.c | 10 ++++------ src/H5Adeprec.c | 10 ++++------ src/H5Aint.c | 10 ++++------ src/H5Apkg.h | 10 ++++------ src/H5Aprivate.h | 10 ++++------ src/H5Apublic.h | 10 ++++------ src/H5Atest.c | 10 ++++------ src/H5B.c | 10 ++++------ src/H5B2.c | 10 ++++------ src/H5B2cache.c | 10 ++++------ src/H5B2dbg.c | 10 ++++------ src/H5B2hdr.c | 10 ++++------ src/H5B2int.c | 10 ++++------ src/H5B2pkg.h | 10 ++++------ src/H5B2private.h | 10 ++++------ src/H5B2public.h | 10 ++++------ src/H5B2stat.c | 10 ++++------ src/H5B2test.c | 10 ++++------ src/H5Bcache.c | 10 ++++------ src/H5Bdbg.c | 10 ++++------ src/H5Bpkg.h | 10 ++++------ src/H5Bprivate.h | 10 ++++------ src/H5Bpublic.h | 10 ++++------ src/H5C.c | 10 ++++------ src/H5CS.c | 10 ++++------ src/H5CSprivate.h | 10 ++++------ src/H5Cpkg.h | 10 ++++------ src/H5Cprivate.h | 10 ++++------ src/H5Cpublic.h | 10 ++++------ src/H5D.c | 10 ++++------ src/H5Dbtree.c | 10 ++++------ src/H5Dchunk.c | 10 ++++------ src/H5Dcompact.c | 10 ++++------ src/H5Dcontig.c | 10 ++++------ src/H5Ddbg.c | 10 ++++------ src/H5Ddeprec.c | 10 ++++------ src/H5Defl.c | 10 ++++------ src/H5Dfill.c | 10 ++++------ src/H5Dint.c | 10 ++++------ src/H5Dio.c | 10 ++++------ src/H5Dlayout.c | 10 ++++------ src/H5Dmpio.c | 10 ++++------ src/H5Doh.c | 10 ++++------ src/H5Dpkg.h | 10 ++++------ src/H5Dprivate.h | 10 ++++------ src/H5Dpublic.h | 10 ++++------ src/H5Dscatgath.c | 10 ++++------ src/H5Dselect.c | 10 ++++------ src/H5Dtest.c | 10 ++++------ src/H5E.c | 10 ++++------ src/H5Edefin.h | 10 ++++------ src/H5Edeprec.c | 10 ++++------ src/H5Einit.h | 10 ++++------ src/H5Eint.c | 10 ++++------ src/H5Epkg.h | 10 ++++------ src/H5Eprivate.h | 10 ++++------ src/H5Epubgen.h | 10 ++++------ src/H5Epublic.h | 10 ++++------ src/H5Eterm.h | 10 ++++------ src/H5F.c | 10 ++++------ src/H5FD.c | 10 ++++------ src/H5FDcore.c | 10 ++++------ src/H5FDcore.h | 10 ++++------ src/H5FDdirect.c | 10 ++++------ src/H5FDdirect.h | 10 ++++------ src/H5FDfamily.c | 10 ++++------ src/H5FDfamily.h | 10 ++++------ src/H5FDint.c | 10 ++++------ src/H5FDlog.c | 10 ++++------ src/H5FDlog.h | 10 ++++------ src/H5FDmpi.c | 10 ++++------ src/H5FDmpi.h | 10 ++++------ src/H5FDmpio.c | 10 ++++------ src/H5FDmpio.h | 10 ++++------ src/H5FDmulti.c | 10 ++++------ src/H5FDmulti.h | 10 ++++------ src/H5FDpkg.h | 10 ++++------ src/H5FDprivate.h | 10 ++++------ src/H5FDpublic.h | 10 ++++------ src/H5FDsec2.c | 10 ++++------ src/H5FDsec2.h | 10 ++++------ src/H5FDspace.c | 10 ++++------ src/H5FDstdio.c | 10 ++++------ src/H5FDstdio.h | 10 ++++------ src/H5FDwindows.c | 10 ++++------ src/H5FDwindows.h | 10 ++++------ src/H5FL.c | 10 ++++------ src/H5FLprivate.h | 10 ++++------ src/H5FO.c | 10 ++++------ src/H5FOprivate.h | 10 ++++------ src/H5FS.c | 10 ++++------ src/H5FScache.c | 10 ++++------ src/H5FSdbg.c | 10 ++++------ src/H5FSpkg.h | 10 ++++------ src/H5FSprivate.h | 10 ++++------ src/H5FSpublic.h | 10 ++++------ src/H5FSsection.c | 10 ++++------ src/H5FSstat.c | 10 ++++------ src/H5FStest.c | 10 ++++------ src/H5Faccum.c | 10 ++++------ src/H5Fcwfs.c | 10 ++++------ src/H5Fdbg.c | 10 ++++------ src/H5Fefc.c | 10 ++++------ src/H5Ffake.c | 10 ++++------ src/H5Fint.c | 10 ++++------ src/H5Fio.c | 10 ++++------ src/H5Fmount.c | 10 ++++------ src/H5Fmpi.c | 10 ++++------ src/H5Fpkg.h | 10 ++++------ src/H5Fprivate.h | 10 ++++------ src/H5Fpublic.h | 10 ++++------ src/H5Fquery.c | 10 ++++------ src/H5Fsfile.c | 10 ++++------ src/H5Fsuper.c | 10 ++++------ src/H5Fsuper_cache.c | 10 ++++------ src/H5Ftest.c | 10 ++++------ src/H5G.c | 10 ++++------ src/H5Gbtree2.c | 10 ++++------ src/H5Gcache.c | 10 ++++------ src/H5Gcompact.c | 10 ++++------ src/H5Gdense.c | 10 ++++------ src/H5Gdeprec.c | 10 ++++------ src/H5Gent.c | 10 ++++------ src/H5Gint.c | 10 ++++------ src/H5Glink.c | 10 ++++------ src/H5Gloc.c | 10 ++++------ src/H5Gname.c | 10 ++++------ src/H5Gnode.c | 10 ++++------ src/H5Gobj.c | 10 ++++------ src/H5Goh.c | 10 ++++------ src/H5Gpkg.h | 10 ++++------ src/H5Gprivate.h | 10 ++++------ src/H5Gpublic.h | 10 ++++------ src/H5Groot.c | 10 ++++------ src/H5Gstab.c | 10 ++++------ src/H5Gtest.c | 10 ++++------ src/H5Gtraverse.c | 10 ++++------ src/H5HF.c | 10 ++++------ src/H5HFbtree2.c | 10 ++++------ src/H5HFcache.c | 10 ++++------ src/H5HFdbg.c | 10 ++++------ src/H5HFdblock.c | 10 ++++------ src/H5HFdtable.c | 10 ++++------ src/H5HFhdr.c | 10 ++++------ src/H5HFhuge.c | 10 ++++------ src/H5HFiblock.c | 10 ++++------ src/H5HFiter.c | 10 ++++------ src/H5HFman.c | 10 ++++------ src/H5HFpkg.h | 10 ++++------ src/H5HFprivate.h | 10 ++++------ src/H5HFpublic.h | 10 ++++------ src/H5HFsection.c | 10 ++++------ src/H5HFspace.c | 10 ++++------ src/H5HFstat.c | 10 ++++------ src/H5HFtest.c | 10 ++++------ src/H5HFtiny.c | 10 ++++------ src/H5HG.c | 10 ++++------ src/H5HGcache.c | 10 ++++------ src/H5HGdbg.c | 10 ++++------ src/H5HGpkg.h | 10 ++++------ src/H5HGprivate.h | 10 ++++------ src/H5HGpublic.h | 10 ++++------ src/H5HGquery.c | 10 ++++------ src/H5HL.c | 10 ++++------ src/H5HLcache.c | 10 ++++------ src/H5HLdbg.c | 10 ++++------ src/H5HLint.c | 10 ++++------ src/H5HLpkg.h | 10 ++++------ src/H5HLprivate.h | 10 ++++------ src/H5HLpublic.h | 10 ++++------ src/H5HP.c | 10 ++++------ src/H5HPprivate.h | 10 ++++------ src/H5I.c | 10 ++++------ src/H5Ipkg.h | 10 ++++------ src/H5Iprivate.h | 10 ++++------ src/H5Ipublic.h | 10 ++++------ src/H5Itest.c | 10 ++++------ src/H5L.c | 10 ++++------ src/H5Lexternal.c | 10 ++++------ src/H5Lpkg.h | 10 ++++------ src/H5Lprivate.h | 10 ++++------ src/H5Lpublic.h | 10 ++++------ src/H5MF.c | 10 ++++------ src/H5MFaggr.c | 10 ++++------ src/H5MFdbg.c | 10 ++++------ src/H5MFpkg.h | 10 ++++------ src/H5MFprivate.h | 10 ++++------ src/H5MFsection.c | 10 ++++------ src/H5MM.c | 10 ++++------ src/H5MMprivate.h | 10 ++++------ src/H5MMpublic.h | 10 ++++------ src/H5MP.c | 10 ++++------ src/H5MPpkg.h | 10 ++++------ src/H5MPprivate.h | 10 ++++------ src/H5MPtest.c | 10 ++++------ src/H5O.c | 10 ++++------ src/H5Oainfo.c | 10 ++++------ src/H5Oalloc.c | 10 ++++------ src/H5Oattr.c | 10 ++++------ src/H5Oattribute.c | 10 ++++------ src/H5Obogus.c | 10 ++++------ src/H5Obtreek.c | 10 ++++------ src/H5Ocache.c | 10 ++++------ src/H5Ochunk.c | 10 ++++------ src/H5Ocont.c | 10 ++++------ src/H5Ocopy.c | 10 ++++------ src/H5Odbg.c | 10 ++++------ src/H5Odrvinfo.c | 10 ++++------ src/H5Odtype.c | 10 ++++------ src/H5Oefl.c | 10 ++++------ src/H5Ofill.c | 10 ++++------ src/H5Oginfo.c | 10 ++++------ src/H5Olayout.c | 10 ++++------ src/H5Olinfo.c | 10 ++++------ src/H5Olink.c | 10 ++++------ src/H5Omessage.c | 10 ++++------ src/H5Omtime.c | 10 ++++------ src/H5Oname.c | 10 ++++------ src/H5Onull.c | 10 ++++------ src/H5Opkg.h | 10 ++++------ src/H5Opline.c | 10 ++++------ src/H5Oprivate.h | 10 ++++------ src/H5Opublic.h | 10 ++++------ src/H5Orefcount.c | 10 ++++------ src/H5Osdspace.c | 10 ++++------ src/H5Oshared.c | 10 ++++------ src/H5Oshared.h | 10 ++++------ src/H5Oshmesg.c | 10 ++++------ src/H5Ostab.c | 10 ++++------ src/H5Otest.c | 10 ++++------ src/H5Ounknown.c | 10 ++++------ src/H5P.c | 10 ++++------ src/H5PL.c | 10 ++++------ src/H5PLextern.h | 10 ++++------ src/H5PLpkg.h | 10 ++++------ src/H5PLprivate.h | 10 ++++------ src/H5PLpublic.h | 10 ++++------ src/H5Pacpl.c | 10 ++++------ src/H5Pdapl.c | 10 ++++------ src/H5Pdcpl.c | 10 ++++------ src/H5Pdeprec.c | 10 ++++------ src/H5Pdxpl.c | 10 ++++------ src/H5Pfapl.c | 10 ++++------ src/H5Pfcpl.c | 10 ++++------ src/H5Pfmpl.c | 10 ++++------ src/H5Pgcpl.c | 10 ++++------ src/H5Pint.c | 10 ++++------ src/H5Plapl.c | 10 ++++------ src/H5Plcpl.c | 10 ++++------ src/H5Pocpl.c | 10 ++++------ src/H5Pocpypl.c | 10 ++++------ src/H5Ppkg.h | 10 ++++------ src/H5Pprivate.h | 10 ++++------ src/H5Ppublic.h | 10 ++++------ src/H5Pstrcpl.c | 10 ++++------ src/H5Ptest.c | 10 ++++------ src/H5R.c | 10 ++++------ src/H5RC.c | 10 ++++------ src/H5RCprivate.h | 10 ++++------ src/H5RS.c | 10 ++++------ src/H5RSprivate.h | 10 ++++------ src/H5Rdeprec.c | 10 ++++------ src/H5Rpkg.h | 10 ++++------ src/H5Rprivate.h | 10 ++++------ src/H5Rpublic.h | 10 ++++------ src/H5S.c | 10 ++++------ src/H5SL.c | 10 ++++------ src/H5SLprivate.h | 10 ++++------ src/H5SM.c | 10 ++++------ src/H5SMbtree2.c | 10 ++++------ src/H5SMcache.c | 10 ++++------ src/H5SMmessage.c | 10 ++++------ src/H5SMpkg.h | 10 ++++------ src/H5SMprivate.h | 10 ++++------ src/H5SMtest.c | 10 ++++------ src/H5ST.c | 10 ++++------ src/H5STprivate.h | 10 ++++------ src/H5Sall.c | 10 ++++------ src/H5Sdbg.c | 10 ++++------ src/H5Shyper.c | 10 ++++------ src/H5Smpio.c | 10 ++++------ src/H5Snone.c | 10 ++++------ src/H5Spkg.h | 10 ++++------ src/H5Spoint.c | 10 ++++------ src/H5Sprivate.h | 10 ++++------ src/H5Spublic.h | 10 ++++------ src/H5Sselect.c | 10 ++++------ src/H5Stest.c | 10 ++++------ src/H5T.c | 10 ++++------ src/H5TS.c | 10 ++++------ src/H5TSprivate.h | 10 ++++------ src/H5Tarray.c | 10 ++++------ src/H5Tbit.c | 10 ++++------ src/H5Tcommit.c | 10 ++++------ src/H5Tcompound.c | 10 ++++------ src/H5Tconv.c | 10 ++++------ src/H5Tcset.c | 10 ++++------ src/H5Tdbg.c | 10 ++++------ src/H5Tdeprec.c | 10 ++++------ src/H5Tenum.c | 10 ++++------ src/H5Tfields.c | 10 ++++------ src/H5Tfixed.c | 10 ++++------ src/H5Tfloat.c | 10 ++++------ src/H5Tnative.c | 10 ++++------ src/H5Toffset.c | 10 ++++------ src/H5Toh.c | 10 ++++------ src/H5Topaque.c | 10 ++++------ src/H5Torder.c | 10 ++++------ src/H5Tpad.c | 10 ++++------ src/H5Tpkg.h | 10 ++++------ src/H5Tprecis.c | 10 ++++------ src/H5Tprivate.h | 10 ++++------ src/H5Tpublic.h | 10 ++++------ src/H5Tstrpad.c | 10 ++++------ src/H5Tvisit.c | 10 ++++------ src/H5Tvlen.c | 10 ++++------ src/H5VM.c | 10 ++++------ src/H5VMprivate.h | 10 ++++------ src/H5WB.c | 10 ++++------ src/H5WBprivate.h | 10 ++++------ src/H5Z.c | 10 ++++------ src/H5Zdeflate.c | 10 ++++------ src/H5Zfletcher32.c | 10 ++++------ src/H5Znbit.c | 10 ++++------ src/H5Zpkg.h | 10 ++++------ src/H5Zprivate.h | 10 ++++------ src/H5Zpublic.h | 10 ++++------ src/H5Zscaleoffset.c | 10 ++++------ src/H5Zshuffle.c | 10 ++++------ src/H5Zszip.c | 10 ++++------ src/H5Ztrans.c | 10 ++++------ src/H5api_adpt.h | 10 ++++------ src/H5checksum.c | 10 ++++------ src/H5dbg.c | 10 ++++------ src/H5detect.c | 10 ++++------ src/H5make_libsettings.c | 10 ++++------ src/H5overflow.h | 10 ++++------ src/H5private.h | 10 ++++------ src/H5public.h | 10 ++++------ src/H5system.c | 10 ++++------ src/H5timer.c | 10 ++++------ src/H5trace.c | 10 ++++------ src/H5version.h | 10 ++++------ src/H5win32defs.h | 10 ++++------ src/Makefile.am | 10 ++++------ src/Makefile.in | 10 ++++------ src/hdf5.h | 10 ++++------ test/H5srcdir.h | 10 ++++------ test/H5srcdir_str.h.in | 10 ++++------ test/Makefile.am | 10 ++++------ test/Makefile.in | 10 ++++------ test/accum.c | 10 ++++------ test/app_ref.c | 10 ++++------ test/big.c | 10 ++++------ test/bittests.c | 10 ++++------ test/btree2.c | 10 ++++------ test/cache.c | 10 ++++------ test/cache_api.c | 10 ++++------ test/cache_common.c | 10 ++++------ test/cache_common.h | 10 ++++------ test/cmpd_dset.c | 10 ++++------ test/cross_read.c | 10 ++++------ test/dangle.c | 10 ++++------ test/dsets.c | 10 ++++------ test/dt_arith.c | 10 ++++------ test/dtransform.c | 10 ++++------ test/dtypes.c | 10 ++++------ test/dynlib1.c | 10 ++++------ test/dynlib2.c | 10 ++++------ test/dynlib3.c | 10 ++++------ test/dynlib4.c | 10 ++++------ test/efc.c | 10 ++++------ test/enum.c | 10 ++++------ test/err_compat.c | 10 ++++------ test/error_test.c | 10 ++++------ test/extend.c | 10 ++++------ test/external.c | 10 ++++------ test/fheap.c | 10 ++++------ test/file_image.c | 10 ++++------ test/fillval.c | 10 ++++------ test/filter_fail.c | 10 ++++------ test/flush1.c | 10 ++++------ test/flush2.c | 10 ++++------ test/freespace.c | 10 ++++------ test/gen_bad_compound.c | 10 ++++------ test/gen_bad_ohdr.c | 10 ++++------ test/gen_bogus.c | 10 ++++------ test/gen_cross.c | 10 ++++------ test/gen_deflate.c | 10 ++++------ test/gen_file_image.c | 10 ++++------ test/gen_filters.c | 10 ++++------ test/gen_idx.c | 10 ++++------ test/gen_mergemsg.c | 10 ++++------ test/gen_new_array.c | 10 ++++------ test/gen_new_fill.c | 10 ++++------ test/gen_new_group.c | 10 ++++------ test/gen_new_mtime.c | 10 ++++------ test/gen_new_super.c | 10 ++++------ test/gen_noencoder.c | 10 ++++------ test/gen_nullspace.c | 10 ++++------ test/gen_old_array.c | 10 ++++------ test/gen_old_group.c | 10 ++++------ test/gen_old_layout.c | 10 ++++------ test/gen_old_mtime.c | 10 ++++------ test/gen_sizes_lheap.c | 10 ++++------ test/gen_udlinks.c | 10 ++++------ test/getname.c | 10 ++++------ test/gheap.c | 10 ++++------ test/h5test.c | 10 ++++------ test/h5test.h | 10 ++++------ test/hyperslab.c | 10 ++++------ test/istore.c | 10 ++++------ test/lheap.c | 10 ++++------ test/links.c | 10 ++++------ test/links_env.c | 10 ++++------ test/mf.c | 10 ++++------ test/mount.c | 10 ++++------ test/mtime.c | 10 ++++------ test/ntypes.c | 10 ++++------ test/objcopy.c | 10 ++++------ test/ohdr.c | 10 ++++------ test/plugin.c | 10 ++++------ test/pool.c | 10 ++++------ test/reserved.c | 10 ++++------ test/set_extent.c | 10 ++++------ test/space_overflow.c | 10 ++++------ test/stab.c | 10 ++++------ test/tarray.c | 10 ++++------ test/tattr.c | 10 ++++------ test/tcheck_version.c | 10 ++++------ test/tchecksum.c | 10 ++++------ test/tconfig.c | 10 ++++------ test/tcoords.c | 10 ++++------ test/test_plugin.sh.in | 10 ++++------ test/testcheck_version.sh.in | 10 ++++------ test/testerror.sh.in | 10 ++++------ test/testframe.c | 10 ++++------ test/testhdf5.c | 10 ++++------ test/testhdf5.h | 10 ++++------ test/testlibinfo.sh.in | 10 ++++------ test/testlinks_env.sh.in | 10 ++++------ test/testmeta.c | 10 ++++------ test/tfile.c | 10 ++++------ test/tgenprop.c | 10 ++++------ test/th5o.c | 10 ++++------ test/th5s.c | 10 ++++------ test/theap.c | 10 ++++------ test/tid.c | 10 ++++------ test/titerate.c | 10 ++++------ test/tmeta.c | 10 ++++------ test/tmisc.c | 10 ++++------ test/trefer.c | 10 ++++------ test/trefstr.c | 10 ++++------ test/tselect.c | 10 ++++------ test/tskiplist.c | 10 ++++------ test/tsohm.c | 10 ++++------ test/ttime.c | 10 ++++------ test/ttsafe.c | 10 ++++------ test/ttsafe.h | 10 ++++------ test/ttsafe_acreate.c | 10 ++++------ test/ttsafe_cancel.c | 10 ++++------ test/ttsafe_dcreate.c | 10 ++++------ test/ttsafe_error.c | 10 ++++------ test/ttst.c | 10 ++++------ test/tunicode.c | 10 ++++------ test/tvlstr.c | 10 ++++------ test/tvltypes.c | 10 ++++------ test/unlink.c | 10 ++++------ test/unregister.c | 10 ++++------ test/vfd.c | 10 ++++------ testpar/Makefile.am | 10 ++++------ testpar/Makefile.in | 10 ++++------ testpar/t_cache.c | 10 ++++------ testpar/t_chunk_alloc.c | 10 ++++------ testpar/t_coll_chunk.c | 10 ++++------ testpar/t_dset.c | 10 ++++------ testpar/t_file.c | 10 ++++------ testpar/t_file_image.c | 10 ++++------ testpar/t_filter_read.c | 10 ++++------ testpar/t_init_term.c | 10 ++++------ testpar/t_mdset.c | 10 ++++------ testpar/t_mpi.c | 10 ++++------ testpar/t_pflush1.c | 10 ++++------ testpar/t_pflush2.c | 10 ++++------ testpar/t_ph5basic.c | 10 ++++------ testpar/t_prestart.c | 10 ++++------ testpar/t_pshutdown.c | 10 ++++------ testpar/t_shapesame.c | 10 ++++------ testpar/t_span_tree.c | 10 ++++------ testpar/testpar.h | 10 ++++------ testpar/testphdf5.c | 10 ++++------ testpar/testphdf5.h | 10 ++++------ tools/Makefile.am | 10 ++++------ tools/Makefile.in | 10 ++++------ tools/h5copy/Makefile.am | 10 ++++------ tools/h5copy/Makefile.in | 10 ++++------ tools/h5copy/h5copy.c | 10 ++++------ tools/h5copy/h5copygentest.c | 10 ++++------ tools/h5copy/testh5copy.sh.in | 10 ++++------ tools/h5diff/Makefile.am | 10 ++++------ tools/h5diff/Makefile.in | 10 ++++------ tools/h5diff/dynlib_diff.c | 10 ++++------ tools/h5diff/h5diff_common.c | 10 ++++------ tools/h5diff/h5diff_common.h | 10 ++++------ tools/h5diff/h5diff_main.c | 10 ++++------ tools/h5diff/h5diff_plugin.sh.in | 10 ++++------ tools/h5diff/h5diffgentest.c | 10 ++++------ tools/h5diff/ph5diff_main.c | 10 ++++------ tools/h5diff/testh5diff.sh.in | 10 ++++------ tools/h5diff/testph5diff.sh.in | 10 ++++------ tools/h5dump/Makefile.am | 10 ++++------ tools/h5dump/Makefile.in | 10 ++++------ tools/h5dump/binread.c | 10 ++++------ tools/h5dump/dynlib_dump.c | 10 ++++------ tools/h5dump/h5dump.c | 10 ++++------ tools/h5dump/h5dump.h | 10 ++++------ tools/h5dump/h5dump_ddl.c | 10 ++++------ tools/h5dump/h5dump_ddl.h | 10 ++++------ tools/h5dump/h5dump_defines.h | 10 ++++------ tools/h5dump/h5dump_extern.h | 10 ++++------ tools/h5dump/h5dump_plugin.sh.in | 10 ++++------ tools/h5dump/h5dump_xml.c | 10 ++++------ tools/h5dump/h5dump_xml.h | 10 ++++------ tools/h5dump/h5dumpgentest.c | 10 ++++------ tools/h5dump/testh5dump.sh.in | 10 ++++------ tools/h5dump/testh5dumppbits.sh.in | 10 ++++------ tools/h5dump/testh5dumpxml.sh.in | 10 ++++------ tools/h5import/Makefile.am | 10 ++++------ tools/h5import/Makefile.in | 10 ++++------ tools/h5import/h5import.c | 10 ++++------ tools/h5import/h5import.h | 10 ++++------ tools/h5import/h5importtest.c | 10 ++++------ tools/h5import/h5importtestutil.sh.in | 10 ++++------ tools/h5jam/Makefile.am | 10 ++++------ tools/h5jam/Makefile.in | 10 ++++------ tools/h5jam/getub.c | 10 ++++------ tools/h5jam/h5jam.c | 10 ++++------ tools/h5jam/h5jamgentest.c | 10 ++++------ tools/h5jam/h5unjam.c | 10 ++++------ tools/h5jam/tellub.c | 10 ++++------ tools/h5jam/testh5jam.sh.in | 10 ++++------ tools/h5ls/Makefile.am | 10 ++++------ tools/h5ls/Makefile.in | 10 ++++------ tools/h5ls/dynlib_ls.c | 10 ++++------ tools/h5ls/h5ls.c | 10 ++++------ tools/h5ls/h5ls_plugin.sh.in | 10 ++++------ tools/h5ls/testh5ls.sh.in | 10 ++++------ tools/h5repack/Makefile.am | 10 ++++------ tools/h5repack/Makefile.in | 10 ++++------ tools/h5repack/dynlib_rpk.c | 10 ++++------ tools/h5repack/dynlib_vrpk.c | 10 ++++------ tools/h5repack/h5repack.c | 10 ++++------ tools/h5repack/h5repack.h | 10 ++++------ tools/h5repack/h5repack.sh.in | 10 ++++------ tools/h5repack/h5repack_copy.c | 10 ++++------ tools/h5repack/h5repack_filters.c | 10 ++++------ tools/h5repack/h5repack_main.c | 10 ++++------ tools/h5repack/h5repack_opttable.c | 10 ++++------ tools/h5repack/h5repack_parse.c | 10 ++++------ tools/h5repack/h5repack_plugin.sh.in | 10 ++++------ tools/h5repack/h5repack_refs.c | 10 ++++------ tools/h5repack/h5repack_verify.c | 10 ++++------ tools/h5repack/h5repacktst.c | 10 ++++------ tools/h5repack/testh5repack_detect_szip.c | 10 ++++------ tools/h5stat/Makefile.am | 10 ++++------ tools/h5stat/Makefile.in | 10 ++++------ tools/h5stat/h5stat.c | 10 ++++------ tools/h5stat/h5stat_gentest.c | 10 ++++------ tools/h5stat/testh5stat.sh.in | 10 ++++------ tools/lib/Makefile.am | 10 ++++------ tools/lib/Makefile.in | 10 ++++------ tools/lib/h5diff.c | 10 ++++------ tools/lib/h5diff.h | 10 ++++------ tools/lib/h5diff_array.c | 10 ++++------ tools/lib/h5diff_attr.c | 10 ++++------ tools/lib/h5diff_dset.c | 10 ++++------ tools/lib/h5diff_util.c | 10 ++++------ tools/lib/h5tools.c | 10 ++++------ tools/lib/h5tools.h | 10 ++++------ tools/lib/h5tools_dump.c | 10 ++++------ tools/lib/h5tools_dump.h | 10 ++++------ tools/lib/h5tools_error.h | 10 ++++------ tools/lib/h5tools_filters.c | 10 ++++------ tools/lib/h5tools_ref.c | 10 ++++------ tools/lib/h5tools_ref.h | 10 ++++------ tools/lib/h5tools_str.c | 10 ++++------ tools/lib/h5tools_str.h | 10 ++++------ tools/lib/h5tools_type.c | 10 ++++------ tools/lib/h5tools_utils.c | 10 ++++------ tools/lib/h5tools_utils.h | 10 ++++------ tools/lib/h5trav.c | 10 ++++------ tools/lib/h5trav.h | 10 ++++------ tools/lib/io_timer.c | 10 ++++------ tools/lib/io_timer.h | 10 ++++------ tools/lib/ph5diff.h | 10 ++++------ tools/misc/Makefile.am | 10 ++++------ tools/misc/Makefile.in | 10 ++++------ tools/misc/h5cc.in | 10 ++++------ tools/misc/h5debug.c | 10 ++++------ tools/misc/h5mkgrp.c | 10 ++++------ tools/misc/h5redeploy.in | 10 ++++------ tools/misc/h5repart.c | 10 ++++------ tools/misc/h5repart_gentest.c | 10 ++++------ tools/misc/repart_test.c | 10 ++++------ tools/misc/talign.c | 10 ++++------ tools/misc/testh5mkgrp.sh.in | 10 ++++------ tools/misc/testh5repart.sh.in | 10 ++++------ tools/perform/Makefile.am | 10 ++++------ tools/perform/Makefile.in | 10 ++++------ tools/perform/build_h5perf_alone.sh | 10 ++++------ tools/perform/build_h5perf_serial_alone.sh | 10 ++++------ tools/perform/chunk.c | 10 ++++------ tools/perform/gen_report.pl | 10 ++++------ tools/perform/iopipe.c | 10 ++++------ tools/perform/overhead.c | 10 ++++------ tools/perform/perf.c | 10 ++++------ tools/perform/perf_meta.c | 10 ++++------ tools/perform/pio_engine.c | 10 ++++------ tools/perform/pio_perf.c | 10 ++++------ tools/perform/pio_perf.h | 10 ++++------ tools/perform/pio_standalone.c | 10 ++++------ tools/perform/pio_standalone.h | 10 ++++------ tools/perform/sio_engine.c | 10 ++++------ tools/perform/sio_perf.c | 10 ++++------ tools/perform/sio_perf.h | 10 ++++------ tools/perform/sio_standalone.c | 10 ++++------ tools/perform/sio_standalone.h | 10 ++++------ tools/perform/zip_perf.c | 10 ++++------ 1088 files changed, 4352 insertions(+), 6528 deletions(-) diff --git a/.autom4te.cfg b/.autom4te.cfg index 7b4dd6b..e7c2ec1 100644 --- a/.autom4te.cfg +++ b/.autom4te.cfg @@ -4,12 +4,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ------------------ ## ## User Preferences. ## diff --git a/.h5chkright.ini b/.h5chkright.ini index 10daeaf..1010dce 100644 --- a/.h5chkright.ini +++ b/.h5chkright.ini @@ -4,12 +4,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # Initialization files for the Copyright Checker, chkcopyright. # Each line is a keyword for action and the rest are values. diff --git a/MANIFEST b/MANIFEST index 8436591..0d65be6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # #------------------------------------------------------------------------------ # This is the list of files that are part of HDF5 source distribution. diff --git a/Makefile.am b/Makefile.am index 50e7928..32dea3e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/Makefile.dist b/Makefile.dist index e38af21..9edb476 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This Makefile is a stub (copied from Makefile.dist) which will run # configure and then invoke the same target in the new Makefile created diff --git a/Makefile.in b/Makefile.in index 389a10f..a8c81ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from diff --git a/bin/bbrelease b/bin/bbrelease index 0a94071..10526df 100755 --- a/bin/bbrelease +++ b/bin/bbrelease @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Make a release of hdf5. diff --git a/bin/buildhdf5 b/bin/buildhdf5 index 3a4b0d3..064000a 100755 --- a/bin/buildhdf5 +++ b/bin/buildhdf5 @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Build HDF5 library by doing configure, make, and tests. # Usage: See USAGE() diff --git a/bin/checkapi b/bin/checkapi index b4a08e8..6882dea 100755 --- a/bin/checkapi +++ b/bin/checkapi @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # require 5.003; diff --git a/bin/checkposix b/bin/checkposix index db47ff3..7ab741c 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -8,12 +8,10 @@ require 5.003; # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke, matzke@llnl.gov # 30 Aug 1997 diff --git a/bin/chkcopyright b/bin/chkcopyright index 1d42f70..a01a21e 100755 --- a/bin/chkcopyright +++ b/bin/chkcopyright @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Check Copyright notice. diff --git a/bin/chkmanifest b/bin/chkmanifest index 38b751f..a016b0f 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Check that all the files in MANIFEST exist and (if this is a diff --git a/bin/debug-ohdr b/bin/debug-ohdr index 170919a..5b0a4b3 100755 --- a/bin/debug-ohdr +++ b/bin/debug-ohdr @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # require 5.003; diff --git a/bin/dependencies b/bin/dependencies index a82a3ee..82247da 100755 --- a/bin/dependencies +++ b/bin/dependencies @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # my $depend_file; my $new_depend_file; diff --git a/bin/deploy b/bin/deploy index ef30d21..73f4b25 100755 --- a/bin/deploy +++ b/bin/deploy @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Deploy the HDF5 binary. # diff --git a/bin/distdep b/bin/distdep index 0a22bd1..4643700 100644 --- a/bin/distdep +++ b/bin/distdep @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Usage: $0 [<].depend diff --git a/bin/errors b/bin/errors index 6ce997b..3c99fdc 100755 --- a/bin/errors +++ b/bin/errors @@ -11,12 +11,10 @@ use Text::Tabs; # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke, matzke@llnl.gov # 30 Aug 1997 diff --git a/bin/gcov_script b/bin/gcov_script index ac82189..9a6512d 100755 --- a/bin/gcov_script +++ b/bin/gcov_script @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # A script to generate coverage files for HDF5 using gcov. # Configures, builds, and runs tests in-place; the output files will be placed diff --git a/bin/genltanalyze b/bin/genltanalyze index 1f56cc1..293c683 100755 --- a/bin/genltanalyze +++ b/bin/genltanalyze @@ -5,12 +5,10 @@ ## ## 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## # regenerate hl/src/H5LTanalyze.c diff --git a/bin/h5vers b/bin/h5vers index 169f89b..55ece48 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -12,12 +12,10 @@ use strict; # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke # 17 July 1998 diff --git a/bin/iostats b/bin/iostats index f57c0d0..f054b9c 100755 --- a/bin/iostats +++ b/bin/iostats @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Usage: pipe the output of Linux's `strace' program into the stdin of diff --git a/bin/locate_sw b/bin/locate_sw index c9a7924..bab7bd2 100755 --- a/bin/locate_sw +++ b/bin/locate_sw @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Try to locate the software as named in argument. diff --git a/bin/make_err b/bin/make_err index 1b39d53fb..2e06e32 100755 --- a/bin/make_err +++ b/bin/make_err @@ -9,12 +9,10 @@ $indent=4; # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create error headers diff --git a/bin/make_overflow b/bin/make_overflow index ced486a..3d0f550 100755 --- a/bin/make_overflow +++ b/bin/make_overflow @@ -14,12 +14,10 @@ my @ctypes = ( () ); # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create assignment overflow #ifdefs diff --git a/bin/make_vers b/bin/make_vers index 2cfad4c..100ee46 100755 --- a/bin/make_vers +++ b/bin/make_vers @@ -16,12 +16,10 @@ $min_sup_idx = 3; # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create public symbol version headers diff --git a/bin/mkdirs b/bin/mkdirs index 694a754..43972b6 100755 --- a/bin/mkdirs +++ b/bin/mkdirs @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This is a small program which will create directories n-levels deep. # You just call it with something like: diff --git a/bin/newer b/bin/newer index 8ed9f87..8083cae 100755 --- a/bin/newer +++ b/bin/newer @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Compare the modification time of file argument 1 against other file arguments. # Return true (0) if argument 1 is newer than all others, otherwise return diff --git a/bin/output_filter.sh b/bin/output_filter.sh index b8b7ff0..a080b55 100644 --- a/bin/output_filter.sh +++ b/bin/output_filter.sh @@ -3,12 +3,10 @@ ## ## 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This contains function definitions of output filtering. # This file should only be sourced in by another shell script. diff --git a/bin/pkgscrpts/h5rmflags b/bin/pkgscrpts/h5rmflags index 8bb28d3..80a249e 100755 --- a/bin/pkgscrpts/h5rmflags +++ b/bin/pkgscrpts/h5rmflags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ## This script wasextracted from h5redeploy to find hdf5 compile scripts and diff --git a/bin/release b/bin/release index 0d74233..0ac9986 100755 --- a/bin/release +++ b/bin/release @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Make a release of hdf5. diff --git a/bin/runtest b/bin/runtest index 34386e4..d55099f 100755 --- a/bin/runtest +++ b/bin/runtest @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # run the hdf5/bin/snapshot diff --git a/bin/snapshot b/bin/snapshot index 2bfcfd6..c144125 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This script should be run nightly from cron. It checks out hdf5 # from the source repository and compares it against the previous diff --git a/bin/snapshot_version b/bin/snapshot_version index 2f1f97d..cb2fd2e 100644 --- a/bin/snapshot_version +++ b/bin/snapshot_version @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # default version for snapshot test diff --git a/bin/timekeeper b/bin/timekeeper index 7c50759..14adf2c 100755 --- a/bin/timekeeper +++ b/bin/timekeeper @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## # As a time keeper of the remote daily test process launched by runtest. # It sleeps for a certain time and then wakes up to hangup those processes diff --git a/bin/trace b/bin/trace index 3f23a26..8b3f68e 100755 --- a/bin/trace +++ b/bin/trace @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## require 5.003; $Source = ""; diff --git a/c++/Makefile.am b/c++/Makefile.am index 416060a..94fbefc 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/Makefile.in b/c++/Makefile.in index ec67f96..f6e5df0 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Top-level HDF5-C++ Makefile(.in) # diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 2408217..51ab8e3 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 95ab397..d819404 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5 Library Examples Makefile(.in) # diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index f8e45b8..ba2c089 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 1e19229..284ce16 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 5ea24ef..2993a0c 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index f8570d2..dbedfc9 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 9f81885..6e1764f 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index 3dcc4e4..32f67ad 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index affaf8c..bdc2fc5 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index 765801d..9fed595 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index 02ceb5f..cee306c 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index 56980e2..d120833 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index 34ef83d..12c6848 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index fe5eec9..92576f1 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index 8a369a4..076822f 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index 4bc8946..13720b9 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 91813fb..3826090 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 77ac36a..315010e 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-c++-ex.sh diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index ca4fc56..c82ccc3 100644 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5c++ compiler tool # Created: Albert Cheng, 2007/3/14 diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index d0eacc0..f8a1cea 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 4536afb..1391b44 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 893cd8f..ae74c62 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __AbstractDs_H diff --git a/c++/src/H5Alltypes.h b/c++/src/H5Alltypes.h index b1d792d..aaf3074 100644 --- a/c++/src/H5Alltypes.h +++ b/c++/src/H5Alltypes.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // This header file simply serves as a container to hold the diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 018eed5..6d2ca83 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index c9f3b3e..6de11f2 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5ArrayType_H diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index c9c1b46..4788b43 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index e9c0945..4a091f0 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5AtomType_H diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 353a15c..3733736 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 33145bc..98883e2 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Attribute_H diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 6dc24f4..23bff29 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Classes_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index f1e45b8..d802f08 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 761125c..81a9a29 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __CommonFG_H diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index aff89f2..16a7d2f 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 75089e8..f6d77f4 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5CompType_H diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index 42f925a..dcf3a17 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Cpp_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index b0bc9d7..99f0724 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 7b449d8..ded483b 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index f7a344c..09aab08 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataSet_H diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 538c245..f0b8a07 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index b490141..ed141a3 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 84e59e8..0e5b40a 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 1118dcf..2deb78f 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 0cd9458..dca846d 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 1072ff4..e085fa5 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index fd2f36d..43ecf9b 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 181aeeb..370b271 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index acfae4e..0c26728 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index af8d9c6..5cbe262 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index ebb7d62..0bb15bc 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index b57ca64..7315e11 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Exception_H diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 76981e1..bf48da8 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 186cac1..fe249ef 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 117bf01..064d077 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 6bb4cc2..02897b8 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 4d7177a..bfb7949 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5File.h b/c++/src/H5File.h index e06a942..946f879 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5File_H diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 0a0bc1d..0abf52a 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 7954709..d0256e1 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index a5d052c..2131040 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 0d26b27..10906cf 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Group_H diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 7054369..e1293b1 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index e9d0c84..5bbee06 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __IdComponent_H diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index 47ee725..1d12233 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 673bd7a..7d48314 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 1ddf2bd..5602b32 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index e457e83..1267286 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index f31c3fc..9772cde 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Class LinkAccPropList represents the HDF5 file access property list and diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 7adc508..d6faa10 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index ed13339..d079bde 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Library_H diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index f10ad0d..eae0342 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 11f8f87..fa75514 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Location_H diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 91d0f82..7a9704a 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index b118bb8..8d9cb45 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Object_H diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 71ed4a9..af21663 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index dcc07cc..b494e85 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 109f221..63061f7 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 9581420..c631fb9 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5PredType_H diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c60b34e..13be182 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index bd04194..014b2c2 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5PropList_H diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index e5355ff..e6534d9 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index d78240a..7ae33ee 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index fc6d2ba..c3d5e58 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 70a2ab8..1b93876 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -6,12 +6,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5VarLenType_H diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index f06b801..976d503 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index ce9c05a..9b42a14 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5-C++ Makefile(.in) # diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 7f3c3ce..00502d9 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ############################################################################ diff --git a/c++/src/header.html b/c++/src/header.html index c3018d7..cb42565 100644 --- a/c++/src/header.html +++ b/c++/src/header.html @@ -12,12 +12,10 @@ xmlns="http://www.w3.org/TR/REC-html40"> * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> diff --git a/c++/test/H5srcdir_str.h.in b/c++/test/H5srcdir_str.h.in index d472124..bab1df3 100644 --- a/c++/test/H5srcdir_str.h.in +++ b/c++/test/H5srcdir_str.h.in @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically diff --git a/c++/test/Makefile.am b/c++/test/Makefile.am index 07fe533..a9fcfdf 100644 --- a/c++/test/Makefile.am +++ b/c++/test/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index e065782..d528314 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5-C++ Makefile(.in) # diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 2711de9..f534e33 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index 0a79d75..ec35821 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 9aee050..53f1663 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 166ee34..c07ba42 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 70c4003..e3526c6 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 6c52caa..09134ed 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 8c2cf3e..d54d541 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 4a5336e..6a5b70d 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 6e12dfd..941ba9c 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index a60403f..275bdb6 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 5b517ff..e511619 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 0786bb5..88aa1fe 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -4,12 +4,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 2639092..bfd6abe 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index b4efe40..4579307 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 9da05e6..588cd73 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index ed923eb..f49dbc0 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/config/BlankForm b/config/BlankForm index 31116bf..a452f92 100644 --- a/config/BlankForm +++ b/config/BlankForm @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/Makefile.am.blank b/config/Makefile.am.blank index a54c734..b01735b 100644 --- a/config/Makefile.am.blank +++ b/config/Makefile.am.blank @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am diff --git a/config/apple b/config/apple index 5203695..0b15dfe 100644 --- a/config/apple +++ b/config/apple @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/cce-fflags b/config/cce-fflags index 896e711..38e902b 100644 --- a/config/cce-fflags +++ b/config/cce-fflags @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/cce-flags b/config/cce-flags index a34fcbe..47e24bf 100644 --- a/config/cce-flags +++ b/config/cce-flags @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/commence.am b/config/commence.am index 554c9fb..471c70d 100644 --- a/config/commence.am +++ b/config/commence.am @@ -7,12 +7,10 @@ ## ## 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## Textually included in the beginning of every HDF5 Makefile.am diff --git a/config/conclude.am b/config/conclude.am index d380c9a..11dafd1 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -7,12 +7,10 @@ ## ## 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## Textually included at the end of most HDF5 Makefiles.am. diff --git a/config/cygwin b/config/cygwin index 7423403..6ead871 100644 --- a/config/cygwin +++ b/config/cygwin @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/examples.am b/config/examples.am index 8597a16..5b9cb5b 100644 --- a/config/examples.am +++ b/config/examples.am @@ -7,12 +7,10 @@ ## ## 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## Textually included near the end of HDF5 Makefiles in example directories. ## Contains boilerplate for building, installing, and cleaning example diff --git a/config/freebsd b/config/freebsd index e42ca60..936c29f 100644 --- a/config/freebsd +++ b/config/freebsd @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/gnu-fflags b/config/gnu-fflags index 1d6caa1..822b716 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/gnu-flags b/config/gnu-flags index e7f8f14..008e819 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/ibm-aix b/config/ibm-aix index 28498e2..5515faf 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # Configuration file for building on the IBM AIX platforms. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/ibm-flags b/config/ibm-flags index 462372d..85ce130 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/intel-fflags b/config/intel-fflags index 3e33fc9..5fbdcc1 100644 --- a/config/intel-fflags +++ b/config/intel-fflags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/intel-flags b/config/intel-flags index 3187daf..af6b955 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/linux-gnu b/config/linux-gnu index 912a93b..243b087 100644 --- a/config/linux-gnu +++ b/config/linux-gnu @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This is the same as linux-gnulibc1 diff --git a/config/linux-gnuaout b/config/linux-gnuaout index 912a93b..243b087 100644 --- a/config/linux-gnuaout +++ b/config/linux-gnuaout @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This is the same as linux-gnulibc1 diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index d1f89af..ea12a88 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/linux-gnulibc2 b/config/linux-gnulibc2 index 76526b8..01a0d20 100644 --- a/config/linux-gnulibc2 +++ b/config/linux-gnulibc2 @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/lt_vers.am b/config/lt_vers.am index ba8f9db..3187fd0 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -7,12 +7,10 @@ ## ## 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/config/pgi-fflags b/config/pgi-fflags index 6cb8930..dec139d 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/pgi-flags b/config/pgi-flags index 29e6f05..b8ca4b8 100644 --- a/config/pgi-flags +++ b/config/pgi-flags @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/site-specific/BlankForm b/config/site-specific/BlankForm index c31383c..03d421c 100644 --- a/config/site-specific/BlankForm +++ b/config/site-specific/BlankForm @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/solaris b/config/solaris index 310c373..394daaf 100644 --- a/config/solaris +++ b/config/solaris @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/examples/Makefile.am b/examples/Makefile.am index 5d0da93..f737814 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/examples/Makefile.in b/examples/Makefile.in index 98eacf6..79ccc89 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5 Library Examples Makefile(.in) # diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 0ea0153..335f9c2 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c index 98b0bb4..c3455f4 100644 --- a/examples/h5_chunk_read.c +++ b/examples/h5_chunk_read.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 8d365a3..ebc7712 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_compound.c b/examples/h5_compound.c index 3fca2a5..b3b3a4a 100644 --- a/examples/h5_compound.c +++ b/examples/h5_compound.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtatt.c b/examples/h5_crtatt.c index 5e1378c..ade17ba 100644 --- a/examples/h5_crtatt.c +++ b/examples/h5_crtatt.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtdat.c b/examples/h5_crtdat.c index f9327e7..4a876d2 100644 --- a/examples/h5_crtdat.c +++ b/examples/h5_crtdat.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrp.c b/examples/h5_crtgrp.c index a626ed8..89bddce 100644 --- a/examples/h5_crtgrp.c +++ b/examples/h5_crtgrp.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrpar.c b/examples/h5_crtgrpar.c index e8cf7c3..6f8c6e8 100644 --- a/examples/h5_crtgrpar.c +++ b/examples/h5_crtgrpar.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrpd.c b/examples/h5_crtgrpd.c index d6a320b..35c4389 100644 --- a/examples/h5_crtgrpd.c +++ b/examples/h5_crtgrpd.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c index 7245794..43c1fc7 100644 --- a/examples/h5_drivers.c +++ b/examples/h5_drivers.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 71ec10a..0b718ad 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_elink_unix2win.c b/examples/h5_elink_unix2win.c index 9c0918c..df52015 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program demonstrates how to translate an external link created on diff --git a/examples/h5_extend.c b/examples/h5_extend.c index 105e553..6e3cff2 100644 --- a/examples/h5_extend.c +++ b/examples/h5_extend.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index 495b49d..4abda30 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index e8a24b8..ba632f5 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program demonstrates how to create and use "external links" in diff --git a/examples/h5_group.c b/examples/h5_group.c index 6b73210..8e89165 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_interm_group.c b/examples/h5_interm_group.c index bd9c7c4..6507fd1 100644 --- a/examples/h5_interm_group.c +++ b/examples/h5_interm_group.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_mount.c b/examples/h5_mount.c index 6da71a1..a2e16c5 100644 --- a/examples/h5_mount.c +++ b/examples/h5_mount.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_rdwt.c b/examples/h5_rdwt.c index 0e290ca..6cd7f0f 100644 --- a/examples/h5_rdwt.c +++ b/examples/h5_rdwt.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_read.c b/examples/h5_read.c index 6fe75be..7fd8ad4 100644 --- a/examples/h5_read.c +++ b/examples/h5_read.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c index 17ec724..d045db1 100644 --- a/examples/h5_ref2reg.c +++ b/examples/h5_ref2reg.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program shows how to create, store and dereference references diff --git a/examples/h5_reference.c b/examples/h5_reference.c index afd550c..c73ce89 100644 --- a/examples/h5_reference.c +++ b/examples/h5_reference.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_select.c b/examples/h5_select.c index ceb9c2c..bbc877c 100644 --- a/examples/h5_select.c +++ b/examples/h5_select.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c index 0c7f2f0..4e1f92a 100644 --- a/examples/h5_shared_mesg.c +++ b/examples/h5_shared_mesg.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_subset.c b/examples/h5_subset.c index 66872ea..904d3f8 100644 --- a/examples/h5_subset.c +++ b/examples/h5_subset.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_write.c b/examples/h5_write.c index 93d40ea..1a7cfe7 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/ph5example.c b/examples/ph5example.c index 7a41db2..d718479 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -5,12 +5,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/run-all-ex.sh b/examples/run-all-ex.sh index 4ff2c55..878e0f8 100755 --- a/examples/run-all-ex.sh +++ b/examples/run-all-ex.sh @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hl-ex.sh diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 9b2a2bb..a684a38 100644 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-c-ex.sh diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index b5f33b5..4e898c1 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5cc compiler tool # Created: Albert Cheng, 2007/4/11 diff --git a/fortran/Makefile.am b/fortran/Makefile.am index 9ddd6dd..38084b9 100644 --- a/fortran/Makefile.am +++ b/fortran/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 461591d..86d9da6 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index caaa08c..3428a9e 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index f5ceed7..3e0acbc 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -21,12 +21,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF5-Fortran Examples Makefile(.in) # diff --git a/fortran/examples/compound.f90 b/fortran/examples/compound.f90 index 2005f41..f5e91d6 100644 --- a/fortran/examples/compound.f90 +++ b/fortran/examples/compound.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/fortran/examples/compound_complex_fortran2003.f90 index 19671f7..6d0f291 100644 --- a/fortran/examples/compound_complex_fortran2003.f90 +++ b/fortran/examples/compound_complex_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create an array of a compound datatype which diff --git a/fortran/examples/compound_fortran2003.f90 b/fortran/examples/compound_fortran2003.f90 index a55d1a6..0168177 100644 --- a/fortran/examples/compound_fortran2003.f90 +++ b/fortran/examples/compound_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create a compound data type, diff --git a/fortran/examples/h5_cmprss.f90 b/fortran/examples/h5_cmprss.f90 index 9ab28f7..61dd7b0 100644 --- a/fortran/examples/h5_cmprss.f90 +++ b/fortran/examples/h5_cmprss.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example illustrates how to create a compressed dataset. diff --git a/fortran/examples/h5_crtatt.f90 b/fortran/examples/h5_crtatt.f90 index 79bc576..7e287c6 100644 --- a/fortran/examples/h5_crtatt.f90 +++ b/fortran/examples/h5_crtatt.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create and write a dataset attribute. diff --git a/fortran/examples/h5_crtdat.f90 b/fortran/examples/h5_crtdat.f90 index 6e4c3a4..dce4408 100644 --- a/fortran/examples/h5_crtdat.f90 +++ b/fortran/examples/h5_crtdat.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrp.f90 b/fortran/examples/h5_crtgrp.f90 index 278d175..12f07e7 100644 --- a/fortran/examples/h5_crtgrp.f90 +++ b/fortran/examples/h5_crtgrp.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrpar.f90 b/fortran/examples/h5_crtgrpar.f90 index 4ef008a..341b648 100644 --- a/fortran/examples/h5_crtgrpar.f90 +++ b/fortran/examples/h5_crtgrpar.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrpd.f90 b/fortran/examples/h5_crtgrpd.f90 index d35f03d..41c1f53 100644 --- a/fortran/examples/h5_crtgrpd.f90 +++ b/fortran/examples/h5_crtgrpd.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_extend.f90 b/fortran/examples/h5_extend.f90 index 315d84f..20b91ff 100644 --- a/fortran/examples/h5_extend.f90 +++ b/fortran/examples/h5_extend.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example extends an HDF5 dataset. It is used in the HDF5 Tutorial. diff --git a/fortran/examples/h5_rdwt.f90 b/fortran/examples/h5_rdwt.f90 index ba05b2f..2fbd85d 100644 --- a/fortran/examples/h5_rdwt.f90 +++ b/fortran/examples/h5_rdwt.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_subset.f90 b/fortran/examples/h5_subset.f90 index 6cb8f7a..ab33c86 100644 --- a/fortran/examples/h5_subset.f90 +++ b/fortran/examples/h5_subset.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to write and read a hyperslab. diff --git a/fortran/examples/hyperslab.f90 b/fortran/examples/hyperslab.f90 index 7823ff6..d340161 100644 --- a/fortran/examples/hyperslab.f90 +++ b/fortran/examples/hyperslab.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/mountexample.f90 b/fortran/examples/mountexample.f90 index 5bdec2a..4a2821d 100644 --- a/fortran/examples/mountexample.f90 +++ b/fortran/examples/mountexample.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90 index f806110..9a5744a 100644 --- a/fortran/examples/nested_derived_type.f90 +++ b/fortran/examples/nested_derived_type.f90 @@ -5,12 +5,10 @@ ! * ! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create a nested compound data type, diff --git a/fortran/examples/ph5example.f90 b/fortran/examples/ph5example.f90 index a0db200..9d4281e 100644 --- a/fortran/examples/ph5example.f90 +++ b/fortran/examples/ph5example.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! Fortran parallel example. Copied from Tutorial's example program of diff --git a/fortran/examples/refobjexample.f90 b/fortran/examples/refobjexample.f90 index c8622a7..d017598 100644 --- a/fortran/examples/refobjexample.f90 +++ b/fortran/examples/refobjexample.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/refregexample.f90 b/fortran/examples/refregexample.f90 index 68fbd24..ab45598 100644 --- a/fortran/examples/refregexample.f90 +++ b/fortran/examples/refregexample.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in index ead7361..41bf9b1 100644 --- a/fortran/examples/run-fortran-ex.sh.in +++ b/fortran/examples/run-fortran-ex.sh.in @@ -5,12 +5,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hlfortran-ex.sh diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90 index d65db9e..9f50eae 100644 --- a/fortran/examples/rwdset_fortran2003.f90 +++ b/fortran/examples/rwdset_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/selectele.f90 b/fortran/examples/selectele.f90 index dcd2379..4281ea6 100644 --- a/fortran/examples/selectele.f90 +++ b/fortran/examples/selectele.f90 @@ -5,12 +5,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in index cd3b86e..f384909 100644 --- a/fortran/examples/testh5fc.sh.in +++ b/fortran/examples/testh5fc.sh.in @@ -6,12 +6,10 @@ # # 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. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5fc compiler tool # Created: Albert Cheng, 2007/3/14 diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index bc2e9f1..f25ee94 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -10,12 +10,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 25f7fa7..b03aa4a 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -17,12 +17,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index 5278280..c8176c5 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -19,12 +19,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Aff_F90.f90 b/fortran/src/H5Aff_F90.f90 index 974b023..771c263 100644 --- a/fortran/src/H5Aff_F90.f90 +++ b/fortran/src/H5Aff_F90.f90 @@ -22,12 +22,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 0d32dac..9c67e82 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -10,12 +10,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index 3ad868c..c86deb8 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -19,12 +19,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 index 7026ae3..1322f96 100644 --- a/fortran/src/H5Dff_F03.f90 +++ b/fortran/src/H5Dff_F03.f90 @@ -17,12 +17,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Dff_F90.f90 b/fortran/src/H5Dff_F90.f90 index 66cfe62..431e116 100644 --- a/fortran/src/H5Dff_F90.f90 +++ b/fortran/src/H5Dff_F90.f90 @@ -19,12 +19,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 6e476ea..c89ccd9 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -10,12 +10,10 @@ * * * 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. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index 7b56376..56da8a7 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -17,12 +17,10 @@ ! * ! 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. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you d